* remote.c (remote_watchpoint_addr_within_range): New function.
authorMaciej W. Rozycki <macro@linux-mips.org>
Fri, 24 Feb 2012 23:48:37 +0000 (23:48 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Fri, 24 Feb 2012 23:48:37 +0000 (23:48 +0000)
(init_remote_ops): Use it.

gdb/ChangeLog
gdb/remote.c

index 9750d3b74f5b7214a35b9f1efd7909fb5dc56e63..0772ee87af2a84e7c261cddbca96578208a3a63c 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * remote.c (remote_watchpoint_addr_within_range): New function.
+       (init_remote_ops): Use it.
+
 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * target.h (target_watchpoint_addr_within_range): Document macro.
index 68c8fd25e774574892832ff498c53b263846d460..2719241ee7e148225548a4c2561e809eb164eb2e 100644 (file)
@@ -7904,6 +7904,15 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type,
                  _("remote_insert_watchpoint: reached end of function"));
 }
 
+static int
+remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
+                                    CORE_ADDR start, int length)
+{
+  CORE_ADDR diff = remote_address_masked (addr - start);
+
+  return diff < length;
+}
+
 
 static int
 remote_remove_watchpoint (CORE_ADDR addr, int len, int type,
@@ -10775,6 +10784,8 @@ Specify the serial device it is connected to\n\
   remote_ops.to_remove_breakpoint = remote_remove_breakpoint;
   remote_ops.to_stopped_by_watchpoint = remote_stopped_by_watchpoint;
   remote_ops.to_stopped_data_address = remote_stopped_data_address;
+  remote_ops.to_watchpoint_addr_within_range =
+    remote_watchpoint_addr_within_range;
   remote_ops.to_can_use_hw_breakpoint = remote_check_watch_resources;
   remote_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint;
   remote_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint;