aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 09:58:16 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:47:05 -0700
commit52b51d06f873e4bc4874042c32383b68caa194fc (patch)
tree1b615e300a3b0900933164f1db868305a0adc644
parentf86e59b2d1189ca289d971e2fd6ca51238a232fa (diff)
downloadgdb-52b51d06f873e4bc4874042c32383b68caa194fc.zip
gdb-52b51d06f873e4bc4874042c32383b68caa194fc.tar.gz
gdb-52b51d06f873e4bc4874042c32383b68caa194fc.tar.bz2
convert to_can_use_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_can_use_hw_breakpoint. * target.h (struct target_ops) <to_can_use_hw_breakpoint>: Use TARGET_DEFAULT_RETURN.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/target-delegates.c16
-rw-r--r--gdb/target.c5
-rw-r--r--gdb/target.h3
4 files changed, 27 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ebeb7d6..604b532 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_can_use_hw_breakpoint.
+ * target.h (struct target_ops) <to_can_use_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_files_info.
* target.h (struct target_ops) <to_files_info>: Use
TARGET_DEFAULT_IGNORE.
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 3186a58..e5d7b28 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -113,6 +113,19 @@ delegate_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struc
}
static int
+delegate_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+{
+ self = self->beneath;
+ return self->to_can_use_hw_breakpoint (self, arg1, arg2, arg3);
+}
+
+static int
+tdefault_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
+{
+ return 0;
+}
+
+static int
delegate_stopped_by_watchpoint (struct target_ops *self)
{
self = self->beneath;
@@ -221,6 +234,8 @@ install_delegators (struct target_ops *ops)
ops->to_insert_breakpoint = delegate_insert_breakpoint;
if (ops->to_remove_breakpoint == NULL)
ops->to_remove_breakpoint = delegate_remove_breakpoint;
+ if (ops->to_can_use_hw_breakpoint == NULL)
+ ops->to_can_use_hw_breakpoint = delegate_can_use_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)
@@ -252,6 +267,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_files_info = tdefault_files_info;
ops->to_insert_breakpoint = memory_insert_breakpoint;
ops->to_remove_breakpoint = memory_remove_breakpoint;
+ ops->to_can_use_hw_breakpoint = tdefault_can_use_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 fc16272..c48ee01 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -604,7 +604,7 @@ update_current_target (void)
/* Do not inherit to_files_info. */
/* Do not inherit to_insert_breakpoint. */
/* Do not inherit to_remove_breakpoint. */
- INHERIT (to_can_use_hw_breakpoint, t);
+ /* Do not inherit to_can_use_hw_breakpoint. */
INHERIT (to_insert_hw_breakpoint, t);
INHERIT (to_remove_hw_breakpoint, t);
/* Do not inherit to_ranged_break_num_registers. */
@@ -734,9 +734,6 @@ update_current_target (void)
(int (*) (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *, struct target_ops *))
nomemory);
- de_fault (to_can_use_hw_breakpoint,
- (int (*) (struct target_ops *, int, int, int))
- return_zero);
de_fault (to_insert_hw_breakpoint,
(int (*) (struct target_ops *, struct gdbarch *,
struct bp_target_info *))
diff --git a/gdb/target.h b/gdb/target.h
index fd0afcf..290f2f6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -455,7 +455,8 @@ struct target_ops
int (*to_remove_breakpoint) (struct target_ops *, struct gdbarch *,
struct bp_target_info *)
TARGET_DEFAULT_FUNC (memory_remove_breakpoint);
- int (*to_can_use_hw_breakpoint) (struct target_ops *, int, int, int);
+ int (*to_can_use_hw_breakpoint) (struct target_ops *, int, int, int)
+ TARGET_DEFAULT_RETURN (0);
int (*to_ranged_break_num_registers) (struct target_ops *);
int (*to_insert_hw_breakpoint) (struct target_ops *,
struct gdbarch *, struct bp_target_info *);