@@ -26,7 +26,7 @@ use tracing::{instrument, Span};
26
26
27
27
use super :: fpu:: { FP_CONTROL_WORD_DEFAULT , FP_TAG_WORD_DEFAULT , MXCSR_DEFAULT } ;
28
28
#[ cfg( gdb) ]
29
- use super :: gdb:: { create_gdb_thread , DebugCommChannel , DebugMsg , DebugResponse , VcpuStopReason } ;
29
+ use super :: gdb:: { DebugCommChannel , DebugMsg , DebugResponse , VcpuStopReason } ;
30
30
#[ cfg( gdb) ]
31
31
use super :: handlers:: DbgMemAccessHandlerWrapper ;
32
32
use super :: handlers:: { MemAccessHandlerWrapper , OutBHandlerWrapper } ;
@@ -38,8 +38,6 @@ use crate::hypervisor::hypervisor_handler::HypervisorHandler;
38
38
use crate :: mem:: memory_region:: { MemoryRegion , MemoryRegionFlags } ;
39
39
use crate :: mem:: ptr:: { GuestPtr , RawPtr } ;
40
40
#[ cfg( gdb) ]
41
- use crate :: sandbox:: config:: DebugInfo ;
42
- #[ cfg( gdb) ]
43
41
use crate :: HyperlightError ;
44
42
use crate :: { log_then_return, new_error, Result } ;
45
43
@@ -604,7 +602,7 @@ impl KVMDriver {
604
602
pml4_addr : u64 ,
605
603
entrypoint : u64 ,
606
604
rsp : u64 ,
607
- #[ cfg( gdb) ] debug_info : & Option < DebugInfo > ,
605
+ #[ cfg( gdb) ] gdb_conn : Option < DebugCommChannel < DebugResponse , DebugMsg > > ,
608
606
) -> Result < Self > {
609
607
let kvm = Kvm :: new ( ) ?;
610
608
@@ -632,23 +630,10 @@ impl KVMDriver {
632
630
Self :: setup_initial_sregs ( & mut vcpu_fd, pml4_addr) ?;
633
631
634
632
#[ cfg( gdb) ]
635
- let ( debug, gdb_conn) = {
636
- if let Some ( DebugInfo { port } ) = debug_info {
637
- let gdb_conn = create_gdb_thread ( * port, unsafe { pthread_self ( ) } ) ;
638
-
639
- // in case the gdb thread creation fails, we still want to continue
640
- // without gdb
641
- match gdb_conn {
642
- Ok ( gdb_conn) => ( Some ( debug:: KvmDebug :: new ( ) ) , Some ( gdb_conn) ) ,
643
- Err ( e) => {
644
- log:: error!( "Could not create gdb connection: {:#}" , e) ;
645
-
646
- ( None , None )
647
- }
648
- }
649
- } else {
650
- ( None , None )
651
- }
633
+ let ( debug, gdb_conn) = if let Some ( gdb_conn) = gdb_conn {
634
+ ( Some ( debug:: KvmDebug :: new ( ) ) , Some ( gdb_conn) )
635
+ } else {
636
+ ( None , None )
652
637
} ;
653
638
654
639
let rsp_gp = GuestPtr :: try_from ( RawPtr :: from ( rsp) ) ?;
0 commit comments