rust-analyzer: Could not debug, lldb

rust-analyzer version: (eg. output of “rust-analyzer: Show RA Version” command, accessible in VSCode via <kbd>Ctrl/⌘</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>) rust-analyzer version: 0.3.2188-standalone (ba56d9b9b 2024-11-17) [c:\Users\matth.vscode\extensions\rust-lang.rust-analyzer-0.3.2188-win32-x64\server\rust-analyzer.exe] rustc version: (eg. output of rustc -V) rustc 1.82.0 (f6e511eec 2024-10-15) editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable) VSCode relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME) … repository link (if public, optional): (eg. rust-analyzer) … code snippet to reproduce: Could not find LLDB data formatters in your Rust toolchain, and after installing it, the same message appears again

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Ah, https://github.com/vadimcn/codelldb/wiki/Windows#debugging-rust-on-windows talks about this, quoting:

Debugging Rust on Windows

The default toolchain installed on Windows by Rustup is the x86_64-pc-windows-msvc toolchain. This toolchain does not include Rust-specific formatters for LLDB, as it is assumed that users will primarily use WinDbg or Microsoft Visual Studio’s debugger for this target. If you prefer to use CodeLLDB for debugging, you have two options:

  1. Use the x86_64-pc-windows-gnu toolchain to compile your Rust project: This option ensures full LLDB visualization support for Rust types.

  2. Compile with the x86_64-pc-windows-msvc toolchain but use LLDB formatters from x86_64-pc-windows-gnu: To use this option, install the x86_64-pc-windows-gnu toolchain via rustup toolchain add x86_64-pc-windows-gnu. Then, configure CodeLLDB to load its formatters by adding the following entry to your workspace configuration: "lldb.script": { "lang.rust.toolchain": "x86_64-pc-windows-gnu" }

    Note that this setup is less ideal due to differences in the debug information layout emitted by the Rust compiler for enum data types when targeting MSVC, which means enums may not be visualized correctly. However, LLDB formatters will work for standard collections like strings and vectors.

For more information on Rust toolchains for Windows, see the Rustup Installation Guide for Windows.

I’ll close this as this is not a rust-analyzer issue

Just here to add, I’m also seeing this issue. Also using rust-analyzer/CodeLLDB

it starts the debug, and another message shows, This version of LLDB has no plugin for the language "rust". Inspection of frame variables will be limited.