Skip to content
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

No BTreeMap BTreeSet debug visualizers for lldb / macOS #111868

Open
alcroito opened this issue May 23, 2023 · 3 comments
Open

No BTreeMap BTreeSet debug visualizers for lldb / macOS #111868

alcroito opened this issue May 23, 2023 · 3 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug.

Comments

@alcroito
Copy link

It would be great if rust / lldb / codelldb (vscode) shipped with lldb visualizers / synthetic debug providers for BTreeSet and BTreeMap.

There exists a similar issue for Windows / natvis at #90520 , but not for lldb / macOS.

I guess the gdb providers https://github.com/rust-lang/rust/blob/1.69.0/src/etc/gdb_providers.py#L242 need to be ported for

https://github.com/rust-lang/rust/blob/1.69.0/src/etc/lldb_providers.py

@alcroito alcroito added the C-bug Category: This is a bug. label May 23, 2023
@jyn514 jyn514 added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label May 26, 2023
@jyn514
Copy link
Member

jyn514 commented May 26, 2023

This isn't specific to macOS, right? LLDB also has the same issue on linux and windows?

@alcroito
Copy link
Author

This isn't specific to macOS, right? LLDB also has the same issue on linux and windows?

I believe so, yes.

@werifu
Copy link
Contributor

werifu commented Dec 12, 2023

The hardest challenge to support this feature is the fact that lldb lacks the ability to print enum correctly, while BTreeMap.root has a type of Option<Root<K, V>> . After this commit [lldb] Add basic support to Rust enums in TypeSystemClang , lldb could print enum in Rust. But the latest release llvm 17.0.6 still does not contain this code.

When this feature is release, pretty print for BTreeMap and BTreeSet can be easily implemented by providing SynthesisProvider just like HashMap and HashSet and I'm willing to do this work. Please let me know when it's ready.

Related issue: #79530

Actually, codelldb supports presenting content of an enum value, I guess it is because of RustEnum which generates an FFI type enum in https://github.com/vadimcn/codelldb/blob/master/adapter/scripts/codelldb/codelldb.py
So it should be possible to support BTreeMap and BTreeSet now by adding synthesis providers in rust.py. But now I find it hard to build that project on my mac, I may do this work when I can successfully run codelldb...

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.
Projects
None yet
Development

No branches or pull requests

3 participants