]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add target_ops argument to to_read_btrace
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:46:13 +0000 (21:46 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:46:45 +0000 (07:46 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target.h (struct target_ops) <to_read_btrace>: Add argument.
* target.c (struct target_ops) <to_read_btrace>: Add argument.
* remote.c (struct target_ops) <to_read_btrace>: Add 'self'
argument.
* amd64-linux-nat.c (amd64_linux_read_btrace): New function.
(_initialize_amd64_linux_nat): Use it.
* i386-linux-nat.c (i386_linux_read_btrace): New function.
(_initialize_i386_linux_nat): Use it.

gdb/ChangeLog
gdb/amd64-linux-nat.c
gdb/i386-linux-nat.c
gdb/remote.c
gdb/target.c
gdb/target.h

index 5c9b175e5e0e0be27b5eef9822b16daf8ba95fce..3480224dbe7105f18aec0b56f493b1b45f813582 100644 (file)
@@ -1,3 +1,14 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target.h (struct target_ops) <to_read_btrace>: Add argument.
+       * target.c (struct target_ops) <to_read_btrace>: Add argument.
+       * remote.c (struct target_ops) <to_read_btrace>: Add 'self'
+       argument.
+       * amd64-linux-nat.c (amd64_linux_read_btrace): New function.
+       (_initialize_amd64_linux_nat): Use it.
+       * i386-linux-nat.c (i386_linux_read_btrace): New function.
+       (_initialize_i386_linux_nat): Use it.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target.h (struct target_ops) <to_teardown_btrace>: Add argument.
index d7256c3ef57693eda5ce14151dc5d1ed76239fd4..b7b889bcd2bc3adf2c8319aa2140b96bcd8262cd 100644 (file)
@@ -1191,6 +1191,15 @@ amd64_linux_teardown_btrace (struct target_ops *self,
   linux_disable_btrace (tinfo);
 }
 
+static enum btrace_error
+amd64_linux_read_btrace (struct target_ops *self,
+                        VEC (btrace_block_s) **data,
+                        struct btrace_target_info *btinfo,
+                        enum btrace_read_type type)
+{
+  return linux_read_btrace (data, btinfo, type);
+}
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_amd64_linux_nat (void);
 
@@ -1234,7 +1243,7 @@ _initialize_amd64_linux_nat (void)
   t->to_enable_btrace = amd64_linux_enable_btrace;
   t->to_disable_btrace = amd64_linux_disable_btrace;
   t->to_teardown_btrace = amd64_linux_teardown_btrace;
-  t->to_read_btrace = linux_read_btrace;
+  t->to_read_btrace = amd64_linux_read_btrace;
 
   /* Register the target.  */
   linux_nat_add_target (t);
index 0f8bc82219aa74c21fc07bf9567a3c5c258e3b07..84f20ab891e76f41d66eb6adf66ff5069f71bfd0 100644 (file)
@@ -1102,6 +1102,15 @@ i386_linux_teardown_btrace (struct target_ops *self,
   linux_disable_btrace (tinfo);
 }
 
+static enum btrace_error
+i386_linux_read_btrace (struct target_ops *self,
+                       VEC (btrace_block_s) **data,
+                       struct btrace_target_info *btinfo,
+                       enum btrace_read_type type)
+{
+  return linux_read_btrace (data, btinfo, type);
+}
+
 /* -Wmissing-prototypes */
 extern initialize_file_ftype _initialize_i386_linux_nat;
 
@@ -1140,7 +1149,7 @@ _initialize_i386_linux_nat (void)
   t->to_enable_btrace = i386_linux_enable_btrace;
   t->to_disable_btrace = i386_linux_disable_btrace;
   t->to_teardown_btrace = i386_linux_teardown_btrace;
-  t->to_read_btrace = linux_read_btrace;
+  t->to_read_btrace = i386_linux_read_btrace;
 
   /* Register the target.  */
   linux_nat_add_target (t);
index b77ea81549b136a780fe0018905da138690de58f..eb8eb0f5b2f69f99363d5a6d329a4c1388b0b973 100644 (file)
@@ -11322,7 +11322,8 @@ remote_teardown_btrace (struct target_ops *self,
 /* Read the branch trace.  */
 
 static enum btrace_error
-remote_read_btrace (VEC (btrace_block_s) **btrace,
+remote_read_btrace (struct target_ops *self,
+                   VEC (btrace_block_s) **btrace,
                    struct btrace_target_info *tinfo,
                    enum btrace_read_type type)
 {
index e1ffaf0df68d71a91cfef2ca936261d896502a77..7d3d587ca2095464abc8c16c7a42de5905ff2a09 100644 (file)
@@ -4250,7 +4250,7 @@ target_read_btrace (VEC (btrace_block_s) **btrace,
 
   for (t = current_target.beneath; t != NULL; t = t->beneath)
     if (t->to_read_btrace != NULL)
-      return t->to_read_btrace (btrace, btinfo, type);
+      return t->to_read_btrace (t, btrace, btinfo, type);
 
   tcomplain ();
   return BTRACE_ERR_NOT_SUPPORTED;
index 982bc185b64627b400d956dd4d052c444789c3e1..b9ff0351deacb13a2dce6312571dea19b4ddb84e 100644 (file)
@@ -921,7 +921,8 @@ struct target_ops
        DATA is cleared before new trace is added.
        The branch trace will start with the most recent block and continue
        towards older blocks.  */
-    enum btrace_error (*to_read_btrace) (VEC (btrace_block_s) **data,
+    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);