Add a new KGDB option to the devel/gdb port. This adds a forward port of the kernel-specific bits of kgdb to recent gdb. It only supports amd64, i386, powerpc, and sparc64. This is based on the changes in the freebsd-7.10-kgdb branch at github/bsdjhb/gdb.git. Note that since the THREADS and KGDB options both apply conflicting patches to configure.tgt I had to handle patching that file specially. This also meant I hda to apply the extra patches in a deterministic order and could not use do-patch-<option>-on:
Filled a couple of comments in phabricator. I'm taking some time to manually run some "regression" tests in several configurations. I'm also thinking to remove THREADS as option and to compile it in. It should simplify KGDB patch management.
Long term I plan to replace the THREADS option entirely with a native threads target I plan to write for upstream gdb that will use ptrace() directly. fbsd-threads.c is buggy and it's not easy to fix some of the issues due to the complexity of trying to support older KSE threads. The new thread target will require some ptrace() changes however, so we will still want THREADS as an option for older systems.
I'm OK with the patch. No new PORTREVISION bump is needed, if KGDB is not installed by default.
Adding Jilles in case he wants to approve this as a ports committer.
(In reply to John Baldwin from comment #4) I'm not actually a ports committer. In a quick look, I don't notice anything wrong at the ports level, but I do not follow the ports framework developments closely.
A commit references this bug: Author: jhb Date: Tue Oct 6 18:52:59 UTC 2015 New revision: 398712 URL: https://svnweb.freebsd.org/changeset/ports/398712 Log: Add a new KGDB option to the devel/gdb port. This adds a forward port of the kernel-specific bits of kgdb to recent gdb. It only supports amd64, i386, powerpc, powerpc64, and sparc64. PR: 203299 Reviewed by: bdrewery Glanced at by: emaste, jilles, luca.pizzamiglio@gmail.com (maintainer) Differential Revision: https://reviews.freebsd.org/D3727 Changes: head/devel/gdb/Makefile head/devel/gdb/files/extrapatch-kgdb head/devel/gdb/files/extrapatch-kgdb-configure.tgt-plain head/devel/gdb/files/extrapatch-kgdb-configure.tgt-threads head/devel/gdb/files/kgdb/ head/devel/gdb/files/kgdb/amd64fbsd-kern.c head/devel/gdb/files/kgdb/fbsd-kld.c head/devel/gdb/files/kgdb/fbsd-kthr.c head/devel/gdb/files/kgdb/fbsd-kvm.c head/devel/gdb/files/kgdb/i386fbsd-kern.c head/devel/gdb/files/kgdb/kgdb-main.c head/devel/gdb/files/kgdb/kgdb.h head/devel/gdb/files/kgdb/ppcfbsd-kern.c head/devel/gdb/files/kgdb/sparc64fbsd-kern.c head/devel/gdb/pkg-plist