diff --git a/riscv/triggers.cc b/riscv/triggers.cc index 07cd6bf765..9e2a495ff5 100644 --- a/riscv/triggers.cc +++ b/riscv/triggers.cc @@ -299,7 +299,7 @@ std::optional icount_t::detect_icount_match(processor_t * const ret = match_result_t(TIMING_BEFORE, action); } - if (count >= 1) { + if (count >= 1 && (ret == std::nullopt || action != MCONTROL_ACTION_DEBUG_MODE)) { if (count == 1) pending = 1; count = count - 1;