Skip to content

Commit e4d98b8

Browse files
craigblackmoretimsifive
authored andcommitted
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 43e7e4b. * Revert "Fix target not halting when GDB jumps to a hardware breakpoint" This reverts commit e2717e4. * Don't step over breakpoints
1 parent 2d9904a commit e4d98b8

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/target/riscv/riscv-011.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,12 +1407,6 @@ static int strict_step(struct target *target, bool announce)
14071407

14081408
LOG_DEBUG("enter");
14091409

1410-
struct breakpoint *breakpoint = target->breakpoints;
1411-
while (breakpoint) {
1412-
riscv_remove_breakpoint(target, breakpoint);
1413-
breakpoint = breakpoint->next;
1414-
}
1415-
14161410
struct watchpoint *watchpoint = target->watchpoints;
14171411
while (watchpoint) {
14181412
riscv_remove_watchpoint(target, watchpoint);
@@ -1423,12 +1417,6 @@ static int strict_step(struct target *target, bool announce)
14231417
if (result != ERROR_OK)
14241418
return result;
14251419

1426-
breakpoint = target->breakpoints;
1427-
while (breakpoint) {
1428-
riscv_add_breakpoint(target, breakpoint);
1429-
breakpoint = breakpoint->next;
1430-
}
1431-
14321420
watchpoint = target->watchpoints;
14331421
while (watchpoint) {
14341422
riscv_add_watchpoint(target, watchpoint);

0 commit comments

Comments
 (0)