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