mirror of
https://github.com/cowmonk/cowos.git
synced 2025-10-27 14:33:27 +00:00
QEMU debugging via LLDB or optionally GDB
This commit is contained in:
parent
4a304f7b63
commit
93abdf8dac
10 changed files with 77 additions and 7 deletions
21
scripts/run-gdb
Executable file
21
scripts/run-gdb
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue