-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 DWARF generation for enums #54004
Merged
Merged
Commits on Oct 30, 2018
-
Fix DWARF generation for enums
The DWARF generated for Rust enums was always somewhat unusual. Rather than using DWARF constructs directly, it would emit magic field names like "RUST$ENCODED$ENUM$0$Name" and "RUST$ENUM$DISR". Since PR rust-lang#45225, though, even this has not worked -- the ad hoc scheme was not updated to handle the wider variety of niche-filling layout optimizations now available. This patch changes the generated DWARF to use the standard tags meant for this purpose; namely, DW_TAG_variant and DW_TAG_variant_part. The patch to implement this went in to LLVM 7. In order to work with older versions of LLVM, and because LLVM doesn't do anything here for PDB, the existing code is kept as a fallback mode. Support for this DWARF is in the Rust lldb and in gdb 8.2. Closes rust-lang#32920 Closes rust-lang#32924 Closes rust-lang#52762 Closes rust-lang#53153
Configuration menu - View commit details
-
Copy full SHA for 71ce4c3 - Browse repository at this point
Copy the full SHA 71ce4c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c32f402 - Browse repository at this point
Copy the full SHA c32f402View commit details -
Update the new enum-debug to ensure that field "D" does not have a discrimnant.
Configuration menu - View commit details
-
Copy full SHA for d8b0eb7 - Browse repository at this point
Copy the full SHA d8b0eb7View commit details -
Add more enum debug info tests
Rename the previous enum debug info test, and add more tests to cover c-like enums and tagged (ordinary) enums.
Configuration menu - View commit details
-
Copy full SHA for e7c49a7 - Browse repository at this point
Copy the full SHA e7c49a7View commit details -
Avoid possible integer overflow in niche value computation
@eddyb pointed out in review that the niche value computation had a possible integer overflow problem, fixed here as he suggested.
Configuration menu - View commit details
-
Copy full SHA for da7b6b4 - Browse repository at this point
Copy the full SHA da7b6b4View commit details -
Bug rust-lang#52452 notes some debuginfo test regressions when moving to gdb 8.1. This series will also cause versions of gdb before 8.2 to fail when a recent LLVM is used -- DW_TAG_variant_part support was not added until 8.2. This patch updates one of the builders to a later version of Ubuntu, which comes with gdb 8.2. It updates the relevant tests to require both a new-enough LLVM and a new-enough gdb; the subsequent patch arranges to continue testing the fallback mode. The "gdbg" results are removed from these tests because the tests now require a rust-enabled gdb. If you read closely, you'll see that some of the lldb results in this patch still look a bit strange. This will be addressed in a subsequent patch; I believe the fix is to disable the Python pretty-printers when lldb is rust-enabled.
Configuration menu - View commit details
-
Copy full SHA for 8bbb62f - Browse repository at this point
Copy the full SHA 8bbb62fView commit details -
The enum debuginfo patch includes a legacy mode that is used when building against LLVM 5 and LLVM 6. The main enum debuginfo tests have been updated to rely on the new approach and a new-enough gdb. This patch makes a copy of these tests so that the fallback mode will continue to be tested. Note that nil-enum.rs is not copied; it seemed not to provide enough value to bother. A new header directive is added, "ignore-llvm-version". I will send a patch to update the rustc documentation once this lands.
Configuration menu - View commit details
-
Copy full SHA for d36e37e - Browse repository at this point
Copy the full SHA d36e37eView commit details -
Update src/tools/lldb to pick up a needed bug fix in the DW_TAG_variant_part handling.
Configuration menu - View commit details
-
Copy full SHA for 98b2688 - Browse repository at this point
Copy the full SHA 98b2688View commit details
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.