| www.delorie.com/gnu/docs/gcc/gcc_9.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GNU Fortran has various special options that are used for debugging
either your program or g77
-g
A sample debugging session looks like this (note the use of the breakpoint):
$ cat gdb.f
PROGRAM PROG
DIMENSION A(10)
DATA A /1.,2.,3.,4.,5.,6.,7.,8.,9.,10./
A(5) = 4.
PRINT*,A
END
$ g77 -g -O gdb.f
$ gdb a.out
...
(gdb) break MAIN__
Breakpoint 1 at 0x8048e96: file gdb.f, line 4.
(gdb) run
Starting program: /home/toon/g77-bugs/./a.out
Breakpoint 1, MAIN__ () at gdb.f:4
4 A(5) = 4.
Current language: auto; currently fortran
(gdb) print a(5)
$1 = 5
(gdb) step
5 PRINT*,A
(gdb) print a(5)
$2 = 4
...
|
See section `Options for Debugging Your Program or GCC' in Using the GNU Compiler Collection (GCC), for more information on debugging options.
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |