Implement GDB/LLDB compatible server #3
|
@ -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 {
|
||||
|
|
|
@ -521,7 +521,11 @@ fn parse_memory_range(req: &mut Request<'_>) -> Option<(u32, usize)> {
|
|||
|
||||
fn debug_stop_reason_string(reason: Option<DebugStopReason>) -> 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<DebugStopReason>) -> String {
|
|||
DebugStopReason::Trace => "trace;",
|
||||
DebugStopReason::Breakpoint => "breakpoint;",
|
||||
DebugStopReason::Watchpoint(_, _) => "watchpoint;",
|
||||
DebugStopReason::Trapped => "trap;",
|
||||
DebugStopReason::Paused => "trap;",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue