Getting started:
I have to mv .emacs file to another name since I seem to have a
conflict with the gdb mode and since I intend to use emacs as a
interface to the debugger.
I compile my executable with DEBUG=yes and NO_FIX=yes in my makefile.
(this worked on oas but not on spur)
M-xstarts the emacs debug mode.
At prompt I enter the executable file name, eg myprog.x
Help:
Type help at gdb prompt shows help categories. help data displays the commands of the data category, for
example. help print explains the specific command.
Break point:
To set a break point at a subroutine type break mysub
where mysub is a subroutine in the program. Be aware
that the SEP preprocessor often change names to mysubtempall.
To set a break point at a line, you type break mysub.f:37.
where 37 is a suitable line in the
source file mysub.f.
(To find the line number, load the source file into emacs,
move to the line, and type C-x l:
emacs tells you the total number of lines, the line number you are at
and the remaining number of lines in the file.)
To remove a breakpoint type delete 2 for the second breakpoint
set. The breakpoint number is mentioned when breakpoint is
established.
Execution:
To execute the executable type
run myprog.x < input.H n1=5 > output.H
To step through the program, the program first has to halt at a
breakpoint.
To type step (or simply s)
steps into the next line or subroutine.
To type next executes the next line
but does not step in subroutine.
Inspection of data: print a1 prints variable value of a1.
print aa[0][0][0] prints the first variable value of array aa.