Report some triggers as hardware breakpoints.

Instead of reporting them all as watchpoints.

Change-Id: If43d282a168f64f8fed6f659bcebbe2ef72f23e9
This commit is contained in:
Tim Newsome 2022-04-27 13:01:14 -07:00
parent d67a5bf064
commit 73199226df
1 changed files with 5 additions and 0 deletions

View File

@ -1262,6 +1262,11 @@ int set_debug_reason(struct target *target, enum riscv_halt_reason halt_reason)
if (riscv_hit_trigger_hit_bit(target, &r->trigger_hit) != ERROR_OK)
return ERROR_FAIL;
target->debug_reason = DBG_REASON_WATCHPOINT;
/* Check if we hit a hardware breakpoint. */
for (struct breakpoint *bp = target->breakpoints; bp; bp = bp->next) {
if (bp->unique_id == r->trigger_hit)
target->debug_reason = DBG_REASON_BREAKPOINT;
}
break;
case RISCV_HALT_INTERRUPT:
case RISCV_HALT_GROUP: