Hi all,
I've managed to find a workaround for the well-known problem of GDB not
being able to debug hw/x86-64 unikernels under QEMU or KVM (see GDB issue
https://sourceware.org/bugzilla/show_bug.cgi?id=13984):
1. Start the unikernel, leaving it paused and waiting for GDB to connect:
rumprun [kvm|qemu] -p -D 1234 [...]
2. Run the following GDB command:
gdb -q -ex "target remote:1234" -ex "hbreak x86_boot" -ex "continue" -ex
"disconnect" -ex "quit" unikernel.bin
This will cause the unikernel to proceed past the transition from 32-bit
mode to long mode and remain in a paused state.
3. Re-launch GDB a second time as you would normally.
I've updated the "Howto: Debugging Rumprun with GDB" page on the wiki with
these instructions.
The workaround works for both QEMU and KVM. The trick seems to be to a;ways
use a hardware-assisted breakpoint on x86_boot. 'disconnect' ensures
QEMU/KVM remains paused and 'quit' followed by a restart is needed to
de-confuse GDB.
Martin