Using Debugger Commands and Setting Breakpoints

To find out what happens at critical points in your program, you need to stop execution at these points and look at the contents of program variables to see if they contain the correct values. Points at which the debugger stops program execution are called breakpoints.

To set a breakpoint, use one of the forms of the stop or stopi commands.

Using a sample program, the following debugger commands set a breakpoint at line 4, run the program, continue the program, delete the breakpoint, rerun the program, and return to the shell:

(idb) stop at 4

[#1: stop at "squares.f90":4 ]

(idb) run

[1] stopped at [squares:4 0x120001880]

>   4      OPEN(UNIT=8, FILE='datafile.dat', STATUS='OLD')

(idb) cont

Process has exited with status 0

(idb) delete 1

(idb) rerun

Process has exited with status 0

(idb) quit


 In this example:

Other Debugger Commands

Other debugger commands include the following:

(idb) sh grep FUNCTION data.for
stop in subsort

See also Summary of Debugger Commands.