I cannot set a breakpoint on a specific line in a preprocessed fortran file: [taschna@localhost gdbtest]$ cat main.F PROGRAM Test IMPLICIT NONE WRITE(*,*) 'Hello World' END [taschna@localhost gdbtest]$ gfortran -g -save-temps main.F -o main [taschna@localhost gdbtest]$ gdb main GNU gdb Red Hat Linux (6.3.0.0-1.84rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) l 1 # 1 "main.F" 2 # 1 "/home/taschna/gdbtest//" 3 # 1 "<built-in>" 4 # 1 "<command line>" 5 # 1 "main.F" 6 PROGRAM Test 7 IMPLICIT NONE 8 9 WRITE(*,*) 'Hello World' 10 (gdb) b 9 No line 9 in file "main.f". Using the same file without the preprocessing works fine: [taschna@localhost gdbtest]$ cp main.F main.f [taschna@localhost gdbtest]$ gfortran -g -save-temps main.f -o main [taschna@localhost gdbtest]$ gdb main . . . (gdb) l 1 PROGRAM Test 2 IMPLICIT NONE 3 4 WRITE(*,*) 'Hello World' 5 6 END (gdb) b 4 Breakpoint 1 at 0x8048602: file main.f, line 4.
According to the comments in the gdb bug database for fortran/2048 (http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit- trail&database=gdb&pr=2048) this is a bug in gfortran, therefore changing the component tag of this bug.
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01957.html
Should be fixed in gcc-4.1.0-0.14.