Created attachment 182259 [details] kgdb.patch The kld parsing code in kgdb was using basename() and dirname() which ended up being broken by the recent changes to make dirname() modify its input buffer. The patch to fbsd-kld.c modifies it to use the lbasename() and ldirname() wrappers in gdb. While here, it adds the kgdb.1 manpage from base which is helpful since stock HEAD no longer ships a kgdb manpage. I also fixed an issue where the mips binaries weren't pulling in -lkvm which is needed for the kgdb binary to link.
During the test, I've found a small issue in the pkg-plist. I'll recreate the patch after my series of tests.
Created attachment 182402 [details] Newer version of the patch, fixing the plist issue This patch substitute the previous one, fixing the pkg-plist issue caused by the added kgdb man page.
Oh, yes, I completely forgot to fix the manpage thing. Thanks! I'll get a ports committer to approve this and then commit.
Approved, assuming it passes poudriere testport.
A commit references this bug: Author: jhb Date: Mon May 8 19:02:26 UTC 2017 New revision: 440447 URL: https://svnweb.freebsd.org/changeset/ports/440447 Log: Fix several issues with kgdb: - The kld parsing code in kgdb was using basename() and dirname() which ended up being broken by the recent changes to make dirname() modify its input buffer. Modify fbsd-kld.c to use the lbasename() and ldirname() wrappers in gdb. - Add the kgdb.1 manpage from base and install it as 'kgdbNNN.1' which is helpful since stock HEAD no longer ships a kgdb manpage. - Link libkvm into mips binaries so that the vmcore target links. - Bump PORTREVISION. PR: 219028 Reviewed by: luca.pizzamiglio@gmail.com (maintainer) Approved by: rene Changes: head/devel/gdb/Makefile head/devel/gdb/files/extrapatch-kgdb head/devel/gdb/files/kgdb/fbsd-kld.c head/devel/gdb/files/kgdb/kgdb.1 head/devel/gdb/pkg-plist