简体   繁体   English

在CLion中使用WSL工具链时如何启用生锈调试?

[英]How to enable rust debugging when using WSL toolchain in CLion?

I am new to rust and I am using CLion and the rust plugin from JetBrains on Windows now. 我对锈是陌生的,现在我正在Windows上使用CLion和JetBrains的锈插件。 It works well when I just compile and run. 当我只是编译并运行时,它运行良好。 But when I start debugging, it shows a dialog like this even though I switch my toolchain to WSL. 但是,当我开始调试时,即使我将工具链切换到WSL,它也会显示这样的对话框。

WSL工具链设置的屏幕截图

错误对话框的屏幕截图

I wonder whether WSL is a kind of GNU toolchain. 我想知道WSL是否是一种GNU工具链。 And if it is, what should I do to enable rust debugging? 如果是的话,我应该怎么做才能启用锈调试? Thanks. 谢谢。

Rust provides two kinds of Tier 1 toolchains for the Windows operating system: pc-windows-msvc and pc-windows-gnu (for i686 and x864_64 architectures, making 4 toolchains in total). Rust为Windows操作系统提供了两种Tier 1工具链pc-windows-msvcpc-windows-gnu (用于i686x864_64体系结构,总共制作了4条工具链)。 Their differences are highlighted here: What are the differences between the GNU and MSVC Rust toolchain? 它们的区别在这里突出显示: GNU和MSVC Rust工具链之间有什么区别?

WSL requires you to use the GNU toolchain. WSL要求您使用GNU工具链。 With Rustup, you can install it and make it the default (or configure it in your IDE of choice): 使用Rustup,您可以安装它并将其设置为默认值(或在所选的IDE中对其进行配置):

rustup toolchain add stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu

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

相关问题 使用VS Code和MSVC工具链调试Rust程序时,如何在“ panic”处设置断点? - How can I set a breakpoint at a `panic` when debugging a Rust program with VS Code and the MSVC toolchain? 使用 clion 调试 rust 时,如何修复奇怪的非 ascii 字符动态 linker 错误? - How can I fix weird non-ascii character dynamic linker errors when debugging rust with clion? 调试 Rust 代码时,CLion 是否可以评估 function? - Does CLion possible evaluate a function when debugging Rust code? 在 Clion 中调试 Rust 导致“错误创建过程” - Debugging Rust in Clion results in "Error creating process" 如何为特定的 rustup 工具链安装 Rust 目标? - How to install a Rust target for a specific rustup toolchain? 如何确定我的Rust编译器正在使用哪个Windows工具链? - How do I tell which Windows toolchain my Rust compiler is using? 如何在浏览器中调试WebAssembly时看到Rust源码? - How to see Rust source code when debugging WebAssembly in a browser? 在使用GDB调试Rust程序时,如何使用格式打印? - How can I print with formatting when debugging a Rust program with GDB? Rust“工具链”到底是什么? - What exactly is a Rust “toolchain”? Rust 工具链位置 - Fedora 35 - Rust Toolchain location - Fedora 35
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM