Skip to main content

Breakpoints

Struct Breakpoints 

Source
pub struct Breakpoints { /* private fields */ }
Expand description

The shared table of entry-point breakpoints.

Implementations§

Source§

impl Breakpoints

Source

pub fn new() -> Self

An empty table.

Source

pub fn len(&self) -> usize

Number of breakpoints currently planted.

Source

pub fn is_empty(&self) -> bool

No breakpoints planted.

Source

pub fn sync( &mut self, s: &CpuState, mem: &dyn GuestMemory, msrs: &EntryMsrs, ) -> usize

Scans the IDT this vCPU uses, plus the system-call MSRs, and plants a breakpoint on every entry point that does not have one yet.

Breakpoints are only ever added here; Breakpoints::clear removes them all when tracing stops.

Source

pub fn original(&self, phys: u64) -> Option<u8>

The byte the guest wrote at phys, if a breakpoint covers it.

Source

pub fn is_ours(&self, phys: u64) -> bool

Is there one of our breakpoints at phys?

Source

pub fn lift(&mut self, phys: u64, vcpu: u32, mem: &dyn GuestMemory) -> bool

Temporarily restores the original byte so vcpu can execute it.

Source

pub fn reinsert(&mut self, phys: u64, mem: &dyn GuestMemory)

Puts a lifted breakpoint back.

Source

pub fn on_guest_write(&mut self, phys: u64, size: u32, mem: &dyn GuestMemory)

Called for every guest write the tracer observes. If the write lands on a breakpoint, the new byte becomes the “original” and the breakpoint is re-planted; if it lands on an IDT, the table is marked stale.

Source

pub fn vectors_at(&self, la: u64) -> &[u8] ⓘ

Vectors whose handler starts at linear address la.

Source

pub fn is_syscall_entry(&self, la: u64) -> bool

Is la a SYSCALL/SYSENTER entry point?

Source

pub fn clear(&mut self, mem: &dyn GuestMemory)

Removes every breakpoint, restoring the guest’s bytes.

Trait Implementations§

Source§

impl Debug for Breakpoints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Breakpoints

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.