1 //! Provide a memory map for the target.
2 use crate::target::Target;
3 use crate::target::TargetResult;
4 
5 /// Target Extension - Read the target's memory map.
6 pub trait MemoryMap: Target {
7     /// Get memory map XML file from the target.
8     ///
9     /// See the [GDB Documentation] for a description of the format.
10     ///
11     /// [GDB Documentation]: https://sourceware.org/gdb/onlinedocs/gdb/Memory-Map-Format.html
12     ///
13     /// Return the number of bytes written into `buf` (which may be less than
14     /// `length`).
15     ///
16     /// If `offset` is greater than the length of the underlying data, return
17     /// `Ok(0)`.
memory_map_xml( &self, offset: u64, length: usize, buf: &mut [u8], ) -> TargetResult<usize, Self>18     fn memory_map_xml(
19         &self,
20         offset: u64,
21         length: usize,
22         buf: &mut [u8],
23     ) -> TargetResult<usize, Self>;
24 }
25 
26 define_ext!(MemoryMapOps, MemoryMap);
27