use gdbstub::arch::Arch;
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
use gdbstub_arch::aarch64::AArch64 as GdbArch;
#[cfg(target_arch = "riscv64")]
use gdbstub_arch::riscv::Riscv64 as GdbArch;
#[cfg(target_arch = "x86_64")]
use gdbstub_arch::x86::X86_64_SSE as GdbArch;
use vm_memory::GuestAddress;
#[derive(Clone, Debug)]
pub enum VcpuDebug {
ReadMem(GuestAddress, usize),
ReadRegs,
ReadReg(<GdbArch as Arch>::RegId),
WriteRegs(Box<<GdbArch as Arch>::Registers>),
WriteReg(<GdbArch as Arch>::RegId, Vec<u8>),
WriteMem(GuestAddress, Vec<u8>),
EnableSinglestep,
GetHwBreakPointCount,
SetHwBreakPoint(Vec<GuestAddress>),
}
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
pub enum VcpuDebugStatus {
RegValues(<GdbArch as Arch>::Registers),
RegValue(Vec<u8>),
MemoryRegion(Vec<u8>),
CommandComplete,
HwBreakPointCount(usize),
HitBreakPoint,
}
#[derive(Debug)]
pub struct VcpuDebugStatusMessage {
pub cpu: usize,
pub msg: VcpuDebugStatus,
}