Skip to content

Commit

Permalink
add INT3 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Blindspot22 committed May 18, 2024
1 parent 1ac470f commit 7c57ee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/interrupts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ pub fn init_idt() {

extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame){
println!("EXCEPTION: BREAKPOINT\n{stack_frame:#?}");
}

#[test_case]
fn test_breakpoint_exception() {
x86_64::instructions::interrupts::int3();
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub fn test_panic_handler(info: &PanicInfo) -> ! {
#[cfg(test)]
#[no_mangle]
pub extern "C" fn _start() -> ! {
init();
test_main();
loop {}
}
Expand Down

0 comments on commit 7c57ee0

Please sign in to comment.