Skip to main content

match_event

Function match_event 

Source
pub fn match_event(
    pre: &CpuState,
    post: &CpuState,
    mem: &dyn GuestMemory,
    bps: &Breakpoints,
    candidates: &[u64],
) -> Option<EventMatch>
Expand description

Checks whether post is the first instruction of a handler entered by an event while the vCPU was at pre, and if so which one.

The test is strict: post must be at a handler for some vector v, the frame on the new stack must hold the old CS selector, and the saved RIP must be one of candidates (the pre-step RIP, or a legal successor of the instruction). A plain jmp into handler code fails the frame test, so it is not mistaken for an interrupt.