Trait arch::GdbOps

source ·
pub trait GdbOps<T: VcpuArch> {
    type Error: StdError;

    // Required methods
    fn read_registers(
        vcpu: &T
    ) -> Result<<GdbArch as Arch>::Registers, Self::Error>;
    fn write_registers(
        vcpu: &T,
        regs: &<GdbArch as Arch>::Registers
    ) -> Result<(), Self::Error>;
    fn read_memory(
        vcpu: &T,
        guest_mem: &GuestMemory,
        vaddr: GuestAddress,
        len: usize
    ) -> Result<Vec<u8>, Self::Error>;
    fn write_memory(
        vcpu: &T,
        guest_mem: &GuestMemory,
        vaddr: GuestAddress,
        buf: &[u8]
    ) -> Result<(), Self::Error>;
    fn read_register(
        vcpu: &T,
        reg_id: <GdbArch as Arch>::RegId
    ) -> Result<Vec<u8>, Self::Error>;
    fn write_register(
        vcpu: &T,
        reg_id: <GdbArch as Arch>::RegId,
        data: &[u8]
    ) -> Result<(), Self::Error>;
    fn enable_singlestep(vcpu: &T) -> Result<(), Self::Error>;
    fn get_max_hw_breakpoints(vcpu: &T) -> Result<usize, Self::Error>;
    fn set_hw_breakpoints(
        vcpu: &T,
        breakpoints: &[GuestAddress]
    ) -> Result<(), Self::Error>;
}

Required Associated Types§

Required Methods§

source

fn read_registers(vcpu: &T) -> Result<<GdbArch as Arch>::Registers, Self::Error>

Reads vCPU’s registers.

source

fn write_registers( vcpu: &T, regs: &<GdbArch as Arch>::Registers ) -> Result<(), Self::Error>

Writes vCPU’s registers.

source

fn read_memory( vcpu: &T, guest_mem: &GuestMemory, vaddr: GuestAddress, len: usize ) -> Result<Vec<u8>, Self::Error>

Reads bytes from the guest memory.

source

fn write_memory( vcpu: &T, guest_mem: &GuestMemory, vaddr: GuestAddress, buf: &[u8] ) -> Result<(), Self::Error>

Writes bytes to the specified guest memory.

source

fn read_register( vcpu: &T, reg_id: <GdbArch as Arch>::RegId ) -> Result<Vec<u8>, Self::Error>

Reads bytes from the guest register.

source

fn write_register( vcpu: &T, reg_id: <GdbArch as Arch>::RegId, data: &[u8] ) -> Result<(), Self::Error>

Writes bytes to the specified guest register.

source

fn enable_singlestep(vcpu: &T) -> Result<(), Self::Error>

Make the next vCPU’s run single-step.

source

fn get_max_hw_breakpoints(vcpu: &T) -> Result<usize, Self::Error>

Get maximum number of hardware breakpoints.

source

fn set_hw_breakpoints( vcpu: &T, breakpoints: &[GuestAddress] ) -> Result<(), Self::Error>

Set hardware breakpoints at the given addresses.

Object Safety§

This trait is not object safe.

Implementors§