Re: kgdb with bhyve -G : cannot set debug.kdb.current=gdb
- Reply: jmblqe : "Re: kgdb with bhyve -G : cannot set debug.kdb.current=gdb"
- In reply to: jmblqe : "kgdb with bhyve -G : cannot set debug.kdb.current=gdb"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 Jun 2025 15:22:11 UTC
On Fri, Jun 06, 2025 at 05:35:13PM +0000, jmblqe wrote: > hello, > i would like to attach kgdb remotely to a FreeBSD 13.5-RELEASE system, as described in in the Handbook and in https://freebsdfoundation.org/wp-content/uploads/2021/11/Kernel_Development_Recipes.pdf > right now i must do this remotely over TCP (with bhyve -G) because the host is a different OS and I don't want to try to do this over serial console in that setting; and for other reasons. > > i am unable to solve the following problem: > > using kgdb requires the following: > > # sysctl debug.kdb.current=gdb This is not required when connecting to the gdb stub in bhyve(8) (enabled with the -G flag). In that case, the gdb stub lives in the hypervisor, not in the kernel. debug.kdb.current is for when you're connecting directly to the in-kernel gdb stub over the serial console or post-panic network stack (see netgdb(4)). > however, gdb is not in "debug.kdb.available", so it returns, > > sysctl: debug.kdb.current=gdb: Invalid argument > > i have the following added to my kernel config, in addition to other options, like lots of "nodevice", which I think should be harmless: > > makeoptions DEBUG=-g > options KDB > options GDB > > (i found that it actually is possible to attach with kgdb when debug.kdb.current is empty, but then when i set a breakpoint and reach the breakpoint, there is a panic due to the unhandled breakpoint) This sounds like a bug in the bhyve gdb stub. Can you share a recipe for how you're triggering the panic?