From cc9cde9bfefb331dbf64ec5b220056f6fc3a35d7 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sun, 24 May 2020 19:50:45 -0700 Subject: [PATCH] [tooling] Remove old GDB workarounds GDB works far better now with QEMU's `-S` flag. No longer does it complain about changing the target from 32 to 64 bits. Get rid of the old `waiting` loop and `sleep` call in the GDB config for the kernel. Tags: debugging --- assets/debugging/jsix.elf-gdb.py | 3 --- qemu.sh | 10 ++++++++-- src/kernel/main.cpp | 3 --- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/debugging/jsix.elf-gdb.py b/assets/debugging/jsix.elf-gdb.py index a916e45..d54a537 100644 --- a/assets/debugging/jsix.elf-gdb.py +++ b/assets/debugging/jsix.elf-gdb.py @@ -24,8 +24,5 @@ class PrintStackCommand(gdb.Command): PrintStackCommand() -import time -time.sleep(3.5) gdb.execute("target remote :1234") -gdb.execute("set waiting = false") gdb.execute("display/i $rip") diff --git a/qemu.sh b/qemu.sh index 159e1f8..efed10b 100755 --- a/qemu.sh +++ b/qemu.sh @@ -3,6 +3,7 @@ build="$(dirname $0)/build" assets="$(dirname $0)/assets" debug="" +debugtarget="${build}/jsix.elf" flash_name="ovmf_vars" gfx="-nographic" kvm="" @@ -10,8 +11,13 @@ cpu="Broadwell,+pdpe1gb" for arg in $@; do case "${arg}" in + --debugboot) + debug="-s -S" + debugtarget="${build}/boot/boot.efi" + flash_name="ovmf_vars_d" + ;; --debug) - debug="-s" + debug="-s -S" flash_name="ovmf_vars_d" ;; --gfx) @@ -37,7 +43,7 @@ fi if [[ -n $TMUX ]]; then if [[ -n $debug ]]; then - tmux split-window "gdb ${build}/jsix.elf" & + tmux split-window -h "gdb ${debugtarget}" & else tmux split-window -l 10 "sleep 1; telnet localhost 45454" & fi diff --git a/src/kernel/main.cpp b/src/kernel/main.cpp index 8d107be..aca26fc 100644 --- a/src/kernel/main.cpp +++ b/src/kernel/main.cpp @@ -72,9 +72,6 @@ init_console() void kernel_main(args::header *header) { - bool waiting = header && (header->mode == args::mode::debug); - while (waiting); - kutil::assert_set_callback(__kernel_assert); init_console();