Skip to content

lldb debugging is not working from version 1.46 #76006

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
douglascorrea opened this issue Aug 27, 2020 · 3 comments · Fixed by #76015
Closed

lldb debugging is not working from version 1.46 #76006

douglascorrea opened this issue Aug 27, 2020 · 3 comments · Fixed by #76015
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@douglascorrea
Copy link

I tried this code:

rust-lldb target/debug/rust-str-vs-string

I expected to see this happen: To be able to use lldb commands as I can if I use lldb directly

Instead, this happened: error: file specified in --source (-s) option doesn't exist: 'lldb_commands'

Meta

rustc --version --verbose:

rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-unknown-linux-gnu
release: 1.46.0
LLVM version: 10.0

The same happens on a macOS machine


I saw that lldb_commands is on src/etc/ directory together with rust-lldb shell script, and I also saw that script calls it directly, but I'm not sure how it should behaves in my machine since the lldb_commands is not there (rustup is not installing it)

I've asked it on Rust users forum, and also in the discord chat, but no answers, so I'm considering it a bug, feel free to close it if it is something wrong with my installation and, if possible, guide me on where should I look to fix it.

@douglascorrea douglascorrea added the C-bug Category: This is a bug. label Aug 27, 2020
@ehuss
Copy link
Contributor

ehuss commented Aug 27, 2020

cc @ortem who introduced lldb_commands in #72357. I also notice the script references $RUSTC_SYSROOT which isn't set anywhere.

@douglascorrea
Copy link
Author

douglascorrea commented Aug 28, 2020

The issue happens because rust-lldb expects lldb_commands and its dependencies resides on the current directory.

Just to let you know that I got it working doing this:

  • Cloned this repo on ~/repos/rust:
  • Edit ~/repos/rust/src/etc/lldb_commands changing the first line to: command script import ./lldb_lookup.py
  • Then run the following to link the files to the current directory:
$ cargo new foobar
$ cd foobar
$ cargo build -v
$ ln -s ~/repos/rust/src/etc/lldb_commands ./
$ ln -s ~/repos/rust/src/etc/lldb_providers.py ./
$ ln -s ~/repos/rust/src/etc/lldb_lookup.py ./
$ ln -s ~/repos/rust/src/etc/lldb_batchmode.py ./
$ rust-lldb rust-lldb target/debug/foobar

@douglascorrea
Copy link
Author

Another important highlight, as @ehuss mentioned, this is a recent change, so 1.45 was working fine and the issue appeared only on 1.46

@jyn514 jyn514 added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Aug 28, 2020
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 28, 2020
@LeSeulArtichaut LeSeulArtichaut added the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Aug 28, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Aug 29, 2020
…acrum

Fix loading pretty-printers in rust-lldb script

Pretty-printers loading in `rust-lldb` script was broken in rust-lang#72357

This fixes rust-lang#76006
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Aug 29, 2020
…acrum

Fix loading pretty-printers in rust-lldb script

Pretty-printers loading in `rust-lldb` script was broken in rust-lang#72357

This fixes rust-lang#76006
@bors bors closed this as completed in 063313b Aug 30, 2020
@jyn514 jyn514 removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 28, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants