This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] fix accounting of hw watchpoints on ppc
- From: Edjunior Barbosa Machado <emachado at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 29 May 2012 15:26:59 -0300
- Subject: [PATCH] fix accounting of hw watchpoints on ppc
Hi,
this small patch fixes the checking of hardware watchpoints on ppc,
taking into account the different types of watches. With this change,
the following unexpected failures no longer happen:
FAIL: gdb.base/watch-read.exp: read watchpoint triggers when value doesn't change, trapping reads and writes
FAIL: gdb.base/watch-read.exp: only read watchpoint triggers when value doesn't change
Tested against ppc64/32, with no regressions found.
Ok to apply?
Thanks,
--
Edjunior Barbosa Machado
IBM Linux Technology Center
gdb/
2012-05-29 Edjunior Machado <emachado@linux.vnet.ibm.com>
* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): fix
accounting of hw watchpoints on ppc.
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 9bd11fd..b9e0c85 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -1461,7 +1461,7 @@ ppc_linux_can_use_hw_breakpoint (int type, int cnt, int ot)
if (type == bp_hardware_watchpoint || type == bp_read_watchpoint
|| type == bp_access_watchpoint || type == bp_watchpoint)
{
- if (cnt > total_hw_wp)
+ if (cnt + ot > total_hw_wp)
return -1;
}
else if (type == bp_hardware_breakpoint)