windows - 尝试通过 LLDB 运行 Rust 程序时出现 "process launch failed: unknown error"

标签 windows rust lldb

我无法在 Windows 10 上使用 LLDB 启动 Rust 二进制文件:

> 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 适用于我系统上的其他可执行文件,例如:

> 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 和 Rust 都是全新安装。

有没有办法从 LLDB 获取更多关于它为什么不工作的信息?

最佳答案

我不相信你可以使用 LLDB 在 Windows 上调试 64 位 Rust 程序。

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.

以及 Visual Studio Code states 的 LLDB 扩展(强调我的):

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.

因此,在这个时间点,我不建议尝试使用 LLDB。由于您已经安装了 MSVC 工具链,我建议您研究安装一些 native 的东西,例如 WinDbg :

WinDbg on 64-bit Rust program

关于windows - 尝试通过 LLDB 运行 Rust 程序时出现 "process launch failed: unknown error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49847553/

相关文章:

xcode - 如何停止不带选项的自动完成XCode调试器?

r - CRAN 发现警告 R CMD check --as-cran does not

正则表达式匹配两个相同的连续字符

ios - BOOL 属性返回错误的 BOOL 结果

Rust Book 12.3 - Unresolved 导入错误 [E4032]

rust - 如何实现 future 功能的流

swift - LLDB 无法检查变量(在 Xcode 中)

c - 如何在 Windows 的文件系统驱动程序中查找 PNP 设备 ID

c - 从 Windows 到 Linux 的语法错误 Fluent UDF

PHP exec 或 shell_exec 未在 Windows Wamp 上返回进程 ID (PID)