Add a simple handler function for the breakpoint exception

master
Philipp Oppermann 8 years ago
parent c2d22af1c7
commit 3bbc2a0bdc

@ -1,5 +1,12 @@
use x86_64::structures::idt::Idt;
use x86_64::structures::idt::{Idt, ExceptionStackFrame};
pub fn init() {
let mut idt = Idt::new();
idt.breakpoint.set_handler_fn(breakpoint_handler);
}
extern "x86-interrupt" fn breakpoint_handler(
stack_frame: &mut ExceptionStackFrame)
{
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
}

@ -5,6 +5,7 @@
#![feature(unique)]
#![feature(allocator_api)]
#![feature(global_allocator)]
#![feature(abi_x86_interrupt)]
#![no_std]

Loading…
Cancel
Save