Bug 191930

Summary: Bring kernel debug files into line with userland standalone debug
Product: Base System Reporter: Ed Maste <emaste>
Component: miscAssignee: Ed Maste <emaste>
Status: Open ---    
Severity: Affects Some People CC: avg, cem, op
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Bug Depends on: 191920    
Bug Blocks: 231027    

Description Ed Maste freebsd_committer freebsd_triage 2014-07-17 20:06:14 UTC
A single src.conf(5) knob, WITH_DEBUG_FILES=yes, enables userland standalone debug.  Setting it enables a few things:

- CFLAGS has -g added to generate debug data during compilation
- Binaries and libraries are built as a .full version which includes debug
- The .full file is converted into one with the debug data stripped out (no extra extension), and a separate debug data file (.debug extension)
- Debug data is installed under /usr/lib/debug/...

Kernel standalone debug files have a few differences:

- The -g flag has to be added via the kernel config file (it is set in GENERIC)
- WITHOUT_KERNEL_SYMBOLS will avoid splitting the kernel objects
- Extensions are different (.debug for the full object, .symbols for the debug data)
- Debug data is installed in the same directory as the kernel objects, in /boot/kernel

The last point is an annoyance, as /boot may not be a very large filesystem
Comment 1 Ed Maste freebsd_committer freebsd_triage 2015-11-24 16:53:57 UTC
As of r288176 these two are addressed:

- Extensions are different (.debug for the full object, .symbols for the debug data)
- Debug data is installed in the same directory as the kernel objects, in /boot/kernel

These two are still true today:

- The -g flag has to be added via the kernel config file (it is set in GENERIC)
- WITHOUT_KERNEL_SYMBOLS will avoid splitting the kernel objects
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-08-30 16:49:46 UTC
Move to 13.x tracking PR. The changes that can be made in an existing branch or in-progress release (11.x/12.x) have been done. Any additional changes to be done in -CURRENT well in advance of a release.