-
Notifications
You must be signed in to change notification settings - Fork 253
Windows
On Windows, there are two ABIs in common use, each with a specific native debug information format: the "MSVC" ABI, used by Microsoft toolchains with the PDB debug information format, and the "GNU" ABI, which originated from Unix toolchains like GCC and LLVM, utilizing the DWARF debug information format.
LLDB supports both formats; however, PDB support remains inferior to DWARF and may be buggy, potentially causing debugger crashes. For this reason, using DWARF (and therefore, the GNU ABI) is recommended whenever possible.
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:
-
Use the
x86_64-pc-windows-gnu
toolchain to compile your Rust project: This option ensures full LLDB visualization support for Rust types. -
Compile with the
x86_64-pc-windows-msvc
toolchain but use LLDB formatters fromx86_64-pc-windows-gnu
: To use this option, install thex86_64-pc-windows-gnu
toolchain viarustup toolchain install stable-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": "stable-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.
CodeLLDB works in WSL2 instances but not in WSL1, as it does not implement certain syscalls required by LLDB.