unsafe fn bkp_handler(a: &ExceptionArguments) {
    let desc = &EXCEPTIONS[a.vector as usize];
    warn!("Got breakpoint interrupt {}", desc.source);

    let kcb = get_kcb();
    if kcb.arch.has_executor() {
        // breakpoints lead to upcalls here since we use int!(3) in user-space
        // to test upcall. In the future we probably wan't to use gdb here and
        // do something better to test upcalls than this...
        let mut plock = kcb.arch.current_executor();
        let p = plock.as_mut().unwrap();

        let resumer = {
            let was_disabled = {
                trace!("vcpu state is: pc_disabled {:?}", p.vcpu().pc_disabled);
                let was_disabled = p.vcpu().upcalls_disabled(VAddr::from(a.rip));
                p.vcpu().disable_upcalls();
                was_disabled
            };

            if was_disabled {
                // Resume to the current save area...
                warn!("Upcalling while disabled");
                kcb_resume_handle(kcb)
            } else {
                // Copy CURRENT_SAVE_AREA to process enabled save area
                // then resume in the upcall handler
                kcb.arch.save_area.as_ref().map(|sa| {
                    p.vcpu().enabled_state = **sa;
                });

                p.upcall(a.vector, a.exception)
            }
        };

        trace!("resuming now...");
        drop(plock);
        resumer.resume()
    } else {
        gdb::event_loop(gdb::KCoreStopReason::BreakpointInterrupt);
        let r = Ring0Resumer::new_iret(kcb.arch.get_save_area_ptr());
        r.resume()
    }
}
/// Handler for a breakpoint exception.
///
/// The default behavior right now is just to print a warning and resume
/// execution in user-space.
Handler for a breakpoint exception.
The default behavior right now is just to print a warning and resume
execution in user-space.
Handler for a breakpoint exception . The default behavior right now is just to print a warning and resume execution in user - space .
unsafe fn bkp_handler(a: &ExceptionArguments) {
    let desc = &EXCEPTIONS[a.vector as usize];
    warn!("Got breakpoint interrupt {}", desc.source);
    let kcb = get_kcb();
    if kcb.arch.has_executor() {
        // breakpoints lead to upcalls here since we use int!(3) in user-space
        // to test upcall. In the future we probably wan't to use gdb here and
        // do something better to test upcalls than this...
        let mut plock = kcb.arch.current_executor();
        let p = plock.as_mut().unwrap();
        let resumer = {
            let was_disabled = {
                trace!("vcpu state is: pc_disabled {:?}", p.vcpu().pc_disabled);
                let was_disabled = p.vcpu().upcalls_disabled(VAddr::from(a.rip));
                p.vcpu().disable_upcalls();
                was_disabled
            };
            if was_disabled {
                // Resume to the current save area...
                warn!("Upcalling while disabled");
                kcb_resume_handle(kcb)
            } else {
                // Copy CURRENT_SAVE_AREA to process enabled save area
                // then resume in the upcall handler
                kcb.arch.save_area.as_ref().map(|sa| {
                    p.vcpu().enabled_state = **sa;
                });
                p.upcall(a.vector, a.exception)
            }
        };
        trace!("resuming now...");
        drop(plock);
        resumer.resume()
    } else {
        gdb::event_loop(gdb::KCoreStopReason::BreakpointInterrupt);
        let r = Ring0Resumer::new_iret(kcb.arch.get_save_area_ptr());
        r.resume()
    }
}
unsafe fn bkp_handler ( a : & ExceptionArguments ) { let desc = & EXCEPTIONS [ a . vector as usize ] ; warn ! ( " " desc source ) ; let kcb = get_kcb ( ) ; if kcb . arch . has_executor ( ) { // breakpoints lead to upcalls here since we use int!(3) in user-space // to test upcall. In the future we probably wan't to use gdb here and // do something better to test upcalls than this... let mut plock = kcb . arch . current_executor ( ) ; let p = plock . as_mut ( ) . unwrap ( ) ; let resumer = { let was_disabled = { trace ! ( " " p vcpu ( ) pc_disabled ) ; let was_disabled = p . vcpu ( ) . upcalls_disabled ( VAddr :: from ( a . rip ) ) ; p . vcpu ( ) . disable_upcalls ( ) ; was_disabled } ; if was_disabled { // Resume to the current save area... warn ! ( " " ) ; kcb_resume_handle ( kcb ) } else { // Copy CURRENT_SAVE_AREA to process enabled save area // then resume in the upcall handler kcb . arch . save_area . as_ref ( ) . map ( | sa | { p . vcpu ( ) . enabled_state = * * sa ; } ) ; p . upcall ( a . vector , a . exception ) } } ; trace ! ( " " ) ; drop ( plock ) ; resumer . resume ( ) } else { gdb :: event_loop ( gdb :: KCoreStopReason :: BreakpointInterrupt ) ; let r = Ring0Resumer :: new_iret ( kcb . arch . get_save_area_ptr ( ) ) ; r . resume ( ) } }
Handler for a breakpoint exception.
Handler for a breakpoint exception .
a
&ExceptionArguments
a
&ExceptionArguments