]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add target_ops argument to to_pid_to_exec_file
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:35:01 +0000 (21:35 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:45:56 +0000 (07:45 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* windows-nat.c (windows_pid_to_exec_file): Add 'self' argument.
* target.h (struct target_ops) <to_pid_to_exec_file>: Add
argument.
(target_pid_to_exec_file): Add argument.
* target.c (debug_to_pid_to_exec_file): Add argument.
(update_current_target): Update.
* nbsd-nat.h (nbsd_pid_to_exec_file): Add 'self' argument.
* nbsd-nat.c (nbsd_pid_to_exec_file): Add 'self' argument.
* linux-nat.c (linux_child_pid_to_exec_file): Add 'self' argument.
(linux_handle_extended_wait): Update.
* inf-child.c (inf_child_pid_to_exec_file): Add 'self' argument.
* fbsd-nat.h (fbsd_pid_to_exec_file): Add 'self' argument.
* fbsd-nat.c (fbsd_pid_to_exec_file): Add 'self' argument.
* darwin-nat.c (darwin_pid_to_exec_file): Add 'self' argument.

gdb/ChangeLog
gdb/darwin-nat.c
gdb/fbsd-nat.c
gdb/fbsd-nat.h
gdb/inf-child.c
gdb/linux-nat.c
gdb/nbsd-nat.c
gdb/nbsd-nat.h
gdb/target.c
gdb/target.h
gdb/windows-nat.c

index 09b88f72389f0732a7961a694d0556fff11c2766..f9102b3dfe597f5a8a2dc36f5571df5ffbea4d1c 100644 (file)
@@ -1,3 +1,20 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * windows-nat.c (windows_pid_to_exec_file): Add 'self' argument.
+       * target.h (struct target_ops) <to_pid_to_exec_file>: Add
+       argument.
+       (target_pid_to_exec_file): Add argument.
+       * target.c (debug_to_pid_to_exec_file): Add argument.
+       (update_current_target): Update.
+       * nbsd-nat.h (nbsd_pid_to_exec_file): Add 'self' argument.
+       * nbsd-nat.c (nbsd_pid_to_exec_file): Add 'self' argument.
+       * linux-nat.c (linux_child_pid_to_exec_file): Add 'self' argument.
+       (linux_handle_extended_wait): Update.
+       * inf-child.c (inf_child_pid_to_exec_file): Add 'self' argument.
+       * fbsd-nat.h (fbsd_pid_to_exec_file): Add 'self' argument.
+       * fbsd-nat.c (fbsd_pid_to_exec_file): Add 'self' argument.
+       * darwin-nat.c (darwin_pid_to_exec_file): Add 'self' argument.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target.h (struct target_ops) <to_rcmd>: Add argument.
index 9027010557a80bd73c1d101ca9703f35cd9e73be..6cbfc832430ef4ead09c6470551196ee9db282a5 100644 (file)
@@ -1989,7 +1989,7 @@ set_enable_mach_exceptions (char *args, int from_tty,
 }
 
 static char *
-darwin_pid_to_exec_file (int pid)
+darwin_pid_to_exec_file (struct target_ops *self, int pid)
 {
   char *path;
   int res;
index 662fa554c5a1138ecb0519de22eeb8df47a8bb86..43ee605ceed5d42a88c322c5d32f31d8df79faef 100644 (file)
@@ -37,7 +37,7 @@
    the child process identified by PID.  */
 
 char *
-fbsd_pid_to_exec_file (int pid)
+fbsd_pid_to_exec_file (struct target_ops *self, int pid)
 {
   size_t len = PATH_MAX;
   char *buf = xcalloc (len, sizeof (char));
index d9d1443e0c4119fb5c4c10b75f342a2a0b637f5e..a048733da49f583cf3894891b876f2faf3be343f 100644 (file)
@@ -23,7 +23,7 @@
 /* Return the name of a file that can be opened to get the symbols for
    the child process identified by PID.  */
 
-extern char *fbsd_pid_to_exec_file (int pid);
+extern char *fbsd_pid_to_exec_file (struct target_ops *self, int pid);
 
 /* Iterate over all the memory regions in the current inferior,
    calling FUNC for each memory region.  OBFD is passed as the last
index 37fac4b412b8152a5b1c373353d4124adbb3c332..e0476368881641dafb2e726fb9431e1c7465519f 100644 (file)
@@ -134,7 +134,7 @@ inf_child_can_run (struct target_ops *self)
 }
 
 static char *
-inf_child_pid_to_exec_file (int pid)
+inf_child_pid_to_exec_file (struct target_ops *self, int pid)
 {
   /* This version of Unix doesn't support translation of a process ID
      to the filename of the executable file.  */
index 50eef3ad7a3acfa13e66e310c8840c6b5419995a..9652692439631ca32d00f3ac0588a3d9f80195fd 100644 (file)
@@ -844,7 +844,7 @@ linux_nat_pass_signals (struct target_ops *self,
 /* Prototypes for local functions.  */
 static int stop_wait_callback (struct lwp_info *lp, void *data);
 static int linux_thread_alive (ptid_t ptid);
-static char *linux_child_pid_to_exec_file (int pid);
+static char *linux_child_pid_to_exec_file (struct target_ops *self, int pid);
 
 \f
 /* Convert wait status STATUS to a string.  Used for printing debug
@@ -2193,7 +2193,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
 
       ourstatus->kind = TARGET_WAITKIND_EXECD;
       ourstatus->value.execd_pathname
-       = xstrdup (linux_child_pid_to_exec_file (pid));
+       = xstrdup (linux_child_pid_to_exec_file (NULL, pid));
 
       return 0;
     }
@@ -4033,7 +4033,7 @@ linux_nat_thread_name (struct target_ops *self, struct thread_info *thr)
    can be opened to get the symbols for the child process.  */
 
 static char *
-linux_child_pid_to_exec_file (int pid)
+linux_child_pid_to_exec_file (struct target_ops *self, int pid)
 {
   char *name1, *name2;
 
index 347636f0ab23384d99359930b61bb0f6b82090bc..72c471b4c2f2583f1556ed822ff8d1c8eaa9170e 100644 (file)
@@ -25,7 +25,7 @@
    the child process identified by PID.  */
 
 char *
-nbsd_pid_to_exec_file (int pid)
+nbsd_pid_to_exec_file (struct target_ops *self, int pid)
 {
   size_t len = PATH_MAX;
   char *buf = xcalloc (len, sizeof (char));
index dc6a57092ee7eaa00db18e601f37b13c18631d01..145505d57cd38db179f1664ca5d73ecfc1e53513 100644 (file)
@@ -23,6 +23,6 @@
 /* Return the name of a file that can be opened to get the symbols for
    the child process identified by PID.  */
 
-extern char *nbsd_pid_to_exec_file (int pid);
+extern char *nbsd_pid_to_exec_file (struct target_ops *self, int pid);
 
 #endif /* nbsd-nat.h */
index 38504945ef6af5ff80257bcee7a47455656c06b7..7ffe2df3ebb6a4d0a6b55248d7fb616312392972 100644 (file)
@@ -831,7 +831,7 @@ update_current_target (void)
            (void (*) (struct target_ops *, char *, struct ui_file *))
            tcomplain);
   de_fault (to_pid_to_exec_file,
-           (char *(*) (int))
+           (char *(*) (struct target_ops *, int))
            return_null);
   de_fault (to_thread_architecture,
            default_thread_architecture);
@@ -5004,11 +5004,11 @@ debug_to_rcmd (struct target_ops *self, char *command,
 }
 
 static char *
-debug_to_pid_to_exec_file (int pid)
+debug_to_pid_to_exec_file (struct target_ops *self, int pid)
 {
   char *exec_file;
 
-  exec_file = debug_target.to_pid_to_exec_file (pid);
+  exec_file = debug_target.to_pid_to_exec_file (&debug_target, pid);
 
   fprintf_unfiltered (gdb_stdlog, "target_pid_to_exec_file (%d) = %s\n",
                      pid, exec_file);
index af8d8343cbc4f444074e397523be546802715a25..d1bb68c896d8fe1fa9bdca8db96d9d538ca40227 100644 (file)
@@ -527,7 +527,7 @@ struct target_ops
     void (*to_stop) (struct target_ops *, ptid_t);
     void (*to_rcmd) (struct target_ops *,
                     char *command, struct ui_file *output);
-    char *(*to_pid_to_exec_file) (int pid);
+    char *(*to_pid_to_exec_file) (struct target_ops *, int pid);
     void (*to_log_command) (const char *);
     struct target_section_table *(*to_get_section_table) (struct target_ops *);
     enum strata to_stratum;
@@ -1545,7 +1545,7 @@ extern char *target_thread_name (struct thread_info *);
    it must persist.  */
 
 #define target_pid_to_exec_file(pid) \
-     (current_target.to_pid_to_exec_file) (pid)
+     (current_target.to_pid_to_exec_file) (&current_target, pid)
 
 /* See the to_thread_architecture description in struct target_ops.  */
 
index 7514eb5a629fa243ea58614b03b2d417659d1892..bc00c43c0020ac2dcc4bc1a8e2b00ca06725610b 100644 (file)
@@ -1994,7 +1994,7 @@ windows_detach (struct target_ops *ops, const char *args, int from_tty)
 }
 
 static char *
-windows_pid_to_exec_file (int pid)
+windows_pid_to_exec_file (struct target_ops *self, int pid)
 {
   static char path[__PMAX];
 #ifdef __CYGWIN__