From 5009afc5ba7a0d57f28fbc834757145fe1f45549 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 2 May 2008 11:07:25 +0000 Subject: * 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. --- gdb/breakpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/breakpoint.c') diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 9dc2ca2..11d9187 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2616,8 +2616,9 @@ watchpoints_triggered (struct target_waitstatus *ws) for (loc = b->loc; loc; loc = loc->next) /* Exact match not required. Within range is sufficient. */ - if (addr >= loc->address - && addr < loc->address + loc->length) + if (target_watchpoint_addr_within_range (¤t_target, + addr, loc->address, + loc->length)) { b->watchpoint_triggered = watch_triggered_yes; break; -- cgit v1.1