Re: bhyve remote kgdb does not support kernel modules...
On Saturday, November 15, 2014 1:15:23 pm John-Mark Gurney wrote: > Julian Elischer wrote this message on Sun, Nov 16, 2014 at 00:23 +0800: > > On 11/15/14, 5:43 PM, John-Mark Gurney wrote: > > >John-Mark Gurney wrote this message on Sat, Nov 15, 2014 at 01:37 -0800: > > >>So, I got remote kgdb working w/ bhyve, but kernel modules aren't > > >>loaded... > > >> > > >>I'm getting: > > >>(kgdb) bt > > >>#0 kdb_enter (why=0x8102ee88 "panic", msg=) > > >> at ../../../kern/subr_kdb.c:444 > > >>#1 0x8094aa79 in vpanic (fmt=, > > >> ap=) at ../../../kern/kern_shutdown.c:739 > > >>#2 0x8094a8c9 in kassert_panic (fmt=) > > >> at ../../../kern/kern_shutdown.c:634 > > >>#3 0x8093583c in __mtx_lock_flags (c=0xf80002919720, opts=0, > > >> file=0x81c3f0fa > > >> "/usr/home/jmg/freebsd.p4/opencrypto/sys/modules/aesni/../../crypto/aesni/aesni.c", line=442) at ../../../kern/kern_mutex.c:217 > > >>#4 0x81c3e3a7 in ?? () > > >>#5 0xf80002a474a0 in ?? () > > >>#6 0xf80002919720 in ?? () > > >> > > >>Where those should be in the aesni.ko module... If I run kgdb on a > > >>local machine, it properly finds the kernel modules... Any hits on > > >>how to fix this? > > > > works for me.. > > the modules I'm debugging are not compiled in. > > you have to have the modules in the standard place ONE THE GDB HOST. > > I make a chroot with an image of the machine being debugged, PLUS the > > sources. > > and then run kgdb from inside that chroot. > > Ahh, that's right, kgdb isn't smart enough to know when you've pointed > it to the kernel build dir whereh the modules are... :( gdb isn't smart enough if you run with all the shared libraries in the current directory either. Note you can always use 'add-kld /path/to/foo.ko' when it can't find a useful module path. Also, you don't have to use a chroot. You can use 'solib-absolute-prefix' (it's documented for shared libraries and kgdb treats modules as shared libraries) and set it to the DESTDIR you use when you install the kernel. That is: % cd /path/to/kernel/amd64/compile/FOO % make % make install BINOWN= DESTDIR=/someplace % kgdb kernel.debug (kgdb) set solib-absolute-prefix /someplace/ (kgdb) target remote (I have a local patch to vmrun.sh on my laptop that always ties a nmdm interface on COM2 if nmdm is loaded so I can now attach kgdb to any VM without having to plan ahead). -- John Baldwin ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: bhyve remote kgdb does not support kernel modules...
Hi John-Mark, Where those should be in the aesni.ko module... If I run kgdb on a local machine, it properly finds the kernel modules... Any hits on how to fix this? To add to Julian's reply, there's also some info in the thread starting at http://docs.FreeBSD.org/cgi/mid.cgi?5363F399.40709 Also, any plans to support the Z2 write-watchpoint packet? (kgdb) watch *(char *)0xf80002919708 Hardware watchpoint 1: *(char *) 18446735277659625224 (kgdb) c Continuing. Can't clear hardware watchpoints without the 'Z2' (write-watchpoint) packet You'd have to write some code to glue the MI gdb/gdb_main.c packet handler to the routines in ddb/db_watch.c. (I'm sure this exists somewhere out there - certainly did at my previous workplace). If you want to take that on, we can do the other piece which is to context-switch the debug registers on guest entry/exit. later, Peter. ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: bhyve remote kgdb does not support kernel modules...
Julian Elischer wrote this message on Sun, Nov 16, 2014 at 00:23 +0800: > On 11/15/14, 5:43 PM, John-Mark Gurney wrote: > >John-Mark Gurney wrote this message on Sat, Nov 15, 2014 at 01:37 -0800: > >>So, I got remote kgdb working w/ bhyve, but kernel modules aren't > >>loaded... > >> > >>I'm getting: > >>(kgdb) bt > >>#0 kdb_enter (why=0x8102ee88 "panic", msg=) > >> at ../../../kern/subr_kdb.c:444 > >>#1 0x8094aa79 in vpanic (fmt=, > >> ap=) at ../../../kern/kern_shutdown.c:739 > >>#2 0x8094a8c9 in kassert_panic (fmt=) > >> at ../../../kern/kern_shutdown.c:634 > >>#3 0x8093583c in __mtx_lock_flags (c=0xf80002919720, opts=0, > >> file=0x81c3f0fa > >> > >> "/usr/home/jmg/freebsd.p4/opencrypto/sys/modules/aesni/../../crypto/aesni/aesni.c", > >> line=442) at ../../../kern/kern_mutex.c:217 > >>#4 0x81c3e3a7 in ?? () > >>#5 0xf80002a474a0 in ?? () > >>#6 0xf80002919720 in ?? () > >> > >>Where those should be in the aesni.ko module... If I run kgdb on a > >>local machine, it properly finds the kernel modules... Any hits on > >>how to fix this? > > works for me.. > the modules I'm debugging are not compiled in. > you have to have the modules in the standard place ONE THE GDB HOST. > I make a chroot with an image of the machine being debugged, PLUS the > sources. > and then run kgdb from inside that chroot. Ahh, that's right, kgdb isn't smart enough to know when you've pointed it to the kernel build dir whereh the modules are... :( Thanks for the reminder... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: bhyve remote kgdb does not support kernel modules...
On 11/15/14, 5:43 PM, John-Mark Gurney wrote: John-Mark Gurney wrote this message on Sat, Nov 15, 2014 at 01:37 -0800: So, I got remote kgdb working w/ bhyve, but kernel modules aren't loaded... I'm getting: (kgdb) bt #0 kdb_enter (why=0x8102ee88 "panic", msg=) at ../../../kern/subr_kdb.c:444 #1 0x8094aa79 in vpanic (fmt=, ap=) at ../../../kern/kern_shutdown.c:739 #2 0x8094a8c9 in kassert_panic (fmt=) at ../../../kern/kern_shutdown.c:634 #3 0x8093583c in __mtx_lock_flags (c=0xf80002919720, opts=0, file=0x81c3f0fa "/usr/home/jmg/freebsd.p4/opencrypto/sys/modules/aesni/../../crypto/aesni/aesni.c", line=442) at ../../../kern/kern_mutex.c:217 #4 0x81c3e3a7 in ?? () #5 0xf80002a474a0 in ?? () #6 0xf80002919720 in ?? () Where those should be in the aesni.ko module... If I run kgdb on a local machine, it properly finds the kernel modules... Any hits on how to fix this? works for me.. the modules I'm debugging are not compiled in. you have to have the modules in the standard place ONE THE GDB HOST. I make a chroot with an image of the machine being debugged, PLUS the sources. and then run kgdb from inside that chroot. Also, any plans to support the Z2 write-watchpoint packet? (kgdb) watch *(char *)0xf80002919708 Hardware watchpoint 1: *(char *) 18446735277659625224 (kgdb) c Continuing. Can't clear hardware watchpoints without the 'Z2' (write-watchpoint) packet ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"
Re: bhyve remote kgdb does not support kernel modules...
John-Mark Gurney wrote this message on Sat, Nov 15, 2014 at 01:37 -0800: > So, I got remote kgdb working w/ bhyve, but kernel modules aren't > loaded... > > I'm getting: > (kgdb) bt > #0 kdb_enter (why=0x8102ee88 "panic", msg=) > at ../../../kern/subr_kdb.c:444 > #1 0x8094aa79 in vpanic (fmt=, > ap=) at ../../../kern/kern_shutdown.c:739 > #2 0x8094a8c9 in kassert_panic (fmt=) > at ../../../kern/kern_shutdown.c:634 > #3 0x8093583c in __mtx_lock_flags (c=0xf80002919720, opts=0, > file=0x81c3f0fa > "/usr/home/jmg/freebsd.p4/opencrypto/sys/modules/aesni/../../crypto/aesni/aesni.c", > line=442) at ../../../kern/kern_mutex.c:217 > #4 0x81c3e3a7 in ?? () > #5 0xf80002a474a0 in ?? () > #6 0xf80002919720 in ?? () > > Where those should be in the aesni.ko module... If I run kgdb on a > local machine, it properly finds the kernel modules... Any hits on > how to fix this? Also, any plans to support the Z2 write-watchpoint packet? (kgdb) watch *(char *)0xf80002919708 Hardware watchpoint 1: *(char *) 18446735277659625224 (kgdb) c Continuing. Can't clear hardware watchpoints without the 'Z2' (write-watchpoint) packet -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." ___ freebsd-virtualization@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscr...@freebsd.org"