[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
This commit is contained in:
Justin C. Miller
2020-05-24 19:50:45 -07:00
parent 774f6fc334
commit cc9cde9bfe
3 changed files with 8 additions and 8 deletions

View File

@@ -24,8 +24,5 @@ class PrintStackCommand(gdb.Command):
PrintStackCommand() PrintStackCommand()
import time
time.sleep(3.5)
gdb.execute("target remote :1234") gdb.execute("target remote :1234")
gdb.execute("set waiting = false")
gdb.execute("display/i $rip") gdb.execute("display/i $rip")

10
qemu.sh
View File

@@ -3,6 +3,7 @@
build="$(dirname $0)/build" build="$(dirname $0)/build"
assets="$(dirname $0)/assets" assets="$(dirname $0)/assets"
debug="" debug=""
debugtarget="${build}/jsix.elf"
flash_name="ovmf_vars" flash_name="ovmf_vars"
gfx="-nographic" gfx="-nographic"
kvm="" kvm=""
@@ -10,8 +11,13 @@ cpu="Broadwell,+pdpe1gb"
for arg in $@; do for arg in $@; do
case "${arg}" in case "${arg}" in
--debugboot)
debug="-s -S"
debugtarget="${build}/boot/boot.efi"
flash_name="ovmf_vars_d"
;;
--debug) --debug)
debug="-s" debug="-s -S"
flash_name="ovmf_vars_d" flash_name="ovmf_vars_d"
;; ;;
--gfx) --gfx)
@@ -37,7 +43,7 @@ fi
if [[ -n $TMUX ]]; then if [[ -n $TMUX ]]; then
if [[ -n $debug ]]; then if [[ -n $debug ]]; then
tmux split-window "gdb ${build}/jsix.elf" & tmux split-window -h "gdb ${debugtarget}" &
else else
tmux split-window -l 10 "sleep 1; telnet localhost 45454" & tmux split-window -l 10 "sleep 1; telnet localhost 45454" &
fi fi

View File

@@ -72,9 +72,6 @@ init_console()
void void
kernel_main(args::header *header) kernel_main(args::header *header)
{ {
bool waiting = header && (header->mode == args::mode::debug);
while (waiting);
kutil::assert_set_callback(__kernel_assert); kutil::assert_set_callback(__kernel_assert);
init_console(); init_console();