Sorry guys - I don't know if any of this should work, but I tried to use gdb with limited success - if the subroutine argument values would have printed, gdb would have been working well enough to be useful. [dir:~/tests/gfortran] dir% gfortran -g -o debug debug.f [dir:~/tests/gfortran] dir% gdb debug GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16 21:42:28 GMT 2004) Copyright 2003 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 "powerpc-apple-darwin". Reading symbols for shared libraries ..... done (gdb) break sub1_ Breakpoint 1 at 0x1c90: file ../../../gcc/libgfortran/runtime/error.c, line 275. (gdb) break sub1 Function "sub1" not defined. (gdb) run Starting program: /Users/dir/tests/gfortran/debug Reading symbols for shared libraries ++. done Error in re-setting breakpoint 1: Function "sub1_" not defined. Re-enabling shared library breakpoints: 1 Breakpoint 1, 0x00001c90 in sub1_ (a=Invalid F77 type code 17 in symbol table. ) at debug.f:5 5 subroutine sub1(a,b) (gdb) s Current language: auto; currently fortran sub1_ (a=Invalid F77 type code 17 in symbol table. ) at debug.f:6 6 i=3 (gdb) s 7 write(*,*)a,b (gdb) print a $1 = (Invalid type code (17) in symbol table. (gdb) print b $2 = (Invalid type code (17) in symbol table. (gdb) quit The program is running. Exit anyway? (y or n) y [dir:~/tests/gfortran] dir% cat debug.f program main call sub1(1.0,2.0) stop end subroutine sub1(a,b) i=3 write(*,*)a,b return end
Can you try -gfull? Darwin defaults to -gused and this might be a bug of -gused.
*** Bug 20113 has been marked as a duplicate of this bug. ***
Confirmed, Hmm, the stabs looks right: .stabs "int1:t(0,17)=@s8;r(0,17);-128;127;",128,0,0,0 Maybe this is a gdb problem in that version of gdb. This works correctly on x86-linux-gnu with -gstabs and gdb 6.3.50_2004-11-04-cvs.
Is this still an issue nowadays?
This works for i668-darwin with the trunk: (gdb) p a $1 = (REF TO -> ( real*4 )) @0x2004: 1 Current language: auto; currently fortran (gdb) p b $2 = (REF TO -> ( real*4 )) @0x2000: 2 GNU gdb 6.3.50-20050815 (Apple version gdb-694) (Tue Jul 17 08:01:07 GMT 2007) This has been fixed via gdb.