Parse short backtraces out of debuginfo#693
Draft
jyn514 wants to merge 4 commits intorust-lang:masterfrom
Draft
Conversation
This implements the runtime side of rust-lang/compiler-team#818. - Extract a helper out of `find_frames` for iterating over a `LookupContinuation` - Make the type signature for `search_object_map` consistent across all platforms. Backtraces are inherently platform specific, but let's not make it any harder on ourselves than we have to. - Add a new `pub fn short_backtraces() -> enum { ThisFrameOnly, Start, End }` API - Use the new [`gimli::UnitRef::shared_attrs`](gimli-rs/gimli#756) API to determine whether a given frame has a short backtrace. This, for now, requires a git dependency on gimli. Note that this currently does not work on MacOS. I do not have a Mac to test this; someone lent me theirs and I tracked it down to `cx.find_dwarf_and_unit` returning `None`, but I have not had the time or resources to narrow it down further than that.
jyn514
commented
Jan 21, 2025
| } | ||
|
|
||
| #[allow(non_upper_case_globals)] | ||
| const DW_AT_short_backtrace: gimli::DwAt = gimli::DwAt(0x3c00); |
Member
Author
There was a problem hiding this comment.
if this changes upstream it will also need to change here: llvm/llvm-project#123683 (comment)
56c6f1a to
ae32a30
Compare
8 tasks
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.
This implements the runtime side of rust-lang/compiler-team#818.
find_framesfor iterating over aLookupContinuationsearch_object_mapconsistent across all platforms. Backtraces are inherently platform specific, but let's not make it any harder on ourselves than we have to.pub fn short_backtraces() -> enum { ThisFrameOnly, Start, End }APIgimli::UnitRef::shared_attrsAPI to determine whether a given frame has a short backtrace. This, for now, requires a git dependency on gimli.Note that this currently does not work on MacOS. I do not have a Mac to test this; someone lent me theirs and I tracked it down to
cx.find_dwarf_and_unitreturningNone, but I have not had the time or resources to narrow it down further than that.