0

I am working on Rust and I am debugging with gdb (MinGW64, I am working on msw).

I saw in the .cargo folder (.cargo/bin) many executables:

   Directory of C:\Users\me\.cargo\bin

24/06/2024  19:37    <DIR>          .
24/06/2024  19:37    <DIR>          ..
24/06/2024  18:48         8,949,760 cargo-clippy.exe
24/06/2024  18:48         8,949,760 cargo-fmt.exe
24/06/2024  18:48         8,949,760 cargo-miri.exe
24/06/2024  18:48         8,949,760 cargo.exe
24/06/2024  18:48         8,949,760 clippy-driver.exe
24/06/2024  18:48         8,949,760 rls.exe
24/06/2024  18:48         8,949,760 rust-analyzer.exe
24/06/2024  18:48         8,949,760 rust-gdb.exe
24/06/2024  18:48         8,949,760 rust-gdbgui.exe
24/06/2024  18:48         8,949,760 rust-lldb.exe
24/06/2024  18:48         8,949,760 rustc.exe
24/06/2024  18:48         8,949,760 rustdoc.exe
24/06/2024  18:48         8,949,760 rustfmt.exe
24/06/2024  18:48         8,949,760 rustup.exe

My question is on the following ones:

24/06/2024  18:48         8,949,760 rust-gdb.exe
24/06/2024  18:48         8,949,760 rust-gdbgui.exe

I could not find what specifically are.

Can someone explain me how to use them, if I can, instead (or with) mingw64 gdb?


Here's what I tried:

I don't think they are a Rust version of gdb, when I run both of them I get the following message:

C:\Users\me\.cargo\bin>rust-gdb.exe
error: the 'rust-gdb.exe' binary, normally provided by the 'rustc' component, is not applicable to the 'stable-x86_64-pc-windows-gnu' toolchain

even if I add an executable as argument, I get the same error.

And with the rust-gdbgui.exe, is it intended for GUIs of editors?

6
  • This ticket seems related.
    – ssbssa
    Commented Jul 7 at 13:29
  • They are wrappers around GDB and GDBGUI with scripts tailored for Rust. Commented Jul 7 at 14:07
  • But how can I use them? If I call rust-gdb MyProgram, I cannot debug like with gdb. What are they meant for? Can I debug with them, or how can I use them?
    – mgrs_
    Commented Jul 7 at 16:25
  • You use them the same you would gdb itself, if you can't use them that way, then there is something wrong with your setup. I don't have a Windows machine to try to reproduce your error though.
    – cafce25
    Commented Jul 8 at 7:51
  • rust-gdb.exe is just a wrapper that redirects to the corresponding file in the current toolchain (e.g. c:\Users\me\.rustup\toolchains\stable-x86_64-pc-windows-gnu\bin\rust-gdb) but the latter is a bash shell script, so won't work in plain Windows. The wrapper doesn't work in MSYS2 consoles either, but the plain script should: /c/Users/me/.rustup/toolchains/stable-x86_64-pc-windows-gnu/bin/rust-gdb
    – Jmb
    Commented Jul 8 at 9:36

0

Browse other questions tagged or ask your own question.