tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

using gdb's 'kvm proc' to debug LWPs



Hi all,

I'd like some help examining LWP backtraces on a running NetBSD system in a qemu-kvm virtual machine.

I've successfully done the following to examine LWP backtraces in crash dumps:

   $ gdb /path/to/netbsd.gdb
   (gdb) target kvm /path/to/netbsd.0.core
   (gdb) dir /path/to/kernel/source/code
   (gdb) kvm proc 0xdeadbeef
   (gdb) bt full

I'm now trying to do something similar on a *running* NetBSD kernel in a qemu-kvm virtual machine (Linux host). qemu has remote gdb stubs, which makes it great for stepping the kernel without having to deal with serial ports or rebuilding the kernel with KGDB enabled.

I'm able to successfully connect and do normal gdb things:

   $ kvm <args> -S -s
   $ gdb /path/to/netbsd.gdb
   (gdb) target remote localhost:1234
   (gdb) dir /path/to/kernel/source/code
   (gdb) bt full

So I can see the current LWP backtrace easily. Unfortunately, the following fails:

   (gdb) kvm proc 0xdeadbeef
   No kernel memory image.

Does anyone know how I can examine the backtraces of other LWPs from a live kernel? Does 'kvm proc' work with a KGDB setup?

Thanks,
Richard


Home | Main Index | Thread Index | Old Index