gdbserver: include linux-arm-tdesc.h in linux-arm-tdesc.c
[deliverable/binutils-gdb.git] / gdb / inf-ptrace.c
index b792af00d10d085d5482d779e9bd41e80fc3a8b8..ecd82ada4ed3deaa5cfed5c575a51fdd830c338a 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
@@ -151,7 +136,7 @@ inf_ptrace_target::create_inferior (const char *exec_file,
   /* We have something that executes now.  We'll be running through
      the shell at this point (if startup-with-shell is true), but the
      pid shouldn't change.  */
-  add_thread_silent (ptid);
+  add_thread_silent (this, ptid);
 
   unpusher.release ();
 
@@ -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,
@@ -251,10 +235,10 @@ inf_ptrace_target::attach (const char *args, int from_tty)
 
   /* Always add a main thread.  If some target extends the ptrace
      target, it should decorate the ptid later with more info.  */
-  thread_info *thr = add_thread_silent (inferior_ptid);
+  thread_info *thr = add_thread_silent (this, inferior_ptid);
   /* Don't consider the thread stopped until we've processed its
      initial SIGSTOP stop.  */
-  set_executing (thr->ptid, true);
+  set_executing (this, thr->ptid, true);
 
   unpusher.release ();
 }
This page took 0.025512 seconds and 4 git commands to generate.