rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
93.58k stars 12.05k forks source link

Implement lldb formatter for "clang encoded" enums (LLDB 18.1+) (v2) #124745

Closed dtolnay closed 1 week ago

dtolnay commented 1 week ago

This PR is identical to #124458, which was approved and merged but then removed from master by a force-push due to a CI bug.

Original PR description:


Summary:

fixes #79530

I landed a fix last year to enable DW_TAG_variant_part encoding in LLDBs (https://reviews.llvm.org/D149213). This PR is a corresponding fix in synthetic formatters to decode that information.

This is in no way perfect implementation but at least it improves the status quo. But most types of enums will be visible and debuggable in some way.

I've also updated most of the existing tests that touch enums and re-enabled test cases based on LLDB for enums.

Test Plan:

ran tests ./x test tests/debuginfo/. Also tested manually in LLDB CLI and LLDB VSCode

Other Thoughs:

A better approach would probably be adopting formatters from codelldb. There is some neat hack that hooks up summary provider via synthetic provider which can ultimately fix more display issues for Rust types and enums too. But getting it to work well might take more time that I have right now.

rustbot commented 1 week ago

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

dtolnay commented 1 week ago

@bors r=Mark-Simulacrum

bors commented 1 week ago

:pushpin: Commit 43e66003f3aaab70da9a8f3356188fda0a2b1a10 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

fmease commented 1 week ago

Failed in rollup: https://github.com/rust-lang/rust/pull/124769#issuecomment-2094972104 CC @VladimirMakaev @bors r-

fmease commented 1 week ago

@bors rollup=iffy

fmease commented 1 week ago

Since the original author (and maintainers) cannot directly modify this PR, I suggest opening a 3rd PR, VladimirMakaev.

VladimirMakaev commented 1 week ago

@fmease I'll open a new PR. Is there a good way I can rerun those tests on CI for a PR? They seem to all pass when I do so locally on Linux server. Need to dig why things are failing on msvc would be nice to be able to trigger a build on PR to know upfront