How to debug a kernel thread?

Mulyadi Santosa mulyadi.santosa at gmail.com
Tue Apr 3 12:00:09 EDT 2012


Hi :)

On Tue, Apr 3, 2012 at 17:37, Parmenides <mobile.parmenides at gmail.com> wrote:
> source tree. I compiled the kernel with kgdb and run it in qemu with
> virtual serial port:
>
>     qemu -kernel bzImage -initrd image.cpio.gz -append
> "kgdboc=ttyS0,115200 kgdbwait" -serial tcp::1234,server
>
> In another console, the gdb was given command:
>
>     (gdb) target remote local:1234
>     (gdb) continue
>
> Then I pressed Ctrl+C to suspend the target, but got no reply. The gdb
> got stuck and lost control to the target. As such, there is no

IIRC, years ago I did the same thing like yours, using kgdb and qemu.
What I forgot is how I hook into the remote kgdb stub.

Here's my suggestion: try other option outside tcp, perhaps UNIX
socket...or anything that's supported by gdb. And see if it makes any
difference.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list