debugging FreeBSD BHyve guest
Anish
akgupt3 at gmail.com
Sun Apr 16 05:15:11 UTC 2017
I just tested bvmdebug with FreeBSD HEAD and it worked fine.
-Anish
*./vmrun.sh -g 6466 vm1*
*<Guest boots>*
*root at bsdguest:~ # uname -a*
*FreeBSD bsdguest 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r314641M: Sat Apr 15
19:53:23 PDT 2017 root at svmhost:/usr/obj/root/head/sys/BHYVE amd64*
*root at bsdguest:~ # sysctl debug.kdb.enter=1*
*debug.kdb.enter: 0KDB: enter: sysctl debug.kdb.enter*
*Received ^C; trying to switch back to ddb.*
*using longjmp, hope it works!*
*KDB: reentering*
*KDB: stack backtrace:*
*...*
*Switching to ddb back-end*
*[ thread pid 782 tid 100072 ]*
*Stopped at kdb_sysctl_enter+0x98: movq $0,kdb_why*
*db> gdb*
*(ctrl-c will return control to ddb)*
*Switching to gdb back-end*
-----------------------------------------
>From other terminal
(kgdb) target remote localhost:6466
...
(kgdb) bt
#0 0xffffffff80a8c6b8 in kdb_sysctl_current (oidp=0x0, arg1=0x80,
arg2=-2198296484032, req=0xfffffe002b51a930)
at /root/FreeBSD/base/head/sys/kern/subr_kdb.c:146
#1 0xffffffff80a57820 in sysctl_new_user (req=0x100000000,
p=0xfffffe002b51a930, l=18446741875413067952)
at /root/FreeBSD/base/head/sys/kern/kern_sysctl.c:1729
#2 0xffffffff80a57016 in sysctl_root (arg1=0x0, arg2=-2120631584)
at /root/FreeBSD/base/head/sys/kern/kern_sysctl.c:1911
#3 0xffffffff80a575a8 in sys___sysctl (td=<value optimized out>, uap=0x3)
at /root/FreeBSD/base/head/sys/kern/kern_sysctl.c:1944
#4 0xffffffff80a5741f in sysctl_old_user (req=<value optimized out>,
p=<value optimized out>, l=<value optimized out>)
at /root/FreeBSD/base/head/sys/kern/kern_sysctl.c:1718
#5 0xffffffff80ec901a in trap (frame=0x0)
at /root/FreeBSD/base/head/sys/amd64/amd64/trap.c:569
#6 0xffffffff80eaab1b in Xalign ()
at /root/FreeBSD/base/head/sys/amd64/amd64/exception.S:164
#7 0x000000080097cb6a in ?? ()
Previous frame inner to this frame (corrupt stack?)
(kgdb)
On Wed, Apr 12, 2017 at 10:14 AM, Julian Elischer <julian at freebsd.org>
wrote:
> On 11/4/17 9:30 pm, Hannes Mehnert wrote:
>
>> Hello,
>>
>> I want to debug a FreeBSD BHyve guest kernel, and tried to follow the
>> instructions on the wiki
>> (https://wiki.freebsd.org/bhyve/DebuggingWithGdb) -- but already the
>> "device bvmdebug" is no longer recognized by make buildkernel.
>>
>
> I hope that is not true. I use it all the time on 10.
>
>
>
>> Is there a way (and a howto?) to kgdb a FreeBSD guest?
>>
>>
>> Thanks,
>>
>> hannes
>> _______________________________________________
>> freebsd-virtualization at freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
>> To unsubscribe, send any mail to "freebsd-virtualization-unsubs
>> cribe at freebsd.org"
>>
>>
> _______________________________________________
> freebsd-virtualization at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubs
> cribe at freebsd.org"
>
More information about the freebsd-virtualization
mailing list