Currently, no gdb options can be given to kgdb -- except the specially-handled -q and -f. This is unfortunate -- in particular, the `-x script' option is missing, but possibly others. The patch below modifies kgdb to: . allow anything after the kernel/core to be sent to gdb_main; . eats all options recognized by kgdb itself; . removes some redundant strdups . re-arrange the command-line loop handling a bit to avoid our own wrapper. The following command now becomes possible, for example: kgdb -v -c /home/mi/crash/vmcore.1 kernel.debug -x script.txt The command-line handling could be improved further to allow mixing of gdb and kgdb options (except where they overlap), but that is, probably, not needed. The common usage (as specified in Handbook) shows kernel.debug and vmcore explicitly... Fix: The up-to-date patch can be found at http://aldan.algebra.com/~mi/kgdb-gdb.patch
Responsible Changed From-To: freebsd-bugs->joerg I think I'll be able to handle that, I'm currently trying to improve KGDB's behaviour when running from within Emacs. Alas, the old patch no longer applies cleanly. Are you willing to provide an updated patch?
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Note that for kgdb in ports, you can just use 'gdb' from ports directly (unlike the old gdb in base where only kgdb understands kernels). In newer gdb, you can just use 'target vmcore' to open a crash dump (or /dev/mem) which means you can use existing GDB support in Emacs or other editors, or use any command line options supported by gdb. I think just using gdb directly is probably the best path forward vs trying to make kgdb support all of gdb's options. In particular, kgdb has different semantics for -r than gdb IIRC. (If you look at the source of kgdb in ports, it effectively just constructs a set of args to pass to gdb using "-xie", etc. type options to change the prompt and invoke 'target vmcore')
I'd like to return that bug to anyone else who has time to handle it. Based on jhb's comment, it can probably be closed.
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
kgdb in base has been removed. For kgdb in ports, use gdb directly instead.