Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 938762

Summary: Add support for MiniDebugInfo (.gnu_debugdata)
Product: Portage Development Reporter: Sam James <sam>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: arsen, eschwartz, esigra
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=920745
https://bugs.kde.org/show_bug.cgi?id=492429
https://github.com/oracle/dtrace-utils/issues/96
https://sourceware.org/bugzilla/show_bug.cgi?id=31884
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 933986    

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-30 23:08:09 UTC
gdb supports MiniDebugInfo (.gnu_debugdata) [0][1]. It's a compressed DWARF format which exists within a DWARF section. It uses xz compression.

Its main purpose is to retain symtab which gets stripped not just in Gentoo but pretty much everywhere.

Having symtab is pretty critical for profiling but also getting some emergency backtrace out of e.g. gdb without rebuilding with debug symbols.

Fedora also seems to enable it by default [2].

The gdb page [0] has a nice simple example for how to implement it, too.

[0] https://sourceware.org/gdb/current/onlinedocs/gdb.html/MiniDebugInfo.html
[1] https://maskray.me/blog/2022-10-30-distribution-of-debug-information#minidebuginfo
[2] https://fedoraproject.org/wiki/Features/MiniDebugInfo
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-30 23:15:31 UTC
The idea here would be that we implement it under some FEATURES flag at first, then do it by default unconditionally (or at least on-by-default).

It doesn't have much value if users have to opt-in to it. The overhead is also very low. It's intended to _not_ be a replacement for full debug information.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-30 23:16:43 UTC
dev-debug/valgrind doesn't support it, although I don't think that's a blocker for this (filed https://bugs.kde.org/show_bug.cgi?id=492429).

dev-debug/dtrace is likely to add support (https://github.com/oracle/dtrace-utils/issues/96).
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-30 23:18:54 UTC
One decision to make is if we include symtab *and* line number information. The line number information makes it a fair bit bigger although still nothing like DWARF.