rustup icon indicating copy to clipboard operation
rustup copied to clipboard

rust-gdb and rust-lldb not working using stable-x86_64-pc-windows-gnu' toolchain

Open PietroValerio opened this issue 3 years ago • 8 comments

Problem

expected debugget output but this message pops up the 'rust-gdb.exe' binary, normally provided by the 'rustc' component, is not applicable to the 'stable-x86_64-pc-windows-gnu' toolchain

Steps

1.type rustup-gdb or rustup-lldb

Possible Solution(s)

Notes Operating system:Windows 10 pro version 10.0.19042 Build 19042 Using mingw-64 Output of rustup --version: rustup 1.24.3 (ce5817a94 2021-05-31) Output of rustup show: Default host: x86_64-pc-windows-gnu stable-x86_64-pc-windows-gnu (default) rustc 1.54.0 (a178d0322 2021-07-26)

PietroValerio avatar Aug 11 '21 15:08 PietroValerio

I think (maybe) the issue is that rustup is assuming all executables end with .exe here, but scripts like rust-gdb are shell scripts which do not have the extension.

ehuss avatar Aug 31 '21 16:08 ehuss

Certainly on Windows we blindly append the extension .exe -- perhaps

  1. we should use PATHEXT rather than always assuming .exe
  2. we should consider how to have rust-gdb and rust-lldb scripts which will work on native Windows and then give the new scripts appropriate extensions.

Failing that, I suppose we could detect the missing executable, but the fact that the component is already installed and present a better error message.

kinnison avatar Oct 09 '21 09:10 kinnison

Same issue ...

D:\RustTest01>rust-lldb
error: the 'rust-lldb.exe' binary, normally provided by the 'rustc' component, is not applicable to the 'stable-x86_64-pc-windows-msvc' toolchain
D:\RustTest01>which rust-lldb
/d/Programs/Rust/.cargo/bin/rust-lldb

prdas31 avatar Oct 17 '21 14:10 prdas31

Based on the link, I am able to debug rust in windows with rust-gdb in Visual Studio Code using the below configuration,

{
            "type": "gdb",
            "request": "launch",
            "name": "Debug Launch",
            "target": "${workspaceRoot}/target/debug/${workspaceRootFolderName}.exe",
            "cwd": "${workspaceRoot}",
            "valuesFormatting": "parseText",
            "gdbpath": "C:/Users/selva/.cargo/bin/rust-gdb.cmd",
            "preLaunchTask": "cargo build (stable-gnu)",
        }

But the pretty printer is not working. It is showing address instead of string.

selvavm avatar Jan 28 '22 17:01 selvavm