convert to_pid_to_exec_file
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 17:51:10 +0000 (10:51 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:30 +0000 (07:47 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_pid_to_exec_file.
* target.h (struct target_ops) <to_pid_to_exec_file>: Use
TARGET_DEFAULT_RETURN.

gdb/ChangeLog
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 3a5b4d7f4ea61e84a42a1ab8b46689f0963b940f..626ec0c57564c205c917fd87e70881bef5b5d502 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
+       to_pid_to_exec_file.
+       * target.h (struct target_ops) <to_pid_to_exec_file>: Use
+       TARGET_DEFAULT_RETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 6658ee9b894a77345c66a62c4d09b85ccea37978..871e417eaa726a4d69847bedfa2e344143514cb5 100644 (file)
@@ -459,6 +459,19 @@ delegate_rcmd (struct target_ops *self, char *arg1, struct ui_file *arg2)
   self->to_rcmd (self, arg1, arg2);
 }
 
+static char *
+delegate_pid_to_exec_file (struct target_ops *self, int arg1)
+{
+  self = self->beneath;
+  return self->to_pid_to_exec_file (self, arg1);
+}
+
+static char *
+tdefault_pid_to_exec_file (struct target_ops *self, int arg1)
+{
+  return 0;
+}
+
 static int
 delegate_can_async_p (struct target_ops *self)
 {
@@ -593,6 +606,8 @@ install_delegators (struct target_ops *ops)
     ops->to_thread_name = delegate_thread_name;
   if (ops->to_rcmd == NULL)
     ops->to_rcmd = delegate_rcmd;
+  if (ops->to_pid_to_exec_file == NULL)
+    ops->to_pid_to_exec_file = delegate_pid_to_exec_file;
   if (ops->to_can_async_p == NULL)
     ops->to_can_async_p = delegate_can_async_p;
   if (ops->to_is_async_p == NULL)
@@ -647,6 +662,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_extra_thread_info = tdefault_extra_thread_info;
   ops->to_thread_name = tdefault_thread_name;
   ops->to_rcmd = default_rcmd;
+  ops->to_pid_to_exec_file = tdefault_pid_to_exec_file;
   ops->to_can_async_p = find_default_can_async_p;
   ops->to_is_async_p = find_default_is_async_p;
   ops->to_async = tdefault_async;
index 3797090f9b41818a1e610162b066cc06afb37678..a357cba57cfc9264410a3139ecbbc0a83968fffd 100644 (file)
@@ -649,7 +649,7 @@ update_current_target (void)
       INHERIT (to_stop, t);
       /* Do not inherit to_xfer_partial.  */
       /* Do not inherit to_rcmd.  */
-      INHERIT (to_pid_to_exec_file, t);
+      /* Do not inherit to_pid_to_exec_file.  */
       INHERIT (to_log_command, t);
       INHERIT (to_stratum, t);
       /* Do not inherit to_has_all_memory.  */
@@ -738,9 +738,6 @@ update_current_target (void)
   de_fault (to_stop,
            (void (*) (struct target_ops *, ptid_t))
            target_ignore);
-  de_fault (to_pid_to_exec_file,
-           (char *(*) (struct target_ops *, int))
-           return_null);
   de_fault (to_thread_architecture,
            default_thread_architecture);
   current_target.to_read_description = NULL;
index 73075ae99465a10d5816385afa4283938f35e976..e4cd63df2417b2aa1caf1d26702d56674211ac05 100644 (file)
@@ -559,7 +559,8 @@ struct target_ops
     void (*to_rcmd) (struct target_ops *,
                     char *command, struct ui_file *output)
       TARGET_DEFAULT_FUNC (default_rcmd);
-    char *(*to_pid_to_exec_file) (struct target_ops *, int pid);
+    char *(*to_pid_to_exec_file) (struct target_ops *, int pid)
+      TARGET_DEFAULT_RETURN (0);
     void (*to_log_command) (struct target_ops *, const char *);
     struct target_section_table *(*to_get_section_table) (struct target_ops *);
     enum strata to_stratum;
This page took 0.032994 seconds and 4 git commands to generate.