pub trait SingleThreadBase: Target {
    // Required methods
    fn read_registers(
        &mut self,
        regs: &mut <Self::Arch as Arch>::Registers
    ) -> TargetResult<(), Self>;
    fn write_registers(
        &mut self,
        regs: &<Self::Arch as Arch>::Registers
    ) -> TargetResult<(), Self>;
    fn read_addrs(
        &mut self,
        start_addr: <Self::Arch as Arch>::Usize,
        data: &mut [u8]
    ) -> TargetResult<usize, Self>;
    fn write_addrs(
        &mut self,
        start_addr: <Self::Arch as Arch>::Usize,
        data: &[u8]
    ) -> TargetResult<(), Self>;

    // Provided methods
    fn support_single_register_access(
        &mut self
    ) -> Option<SingleRegisterAccessOps<'_, (), Self>> { ... }
    fn support_resume(&mut self) -> Option<SingleThreadResumeOps<'_, Self>> { ... }
}
Expand description

Base required debugging operations for single threaded targets.

Required Methods§

source

fn read_registers( &mut self, regs: &mut <Self::Arch as Arch>::Registers ) -> TargetResult<(), Self>

Read the target’s registers.

source

fn write_registers( &mut self, regs: &<Self::Arch as Arch>::Registers ) -> TargetResult<(), Self>

Write the target’s registers.

source

fn read_addrs( &mut self, start_addr: <Self::Arch as Arch>::Usize, data: &mut [u8] ) -> TargetResult<usize, Self>

Read bytes from the specified address range and return the number of bytes that were read.

Implementations may return a number n that is less than data.len() to indicate that memory starting at start_addr + n cannot be accessed.

Implemenations may also return an appropriate non-fatal error if the requested address range could not be accessed (e.g: due to MMU protection, unhanded page fault, etc…).

Implementations must guarantee that the returned number is less than or equal data.len().

source

fn write_addrs( &mut self, start_addr: <Self::Arch as Arch>::Usize, data: &[u8] ) -> TargetResult<(), Self>

Write bytes to the specified address range.

If the requested address range could not be accessed (e.g: due to MMU protection, unhanded page fault, etc…), an appropriate non-fatal error should be returned.

Provided Methods§

source

fn support_single_register_access( &mut self ) -> Option<SingleRegisterAccessOps<'_, (), Self>>

Support for single-register access. See SingleRegisterAccess for more details.

While this is an optional feature, it is highly recommended to implement it when possible, as it can significantly improve performance on certain architectures.

source

fn support_resume(&mut self) -> Option<SingleThreadResumeOps<'_, Self>>

Support for resuming the target (e.g: via continue or step)

Implementors§