]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
convert to_log_command
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 17:52:58 +0000 (10:52 -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_log_command.
* target.h (struct target_ops) <to_log_command>: Use
TARGET_DEFAULT_IGNORE.
(target_log_command): Unconditionally delegate.

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

index 626ec0c57564c205c917fd87e70881bef5b5d502..e3ec9ac34d1a4351906a806c3cfb9794730d92d0 100644 (file)
@@ -1,3 +1,12 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
+       to_log_command.
+       * target.h (struct target_ops) <to_log_command>: Use
+       TARGET_DEFAULT_IGNORE.
+       (target_log_command): Unconditionally delegate.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 871e417eaa726a4d69847bedfa2e344143514cb5..600e64ecb0b92bcdee67dd1f76b0cc7f6f30bea6 100644 (file)
@@ -472,6 +472,18 @@ tdefault_pid_to_exec_file (struct target_ops *self, int arg1)
   return 0;
 }
 
+static void
+delegate_log_command (struct target_ops *self, const char *arg1)
+{
+  self = self->beneath;
+  self->to_log_command (self, arg1);
+}
+
+static void
+tdefault_log_command (struct target_ops *self, const char *arg1)
+{
+}
+
 static int
 delegate_can_async_p (struct target_ops *self)
 {
@@ -608,6 +620,8 @@ install_delegators (struct target_ops *ops)
     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_log_command == NULL)
+    ops->to_log_command = delegate_log_command;
   if (ops->to_can_async_p == NULL)
     ops->to_can_async_p = delegate_can_async_p;
   if (ops->to_is_async_p == NULL)
@@ -663,6 +677,7 @@ install_dummy_methods (struct target_ops *ops)
   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_log_command = tdefault_log_command;
   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 a357cba57cfc9264410a3139ecbbc0a83968fffd..db6771ec938feeb6d366b4346e2c88e877f45f3d 100644 (file)
@@ -650,7 +650,7 @@ update_current_target (void)
       /* Do not inherit to_xfer_partial.  */
       /* Do not inherit to_rcmd.  */
       /* Do not inherit to_pid_to_exec_file.  */
-      INHERIT (to_log_command, t);
+      /* Do not inherit to_log_command.  */
       INHERIT (to_stratum, t);
       /* Do not inherit to_has_all_memory.  */
       /* Do not inherit to_has_memory.  */
index e4cd63df2417b2aa1caf1d26702d56674211ac05..a1259c8a82afebc4f40bebbd50730b378a28bb59 100644 (file)
@@ -561,7 +561,8 @@ struct target_ops
       TARGET_DEFAULT_FUNC (default_rcmd);
     char *(*to_pid_to_exec_file) (struct target_ops *, int pid)
       TARGET_DEFAULT_RETURN (0);
-    void (*to_log_command) (struct target_ops *, const char *);
+    void (*to_log_command) (struct target_ops *, const char *)
+      TARGET_DEFAULT_IGNORE ();
     struct target_section_table *(*to_get_section_table) (struct target_ops *);
     enum strata to_stratum;
     int (*to_has_all_memory) (struct target_ops *);
@@ -1930,12 +1931,8 @@ extern char *target_fileio_read_stralloc (const char *filename);
 
 /* Command logging facility.  */
 
-#define target_log_command(p)                                          \
-  do                                                                   \
-    if (current_target.to_log_command)                                 \
-      (*current_target.to_log_command) (&current_target,               \
-                                       p);                             \
-  while (0)
+#define target_log_command(p)                                  \
+  (*current_target.to_log_command) (&current_target, p)
 
 
 extern int target_core_of_thread (ptid_t ptid);