I am trying to debug a Rust application using VSCode, but I am unable to inspect any local variables or use the watch window (see attached).
All breakpoints work fine, I just cannot view any variables, etc.
The LLDB is what is shown in VSCODE plugin, but when I do lldb --version
from the terminal it says: lldb version 3.8.0 ( revision )
.
I get no errors when starting lldb from the terminal. All breakpoints are hit while debugging, I just cannot see any of the variable values.
For the sake of completeness, I verified python scripting support as a Prerequisite listed on: https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
**
python-lldb-3.8 is already the newest version
**
Install the rust-analyzer extension# You can find and install the rust-analyzer extension from within VS Code via the Extensions view (Ctrl+Shift+X) and searching for 'rust-analyzer'. You should install the Release Version.
In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch. json . And it will open the launch.
Set breakpoints in source code To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.
The correct solution was to install LLDB 3.9. I can now inspect local variables, use the watch window, and see values via tooltips.
Here are the steps:
sudo apt-get install python-lldb-3.9
llvm-3.9
(instead of just llvm
) then VSCode may not recognize it and complain that LLVM is not installed or supported. My solution (yours may vary) was to remove then reinstall the VSCode extensions "LLDB Debugger 0.7.3" and "Native Debug 0.21.2"Once this was done and VSCode was restarted, I started to debug with F5 then VSCode gave me an alert that a different LLDB was found (3.9) and asked to update to new executable - say yes and you should be good to go.
Results:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With