z0rr0 wrote:Yes, that's also a possibility. However, I could not make "si" work.
Honestly, I have never ever issues with that. It always "just works" (TM) for me. Did you set the correct architecture and image file in gdb? For long mode, something like
Code: Select all
set architecture i386:x86-64
target remote localhost:1234
symbol-file (your elf kernel here)
? Gdb is very strict on having the correct symbols, you can't just disassemble or execute if the memory pointed by RIP is not inside a function.
z0rr0 wrote:Thanks, I will check it. The other option is to try to figure out why the gdbstub in QEMU does not work in this case and fix it.
That won't help you when you'll finally move to test on real machine. But lucky for you (and others who'll come after you), I've quickly put together a
mini debugger. Works for ARM (AArch64) and PC (x86_64), and uses the serial port to connect to a
VT terminal (or some kind of emulator like PuTTY and minicom running on another PC).
Cheers,
bzt