So I'm trying to do some debugging with gdb and noticed that setting my breakpoint at main() seems to be ignored by the debugger, it just goes ahead and executes the whole program when I give gdb the run command.
I did some research and apparently this is caused by Rust having a different main() function that actually executes the main() of your program. But based on the thread I was reading on this forum, that issue has already been fixed?
I've just upgraded gdb to 8.1, which supposedly has Rust support, and I'm still running into this problem. Setting the breakpoint at program_name::main is a quick workaround though.
Now if only I could figure out how to get gdb inside emacs to not keep displacing the buffers I want (my gdb command line, the source line I am stopped at) with their input/output buffer every time I println anything. But this isn't a rust issue...
I just use Ctrl-x o within gdb to display the surrounding Rust code. Pressing it again allows you to scroll, and to go back to the command line, press it again ...
Another really nice option for viewing the source while debugging is cgdb. It’s a curses wrapper around gdb. I never use gdb, even when debugging embedded rust over JTAG.