Implement stepping

This commit is contained in:
2025-01-05 13:44:59 -05:00
parent 6fd8d8f5cf
commit 84f2cf7ece
3 changed files with 58 additions and 11 deletions
+8 -1
View File
@@ -258,6 +258,12 @@ impl GdbConnection {
self.stop_reason = None;
// Don't send a response until we hit a breakpoint or get interrupted
return Ok(None);
} else if req.match_str("s") {
self.client
.send_command(EmulatorCommand::DebugStep(self.sim_id));
self.stop_reason = None;
// Don't send a response until we hit a breakpoint or get interrupted
return Ok(None);
} else if req.match_str("p") {
let mut read_register = || {
let register_index = req.match_hex::<usize>()?;
@@ -348,7 +354,8 @@ impl Drop for GdbConnection {
fn debug_stop_reason_string(reason: Option<DebugStopReason>) -> &'static str {
match reason {
Some(DebugStopReason::Breakpoint) => "T05;thread:p1.t1;threads;p1.t1;reason:breakpoint",
Some(DebugStopReason::Trace) => "T05;thread:p1.t1;threads:p1.t1;reason:trace;",
Some(DebugStopReason::Breakpoint) => "T05;thread:p1.t1;threads:p1.t1;reason:breakpoint;",
Some(DebugStopReason::Trapped) => "T05;swbreak;thread:p1.t1;threads:p1.t1;reason:trap;",
None => "T00;thread:p1.t1;threads:p1.t1;",
}