diff --git a/src/protocol/response_writer.rs b/src/protocol/response_writer.rs index 3dea22a..1ef43ea 100644 --- a/src/protocol/response_writer.rs +++ b/src/protocol/response_writer.rs @@ -212,6 +212,14 @@ impl<'a, C: Connection + 'a> ResponseWriter<'a, C> { Ok(()) } + /// Marks data of 'size' bytes as unavailable. + pub fn write_x(&mut self, size: usize) -> Result<(), Error> { + for _ in 0..(size * 2) { + self.write(b'x')?; + } + Ok(()) + } + /// Write a number as a big-endian hex string using the most compact /// representation possible (i.e: trimming leading zeros). pub fn write_num(&mut self, digit: D) -> Result<(), Error> { diff --git a/src/stub/core_impl/base.rs b/src/stub/core_impl/base.rs index a87483b..c194bbf 100644 --- a/src/stub/core_impl/base.rs +++ b/src/stub/core_impl/base.rs @@ -202,7 +202,7 @@ impl GdbStubImpl { regs.gdb_serialize(|val| { let res = match val { Some(b) => res.write_hex_buf(&[b]), - None => res.write_str("xx"), + None => res.write_x(std::mem::size_of::()), }; if let Err(e) = res { err = Err(e);