Add target_ops argument to to_remove_hw_breakpoint
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:29:03 +0000 (21:29 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:45:32 +0000 (07:45 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target.h (struct target_ops) <to_remove_hw_breakpoint>: Add
argument.
(target_remove_hw_breakpoint): Add argument.
* target.c (debug_to_remove_hw_breakpoint): Add argument.
(update_current_target): Update.
* remote.c (remote_remove_hw_breakpoint): Add 'self' argument.
* ppc-linux-nat.c (ppc_linux_remove_hw_breakpoint): Add 'self'
argument.
* i386-nat.c (i386_remove_hw_breakpoint): Add 'self' argument.
* arm-linux-nat.c (arm_linux_remove_hw_breakpoint): Add 'self'
argument.
* aarch64-linux-nat.c (aarch64_linux_remove_hw_breakpoint): Add
'self' argument.

gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/arm-linux-nat.c
gdb/i386-nat.c
gdb/ppc-linux-nat.c
gdb/remote.c
gdb/target.c
gdb/target.h

index db4e949..fff135d 100644 (file)
@@ -1,5 +1,21 @@
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
+       * target.h (struct target_ops) <to_remove_hw_breakpoint>: Add
+       argument.
+       (target_remove_hw_breakpoint): Add argument.
+       * target.c (debug_to_remove_hw_breakpoint): Add argument.
+       (update_current_target): Update.
+       * remote.c (remote_remove_hw_breakpoint): Add 'self' argument.
+       * ppc-linux-nat.c (ppc_linux_remove_hw_breakpoint): Add 'self'
+       argument.
+       * i386-nat.c (i386_remove_hw_breakpoint): Add 'self' argument.
+       * arm-linux-nat.c (arm_linux_remove_hw_breakpoint): Add 'self'
+       argument.
+       * aarch64-linux-nat.c (aarch64_linux_remove_hw_breakpoint): Add
+       'self' argument.
+
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
        * target.h (struct target_ops) <to_insert_hw_breakpoint>: Add
        argument.
        (target_insert_hw_breakpoint): Add argument.
index 9a4aba9..cec5e4a 100644 (file)
@@ -1235,7 +1235,8 @@ aarch64_linux_insert_hw_breakpoint (struct target_ops *self,
    Return 0 on success, -1 on failure.  */
 
 static int
-aarch64_linux_remove_hw_breakpoint (struct gdbarch *gdbarch,
+aarch64_linux_remove_hw_breakpoint (struct target_ops *self,
+                                   struct gdbarch *gdbarch,
                                    struct bp_target_info *bp_tgt)
 {
   int ret;
index 00b22cc..99699ab 100644 (file)
@@ -1056,7 +1056,8 @@ arm_linux_insert_hw_breakpoint (struct target_ops *self,
 
 /* Remove a hardware breakpoint.  */
 static int
-arm_linux_remove_hw_breakpoint (struct gdbarch *gdbarch, 
+arm_linux_remove_hw_breakpoint (struct target_ops *self,
+                               struct gdbarch *gdbarch, 
                                struct bp_target_info *bp_tgt)
 {
   struct lwp_info *lp;
index 21ef95c..80bb217 100644 (file)
@@ -791,7 +791,7 @@ i386_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
    Return 0 on success, -1 on failure.  */
 
 static int
-i386_remove_hw_breakpoint (struct gdbarch *gdbarch,
+i386_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
                           struct bp_target_info *bp_tgt)
 {
   struct i386_debug_reg_state *state
index 6213b74..eb0ccc6 100644 (file)
@@ -1710,7 +1710,8 @@ ppc_linux_insert_hw_breakpoint (struct target_ops *self,
 }
 
 static int
-ppc_linux_remove_hw_breakpoint (struct gdbarch *gdbarch,
+ppc_linux_remove_hw_breakpoint (struct target_ops *self,
+                               struct gdbarch *gdbarch,
                                  struct bp_target_info *bp_tgt)
 {
   struct lwp_info *lp;
index 8581d26..a837882 100644 (file)
@@ -8385,7 +8385,7 @@ remote_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
 
 
 static int
-remote_remove_hw_breakpoint (struct gdbarch *gdbarch,
+remote_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
                             struct bp_target_info *bp_tgt)
 {
   CORE_ADDR addr;
index 08866b9..95ad27e 100644 (file)
@@ -107,7 +107,8 @@ static int debug_to_insert_hw_breakpoint (struct target_ops *self,
                                          struct gdbarch *,
                                          struct bp_target_info *);
 
-static int debug_to_remove_hw_breakpoint (struct gdbarch *,
+static int debug_to_remove_hw_breakpoint (struct target_ops *self,
+                                         struct gdbarch *,
                                          struct bp_target_info *);
 
 static int debug_to_insert_watchpoint (CORE_ADDR, int, int,
@@ -743,7 +744,8 @@ update_current_target (void)
                      struct bp_target_info *))
            return_minus_one);
   de_fault (to_remove_hw_breakpoint,
-           (int (*) (struct gdbarch *, struct bp_target_info *))
+           (int (*) (struct target_ops *, struct gdbarch *,
+                     struct bp_target_info *))
            return_minus_one);
   de_fault (to_insert_watchpoint,
            (int (*) (CORE_ADDR, int, int, struct expression *))
@@ -4733,12 +4735,14 @@ debug_to_insert_hw_breakpoint (struct target_ops *self,
 }
 
 static int
-debug_to_remove_hw_breakpoint (struct gdbarch *gdbarch,
+debug_to_remove_hw_breakpoint (struct target_ops *self,
+                              struct gdbarch *gdbarch,
                               struct bp_target_info *bp_tgt)
 {
   int retval;
 
-  retval = debug_target.to_remove_hw_breakpoint (gdbarch, bp_tgt);
+  retval = debug_target.to_remove_hw_breakpoint (&debug_target,
+                                                gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
                      "target_remove_hw_breakpoint (%s, xxx) = %ld\n",
index 6fc7294..7f94b2b 100644 (file)
@@ -454,7 +454,8 @@ struct target_ops
     int (*to_ranged_break_num_registers) (struct target_ops *);
     int (*to_insert_hw_breakpoint) (struct target_ops *,
                                    struct gdbarch *, struct bp_target_info *);
-    int (*to_remove_hw_breakpoint) (struct gdbarch *, struct bp_target_info *);
+    int (*to_remove_hw_breakpoint) (struct target_ops *,
+                                   struct gdbarch *, struct bp_target_info *);
 
     /* Documentation of what the two routines below are expected to do is
        provided with the corresponding target_* macros.  */
@@ -1642,7 +1643,8 @@ extern int target_remove_mask_watchpoint (CORE_ADDR, CORE_ADDR, int);
                                                gdbarch, bp_tgt)
 
 #define target_remove_hw_breakpoint(gdbarch, bp_tgt) \
-     (*current_target.to_remove_hw_breakpoint) (gdbarch, bp_tgt)
+     (*current_target.to_remove_hw_breakpoint) (&current_target,       \
+                                               gdbarch, bp_tgt)
 
 /* Return number of debug registers needed for a ranged breakpoint,
    or -1 if ranged breakpoints are not supported.  */