Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] fix accounting of hw watchpoints on ppc
@ 2012-05-29 18:28 Edjunior Barbosa Machado
  2012-05-30 12:59 ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Edjunior Barbosa Machado @ 2012-05-29 18:28 UTC (permalink / raw)
  To: gdb-patches

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-30 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-29 18:28 [PATCH] fix accounting of hw watchpoints on ppc Edjunior Barbosa Machado
2012-05-30 12:59 ` Jan Kratochvil
2012-05-30 13:45   ` Edjunior Barbosa Machado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox