Implement GDB/LLDB compatible server #3
|
@ -311,7 +311,7 @@ impl Emulator {
|
||||||
}
|
}
|
||||||
let debug = DebugInfo {
|
let debug = DebugInfo {
|
||||||
sender,
|
sender,
|
||||||
stop_reason: Some(DebugStopReason::Trapped),
|
stop_reason: Some(DebugStopReason::Paused),
|
||||||
};
|
};
|
||||||
self.debuggers.insert(sim_id, debug);
|
self.debuggers.insert(sim_id, debug);
|
||||||
self.state
|
self.state
|
||||||
|
@ -334,7 +334,7 @@ impl Emulator {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn debug_interrupt(&mut self, sim_id: SimId) {
|
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) {
|
fn debug_stop(&mut self, sim_id: SimId, reason: DebugStopReason) {
|
||||||
|
@ -686,7 +686,7 @@ pub enum DebugStopReason {
|
||||||
// We hit a watchpoint
|
// We hit a watchpoint
|
||||||
Watchpoint(VBWatchpointType, u32),
|
Watchpoint(VBWatchpointType, u32),
|
||||||
// The debugger told us to pause
|
// The debugger told us to pause
|
||||||
Trapped,
|
Paused,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DebugInfo {
|
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 {
|
fn debug_stop_reason_string(reason: Option<DebugStopReason>) -> String {
|
||||||
let mut result = String::new();
|
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 {
|
if let Some(DebugStopReason::Breakpoint) = reason {
|
||||||
result += "swbreak;";
|
result += "swbreak;";
|
||||||
}
|
}
|
||||||
|
@ -542,7 +546,7 @@ fn debug_stop_reason_string(reason: Option<DebugStopReason>) -> String {
|
||||||
DebugStopReason::Trace => "trace;",
|
DebugStopReason::Trace => "trace;",
|
||||||
DebugStopReason::Breakpoint => "breakpoint;",
|
DebugStopReason::Breakpoint => "breakpoint;",
|
||||||
DebugStopReason::Watchpoint(_, _) => "watchpoint;",
|
DebugStopReason::Watchpoint(_, _) => "watchpoint;",
|
||||||
DebugStopReason::Trapped => "trap;",
|
DebugStopReason::Paused => "trap;",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue