I'm having a problem with debugging Fortran code within emacs using gdb.
Gdb starts up fine and the program loads OK and stops on the first breakpoint, which I set at the beginning main
. Then when I type n
to go to the next line, the program proceeds to run all the way through (as if I typed c
), instead of going to the next line. To get around this, I set another breakpoint further down. After hitting c
, (at the first breakpoint in main
) the code skips to and stops at the latter breakpoint (which is what I want).
However, at this point, I can no longer enter gdb commands, as the source code has moved to the top window, and the output to the bottom window (whereas normally all the gdb input commands and program output occur in the top window, and the source code being traversed through on the bottom). So now at this point, when I enter gdb commands, it becomes part of the source code and I cannot navigate through it with n
and c
and such - instead the code has a bunch of n
's an c
's in it!
I'm running Fedora 18, and GNU Emacs 24.3.1. Also, to run gdb in emacs, it insists I use the switch -i=mi
. After I hit M-x gdb
, the line at the bottom pops up as: Run gdb (like this): gdb -i=mi ...
. I tried playing around with the switches, such as -annotate=3
to no avail.