[PATCH] Fix read and access watchpoint can't stop.

r@hev.cc r@hev.cc
Wed Mar 28 01:07:00 GMT 2018


From: Heiher <r@hev.cc>

	* breakpoint.c (bpstat_check_watchpoint):
	Fix read and access watchpoint can't stop.
---
 gdb/ChangeLog    | 5 +++++
 gdb/breakpoint.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e0a86e02ec..d9647d565c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-27  Heiher  <r@hev.cc>
+
+	* breakpoint.c (bpstat_check_watchpoint):
+	Fix read and access watchpoint can't stop.
+
 2017-09-07  Joel Brobecker  <brobecker@adacore.com>
 
 	* version.in: Set GDB version number to 8.0.1.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4940ec271b..53c9c985c1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5309,7 +5309,7 @@ bpstat_check_watchpoint (bpstat bs)
 	   this watchpoint.  */
 	must_check_value = 1;
       else if (b->watchpoint_triggered == watch_triggered_unknown
-	       && b->base.type == bp_hardware_watchpoint)
+	       && is_hardware_watchpoint (bs->breakpoint_at))
 	/* We were stopped by a hardware watchpoint, but the target could
 	   not report the data address.  We must check the watchpoint's
 	   value.  Access and read watchpoints are out of luck; without
-- 
2.16.3



More information about the Binutils mailing list