-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Update DWARF for space optimizations #46173
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
C-bug
Category: This is a bug.
Comments
Linking from IRC discussion. Swift has its own fork/copy of lldb, and includes aggressively (dynamically!) optimized enums: https:/apple/swift-lldb |
I think this bug is a dup of #32920 |
kennytm
added
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
C-bug
Category: This is a bug.
labels
Nov 28, 2017
I belatedly realized I could close this. Dup of #32920 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
C-bug
Category: This is a bug.
#45225 implemented a number of space optimizations. However, the DWARF was not updated to follow.
For example, for a sample type mentioned in the PR:
Nightly emits this DWARF:
This is entirely missing entries for
C
andD
(B
is implicit in the specialRUST$ENCODED$ENUM$0$B
member name).This is a good opportunity to remove
RUST$ENCODED$ENUM
and alsoRUST$ENUM$DISR
.@eddyb pointed out one approach on irc, namely to use the existing
DW_TAG_variant_part
support in DWARF. This will yield somewhat weird-looking output; first because the tag is only defined as a child of a structure, so the union will have to be wrapped in an artificial struct; and second because the discriminant is defined to be a reference to one of the struct's members.This does seem likely to work, though; and since neither gdb nor lldb currently handle
DW_TAG_variant_part
at all, we probably have some leeway to do what we like. Plan B might be something like introduce a small DWARF extension to represent the layout in a form closer to what rustc is actually doing.Unfortunately LLVM's debuginfo builder also does not seem to have a notion of discriminated unions, so step 1 will have to be an LLVM patch.
The text was updated successfully, but these errors were encountered: