Page MenuHomeFreeBSD

Add a KGDB option to the devel/gdb port.
ClosedPublic

Authored by jhb on Sep 23 2015, 10:22 PM.

Details

Summary

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.

Test Plan
  • tested build with just threads, just kgdb, and both kgdb and threads.
  • verified gdb710 was able to debug threads when enabled
  • verified kgdb710 worked on a live amd64 system when enabled

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb updated this revision to Diff 8916.Sep 23 2015, 10:22 PM
jhb retitled this revision from to Add a KGDB option to the devel/gdb port..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
emaste added inline comments.Sep 24 2015, 1:17 AM
devel/gdb/Makefile
37 ↗(On Diff #8916)

Is there a reason not to include KGDB support by default? In a subsequent change perhaps?

devel/gdb/pkg-plist
2 ↗(On Diff #8916)

Here there is a typo, a missing k in kgdb:
%%GDB_LINK%%%%KGDB%%bin/kgdb

A note about architectures: devel/gdb is tested on i386, amd64, powerpc and powerpc64; at the moment, sparc64 is excluded (ONLY_FOR_ARCHS in the Makefile)

Is powerpc64 supported on kgdb? Otherwise, we should arrange the Makefile to exclude this options on that architecture.

jhb added inline comments.Sep 25 2015, 4:24 PM
devel/gdb/Makefile
37 ↗(On Diff #8916)

Just an abundance of caution. It will need to be the default before we can remove the base system gdb. Also, we should probably only remove the base system gdb for platforms that 1) support devel/gdb with kgdb, and 2) support lldb in the base system. However, once kgdb in here has had a bit more testing that will be true for at least amd64 and i386. Eventually we might dispense with requirement 2) if we require external toolchains for say, sparc64.

jhb added a comment.Sep 25 2015, 4:25 PM

A note about architectures: devel/gdb is tested on i386, amd64, powerpc and powerpc64; at the moment, sparc64 is excluded (ONLY_FOR_ARCHS in the Makefile)

Is powerpc64 supported on kgdb? Otherwise, we should arrange the Makefile to exclude this options on that architecture.

The ppcfbsd-kern.c target supports both powerpc and powerpc64. However, I haven't yet had anyone confirm that they've tested it. I'm trying to get qemu going on my own machines so I can test it, but I've yet to get FreeBSD to install inside of qemu for powerpc (32 or 64 bit).

jhb updated this revision to Diff 8932.Sep 25 2015, 4:44 PM

Fix kgdb link in plist.

np added a subscriber: np.Sep 28 2015, 10:05 PM
jhb updated this revision to Diff 8972.Sep 29 2015, 10:34 PM
  • Remove unused header.
jhb updated this revision to Diff 8973.Sep 29 2015, 10:35 PM
  • Fix kernel_from_dumpnr() to work with newer debug build.
bdrewery accepted this revision.Oct 5 2015, 10:33 PM
bdrewery added a reviewer: bdrewery.
This revision is now accepted and ready to land.Oct 5 2015, 10:33 PM
This revision was automatically updated to reflect the committed changes.