Skip to content

Commit 772eb24

Browse files
committed
boot-qemu.py: Check gdb_bin earlier
Otherwise, the call to sys.exit() in die() does not work and we end up hanging. Additionally, move it out of the while loop, as it does not make send to check for gdb_bin every single time we want to invoke it. Reported-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 6b17f8f commit 772eb24

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

boot-qemu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ def launch_qemu(cfg):
754754
pretty_print_qemu_info(qemu_cmd[0])
755755

756756
if gdb:
757+
utils.check_cmd(gdb_bin)
758+
757759
while True:
758760
utils.check_cmd("lsof")
759761
lsof = subprocess.run(["lsof", "-i:1234"],
@@ -766,7 +768,6 @@ def launch_qemu(cfg):
766768
utils.green("Starting QEMU with GDB connection on port 1234...")
767769
with subprocess.Popen(qemu_cmd + ["-s", "-S"]) as qemu_process:
768770
utils.green("Starting GDB...")
769-
utils.check_cmd(gdb_bin)
770771
gdb_cmd = [gdb_bin]
771772
gdb_cmd += [kernel_location.joinpath("vmlinux")]
772773
gdb_cmd += ["-ex", "target remote :1234"]

0 commit comments

Comments
 (0)