Fix single stepping over faulting instructions. (#80)
authorTim Newsome <tim@sifive.com>
Fri, 16 Dec 2016 05:12:34 +0000 (21:12 -0800)
committerAndrew Waterman <aswaterman@gmail.com>
Fri, 16 Dec 2016 05:12:34 +0000 (21:12 -0800)
riscv/execute.cc

index 36e789629ecc4d075e5b0681e3519892e5f1328b..eb9fe4bd9ac109929ca5784905c6adb21e45f778 100644 (file)
@@ -190,6 +190,11 @@ miss:
     {
       take_trap(t, pc);
       n = instret;
+
+      if (unlikely(state.single_step == state.STEP_STEPPED)) {
+        state.single_step = state.STEP_NONE;
+        enter_debug_mode(DCSR_CAUSE_STEP);
+      }
     }
     catch (trigger_matched_t& t)
     {