How to use DDD to debug the kernel of a local Qemu virtual machine?

I want to use GNU DDD (the gdb graphical shell) to debug the Linux kernel, which runs (on some distribution) inside qemu.

I have a vmlinux image outside of Qemu and run Qemu with -s -S , so it acts like gdbserver (stops at startup and waits for debugging commands). Now, how to connect DDD to this gdbserver using local vmlinux image?

Should I just open the image and tell gdb 'target remote'?

+4
source share
2 answers

Basically you answered your question - yes, use the target remote gdb command in ddd to connect:

 $ gdb qemuKernelFile (gdb) target remote localhost:1234 
+2
source

With minor adjustments, you can describe in detail the procedure described in detail here .

Image from this tutorial:

enter image description here

+2
source

All Articles