------- Comment #1 from burnus at gcc dot gnu dot org 2007-11-20 11:34 ------- The problem is that you end up in the wrong file. If you enter "break 3" you are debugging the wrapping program not the Fortran "program test", which is the reason that there is no "i" available.
Try: break file.f:line, e.g. (gdb) b b.f:2 However, there is another problem: One cannot set the break point after the assignment: program test ! Breakpoint possible i = 1 ! Breakpoint possible ! Breakpoint here ! No breakpoint possible end ! No breakpoint possible Setting a breakpoint in line 2, one can print the value "i" before the assignment; however, doing a "step" one ends in the wrapping main() program and can thus never read the value after the assignment. Using g77 or ifort, one can set a break point in line 3 or 4 and gdb shows then: Breakpoint 1, test () at b.f:4 4 end -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- GCC host triplet|i386-apple-darwin | Summary|Unable to debug code |Debugging: Cannot set |compiled with gfortran on |breakpoint in comment lines |MacOSX 10.4.11 |or "END PROGRAM" http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34153