Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDB doesn't find debugging symbols in Rust executable

This is my Cargo.toml with debugging settings:

[package] 
name = "rpolysolve" 
version = "0.1.0" 
authors = ["stiv"]

[dependencies] 
[profile.dev] 
debug = true  
opt-level = 0

As I can see from console output, cargo has not removed debug symbols:

Finished dev [unoptimized + debuginfo] target(s) in 5.66 secs

I have downloaded gdb-7.9.1-tdm64-2 to my C:\gdb-7.9.1-tdm64-2 folder on windows7. Now I try to launch it with this command from project folder:

C:\gdb-7.9.1-tdm64-2\gdb64\bin\gdb.exe ./target/debug/rpolysolve.exe

GNU gdb (GDB) 7.9.1
... GNU blablabla cut here ...
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./target/debug/rpolysolve.exe...(no debugging symbols found)...done.

As you see it says no debugging symbols found and there is now way how I can set a breakpoint. How can I fix this?

like image 512
Stepan Yakovenko Avatar asked Oct 18 '22 07:10

Stepan Yakovenko


1 Answers

Ok, the solution is to switch toolchain, i.e. to make binaries be compatible with GNU:

rustup install stable-gnu 
rustup default stable-gnu

I don't know if there is gdb.exe for msvc toolchain.

like image 125
Stepan Yakovenko Avatar answered Oct 21 '22 01:10

Stepan Yakovenko