Hi, I have some troubles using gdb with rust. What I do:
cargo new hello_world --bin
cd hello_world
cargo build
[rust-]gdb target/debug/hello_world
If i then enter start and open source layout with C-x a, then all I see is "no source available". Single-stepping through the program with next doesn't seem to work for me either.
I see this on both Arch (gdb 7.12) and Fedora 24 (gdb 7.11.1). I suppose this is not expected behavior. What am I missing? What am I doing wrong? Do I have something misconfigured?
What's happening here is that rust provides its own main that then calls your hello_world::main. However, the provided main doesn't have debugging information in your case. This prevents next from working in gdb.
You found a good workaround. I also sometimes just put a breakpoint where I'm interested in debugging before run (and avoiding start).