summaryrefslogtreecommitdiffstats
path: root/sparc.c
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2019-11-04 22:57:29 +0100
committerJiri Gaisler <jiri@gaisler.se>2019-11-08 22:33:05 +0100
commit88b545002e553f1e21fab1aff854a3e325976ad3 (patch)
tree45aaddcb10ccc2d17706e2fee31d367042bbd2f0 /sparc.c
parentRelease version 2.18 (diff)
downloadsis-88b545002e553f1e21fab1aff854a3e325976ad3.tar.bz2
Improve gdb watchpoint handling
* show old/new values * stop at correct instruction
Diffstat (limited to 'sparc.c')
-rw-r--r--sparc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sparc.c b/sparc.c
index db40e8d..a06aa6b 100644
--- a/sparc.c
+++ b/sparc.c
@@ -961,12 +961,23 @@ sparc_dispatch_instruction (sregs)
if (op3 & 4)
{
sregs->icnt = T_ST; /* Set store instruction count */
+
+ /* skip store if we resume after a write watchpoint */
+ if (sis_gdb_break && ebase.wphit)
+ {
+ ebase.wphit = 0;
+ break;
+ }
+
if (ebase.wpwnum)
{
if ((ebase.wphit = check_wpw (sregs, address, wpmask (op3))))
{
sregs->trap = WPT_TRAP;
- break;
+ /* gdb seems to expect that the write goes trough when the
+ * watchpoint is hit, but PC stays on the store instruction */
+ if (!sis_gdb_break)
+ break;
}
}
#if defined(STAT) || defined(ENABLE_L1CACHE)