Fix wrapping memory reads for 64-bit addresses

This commit is contained in:
2025-01-05 13:54:53 -05:00
parent 84f2cf7ece
commit 2cf99dbc21
3 changed files with 12 additions and 10 deletions
+4 -3
View File
@@ -280,17 +280,18 @@ impl GdbConnection {
}
} else if let Some(op) = req.match_some_str(["m", "x"]) {
let mut read_memory = || {
let start = req.match_hex::<u32>()?;
let start = req.match_hex::<u64>()? as u32;
if !req.match_str(",") {
return None;
};
let size = req.match_hex::<u32>()?;
let length = req.match_hex::<usize>()?;
let mut buf = self.memory_buf.take().unwrap_or_default();
buf.clear();
let (tx, rx) = ::oneshot::channel();
self.client.send_command(EmulatorCommand::ReadMemory(
self.sim_id,
start..(start + size),
start,
length,
buf,
tx,
));