aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-nat.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2008-05-02 11:07:25 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2008-05-02 11:07:25 +0000
commit5009afc5ba7a0d57f28fbc834757145fe1f45549 (patch)
tree84eb99d8f3cee40602e1f5f48650b3db51714cc4 /gdb/ppc-linux-nat.c
parenta99f88dcfcd4f977edc6daf5c469d656808e5576 (diff)
downloadgdb-5009afc5ba7a0d57f28fbc834757145fe1f45549.zip
gdb-5009afc5ba7a0d57f28fbc834757145fe1f45549.tar.gz
gdb-5009afc5ba7a0d57f28fbc834757145fe1f45549.tar.bz2
* target.h (struct target_ops): Add
to_watchpoint_addr_within_range. (target_watchpoint_addr_within_range): New function. * target.c (update_current_target): Inherit to_watchpoint_addr_within_range, defaulting to default_watchpoint_addr_within_range. (default_watchpoint_addr_within_range): New function. (debug_to_watchpoint_addr_within_range): New function. (setup_target_debug): Set to_watchpoint_addr_within_range. * ppc-linux-nat.c (ppc_linux_watchpoint_addr_within_range): New function. (_initialize_ppc_linux_nat): Set to_watchpoint_addr_within_range. * breakpoint.c (watchpoints_triggered): Use target_watchpoint_addr_within_range. * gdbint.texinfo (Algorithms): Describe target_watchpoint_addr_within_range.
Diffstat (limited to 'gdb/ppc-linux-nat.c')
-rw-r--r--gdb/ppc-linux-nat.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 53bc4ae..5486588 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -889,6 +889,16 @@ ppc_linux_stopped_by_watchpoint (void)
return ppc_linux_stopped_data_address (&current_target, &addr);
}
+static int
+ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
+ CORE_ADDR addr,
+ CORE_ADDR start, int length)
+{
+ addr &= ~7;
+ /* Check whether [start, start+length-1] intersects [addr, addr+7]. */
+ return start <= addr + 7 && start + length - 1 >= addr;
+}
+
static void
ppc_linux_store_inferior_registers (struct regcache *regcache, int regno)
{
@@ -997,6 +1007,7 @@ _initialize_ppc_linux_nat (void)
t->to_remove_watchpoint = ppc_linux_remove_watchpoint;
t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
t->to_stopped_data_address = ppc_linux_stopped_data_address;
+ t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range;
t->to_read_description = ppc_linux_read_description;