Created attachment 190766 [details]
diff of docs changes
The docs don't mention that kgdb is not installed in a directory in PATH so it took me a while to figure out what the docs were talking about. Eventually I ran `find / -name "*kgdb*` and discovered /lib/userexec/kgdb which is the only such binary installed on my system on 12-CURRENT. The location of the debug kernel was also incorrect in the docs and that took my a while to figure out. These two changes allowed me to finally debug my kernel panics on 12-CURRENT. If there are better solutions or changes to be made, let me know. Thank you!
A different patch would be preferred, since the libexec version is not preferred for general use after (base) r317094 -- gdb -k from ports should be a superset of functionality.
(In reply to Benjamin Kaduk from comment #1)
I saw mentioned a few times that the libexec was not intended to be used but it was the only kgdb that I could find. It was written a few times that kgdb was part of the base system and not part of the ports. I'd be happy to change it (and also happy to learn what to actually use), but this is the only way I was able to run gdb on a kernel core dump myself.
https://svnweb.freebsd.org/ports/head/devel/gdb/pkg-plist?revision=440447&view=markup seems to indicate that a recent gdb package/port will install a kgdb binary. Is that not the case for you?
(In reply to Benjamin Kaduk from comment #3)
I'll give that a shot. If this is the appropriate path, this patch should also encompass any reference to kgdb being a built-in utility and that to get core dump debugger functionality you must now install gdb from ports.
That sounds like the appropriate path, yes. Thank you for offering to take on the work of fixing the documentation!
You were right, it is installed with gdb. I also missed the deprecation notice in the kgdb man page that mentions this too: https://www.freebsd.org/cgi/man.cgi?query=kgdb. I'm attaching an updated diff. I can't seem to find any other references to it being part of the base system.
Created attachment 190776 [details]
updated kgdb docs diff referencing gdb port
Is there anything more I can do to get this good to go/merged?
(In reply to Phil Eaton from comment #8)
The reminder should be enough (I think I either didn't notice when the latest patch first came in or was too busy to do anything with it).
I'll tweak a couple things (like using markup for "<package>devel/gdb</package>" and mentioning both paths to the debug kernel binary in the object tree, since IIRC the old version is still in use on some supported releases, but once the build passes it should be good to go.
A commit references this bug:
Date: Fri Mar 9 02:06:39 UTC 2018
New revision: 51474
Update kgdb instructions
The port/package should be used now, and build system changes have
moved the kernel images in the object tree to a new location (on
Submitted by: Phil Eaton <email@example.com>
And the change is now live, so I'll close this.
And thank *you* for putting the patch together!