$ cat module.f90
module foo
  real :: a
end module foo

program main
  use foo, only : a
  a = 42.
  print *,a
end program main
$ gfortran -g module.f90
$ gdb ./a.out
GNU gdb 6.3-debian
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-linux"...Using host libthread_db library
"/lib/tls/libthread_db.so.1".

(gdb) b module.f90:7
Breakpoint 1 at 0x80485e4: file module.f90, line 7.
(gdb) r
Starting program: /home/ig25/Krempel/Gdb/a.out

Breakpoint 1, MAIN__ () at module.f90:7
7         a = 42.
Current language:  auto; currently fortran
(gdb) p a
No symbol "a" in current context.
(gdb)

$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1/configure --prefix=/home/ig25
--enable-languages=c,fortran : (reconfigured) ../gcc-4.1/configure
--prefix=/home/ig25 --enable-languages=c,fortran --no-create --no-recursion
Thread model: posix
gcc version 4.1.0 20051011 (experimental)
$ gdb --version
GNU gdb 6.3-debian
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-linux".


-- 
           Summary: variables from modules not visible in gdb
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24526

Reply via email to