From 3e1a1f74855b464ec6bf1981ba1db5bbc389f36a Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Wed, 17 May 2023 22:46:19 -0700 Subject: [PATCH] Add a qemu debug option and gdb init file. --- .gdbinit | 3 +++ CMakeLists.txt | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .gdbinit diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 0000000..568ed61 --- /dev/null +++ b/.gdbinit @@ -0,0 +1,3 @@ +target remote localhost:1234 +file builddbg/zion/zion +break zion diff --git a/CMakeLists.txt b/CMakeLists.txt index 19ba2aa..36d3e3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,11 @@ add_custom_command( ) add_custom_target(qemu - COMMAND qemu-system-x86_64 -d guest_errors -m 1G -serial stdio -hda disk.img --boot c + COMMAND qemu-system-x86_64 -d guest_errors -m 1G -serial stdio -hda disk.img + DEPENDS disk.img + USES_TERMINAL) + +add_custom_target(qemu-dbg + COMMAND qemu-system-x86_64 -d guest_errors -m 1G -serial stdio -hda disk.img -S -s DEPENDS disk.img USES_TERMINAL)