Skip to content

Add LLDB providers for BTreeMap and BTreeSet #140130

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ede1998
Copy link

@ede1998 ede1998 commented Apr 21, 2025

Fixes #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 #126092 and errors with import _lldb (#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.

@rustbot
Copy link
Collaborator

rustbot commented Apr 21, 2025

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 21, 2025
@rust-log-analyzer

This comment has been minimized.

@ede1998 ede1998 force-pushed the add-lldb-btree-providers branch from 687620b to 950f608 Compare April 22, 2025 10:09
@Mark-Simulacrum
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 4, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@ede1998 ede1998 force-pushed the add-lldb-btree-providers branch from e792e29 to bb58d72 Compare May 7, 2025 21:41
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 7, 2025
@rust-log-analyzer

This comment has been minimized.

@ede1998 ede1998 force-pushed the add-lldb-btree-providers branch from bb58d72 to f5148c7 Compare May 9, 2025 20:08
@ede1998 ede1998 force-pushed the add-lldb-btree-providers branch from f5148c7 to 53ef2e0 Compare May 10, 2025 12:49
@ede1998 ede1998 marked this pull request as ready for review May 10, 2025 12:55
@rustbot
Copy link
Collaborator

rustbot commented May 10, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2025
@ede1998
Copy link
Author

ede1998 commented May 10, 2025

@rustbot ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No BTreeMap BTreeSet debug visualizers for lldb / macOS
4 participants