aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcraigblackmore <craig.blackmore@bristol.ac.uk>2018-08-06 20:41:42 +0100
committerTim Newsome <tim@sifive.com>2018-08-06 12:41:42 -0700
commite4d98b83da0d691c193910976141a3e52dfcdfe0 (patch)
tree51791613ce1605ac80385897ea8e57e2dc6bbd09
parent2d9904ada78b9c2181caaed0a7d6ee942f7da13b (diff)
downloadriscv-openocd-e4d98b83da0d691c193910976141a3e52dfcdfe0.zip
riscv-openocd-e4d98b83da0d691c193910976141a3e52dfcdfe0.tar.gz
riscv-openocd-e4d98b83da0d691c193910976141a3e52dfcdfe0.tar.bz2
Fix target not halting when GDB jumps to a hardware breakpoint (#283)
* Fix target not halting when GDB jumps to a hardware breakpoint This issue affects riscv-0.11. It is caused by OpenOCD manually stepping over hardware breakpoints to resume or step after a halt. This is not necessary as GDB should remove and add breakpoints as required. At the moment OpenOCD still steps over hardware watchpoints manually as GDB needs to know which address triggered the watchpoint and OpenOCD does not currently provide this information. Tested on the freedom-e310-arty using the GDB regression suite. There is one regression which is a corner case caused by a GDB bug. If a breakpoint is set in GDB and then the executable file is discarded, GDB reverts to its default information about address sizes e.g. on the freedom-e310-arty, 0x20400000 becomes 0xffff20400000. As a result, GDB is unable to step over breakpoints set before the executable was discarded. * Fix style issues * Revert "Fix style issues" This reverts commit 43e7e4b60a0675dce686a6e83ba10b3f0ef62d8a. * Revert "Fix target not halting when GDB jumps to a hardware breakpoint" This reverts commit e2717e4cfa3df21b2878791f4b9b8fbcbc2f5195. * Don't step over breakpoints
-rw-r--r--src/target/riscv/riscv-011.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c
index f2a6869..142b27f 100644
--- a/src/target/riscv/riscv-011.c
+++ b/src/target/riscv/riscv-011.c
@@ -1407,12 +1407,6 @@ static int strict_step(struct target *target, bool announce)
LOG_DEBUG("enter");
- struct breakpoint *breakpoint = target->breakpoints;
- while (breakpoint) {
- riscv_remove_breakpoint(target, breakpoint);
- breakpoint = breakpoint->next;
- }
-
struct watchpoint *watchpoint = target->watchpoints;
while (watchpoint) {
riscv_remove_watchpoint(target, watchpoint);
@@ -1423,12 +1417,6 @@ static int strict_step(struct target *target, bool announce)
if (result != ERROR_OK)
return result;
- breakpoint = target->breakpoints;
- while (breakpoint) {
- riscv_add_breakpoint(target, breakpoint);
- breakpoint = breakpoint->next;
- }
-
watchpoint = target->watchpoints;
while (watchpoint) {
riscv_add_watchpoint(target, watchpoint);