-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(debuginfo): Prefer DWARF names for Dart functions #293
Merged
Conversation
This file contains 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
mitsuhiko
approved these changes
Nov 26, 2020
jan-auer
commented
Nov 26, 2020
|
||
// Trust the symbol table more to contain accurate mangled names. However, since Dart's name | ||
// mangling is lossy, we need to load the demangled name instead. | ||
let prefer_dwarf_names = producer.as_deref() == Some(b"Dart VM"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part 1 of the change: Detecting the Dart producer.
.map(|n| Name::new(n, NameMangling::Mangled, self.language)) | ||
}) | ||
} else { | ||
let symbol_name = if self.prefer_dwarf_names || inline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part 2 of the change: Skipping symbol table lookup if DWARF names are preferred.
jan-auer
added a commit
that referenced
this pull request
Nov 26, 2020
* master: fix(debuginfo): Prefer DWARF names for Dart functions (#293)
jan-auer
added a commit
that referenced
this pull request
Dec 22, 2020
* master: (21 commits) fix: New nightly clippy lint (#295) fix(release): Do not publish examples to crates.io release: 8.0.0 ref(debuginfo): Remove re-exports of error types (#300) meta: Update changelog ref(debuginfo): Switch to error with kind (#299) ref(minidump): Switch to error with kind (#298) ref(unreal): Switch to error with kind (#297) ref(symcache): Switch to error with kind (#296) feat: Rename architecture to wasm32 (#294) fix(debuginfo): Prefer DWARF names for Dart functions (#293) fix: clippy (#292) hack(dwarf): Skip line program sequences at 0 (#291) feat(wasm): support for wasm (#166) ci: Run rust nighlty on a schedule (#289) ref: Updates for rust 1.48 (#288) fix(debuginfo): Update dmsort to 1.0.1 to avoid panic due to UB (#287) ci: Use GHA instead of zeus (#286) ref: Introduce explicit NameMangling and better DemangleOptions (#275) meta: Bump all semver-major dependencies (#283) ...
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.
We generally trust the symbol table to contain more accurate names than DW_AT_name and other attributes on DIEs in DWARF debug information. Some C++ compilers have been known to output truncated or simplified names into these attributes, whereas the symbol table always contains accurately mangled names.
The Dart compiler is an exception to this case. Its name mangling appears to be lossy and there is no generally available demangler. Thus, we need to prefer the demangled DW_AT_name.
Example:
Precompiled__pM_658260265_sEa__anonymous_closure__8632
_MyAppState.build.<anonymous closure>
Obtained via
cargo run -p addr2line -- -fCi -e app.symbols 0x211b7c
from this example.Before:
After: