// fetch/decode/execute loop
void processor_t::step(size_t n)
{
- // TODO: We should really not call this function at all when halted, to avoid
- // burning CPU.
- while (run && !halted && n > 0) {
+ if (state.dcsr.debugint && state.dcsr.cause == DCSR_CAUSE_NONE) {
+ enter_debug_mode(DCSR_CAUSE_DEBUGINT);
+ }
+
+ while (n > 0) {
size_t instret = 0;
reg_t pc = state.pc;
mmu_t* _mmu = mmu;