diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index b35a6a4c6..88dbacb8e 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -1852,9 +1852,8 @@ static int handle_halt(struct target *target, bool announce) * which watchpoint to step over. Setting need_strict_step to true * flags OpenOCD to disable triggers -> step -> enable triggers on * the next step or resume*/ - if (! riscv_breakpoint_hit(target, 0, info->dpc)) { + if (!riscv_breakpoint_hit(target, 0, info->dpc)) info->need_strict_step = true; - } break; case DCSR_CAUSE_DEBUGINT: target->debug_reason = DBG_REASON_DBGRQ; diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index f1679cdde..5913351a4 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -2032,12 +2032,12 @@ bool riscv_breakpoint_hit(struct target *target, int hartid, uint64_t dpc) if (tdata2 == dpc) { LOG_DEBUG("breakpoint %d matches dpc", t); - hit = true; - break; + hit = true; + break; } } - // restore tselect + /* restore tselect */ riscv_set_register_on_hart(target, hartid, GDB_REGNO_TSELECT, tselect); LOG_DEBUG("no breakpoint matches dpc");