]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
convert to_read_btrace
authorTom Tromey <tromey@redhat.com>
Thu, 19 Dec 2013 15:19:02 +0000 (08:19 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:48:37 +0000 (07:48 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

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

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

index 0402da30bae30b8b2ab5fab2950252cf87f7cba9..3cdb9fe46bce4b414aa9e119b0f1095a4f19274d 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (target_read_btrace): Unconditionally delegate.
+       * target.h (struct target_ops) <to_read_btrace>: Use
+       TARGET_DEFAULT_NORETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 800a37c79faca78f84d7422f4daf127b4012730d..1b956d23599599c636d13595333fde8570f92fb6 100644 (file)
@@ -1326,6 +1326,19 @@ tdefault_teardown_btrace (struct target_ops *self, struct btrace_target_info *ar
   tcomplain ();
 }
 
+static enum btrace_error 
+delegate_read_btrace (struct target_ops *self, VEC (btrace_block_s) **arg1, struct btrace_target_info *arg2, enum btrace_read_type  arg3)
+{
+  self = self->beneath;
+  return self->to_read_btrace (self, arg1, arg2, arg3);
+}
+
+static enum btrace_error 
+tdefault_read_btrace (struct target_ops *self, VEC (btrace_block_s) **arg1, struct btrace_target_info *arg2, enum btrace_read_type  arg3)
+{
+  tcomplain ();
+}
+
 static void
 delegate_save_record (struct target_ops *self, const char *arg1)
 {
@@ -1722,6 +1735,8 @@ install_delegators (struct target_ops *ops)
     ops->to_disable_btrace = delegate_disable_btrace;
   if (ops->to_teardown_btrace == NULL)
     ops->to_teardown_btrace = delegate_teardown_btrace;
+  if (ops->to_read_btrace == NULL)
+    ops->to_read_btrace = delegate_read_btrace;
   if (ops->to_save_record == NULL)
     ops->to_save_record = delegate_save_record;
   if (ops->to_delete_record == NULL)
@@ -1865,6 +1880,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_supports_btrace = tdefault_supports_btrace;
   ops->to_disable_btrace = tdefault_disable_btrace;
   ops->to_teardown_btrace = tdefault_teardown_btrace;
+  ops->to_read_btrace = tdefault_read_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 85ee3312c9c20fd67148286643013fa1949b4d1f..75d961b870fa9c51d05a22d1e0698746b1711e93 100644 (file)
@@ -3817,14 +3817,7 @@ target_read_btrace (VEC (btrace_block_s) **btrace,
                    struct btrace_target_info *btinfo,
                    enum btrace_read_type type)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
-    if (t->to_read_btrace != NULL)
-      return t->to_read_btrace (t, btrace, btinfo, type);
-
-  tcomplain ();
-  return BTRACE_ERR_NOT_SUPPORTED;
+  return current_target.to_read_btrace (&current_target, btrace, btinfo, type);
 }
 
 /* See target.h.  */
index 8898438519bacf3aab3f75f5d435d4c4ab434b88..13090e193a0242d03e999587f5b7de8a8b3143ac 100644 (file)
@@ -1023,7 +1023,8 @@ struct target_ops
     enum btrace_error (*to_read_btrace) (struct target_ops *self,
                                         VEC (btrace_block_s) **data,
                                         struct btrace_target_info *btinfo,
-                                        enum btrace_read_type type);
+                                        enum btrace_read_type type)
+      TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Stop trace recording.  */
     void (*to_stop_recording) (struct target_ops *);