【问题标题】:"process launch failed: unknown error" when trying to run Rust program via LLDB尝试通过 LLDB 运行 Rust 程序时出现“进程启动失败:未知错误”
【发布时间】:2018-09-25 14:48:48
【问题描述】:

我无法在 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 获得更多关于它为什么不工作的信息?

【问题讨论】:

标签: windows rust lldb


【解决方案1】:

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

LLDB home page states

  • i386 的 Windows 本地用户空间调试 (*)

(*) 对 Windows 的支持正在积极开发中。基本的 功能有望工作,功能改进 很快。

还有Visual Studio Code states 的 LLDB 扩展(重点是我的):

目前,已知 LLDB 的 Windows 端口只能可靠地工作 带有 32 位二进制文​​件和 DWARF 调试信息:

  • LLDB 对 MSVC .PDB 调试信息格式的支持不完整。只有 DWARF 调试信息才能可靠地工作。
  • 64 位 LLDB 非常不稳定,所以我不推荐使用它。不幸的是,32 位调试器仅限于调试 32 位 仅处理。

实际上,以上意味着对于 C++ 程序,您需要 使用 i686 MinGW 工具链(不是 MSVC!)编译。 对于 Rust,您需要 使用 i686-pc-windows-gnu.

因此,在这个时候,我不建议尝试使用 LLDB。既然你已经安装了 MSVC 工具链,我建议你研究安装一些原生的东西,比如WinDbg:

【讨论】:

    猜你喜欢
    • 2018-03-30
    • 1970-01-01
    • 2020-09-26
    • 2014-11-19
    • 2014-11-02
    • 1970-01-01
    • 1970-01-01
    • 2021-12-16
    • 1970-01-01
    相关资源
    最近更新 更多