convert to_enable_btrace
authorTom Tromey <tromey@redhat.com>
Thu, 19 Dec 2013 15:19:41 +0000 (08:19 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:48:38 +0000 (07:48 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (target_enable_btrace): Unconditionally delegate.
* target.h (struct target_ops) <to_enable_btrace>: Use
TARGET_DEFAULT_NORETURN.

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

index 3cdb9fe46bce4b414aa9e119b0f1095a4f19274d..644ebfd7ebb9058f2c2eb4ded9998caa8be3b27f 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (target_enable_btrace): Unconditionally delegate.
+       * target.h (struct target_ops) <to_enable_btrace>: Use
+       TARGET_DEFAULT_NORETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 1b956d23599599c636d13595333fde8570f92fb6..df17c7b62b2b9e47863e6ec4ed08c13bd12c040a 100644 (file)
@@ -1300,6 +1300,19 @@ tdefault_supports_btrace (struct target_ops *self)
   return 0;
 }
 
+static struct btrace_target_info *
+delegate_enable_btrace (struct target_ops *self, ptid_t arg1)
+{
+  self = self->beneath;
+  return self->to_enable_btrace (self, arg1);
+}
+
+static struct btrace_target_info *
+tdefault_enable_btrace (struct target_ops *self, ptid_t arg1)
+{
+  tcomplain ();
+}
+
 static void
 delegate_disable_btrace (struct target_ops *self, struct btrace_target_info *arg1)
 {
@@ -1731,6 +1744,8 @@ install_delegators (struct target_ops *ops)
     ops->to_can_use_agent = delegate_can_use_agent;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
+  if (ops->to_enable_btrace == NULL)
+    ops->to_enable_btrace = delegate_enable_btrace;
   if (ops->to_disable_btrace == NULL)
     ops->to_disable_btrace = delegate_disable_btrace;
   if (ops->to_teardown_btrace == NULL)
@@ -1878,6 +1893,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_use_agent = tdefault_use_agent;
   ops->to_can_use_agent = tdefault_can_use_agent;
   ops->to_supports_btrace = tdefault_supports_btrace;
+  ops->to_enable_btrace = tdefault_enable_btrace;
   ops->to_disable_btrace = tdefault_disable_btrace;
   ops->to_teardown_btrace = tdefault_teardown_btrace;
   ops->to_read_btrace = tdefault_read_btrace;
index 75d961b870fa9c51d05a22d1e0698746b1711e93..547afcc8e278d4cdedc7da90d73cec0516aeefb6 100644 (file)
@@ -3784,14 +3784,7 @@ target_ranged_break_num_registers (void)
 struct btrace_target_info *
 target_enable_btrace (ptid_t ptid)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
-    if (t->to_enable_btrace != NULL)
-      return t->to_enable_btrace (t, ptid);
-
-  tcomplain ();
-  return NULL;
+  return current_target.to_enable_btrace (&current_target, ptid);
 }
 
 /* See target.h.  */
index 13090e193a0242d03e999587f5b7de8a8b3143ac..bbc0ecd528661e2fcb67e44b6a26553d72fa1f73 100644 (file)
@@ -1001,7 +1001,8 @@ struct target_ops
     /* Enable branch tracing for PTID and allocate a branch trace target
        information struct for reading and for disabling branch trace.  */
     struct btrace_target_info *(*to_enable_btrace) (struct target_ops *,
-                                                   ptid_t ptid);
+                                                   ptid_t ptid)
+      TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Disable branch tracing and deallocate TINFO.  */
     void (*to_disable_btrace) (struct target_ops *,
This page took 0.033902 seconds and 4 git commands to generate.