File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -755,6 +755,7 @@ def launch_qemu(cfg):
755755
756756 if gdb :
757757 utils .check_cmd (gdb_bin )
758+ qemu_cmd += ["-s" , "-S" ]
758759
759760 while True :
760761 utils .check_cmd ("lsof" )
@@ -766,12 +767,18 @@ def launch_qemu(cfg):
766767 utils .die ("Port 1234 is already in use, is QEMU running?" )
767768
768769 utils .green ("Starting QEMU with GDB connection on port 1234..." )
769- with subprocess .Popen (qemu_cmd + ["-s" , "-S" ]) as qemu_process :
770+ with subprocess .Popen (qemu_cmd ,
771+ preexec_fn = os .setpgrp ) as qemu_process :
770772 utils .green ("Starting GDB..." )
771773 gdb_cmd = [gdb_bin ]
772774 gdb_cmd += [kernel_location .joinpath ("vmlinux" )]
773775 gdb_cmd += ["-ex" , "target remote :1234" ]
774- subprocess .run (gdb_cmd , check = False )
776+
777+ with subprocess .Popen (gdb_cmd ) as gdb_process :
778+ try :
779+ gdb_process .wait ()
780+ except KeyboardInterrupt :
781+ pass
775782
776783 utils .red ("Killing QEMU..." )
777784 qemu_process .kill ()
You can’t perform that action at this time.
0 commit comments