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

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

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

index c6cb8b1268d3ac01ea54e0b555fac99733afeb94..6b61768062b100deef8e4de4bdb8c02456db3621 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (target_disable_btrace): Unconditionally delegate.
+       * target.h (struct target_ops) <to_disable_btrace>: Use
+       TARGET_DEFAULT_NORETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index e0c78333e773572d99c174b4dea29466ae7c83c7..30c2849be15e2227fc914dccf5b1b5b46a2ae083 100644 (file)
@@ -1300,6 +1300,19 @@ tdefault_supports_btrace (struct target_ops *self)
   return 0;
 }
 
+static void
+delegate_disable_btrace (struct target_ops *self, struct btrace_target_info *arg1)
+{
+  self = self->beneath;
+  self->to_disable_btrace (self, arg1);
+}
+
+static void
+tdefault_disable_btrace (struct target_ops *self, struct btrace_target_info *arg1)
+{
+  tcomplain ();
+}
+
 static void
 delegate_save_record (struct target_ops *self, const char *arg1)
 {
@@ -1692,6 +1705,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_disable_btrace == NULL)
+    ops->to_disable_btrace = delegate_disable_btrace;
   if (ops->to_save_record == NULL)
     ops->to_save_record = delegate_save_record;
   if (ops->to_delete_record == NULL)
@@ -1833,6 +1848,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_disable_btrace = tdefault_disable_btrace;
   ops->to_save_record = tdefault_save_record;
   ops->to_delete_record = tdefault_delete_record;
   ops->to_record_is_replaying = tdefault_record_is_replaying;
index 92be667a93c4e81fc7dd123cd441ebf1d027ad9e..2914a2aa681b943448fe1612a1abc1b467660cfd 100644 (file)
@@ -3799,16 +3799,7 @@ target_enable_btrace (ptid_t ptid)
 void
 target_disable_btrace (struct btrace_target_info *btinfo)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
-    if (t->to_disable_btrace != NULL)
-      {
-       t->to_disable_btrace (t, btinfo);
-       return;
-      }
-
-  tcomplain ();
+  current_target.to_disable_btrace (&current_target, btinfo);
 }
 
 /* See target.h.  */
index 4474f431dce4a522d9c7bec531e23325aa1a1515..eed1d6638e5301e9b4715faa8f6eea078ef35e84 100644 (file)
@@ -1005,7 +1005,8 @@ struct target_ops
 
     /* Disable branch tracing and deallocate TINFO.  */
     void (*to_disable_btrace) (struct target_ops *,
-                              struct btrace_target_info *tinfo);
+                              struct btrace_target_info *tinfo)
+      TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Disable branch tracing and deallocate TINFO.  This function is similar
        to to_disable_btrace, except that it is called during teardown and is