Implement execute breakpoints

This commit is contained in:
2025-01-05 00:47:58 -05:00
parent 856ee00999
commit d6eb8ec7ef
3 changed files with 129 additions and 18 deletions
+18 -1
View File
@@ -307,6 +307,22 @@ impl GdbConnection {
} else {
self.response()
}
} else if req.match_str("Z0,") {
if let Some(address) = req.match_hex() {
self.client
.send_command(EmulatorCommand::AddBreakpoint(self.sim_id, address));
self.response().write_str("OK")
} else {
self.response()
}
} else if req.match_str("z0,") {
if let Some(address) = req.match_hex() {
self.client
.send_command(EmulatorCommand::RemoveBreakpoint(self.sim_id, address));
self.response().write_str("OK")
} else {
self.response()
}
} else {
// unrecognized command
self.response()
@@ -331,7 +347,8 @@ impl Drop for GdbConnection {
fn debug_stop_reason_string(reason: Option<DebugStopReason>) -> &'static str {
match reason {
Some(DebugStopReason::Trapped) => "T05;thread:p1.t1;threads:p1.t1;reason:trap;",
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;",
}
}