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§
sourcefn read_registers(vcpu: &T) -> Result<<GdbArch as Arch>::Registers, Self::Error>
fn read_registers(vcpu: &T) -> Result<<GdbArch as Arch>::Registers, Self::Error>
Reads vCPU’s registers.
sourcefn write_registers(
vcpu: &T,
regs: &<GdbArch as Arch>::Registers
) -> Result<(), Self::Error>
fn write_registers( vcpu: &T, regs: &<GdbArch as Arch>::Registers ) -> Result<(), Self::Error>
Writes vCPU’s registers.
sourcefn read_memory(
vcpu: &T,
guest_mem: &GuestMemory,
vaddr: GuestAddress,
len: usize
) -> Result<Vec<u8>, Self::Error>
fn read_memory( vcpu: &T, guest_mem: &GuestMemory, vaddr: GuestAddress, len: usize ) -> Result<Vec<u8>, Self::Error>
Reads bytes from the guest memory.
sourcefn write_memory(
vcpu: &T,
guest_mem: &GuestMemory,
vaddr: GuestAddress,
buf: &[u8]
) -> Result<(), Self::Error>
fn write_memory( vcpu: &T, guest_mem: &GuestMemory, vaddr: GuestAddress, buf: &[u8] ) -> Result<(), Self::Error>
Writes bytes to the specified guest memory.
sourcefn read_register(
vcpu: &T,
reg_id: <GdbArch as Arch>::RegId
) -> Result<Vec<u8>, Self::Error>
fn read_register( vcpu: &T, reg_id: <GdbArch as Arch>::RegId ) -> Result<Vec<u8>, Self::Error>
Reads bytes from the guest register.
sourcefn write_register(
vcpu: &T,
reg_id: <GdbArch as Arch>::RegId,
data: &[u8]
) -> Result<(), Self::Error>
fn write_register( vcpu: &T, reg_id: <GdbArch as Arch>::RegId, data: &[u8] ) -> Result<(), Self::Error>
Writes bytes to the specified guest register.
sourcefn enable_singlestep(vcpu: &T) -> Result<(), Self::Error>
fn enable_singlestep(vcpu: &T) -> Result<(), Self::Error>
Make the next vCPU’s run single-step.
sourcefn get_max_hw_breakpoints(vcpu: &T) -> Result<usize, Self::Error>
fn get_max_hw_breakpoints(vcpu: &T) -> Result<usize, Self::Error>
Get maximum number of hardware breakpoints.
sourcefn set_hw_breakpoints(
vcpu: &T,
breakpoints: &[GuestAddress]
) -> Result<(), Self::Error>
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.