Merged
Conversation
cpp_my_benchmark_stripped.bin is the C++ benchmark binary with DWARF sections removed (strip --strip-debug) but .symtab/.dynsym intact, plus a .gnu_debuglink pointing to cpp_my_benchmark.debug. cpp_my_benchmark.debug contains the extracted DWARF sections (objcopy --only-keep-debug). Together they mimic the libc + libc6-dbg split where system libraries ship stripped and debug packages provide separate .debug files.
There was a problem hiding this comment.
Pull request overview
Adds support for resolving DWARF from separate debug info files referenced via .gnu_debuglink, improving symbolization for stripped binaries (e.g., distro-provided *-dbg packages).
Changes:
- Implement
.gnu_debuglink-based lookup (GDB-style search order) and fallback when DWARF is missing in the main binary. - Add a regression test covering stripped-binary + separate debug file resolution.
- Introduce new perf-map test artifacts and add
crc32fastdependency for CRC verification.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/executor/wall_time/perf/debug_info.rs |
Adds .gnu_debuglink lookup + fallback logic and a new test for stripped binaries. |
Cargo.toml |
Adds crc32fast dependency for debuglink CRC validation. |
Cargo.lock |
Records dependency graph update including crc32fast. |
testdata/perf_map/cpp_my_benchmark_stripped.bin |
New LFS-tracked stripped ELF fixture containing .gnu_debuglink. |
testdata/perf_map/cpp_my_benchmark.debug |
New LFS-tracked separate debug file fixture with DWARF sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1d8f9ea to
93e8801
Compare
GuillaumeLagrange
approved these changes
Apr 21, 2026
libc.so.6 and libc.so.6.debug are the stripped libc plus its separate debug file from Ubuntu 22.04 (jammy) glibc 2.35-0ubuntu3, amd64. Extracted from the official .deb packages: pool/main/g/glibc/libc6_2.35-0ubuntu3_amd64.deb pool/main/g/glibc/libc6-dbg_2.35-0ubuntu3_amd64.deb via `ar x` + `tar --zstd -xf data.tar.zst`. The debug file originally lives under /usr/lib/debug/.build-id/89/c3cb85...1969.debug; it is renamed to libc.so.6.debug in testdata/ for readability. Tests that need the .gnu_debuglink basename stage a tempdir copy with the expected name. Build-id: 89c3cb85f9e55046776471fed05ec441581d1969 These fixtures exercise the build-id and .gnu_debuglink resolution paths against a real-world stripped system library, complementing the synthetic cpp_my_benchmark pair.
93e8801 to
6cdbf5b
Compare
Stripped system libraries (e.g. libc.so.6) ship without DWARF and with only .dynsym. Installing debug packages like libc6-dbg drops a companion .debug file, but the runner had no way to find it — leaving "Unknown symbol" entries and missing file/line info in flamegraphs. Resolve debug files via two mechanisms: 1. Build-ID lookup at /usr/lib/debug/.build-id/XX/YYYYYY.debug, which is how Ubuntu/Debian debug packages actually install files. 2. .gnu_debuglink with the standard GDB search order (same dir, .debug/ subdir, /usr/lib/debug/<path>/) and CRC32 validation to avoid using stale debug files after binary upgrades. The resolved debug file is used both for DWARF (file/line lookup in ModuleDebugInfo) and for merging the full .symtab into ModuleSymbols.
5650976 to
9b26b2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.