pub trait GdbOps {
type Error: StdError;
// Required methods
fn read_registers(
vcpu: &dyn VcpuArch,
) -> Result<<GdbArch as Arch>::Registers, Self::Error>;
fn write_registers(
vcpu: &dyn VcpuArch,
regs: &<GdbArch as Arch>::Registers,
) -> Result<(), Self::Error>;
fn read_memory(
vcpu: &dyn VcpuArch,
guest_mem: &GuestMemory,
vaddr: GuestAddress,
len: usize,
) -> Result<Vec<u8>, Self::Error>;
fn write_memory(
vcpu: &dyn VcpuArch,
guest_mem: &GuestMemory,
vaddr: GuestAddress,
buf: &[u8],
) -> Result<(), Self::Error>;
fn read_register(
vcpu: &dyn VcpuArch,
reg_id: <GdbArch as Arch>::RegId,
) -> Result<Vec<u8>, Self::Error>;
fn write_register(
vcpu: &dyn VcpuArch,
reg_id: <GdbArch as Arch>::RegId,
data: &[u8],
) -> Result<(), Self::Error>;
fn enable_singlestep(vcpu: &dyn VcpuArch) -> Result<(), Self::Error>;
fn get_max_hw_breakpoints(vcpu: &dyn VcpuArch) -> Result<usize, Self::Error>;
fn set_hw_breakpoints(
vcpu: &dyn VcpuArch,
breakpoints: &[GuestAddress],
) -> Result<(), Self::Error>;
}Required Associated Types§
Required Methods§
Sourcefn read_registers(
vcpu: &dyn VcpuArch,
) -> Result<<GdbArch as Arch>::Registers, Self::Error>
fn read_registers( vcpu: &dyn VcpuArch, ) -> Result<<GdbArch as Arch>::Registers, Self::Error>
Reads vCPU’s registers.
Sourcefn write_registers(
vcpu: &dyn VcpuArch,
regs: &<GdbArch as Arch>::Registers,
) -> Result<(), Self::Error>
fn write_registers( vcpu: &dyn VcpuArch, regs: &<GdbArch as Arch>::Registers, ) -> Result<(), Self::Error>
Writes vCPU’s registers.
Sourcefn read_memory(
vcpu: &dyn VcpuArch,
guest_mem: &GuestMemory,
vaddr: GuestAddress,
len: usize,
) -> Result<Vec<u8>, Self::Error>
fn read_memory( vcpu: &dyn VcpuArch, guest_mem: &GuestMemory, vaddr: GuestAddress, len: usize, ) -> Result<Vec<u8>, Self::Error>
Reads bytes from the guest memory.
Sourcefn write_memory(
vcpu: &dyn VcpuArch,
guest_mem: &GuestMemory,
vaddr: GuestAddress,
buf: &[u8],
) -> Result<(), Self::Error>
fn write_memory( vcpu: &dyn VcpuArch, guest_mem: &GuestMemory, vaddr: GuestAddress, buf: &[u8], ) -> Result<(), Self::Error>
Writes bytes to the specified guest memory.
Sourcefn read_register(
vcpu: &dyn VcpuArch,
reg_id: <GdbArch as Arch>::RegId,
) -> Result<Vec<u8>, Self::Error>
fn read_register( vcpu: &dyn VcpuArch, reg_id: <GdbArch as Arch>::RegId, ) -> Result<Vec<u8>, Self::Error>
Reads bytes from the guest register.
Returns an empty vector if reg_id is valid but the register is not available.
Sourcefn write_register(
vcpu: &dyn VcpuArch,
reg_id: <GdbArch as Arch>::RegId,
data: &[u8],
) -> Result<(), Self::Error>
fn write_register( vcpu: &dyn VcpuArch, reg_id: <GdbArch as Arch>::RegId, data: &[u8], ) -> Result<(), Self::Error>
Writes bytes to the specified guest register.
Sourcefn enable_singlestep(vcpu: &dyn VcpuArch) -> Result<(), Self::Error>
fn enable_singlestep(vcpu: &dyn VcpuArch) -> Result<(), Self::Error>
Make the next vCPU’s run single-step.
Sourcefn get_max_hw_breakpoints(vcpu: &dyn VcpuArch) -> Result<usize, Self::Error>
fn get_max_hw_breakpoints(vcpu: &dyn VcpuArch) -> Result<usize, Self::Error>
Get maximum number of hardware breakpoints.
Sourcefn set_hw_breakpoints(
vcpu: &dyn VcpuArch,
breakpoints: &[GuestAddress],
) -> Result<(), Self::Error>
fn set_hw_breakpoints( vcpu: &dyn VcpuArch, breakpoints: &[GuestAddress], ) -> Result<(), Self::Error>
Set hardware breakpoints at the given addresses.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.