convert to_pass_signals
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:42:10 +0000 (14:42 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:48:13 +0000 (07:48 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (target_pass_signals): Unconditionally delegate.
* target.h (struct target_ops) <to_pass_signals>: Use
TARGET_DEFAULT_IGNORE.

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

index 38eaf10c61b6dff0fee10d86646512705316cd80..77f910edbd20bc331b94e579fc76068967b2d7f0 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (target_pass_signals): Unconditionally delegate.
+       * target.h (struct target_ops) <to_pass_signals>: Use
+       TARGET_DEFAULT_IGNORE.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index f3000b72c6ca9a7922f809704a03fb44ef4a9d73..22cb3606515cc68f6d23cb10ecb3367cbbee9f59 100644 (file)
@@ -517,6 +517,18 @@ delegate_mourn_inferior (struct target_ops *self)
   self->to_mourn_inferior (self);
 }
 
+static void
+delegate_pass_signals (struct target_ops *self, int arg1, unsigned char *arg2)
+{
+  self = self->beneath;
+  self->to_pass_signals (self, arg1, arg2);
+}
+
+static void
+tdefault_pass_signals (struct target_ops *self, int arg1, unsigned char *arg2)
+{
+}
+
 static char *
 delegate_extra_thread_info (struct target_ops *self, struct thread_info *arg1)
 {
@@ -1256,6 +1268,8 @@ install_delegators (struct target_ops *ops)
     ops->to_has_exited = delegate_has_exited;
   if (ops->to_mourn_inferior == NULL)
     ops->to_mourn_inferior = delegate_mourn_inferior;
+  if (ops->to_pass_signals == NULL)
+    ops->to_pass_signals = delegate_pass_signals;
   if (ops->to_extra_thread_info == NULL)
     ops->to_extra_thread_info = delegate_extra_thread_info;
   if (ops->to_thread_name == NULL)
@@ -1413,6 +1427,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_set_syscall_catchpoint = tdefault_set_syscall_catchpoint;
   ops->to_has_exited = tdefault_has_exited;
   ops->to_mourn_inferior = default_mourn_inferior;
+  ops->to_pass_signals = tdefault_pass_signals;
   ops->to_extra_thread_info = tdefault_extra_thread_info;
   ops->to_thread_name = tdefault_thread_name;
   ops->to_stop = tdefault_stop;
index 13ec67d071ada6b80e50b147e3e1c5a8d4932cd8..b04e8f2c6412f5eb31d54fc2995be99cc91e3908 100644 (file)
@@ -2580,31 +2580,22 @@ target_resume (ptid_t ptid, int step, enum gdb_signal signal)
 void
 target_pass_signals (int numsigs, unsigned char *pass_signals)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
+  if (targetdebug)
     {
-      if (t->to_pass_signals != NULL)
-       {
-         if (targetdebug)
-           {
-             int i;
-
-             fprintf_unfiltered (gdb_stdlog, "target_pass_signals (%d, {",
-                                 numsigs);
+      int i;
 
-             for (i = 0; i < numsigs; i++)
-               if (pass_signals[i])
-                 fprintf_unfiltered (gdb_stdlog, " %s",
-                                     gdb_signal_to_name (i));
+      fprintf_unfiltered (gdb_stdlog, "target_pass_signals (%d, {",
+                         numsigs);
 
-             fprintf_unfiltered (gdb_stdlog, " })\n");
-           }
+      for (i = 0; i < numsigs; i++)
+       if (pass_signals[i])
+         fprintf_unfiltered (gdb_stdlog, " %s",
+                             gdb_signal_to_name (i));
 
-         (*t->to_pass_signals) (t, numsigs, pass_signals);
-         return;
-       }
+      fprintf_unfiltered (gdb_stdlog, " })\n");
     }
+
+  (*current_target.to_pass_signals) (&current_target, numsigs, pass_signals);
 }
 
 void
index 884abf1ecacaa1ddbeef07d01dac2f70283fd360..468a5cdc2728896cdc8c8ad2db41d3ea06a488a3 100644 (file)
@@ -550,7 +550,8 @@ struct target_ops
 
     /* Documentation of this routine is provided with the corresponding
        target_* macro.  */
-    void (*to_pass_signals) (struct target_ops *, int, unsigned char *);
+    void (*to_pass_signals) (struct target_ops *, int, unsigned char *)
+      TARGET_DEFAULT_IGNORE ();
 
     /* Documentation of this routine is provided with the
        corresponding target_* function.  */