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...

Adjective-Object added a commit to Adjective-Object/good-fences-rs-core that referenced this issue Sep 25, 2024
…tector, clippy) (#80)

## Major Changes:
- updates the `devcontainer` definition to make things more usable:
  - Bases devcontainer off newer version of ubuntu (24.10)
- Fix locale issue causing spacing issue in zsh
(https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-see-duplicate-typed-characters-after-i-complete-a-command)
- Switches to `gdb` as the default debugger, as it supports hashmap
visualization (rust-lang/rust#111868)
- Caches rust packages in a persistent volume to avoid re-downloading
packages between container rebuilds.
- adds a resolver for SWC that is aware of package `exports, to support
custom `source` imports within a monorepo
- adds a deadlock detector for `dashmap` and wires it into the caching
resolver (this is temporary and should be removed in the future)
- Adds a CI job to ensure no unused dependencies are included (using
`cargo-udeps`). This is not included in the container build as it is
_exceptionally_ slow to build from source (~250s on my machine)
- Fixes issues discovered by `cargo clippy`

---------

Co-authored-by: Max Huang-Hobbs <Maxwell.HuangHobbs@microsoft.com>
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