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

rust-lldb fails to load on LLDB 8.0.0 #65344

Open
zmitchell opened this issue Oct 12, 2019 · 6 comments
Open

rust-lldb fails to load on LLDB 8.0.0 #65344

zmitchell opened this issue Oct 12, 2019 · 6 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@zmitchell
Copy link

When I run rust-lldb I get the following error:

$ rust-lldb target/debug/myprogram
(lldb) command script import "/Users/zmitchell/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py"
error: module importing failed: loading unimplemented

I'm not sure where to begin debugging this issue. Is it a problem with the Python version used by lldb? Is it an error in the lldb_rust_formatters.py script?

This is on macOS 10.15, though I had the problem on 10.14 as well. I have rustup 1.19.0, lldb 8.0.0, and the 1.38.0 stable toolchain.

Is there anything you'd recommend looking at or do you have any other guidance?

@Mark-Simulacrum
Copy link
Member

Just to check, that file exists, right?

Other than that not sure really how to debug this. Which version of python are you using?

@Mark-Simulacrum Mark-Simulacrum added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Oct 12, 2019
@zmitchell
Copy link
Author

That file does exist. I'm using Python 3.7.2 installed via pyenv.

@pnkfelix pnkfelix changed the title rust-lldb fails to load rust-lldb fails to load on LLDB 8.0.0 Dec 19, 2022
@pnkfelix
Copy link
Member

Visiting for wg-debugging triage

Our best guess (see conversation here) is that this has to do with a change in LLDB 8.

First step would probably be for one of the local developers to replicate the problem locally (or check if it has been resolved, somehow).

@pnkfelix
Copy link
Member

This thread for crystal-lang ran into same issue ("(lldb) command script import /Users/xxx/Work/crystal/etc/lldb/crystal_formatters.py error: module importing failed: loading unimplemented.")

and its filled with lots of ideas of things to investigate

https://forum.crystal-lang.org/t/debugger-support/1325/162

@pnkfelix
Copy link
Member

@rustbot label: P-medium

@rustbot rustbot added the P-medium Medium priority label Dec 19, 2022
@zmitchell
Copy link
Author

As followup I no longer see an issue. This is my system configuration now:
macOS 12.3.1 on M1 Max

$ rust-lldb --version
lldb-1316.0.9.41
Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
$ rustc -V
rustc 1.65.0 (897e37553 2022-11-02)

Loading a brand new binary crate works just fine:

$ cargo new --bin lldb_test
$ cd lldb_test; cargo build
$ rust-lldb target/debug/lldb_test
(lldb) command script import "/Users/zmitchell/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/etc/lldb_lookup.py"
(lldb) command source -s 0 '/Users/zmitchell/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/etc/lldb_commands'
Executing commands in '/Users/zmitchell/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/etc/lldb_commands'.
(lldb) type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)String$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^&(mut )?str$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^&(mut )?\\[.+\\]$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(std::ffi::([a-z_]+::)+)OsString$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)Vec<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)VecDeque<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)BTreeSet<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)BTreeMap<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(std::collections::([a-z_]+::)+)HashMap<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(std::collections::([a-z_]+::)+)HashSet<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)Rc<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(alloc::([a-z_]+::)+)Arc<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(core::([a-z_]+::)+)Cell<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(core::([a-z_]+::)+)Ref<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(core::([a-z_]+::)+)RefMut<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^(core::([a-z_]+::)+)RefCell<.+>$" --category Rust
(lldb) type summary add -F lldb_lookup.summary_lookup  -e -x -h "^core::num::([a-z_]+::)*NonZero.+$" --category Rust
(lldb) type category enable Rust
(lldb) target create "target/debug/lldb_test"
Current executable set to '/Users/zmitchell/code/lldb_test/target/debug/lldb_test' (arm64).

@Nilstrieb Nilstrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
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.) P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants