Page MenuHomeFreeBSD

Add a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.
ClosedPublic

Authored by jhb on Apr 21 2017, 9:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 31, 3:34 PM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Unknown Object (File)
Mar 12 2024, 7:04 AM
Subscribers

Details

Summary

Add a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.

When this option is enabled, only gdb and kgdb are installed to /usr/libexec
for use by crashinfo(8). Other bits of GDB such as gdbserver and gdbtui
are not installed. For this option to be effective, GDB must be enabled.

Rework r317094 to re-enable GDB on all platforms but enable GDB_LIBEXEC
on platforms for which the GDB in ports is a superset of functionality.

This is a compromise suggested by kib@.

Test Plan
  • have not yet tested this, will follow up once I have

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tools/build/mk/OptionalObsoleteFiles.inc
2441 ↗(On Diff #27618)

} placement

usr.sbin/crashinfo/crashinfo.sh
43 ↗(On Diff #27618)

maybe /usr/libexec/gdb before /usr/bin/gdb? I can imagine not-really-supported upgrade paths that have both, where /usr/bin/gdb is an old leftover.

60 ↗(On Diff #27618)

quotes unnecessary

158 ↗(On Diff #27618)

Perhaps emit a suggestion to install the kgdb package or port?

I am fine with /usr/libexec/{,k}gdb, and I agree with the changes in whole. I cannot provide useful comments on the details of the make infrastructure changes, except what Ed noted.

This revision is now accepted and ready to land.Apr 22 2017, 5:21 AM
jhb edited edge metadata.
  • Review feedback.
This revision now requires review to proceed.Apr 24 2017, 2:08 AM

LGTM with one nit as noted

tools/build/mk/OptionalObsoleteFiles.inc
2441 ↗(On Diff #27674)

} still in wrong spot?

This revision is now accepted and ready to land.Apr 24 2017, 3:24 AM
jhb edited edge metadata.
  • Include src.opts.mk.
This revision now requires review to proceed.Apr 24 2017, 5:32 PM
tools/build/mk/OptionalObsoleteFiles.inc
2441 ↗(On Diff #27687)

This is still ${MK_GDB_LIBEXEC == yes} not ${MK_GDB_LIBEXEC} == yes

  • Add another include of src.opts.mk.
  • Correct } location.
jhb marked 5 inline comments as done.Apr 24 2017, 6:13 PM
jhb added inline comments.
tools/build/mk/OptionalObsoleteFiles.inc
2446 ↗(On Diff #27690)

Will commit this separately.

2451 ↗(On Diff #27690)

I need to delete these if MK_GDB == no as well.

usr.sbin/crashinfo/crashinfo.sh
158 ↗(On Diff #27618)

I'm a bit hesitant to do that here. For one, this script can be run during boot. Secondly, some platforms don't have a working kgdb yet. (RISC-V just doesn't have a kernel debugger at all). Given that we will ship /usr/libexec/kgdb until klldb exists I think that this message will only really be seen on systems like RISC-V.

LGTM modulo the minor updates you mentioned

gnu/usr.bin/gdb/Makefile.inc
3 ↗(On Diff #27690)

I'm not sure where Makefile.inc gets included from (if that place may already include src.opts.mk?), but LGTM if this is needed.

This revision is now accepted and ready to land.Apr 24 2017, 6:30 PM
jhb edited edge metadata.
  • Delete /usr/libexec/*gdb if WITHOUT_GDB=yes is set.
This revision now requires review to proceed.Apr 24 2017, 6:32 PM
This revision is now accepted and ready to land.Apr 24 2017, 6:38 PM

Finally passed various tests on my laptop by doing installworld with WITHOUT_GDB=yes, WITHOUT_GDB_LIBEXEC=yes, and default (WITH_GDB_LIBEXEC=yes) and verifying the correct things get installed, and that 'make check-old' with either WITHOUT_GDB=yes, or WITHOUT_GDB_LIBEXEC=yes or the default all report the right things for each of the 3 installed world cases.

gnu/usr.bin/gdb/Makefile.inc
3 ↗(On Diff #27690)

The various child Makefiles (gdb/Makefile, gdbtui/Makefile, etc.) do not currently include src.opts.mk as they don't need it.

This revision was automatically updated to reflect the committed changes.