Stub out reading registers and memory

This commit is contained in:
2025-01-01 18:15:41 -05:00
parent 9519897711
commit d016538408
5 changed files with 97 additions and 24 deletions
+27
View File
@@ -212,6 +212,33 @@ impl GdbConnection {
} else if req.match_str("c") || req.match_str("vCont;c:") {
self.client.send_command(EmulatorCommand::Resume);
// Don't send a response until we hit a breakpoint or get interrupted
} else if req.match_str("p") {
let Some(register) = req.match_hex::<u32>() else {
let res = self.response();
self.send(res).await?;
continue;
};
let res = self.response().write_hex(register);
self.send(res).await?;
} else if req.match_str("m") {
let mut read_params = || {
let start = req.match_hex::<u32>()?;
if !req.match_str(",") {
return None;
};
let size = req.match_hex::<u32>()?;
Some((start, size))
};
let Some((start, size)) = read_params() else {
let res = self.response();
self.send(res).await?;
continue;
};
let mut res = self.response();
for i in 0..size {
res = res.write_hex((start + i) as u8);
}
self.send(res).await?;
} else {
// unrecognized command
let res = self.response();