QEMU debugging via LLDB or optionally GDB

This commit is contained in:
cowmonk 2025-07-21 14:10:43 -07:00
parent 4a304f7b63
commit 93abdf8dac
10 changed files with 77 additions and 7 deletions

21
scripts/run-gdb Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
echo "Starting QEMU with GDB server (localhost:1234)..."
qemu-system-x86_64 -cdrom cowos.iso -m 512M -serial stdio -s -S &
QEMU_PID=$!
sleep 1 # just in case so we let it cook
if ! ps -p $QEMU_PID > /dev/null; then
echo "Error: QEMU failed to start."
exit 1
fi
echo "Launching GDB in TUI mode..."
gdb --tui \
-ex "file ./kernel/bin/cowos" \
-ex "target remote localhost:1234" \
# kill QEMU when GDB exits
echo "GDB exited. Terminating QEMU..."
kill $QEMU_PID 2>/dev/null