"process launch failed: unknown error" when trying to run Rust program via LLDB

Xavier Shay

I am unable to launch Rust binaries with LLDB on Windows 10:

> cat test.rs
fn main() {
    println!("hello");
}
> rustc --version --verbose
rustc 1.25.0 (84203cac6 2018-03-25)
binary: rustc
commit-hash: 84203cac67e65ca8640b8392348411098c856985
commit-date: 2018-03-25
host: x86_64-pc-windows-msvc
release: 1.25.0
LLVM version: 6.0
> rustc -g test.rs
> .\test.exe
hello
> lldb --version
lldb version 6.0.0 (https://github.com/llvm-mirror/lldb.git revision 38001b27c9f319a3112271ca44fa0e1912583570)
  clang revision b3bac44cb354b63214b16fab24b5c0ffd392ec02
  llvm revision bbbe81ad6ad6db7ccb332df1f1932a5589a7eeca
> lldb test.exe
(lldb) target create "test.exe"
Current executable set to 'test.exe' (x86_64).
(lldb) process launch
error: process launch failed: unknown error

LLDB works fine for other executables on my system, for example:

> lldb C:\Windows\system32\cmd.exe
(lldb) target create "C:\\Windows\\system32\\cmd.exe"
Current executable set to 'C:\Windows\system32\cmd.exe' (i686).
(lldb) process launch
Process 15944 launching
(lldb) Process 15944 launched: 'C:\Windows\system32\cmd.exe' (i686)

LLDB and Rust are both fresh installs.

Is there a way to get more information from LLDB about why it isn't working?

Shepmaster

I do not believe you can use LLDB to debug a 64-bit Rust program on Windows.

The LLDB home page states:

  • Windows local user-space debugging for i386 (*)

(*) Support for Windows is under active development. Basic functionality is expected to work, with functionality improving rapidly.

And the LLDB extension for Visual Studio Code states (emphasis mine):

At the moment, Windows port of LLDB is known to work reliably only with 32-bit binaries and DWARF debug info:

  • LLDB's support of MSVC .PDB debug info format is incomplete. Only DWARF debug info works reliably.
  • The 64-bit LLDB is very unstable, so I cannot recommend using it. Unfortunately, 32-bit debuggers are limited to debugging 32-bit processes only.

In practice, the above means that for C++ programs, you'll need to compile with i686 MinGW toolchain (not MSVC!). For Rust you'll need to use i686-pc-windows-gnu.

Thus, at this point in time, I would not recommend attempting to use LLDB. Since you have installed the MSVC toolchain, I advise you to investigate installing something native, such as WinDbg:

WinDbg on 64-bit Rust program

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

TOP Ranking

HotTag

Archive