Skip to main content

debug_handler

Function debug_handler 

Source
pub fn debug_handler(_tf: &mut TrapFrame) -> bool
Expand description

Debug handler.

On x86_64, the handler is invoked for debug-related traps (for example, hardware breakpoints, single-step traps, or other debug exceptions). The handler receives a mutable reference to the trapped TrapFrame and returns a boolean with the following meaning:

  • true means the debug trap has been fully handled and execution should resume from the state stored in the trap frame.
  • false means the debug trap was not handled and default/secondary processing should take place.

As with breakpoint_handler(), when returning true, the handler must adjust the saved program counter (or equivalent) in the trap frame if required by the architecture so that resuming execution does not immediately cause the same debug condition to fire again. Callers must take the architecture- specific PC semantics into account when deciding how to advance or modify the PC.