-
Notifications
You must be signed in to change notification settings - Fork 13.3k
No BTreeMap BTreeSet debug visualizers for lldb / macOS #111868
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
Comments
This isn't specific to macOS, right? LLDB also has the same issue on linux and windows? |
I believe so, yes. |
The hardest challenge to support this feature is the fact that lldb lacks the ability to print enum correctly, while 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 |
…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>
I got something working on Linux. Don't have macOS to cross test it though: https://github.com/ede1998/btreemap-debug/compare/27851762d6a33e21223c5e811f1688a8bf20f9f7..master Planning to turn it into a proper PR in the next few days. It works on the terminal with Output on command line
The output on the command line is a bit lengthy but it should be the same as with a |
…r=Mark-Simulacrum Add LLDB providers for BTreeMap and BTreeSet Fixes rust-lang#111868. I'm unsure what the supported LLDB versions for `rust-lldb` are. I tested with LLDB 18 and 19 and it works with those but I know that it does not work with LLDB 14 which was picked by my `codelldb` extension for some reason (even though it packages LLDB 19). I also had to work around what seems like an LLDB bug to me. Otherwise, I'd have kept the code more similar to the GDB provider. `SBTarget.FindFirstType()` does not find the types that I'm searching for (`LeafNode<i32, i32>*`): ``` target = node.GetTarget() print("leaf type:", node.GetType()) internal_type = target.FindFirstType(node.GetType().GetName()) print("Actual type:", internal_type) ``` which prints ``` leaf type: struct alloc::collections::btree::node::LeafNode<int, int> * Actual type: No value ``` All in all, my experience with LLDB debug provider was very fiddly/they seem to break easily but I think it would be better to have `BTreeMap`/`BTreeSet` providers than not have them. Getting to run the `debuginfo` tests was a pain too because of rust-lang#126092 and errors with `import _lldb` (rust-lang#123621). I ended up re-compling lldb from source against python 3.10 because the tests don't work if lldb is compiled against python 3.12. Also, it seems like the tests are not run in CI? At least I had a test commit in the PR before to trigger a `debuginfo` test failure which I didn't see here in my PR.
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
The text was updated successfully, but these errors were encountered: