How to debug the Linux kernel with GDB and QEMU?

I’d try:

(gdb) target remote localhost:1234
(gdb) continue

Using the ‘-s’ option makes qemu listen on port tcp::1234, which you can connect to as localhost:1234 if you are on the same machine. Qemu’s ‘-S’ option makes Qemu stop execution until you give the continue command.

Best thing would probably be to have a look at a decent GDB tutorial to get along with what you are doing. This one looks quite nice.

Leave a Comment