Skip to content

Add opt-in caching for shared DWARF abbreviations - #788

Open
anik-dasgupta wants to merge 1 commit into
rust-lang:mainfrom
anik-dasgupta:cache-shared-dwarf-abbreviations
Open

anik-dasgupta wants to merge 1 commit into
rust-lang:mainfrom
anik-dasgupta:cache-shared-dwarf-abbreviations

Conversation

@anik-dasgupta

Copy link
Copy Markdown

Summary

Populate gimli's abbreviation cache with AbbreviationsCacheStrategy::Duplicates before constructing the addr2line context when RUST_LIB_BACKTRACE_CACHE_SHARED_ABBREVIATIONS is present.

This allows compilation units that reference the same .debug_abbrev table to reuse its parsed representation. LLVM BOLT's -update-debug-sections can produce such shared tables. The Duplicates strategy caches only abbreviation offsets referenced by multiple units.

Testing

Passed on macOS:

  • cargo fmt --all -- --check
  • cargo test
  • RUST_LIB_BACKTRACE_CACHE_SHARED_ABBREVIATIONS=1 cargo test

When `RUST_LIB_BACKTRACE_CACHE_SHARED_ABBREVIATIONS` is present, populate gimli's abbreviation cache with `AbbreviationsCacheStrategy::Duplicates` before constructing the addr2line context. This lets compilation units sharing an abbreviation table reuse its parsed representation.
@workingjubilee

Copy link
Copy Markdown
Member

This PR does not motivate why it uses an environment variable.

See the rust-lang/rust LLM usage policy. I intend to remove this as a separate repo, which is why I have not bothered to formally note that I intend for it to be applied here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants