Add simple breakpoint exception handler that logs
@@ -24,10 +24,15 @@ lazy_static! {
static ref IDT: InterruptDescriptorTable = {
let mut idt = InterruptDescriptorTable::new();
idt.double_fault.set_handler_fn(double_fault_handler);
+ idt.breakpoint.set_handler_fn(breakpoint_handler);
idt
};
}
+extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) {
+ log::error!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
+}
+
extern "x86-interrupt" fn double_fault_handler(
stack_frame: InterruptStackFrame,
_error_code: u64,
