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

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

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

index 77f910edbd20bc331b94e579fc76068967b2d7f0..e3ce6d115f97831d20846427d583ba896f9c2d40 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (target_program_signals): Unconditionally delegate.
+       * target.h (struct target_ops) <to_program_signals>: Use
+       TARGET_DEFAULT_IGNORE.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 22cb3606515cc68f6d23cb10ecb3367cbbee9f59..d3b8da76e60e718315ee6d279b94f29e239c967c 100644 (file)
@@ -529,6 +529,18 @@ tdefault_pass_signals (struct target_ops *self, int arg1, unsigned char *arg2)
 {
 }
 
+static void
+delegate_program_signals (struct target_ops *self, int arg1, unsigned char *arg2)
+{
+  self = self->beneath;
+  self->to_program_signals (self, arg1, arg2);
+}
+
+static void
+tdefault_program_signals (struct target_ops *self, int arg1, unsigned char *arg2)
+{
+}
+
 static char *
 delegate_extra_thread_info (struct target_ops *self, struct thread_info *arg1)
 {
@@ -1270,6 +1282,8 @@ install_delegators (struct target_ops *ops)
     ops->to_mourn_inferior = delegate_mourn_inferior;
   if (ops->to_pass_signals == NULL)
     ops->to_pass_signals = delegate_pass_signals;
+  if (ops->to_program_signals == NULL)
+    ops->to_program_signals = delegate_program_signals;
   if (ops->to_extra_thread_info == NULL)
     ops->to_extra_thread_info = delegate_extra_thread_info;
   if (ops->to_thread_name == NULL)
@@ -1428,6 +1442,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_has_exited = tdefault_has_exited;
   ops->to_mourn_inferior = default_mourn_inferior;
   ops->to_pass_signals = tdefault_pass_signals;
+  ops->to_program_signals = tdefault_program_signals;
   ops->to_extra_thread_info = tdefault_extra_thread_info;
   ops->to_thread_name = tdefault_thread_name;
   ops->to_stop = tdefault_stop;
index b04e8f2c6412f5eb31d54fc2995be99cc91e3908..0519900a35d1237c6d2e080d3dcd093048820e02 100644 (file)
@@ -2601,31 +2601,23 @@ target_pass_signals (int numsigs, unsigned char *pass_signals)
 void
 target_program_signals (int numsigs, unsigned char *program_signals)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
+  if (targetdebug)
     {
-      if (t->to_program_signals != NULL)
-       {
-         if (targetdebug)
-           {
-             int i;
-
-             fprintf_unfiltered (gdb_stdlog, "target_program_signals (%d, {",
-                                 numsigs);
+      int i;
 
-             for (i = 0; i < numsigs; i++)
-               if (program_signals[i])
-                 fprintf_unfiltered (gdb_stdlog, " %s",
-                                     gdb_signal_to_name (i));
+      fprintf_unfiltered (gdb_stdlog, "target_program_signals (%d, {",
+                         numsigs);
 
-             fprintf_unfiltered (gdb_stdlog, " })\n");
-           }
+      for (i = 0; i < numsigs; i++)
+       if (program_signals[i])
+         fprintf_unfiltered (gdb_stdlog, " %s",
+                             gdb_signal_to_name (i));
 
-         (*t->to_program_signals) (t, numsigs, program_signals);
-         return;
-       }
+      fprintf_unfiltered (gdb_stdlog, " })\n");
     }
+
+  (*current_target.to_program_signals) (&current_target,
+                                       numsigs, program_signals);
 }
 
 static int
index 468a5cdc2728896cdc8c8ad2db41d3ea06a488a3..421dd75867178c77b4456a93f44b9e5ec421b16a 100644 (file)
@@ -555,7 +555,8 @@ struct target_ops
 
     /* Documentation of this routine is provided with the
        corresponding target_* function.  */
-    void (*to_program_signals) (struct target_ops *, int, unsigned char *);
+    void (*to_program_signals) (struct target_ops *, int, unsigned char *)
+      TARGET_DEFAULT_IGNORE ();
 
     int (*to_thread_alive) (struct target_ops *, ptid_t ptid);
     void (*to_find_new_threads) (struct target_ops *);