Announcing LLDB for VSCode

Hey rustaceans!

I've just published the first version of LLDB plugin for VSCode.
Those of you who are already using VSCode for Rust coding, may find it a useful addition to RustyCode. It works on Linux, OSX and Windows (if you manage to build LLDB there).

Let me know how it does for you!


"Step over" does always "Step in" for me. This also happens with plain lldb, so it's not a problem with the plugin, but maybe you know why this is the case? Maybe bad debug information?

Also, what's the difference to this plugin?

I think this is related to issues described in PR 33097. LLDB built from the current master branch does not have this problem. Hopefully it will not take too long for the fix to percolate into LLDB shipped with XCode.

Tightness of integration.
Mine uses LLDB's native Python API, whereas the other plugin uses GDB-MI interface. There are some things in LLDB, particularly around variable inspection, that just aren't exposed via GDB-MI. Also, LLDB's implementation of GDB-MI seems to be buggy in places.
All in all, I think that mine provides a better user experience. But you are welcome to disagree :smile:.

1 Like

Hi, thanks for the plugin!

I got one question: can I use this plugin with rust-lldb?

Not directly. Unfortunately, VSCode debug adapters cannot access user/workspace settings, so changing name of the debugger executable would require some editing of the plugin source.

You can insert the three relevant lines as initCommands in the launch configuration though.

Oh wow, I thought rust-lldb is special build of lldb.

$ file `which rust-lldb`
/Users/pepyakin/.cargo/bin/rust-lldb: Mach-O 64-bit executable x86_64

I added initCommands

"initCommands": [
  "command script import \"/Users/pepyakin/.multirust/toolchains/nightly-2016-06-10-x86_64-apple-darwin/lib/rustlib/etc/\"",
  "type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust",
  "type category enable Rust"

However, when lldb stop at breakpoint, command, like > print *self or "Step into" doesn't do anything. If I press "Stop" all entered commands will be printed with result "Cancelled"

> print *self

Also, locals in sidepanel doesn't show up (there is just a eternal activity indicator), and if I wait enough, VSCode will terminate debugging session.

Does rust-lldb itself work with that binary? What does lldb --version output?

Just launched it again and it just worked. Both binaries report lldb-340.4.119.1

Very cool plugin. Make sure you've got the 'six' python module installed or you may get a failure to launch without any details:

For me on a new Ubuntu 16.04 image:

    pip install six```

Update: lldb 360.1.25 shipped with Xcode 8 beta has this bug fixed.

1 Like

Thank you for this extension. Great work!

For people who run into the same issue: printing/viewing variables didn't work for me on OS X, despite setting initCommands. Updating to Xcode 8 beta solved the problem.

Variables seem to work better with XCode 8 but stepping still jumps around like crazy. It seems that line numbers are somehow messed up.

All the time or just in macros? Macro expansions are known to have bad line debug info.

Will this be fixed in Rust?

Looks like LLDB is finally usable on Windows (only *-windows-gnu toolchain for now), so y'all may want to give it a try. Get it here: LLVM Snapshot Builds.


Thanks, those initCommands did the job for me!

Does anyone else get this error immediately after launching or trying to attach?

error: module importing failed: No module named adapter
File "", line 1, in error: module importing failed: No module named adapter

I'm on macOS 10.12.4, XCode 8.3.2, and using rust 1.19.0-nightly (f1140a331 2017-05-08)

Do you have brew or macports python installed?

I have brew installed.

Can you please try launching lldb via this script:

  export PATH=/usr/bin:$PATH
  exec lldb "$@"