Bug 203299 - devel/gdb: Add KGDB option
Summary: devel/gdb: Add KGDB option
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL: https://reviews.freebsd.org/D3727
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-23 22:32 UTC by John Baldwin
Modified: 2015-10-06 18:54 UTC (History)
2 users (show)

See Also:
luca.pizzamiglio: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baldwin freebsd_committer freebsd_triage 2015-09-23 22:32:19 UTC
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:
Comment 1 luca.pizzamiglio 2015-09-25 09:08:31 UTC
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.
Comment 2 John Baldwin freebsd_committer freebsd_triage 2015-09-25 16:16:48 UTC
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.
Comment 3 luca.pizzamiglio 2015-09-28 12:39:41 UTC
I'm OK with the patch.

No new PORTREVISION bump is needed, if KGDB is not installed by default.
Comment 4 John Baldwin freebsd_committer freebsd_triage 2015-09-28 22:02:48 UTC
Adding Jilles in case he wants to approve this as a ports committer.
Comment 5 Jilles Tjoelker freebsd_committer freebsd_triage 2015-09-29 21:25:20 UTC
(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.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-10-06 18:53:20 UTC
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