简体   繁体   English

在 Clion 中调试 Rust 导致“错误创建过程”

[英]Debugging Rust in Clion results in "Error creating process"

I'm new to rust and would like to debug my Rust code using Clion (19.3 currently) and followed this answer to switch the compiler from MSVC to GNU, Now when I run my program (in debug) I get this error from Clion:我是 rust 新手,想使用Clion (当前为 19.3)调试我的 Rust 代码,并按照此答案将编译器从 MSVC 切换到 GNU,现在当我运行我的程序(在调试中)时,我从 Clion 收到此错误:

com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: Error creating process <Program Path>, (error 50).

Though running without debugging works fine.虽然在没有调试的情况下运行可以正常工作。

If I google the error I get this issue on github which essentially says use a 64bit compiler on a 64bit app.如果我用谷歌搜索错误,我会在 github 上遇到这个问题,它实际上是说在 64 位应用程序上使用 64 位编译器。 The compiler I added is 64 bit and since I installed the 64 bit version of rust I assume that the programs that it outputs are 64bit... (though I don't know enough about rust to be 100% sure)我添加的编译器是 64 位的,因为我安装了 64 位版本的 rust,所以我假设它输出的程序是 64 位的......(虽然我对 rust 的了解不够,无法 100% 确定)

Running rustup show returns this:运行rustup show返回:

rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\User\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-gnu (default)
stable-x86_64-pc-windows-msvc

active toolchain
----------------

stable-x86_64-pc-windows-gnu (default)
rustc 1.42.0 (b8cedc004 2020-03-09)

Which is where I'm getting the idea that the correct toolchain is being used (as it says x86_64 all over the place).这就是我得到使用正确工具链的想法的地方(因为它到处都是x86_64 )。

Where as I going wrong?我哪里出错了? and what is miss configured?什么是小姐配置?

Turns out that I'm super dumb and had the Clion pointing at a 32 bit install rather than the 64 bit install.事实证明,我非常愚蠢,并且让 Clion 指向 32 位安装而不是 64 位安装。 I ended up following this guide by Jetbrains themselves: https://blog.jetbrains.com/clion/2019/10/debugging-rust-code-in-clion/我最终遵循了 Jetbrains 自己的本指南: https : //blog.jetbrains.com/clion/2019/10/debugging-rust-code-in-clion/

On Windows, go to Settings |在 Windows 上,转到设置 | Build, Execution, Deployment |构建、执行、部署 | Toolchain and set either Cygwin or MinGW as your working environment.工具链并将 Cygwin 或 MinGW 设置为您的工作环境。 Then, run rustup toolchain list and check the first line: it should be one of the gnu versions matching the bitness of the debugger.然后,运行 rustup toolchain list 并检查第一行:它应该是与调试器位数匹配的 gnu 版本之一。 For example, if you're working on MinGW (32-bit), the default toolchain should be i686-pc-windows-gnu.例如,如果您正在使用MinGW(32 位),则默认工具链应为 i686-pc-windows-gnu。 If you're on MinGW64, it should be x86_64-pc-windows-gnu .如果你在MinGW64 上,它应该是 x86_64-pc-windows-gnu You can set the appropriate toolchain by running rustup default "toolchain_name".您可以通过运行 rustup default "toolchain_name" 来设置适当的工具链。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM