Fix SimpleMemory memory_map_xml

Former-commit-id: 391758925af1c1082536e14e382ca37338e95f55
Former-commit-id: 51ba0286fc9f5c4b413ab5e50fd928b0bb0c4d4b
This commit is contained in:
Michel Heily 2022-09-08 23:48:00 +03:00
parent f3fac5e3b8
commit 85766bc499

View file

@ -69,13 +69,13 @@ impl DebugRead for SimpleMemory {
impl MemoryGdbInterface for SimpleMemory { impl MemoryGdbInterface for SimpleMemory {
fn memory_map_xml(&self, offset: u64, length: usize, buf: &mut [u8]) -> usize { fn memory_map_xml(&self, offset: u64, length: usize, buf: &mut [u8]) -> usize {
let memory_map = r#"<?xml version="1.0"?> let memory_map = format!(r#"<?xml version="1.0"?>
<!DOCTYPE memory-map <!DOCTYPE memory-map
PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN" PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"
"http://sourceware.org/gdb/gdb-memory-map.dtd"> "http://sourceware.org/gdb/gdb-memory-map.dtd">
<memory-map> <memory-map>
<memory type="ram" start="0x0" length="16384"/> <memory type="ram" start="0x0" length="{}"/>
</memory-map>"# </memory-map>"#, self.data.len())
.trim() .trim()
.as_bytes(); .as_bytes();
copy_range_to_buf(memory_map, offset, length, buf) copy_range_to_buf(memory_map, offset, length, buf)