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