@@ -34,7 +34,7 @@ use super::mshv::MshvVm;
3434use  super :: regs:: { 
3535    CommonFpu ,  CommonRegisters ,  FP_CONTROL_WORD_DEFAULT ,  FP_TAG_WORD_DEFAULT ,  MXCSR_DEFAULT , 
3636} ; 
37- use  super :: vm:: { HyperlightExit ,  Vm } ; 
37+ use  super :: vm:: { DebugExit ,   HyperlightExit ,  Vm } ; 
3838use  super :: { 
3939    HyperlightVm ,  CR0_AM ,  CR0_ET ,  CR0_MP ,  CR0_NE ,  CR0_PE ,  CR0_PG ,  CR0_WP ,  CR4_OSFXSR , 
4040    CR4_OSXMMEXCPT ,  CR4_PAE ,  EFER_LMA ,  EFER_LME ,  EFER_NX ,  EFER_SCE , 
@@ -502,11 +502,29 @@ impl HyperlightVm for HyperlightSandbox {
502502        loop  { 
503503            match  self . vm . run_vcpu ( )  { 
504504                #[ cfg( gdb) ]  
505-                 Ok ( HyperlightExit :: Debug  {  dr6,  exception } )  => { 
506-                     let  stop_reason =
507-                         arch:: vcpu_stop_reason ( self . vm . as_mut ( ) ,  self . entrypoint ,  dr6,  exception) ?; 
508-                     if  let  Err ( e)  = self . handle_debug ( dbg_mem_access_fn. clone ( ) ,  stop_reason)  { 
509-                         log_then_return ! ( e) ; 
505+                 Ok ( HyperlightExit :: Debug ( debug_exit) )  => { 
506+                     match  debug_exit { 
507+                         DebugExit :: Debug  {  dr6,  exception }  => { 
508+                             // Handle debug event (breakpoints) 
509+                             let  stop_reason = arch:: vcpu_stop_reason ( 
510+                                 self . vm . as_mut ( ) , 
511+                                 self . entrypoint , 
512+                                 dr6, 
513+                                 exception, 
514+                             ) ?; 
515+                             if  let  Err ( e)  =
516+                                 self . handle_debug ( dbg_mem_access_fn. clone ( ) ,  stop_reason) 
517+                             { 
518+                                 log_then_return ! ( e) ; 
519+                             } 
520+                         } 
521+                         DebugExit :: Interrupt  => { 
522+                             if  let  Err ( e)  = self 
523+                                 . handle_debug ( dbg_mem_access_fn. clone ( ) ,  VcpuStopReason :: Interrupt ) 
524+                             { 
525+                                 log_then_return ! ( e) ; 
526+                             } 
527+                         } 
510528                    } 
511529                } 
512530
@@ -580,7 +598,6 @@ impl HyperlightVm for HyperlightSandbox {
580598                        } 
581599                    } 
582600                } 
583- 
584601                Ok ( HyperlightExit :: Cancelled ( ) )  => { 
585602                    // Shutdown is returned when the host has cancelled execution 
586603                    // After termination, the main thread will re-initialize the VM 
0 commit comments