Skip to content

Commit

Permalink
riscv: handle NoException exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Cross <sean@xobs.io>
  • Loading branch information
xobs committed Sep 6, 2019
1 parent 3e900d3 commit f19e9d6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions wishbone-tool/src/riscv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,11 @@ impl RiscvCpu {
self.controller.perform_resume(bridge, false)?;

if let Some(exception) = self.last_exception.lock().unwrap().take() {
Ok(Some(format!("{}", exception)))
}
else {
Ok(None)
if exception != RiscvException::NoException {
return Ok(Some(format!("{}", exception)));
}
}
Ok(None)
}

/// Step the CPU forward by one instruction.
Expand All @@ -728,11 +728,11 @@ impl RiscvCpu {
self.controller.perform_resume(bridge, true)?;

if let Some(exception) = self.last_exception.lock().unwrap().take() {
Ok(Some(format!("{}", exception)))
}
else {
Ok(None)
if exception != RiscvException::NoException {
return Ok(Some(format!("{}", exception)));
}
}
Ok(None)
}

/// Convert a GDB `regnum` into a `RiscvRegister`
Expand Down

0 comments on commit f19e9d6

Please sign in to comment.