Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938762 - Add support for MiniDebugInfo (.gnu_debugdata)
Summary: Add support for MiniDebugInfo (.gnu_debugdata)
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 933986
  Show dependency tree
 
Reported: 2024-08-30 23:08 UTC by Sam James
Modified: 2024-08-31 00:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.