diff --git a/src/emulator.rs b/src/emulator.rs index 3dadfe1..96df37d 100644 --- a/src/emulator.rs +++ b/src/emulator.rs @@ -311,7 +311,7 @@ impl Emulator { } let debug = DebugInfo { sender, - stop_reason: Some(DebugStopReason::Trapped), + stop_reason: Some(DebugStopReason::Paused), }; self.debuggers.insert(sim_id, debug); self.state @@ -334,7 +334,7 @@ impl Emulator { } fn debug_interrupt(&mut self, sim_id: SimId) { - self.debug_stop(sim_id, DebugStopReason::Trapped); + self.debug_stop(sim_id, DebugStopReason::Paused); } fn debug_stop(&mut self, sim_id: SimId, reason: DebugStopReason) { @@ -686,7 +686,7 @@ pub enum DebugStopReason { // We hit a watchpoint Watchpoint(VBWatchpointType, u32), // The debugger told us to pause - Trapped, + Paused, } struct DebugInfo { diff --git a/src/gdbserver.rs b/src/gdbserver.rs index b646990..6c59ccd 100644 --- a/src/gdbserver.rs +++ b/src/gdbserver.rs @@ -521,7 +521,11 @@ fn parse_memory_range(req: &mut Request<'_>) -> Option<(u32, usize)> { fn debug_stop_reason_string(reason: Option) -> String { let mut result = String::new(); - result += if reason.is_some() { "T05;" } else { "T00;" }; + result += if reason.is_some_and(|r| r != DebugStopReason::Paused) { + "T05;" + } else { + "T00;" + }; if let Some(DebugStopReason::Breakpoint) = reason { result += "swbreak;"; } @@ -542,7 +546,7 @@ fn debug_stop_reason_string(reason: Option) -> String { DebugStopReason::Trace => "trace;", DebugStopReason::Breakpoint => "breakpoint;", DebugStopReason::Watchpoint(_, _) => "watchpoint;", - DebugStopReason::Trapped => "trap;", + DebugStopReason::Paused => "trap;", }; }