codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

Rust enum printing broken on Windows since Rust 1.65

Open MichaelMcDonnell opened this issue 2 years ago • 7 comments

OS: Windows_NT x64 10.0.19045 VSCode version: 1.74.2 (user setup) CodeLLDB version: v1.8.1 Compiler: Rust 1.65.0 Debuggee: x86_64-windows-msvc

The CodeLLDB extension currently doesn't show Rust enumerations (sum type) correctly on Windows when using Rust 1.65 or newer. It worked fine in 1.64.

I noticed that enum$< is now enum2$<. It was changed in this commit that was part of Rust 1.65: https://github.com/rust-lang/rust/pull/98393

I have created a small example that can be used to reproduce the problem and it includes screenshots: https://github.com/MichaelMcDonnell/enum_debug

Thank you!

MichaelMcDonnell avatar Dec 27 '22 18:12 MichaelMcDonnell

This one won't be fixed for a while. Lldb does not support accessing static class members, which is needed to decode new style msvc enums.
I suggest compiling for the -gnu ABI.

vadimcn avatar Dec 28 '22 21:12 vadimcn

Ok, thanks! Is there an open issue for accessing static class members in the LLDB issue tracker?

MichaelMcDonnell avatar Dec 28 '22 21:12 MichaelMcDonnell

Not that I know of.

vadimcn avatar Dec 29 '22 00:12 vadimcn

AFAIK this has been fixed in LLVM 18.0.0

Walnut356 avatar May 13 '24 01:05 Walnut356

Are you sure about that? It's still looks similar to this on my system with

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-pc-windows-msvc
release: 1.78.0
LLVM version: 18.1.2

kaivol avatar May 13 '24 12:05 kaivol

My bad on the wording - the LLVM issues blocking this from being fixed in codeLLDB have been resolved.

Walnut356 avatar May 13 '24 21:05 Walnut356

Ah I see. So that means I'll have to wait for CodeLLDB to make the actual fixes (after updating its LLDB version), right?

kaivol avatar May 14 '24 14:05 kaivol