From 6756d25e5cab54e94962f119fe193fd4ca70567a Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Thu, 16 Nov 2023 22:11:35 -0800 Subject: [PATCH] [Build] Add a way to start qemu in debug mode with new script. --- scripts/qemu.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/qemu.sh b/scripts/qemu.sh index 2ddf286..b2ea1cc 100755 --- a/scripts/qemu.sh +++ b/scripts/qemu.sh @@ -14,8 +14,13 @@ ninja install sudo sh ${DIR}/build_image.sh disk.img +QEMU_ARGS= +if [[ $1 == "debug" ]]; then + QEMU_ARGS+="-S -s" +fi + # Use machine q35 to access PCI devices. -qemu-system-x86_64 -machine q35 -d guest_errors -m 1G -serial stdio -hda disk.img +qemu-system-x86_64 -machine q35 -d guest_errors -m 1G -serial stdio -hda disk.img ${QEMU_ARGS} popd # Extra options to add to this script in the future.