aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 10:05:18 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:47:07 -0700
commit418dabacd2dce85dc781f6fdc5aa277476b445c9 (patch)
treee9988c8241a5673d3682b6fac43bbc969ae9f806
parent61b371f94436eccaf6792b0a0243bcd1aabe8051 (diff)
downloadgdb-418dabacd2dce85dc781f6fdc5aa277476b445c9.zip
gdb-418dabacd2dce85dc781f6fdc5aa277476b445c9.tar.gz
gdb-418dabacd2dce85dc781f6fdc5aa277476b445c9.tar.bz2
convert to_remove_hw_breakpoint
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_remove_hw_breakpoint. * target.h (struct target_ops) <to_remove_hw_breakpoint>: Use TARGET_DEFAULT_RETURN.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/target-delegates.c16
-rw-r--r--gdb/target.c6
-rw-r--r--gdb/target.h3
4 files changed, 27 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c137d6b..81fd3f4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -2,6 +2,14 @@
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
+ to_remove_hw_breakpoint.
+ * target.h (struct target_ops) <to_remove_hw_breakpoint>: Use
+ TARGET_DEFAULT_RETURN.
+
+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
+ * target.c (update_current_target): Don't inherit or default
to_insert_hw_breakpoint.
* target.h (struct target_ops) <to_insert_hw_breakpoint>: Use
TARGET_DEFAULT_RETURN.
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 9f72972..da91fb0 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -139,6 +139,19 @@ tdefault_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, st
}
static int
+delegate_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
+{
+ self = self->beneath;
+ return self->to_remove_hw_breakpoint (self, arg1, arg2);
+}
+
+static int
+tdefault_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
+{
+ return -1;
+}
+
+static int
delegate_stopped_by_watchpoint (struct target_ops *self)
{
self = self->beneath;
@@ -251,6 +264,8 @@ install_delegators (struct target_ops *ops)
ops->to_can_use_hw_breakpoint = delegate_can_use_hw_breakpoint;
if (ops->to_insert_hw_breakpoint == NULL)
ops->to_insert_hw_breakpoint = delegate_insert_hw_breakpoint;
+ if (ops->to_remove_hw_breakpoint == NULL)
+ ops->to_remove_hw_breakpoint = delegate_remove_hw_breakpoint;
if (ops->to_stopped_by_watchpoint == NULL)
ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
if (ops->to_stopped_data_address == NULL)
@@ -284,6 +299,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_remove_breakpoint = memory_remove_breakpoint;
ops->to_can_use_hw_breakpoint = tdefault_can_use_hw_breakpoint;
ops->to_insert_hw_breakpoint = tdefault_insert_hw_breakpoint;
+ ops->to_remove_hw_breakpoint = tdefault_remove_hw_breakpoint;
ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
ops->to_stopped_data_address = tdefault_stopped_data_address;
ops->to_rcmd = default_rcmd;
diff --git a/gdb/target.c b/gdb/target.c
index b03d9a9..eb9a21c 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -606,7 +606,7 @@ update_current_target (void)
/* Do not inherit to_remove_breakpoint. */
/* Do not inherit to_can_use_hw_breakpoint. */
/* Do not inherit to_insert_hw_breakpoint. */
- INHERIT (to_remove_hw_breakpoint, t);
+ /* Do not inherit to_remove_hw_breakpoint. */
/* Do not inherit to_ranged_break_num_registers. */
INHERIT (to_insert_watchpoint, t);
INHERIT (to_remove_watchpoint, t);
@@ -734,10 +734,6 @@ update_current_target (void)
(int (*) (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *, struct target_ops *))
nomemory);
- de_fault (to_remove_hw_breakpoint,
- (int (*) (struct target_ops *, struct gdbarch *,
- struct bp_target_info *))
- return_minus_one);
de_fault (to_insert_watchpoint,
(int (*) (struct target_ops *, CORE_ADDR, int, int,
struct expression *))
diff --git a/gdb/target.h b/gdb/target.h
index 3b56b73..32cf4f6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -462,7 +462,8 @@ struct target_ops
struct gdbarch *, struct bp_target_info *)
TARGET_DEFAULT_RETURN (-1);
int (*to_remove_hw_breakpoint) (struct target_ops *,
- struct gdbarch *, struct bp_target_info *);
+ struct gdbarch *, struct bp_target_info *)
+ TARGET_DEFAULT_RETURN (-1);
/* Documentation of what the two routines below are expected to do is
provided with the corresponding target_* macros. */