Skip to main content

breakpoint_handler

Function breakpoint_handler 

Source
pub fn breakpoint_handler(tf: &mut KernelTrapFrame<'_>) -> bool
Expand description

Breakpoint handler.

The handler is invoked with a typed view of the trapped kernel registers and must return a boolean indicating whether it has fully handled the trap:

  • true means the breakpoint has been handled and control should resume according to the state encoded in the trap frame.
  • false means the breakpoint was not handled and default processing (such as falling back to another mechanism or terminating) should occur.

When returning true, the handler is responsible for updating the saved program counter (or equivalent PC field) in the trap frame as required by the target architecture. In particular, the handler must ensure that, upon resuming from the trap, execution does not immediately re-trigger the same breakpoint instruction or condition, which could otherwise lead to an infinite trap loop. Register changes must go through KernelTrapFrame::apply_registers, which preserves CPU-owned and privilege-origin state.