tfile_target::close: trace_fd can't be -1
[deliverable/binutils-gdb.git] / gdb / inf-ptrace.c
index b792af00d10d085d5482d779e9bd41e80fc3a8b8..4ad1cd0622725c90a1414fb5471f032453d60e79 100644 (file)
@@ -1,6 +1,6 @@
 /* Low-level child interface to ptrace.
 
-   Copyright (C) 1988-2019 Free Software Foundation, Inc.
+   Copyright (C) 1988-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -94,20 +94,6 @@ inf_ptrace_target::remove_fork_catchpoint (int pid)
 #endif /* PT_GET_PROCESS_STATE */
 \f
 
-/* Default method for "inf_ptrace_me_fail_reason", which returns an
-   empty string.  */
-
-static std::string
-default_inf_ptrace_me_fail_reason (int err)
-{
-  return {};
-}
-
-/* See inf-ptrace.h.  */
-
-std::string (*inf_ptrace_me_fail_reason) (int err)
-  = default_inf_ptrace_me_fail_reason;
-
 /* Prepare to be traced.  */
 
 static void
@@ -115,8 +101,7 @@ inf_ptrace_me (void)
 {
   /* "Trace me, Dr. Memory!"  */
   if (ptrace (PT_TRACE_ME, 0, (PTRACE_TYPE_ARG3) 0, 0) < 0)
-    trace_start_error_with_name ("ptrace",
-                                inf_ptrace_me_fail_reason (errno).c_str ());
+    trace_start_error_with_name ("ptrace");
 }
 
 /* Start a new inferior Unix child process.  EXEC_FILE is the file to
@@ -201,7 +186,6 @@ inf_ptrace_target::mourn_inferior ()
 void
 inf_ptrace_target::attach (const char *args, int from_tty)
 {
-  char *exec_file;
   pid_t pid;
   struct inferior *inf;
 
@@ -225,7 +209,7 @@ inf_ptrace_target::attach (const char *args, int from_tty)
 
   if (from_tty)
     {
-      exec_file = get_exec_file (0);
+      const char *exec_file = get_exec_file (0);
 
       if (exec_file)
        printf_unfiltered (_("Attaching to program: %s, %s\n"), exec_file,
This page took 0.026502 seconds and 4 git commands to generate.