[Note: this is an older post, published now (Nov ’14).]
We assume you’ve already setup a QEMU guest, which can be traced from the host using KGDB.
In our case, we’re running FreeOpenZoo’s OpenSUSE11 image as the QEMU guest machine; the kernel has been custom-built to support KGDB. Further, the guest machine has been configured to have a “rtl8139” network card emulated. This is actually the RealTek 8139c.
qemu -m 512 -cdrom /dev/cdrom -net nic,model=”rtl8139″ -localtime -kernel-kqemu -serial “stdio” -serial “pty” opensuse11-gnome.qcow.img
The host is Ubuntu 9.04.
Run the QEMU guest machine:
Usage: suse11_qemu [mode]
mode: 0 => ‘normal’ boot, kgdb off
1 => ‘debug mode’ boot, kgdb on
# ./suse11_qemu 1kqemu 130052 0Dbg (KGDB) Mode.Once QEMU is running, run ‘gdb vmlinux’ (in another terminal) and connect to the target!