This is the mail archive of the
mailing list for the GNU Fortran project.
a problem of debuging module variables with gdb
- From: Ran Qin <rqin at ldeo dot columbia dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 4 Apr 2005 11:30:54 -0400
- Subject: a problem of debuging module variables with gdb
I try to use GDB to debug my f90 code, but find that gdb can never
correctly show the variable declared in modules.
There is a sample code:
$ cat hello.f90
real(8) :: a,b,c
end module test_mod
use test_mod,only: a,b,c
real(8) :: al
al = a+b
end program testf90
Then I compile it with gfortran -g -o hello hello.f90 and debug with
I got the following results:
(gdb) break hello.f90:13
Breakpoint 1 at 0x1c30: file hello.f90, line 13.
Starting program: /Users/rqin/Documents/helloworld/hello
Reading symbols for shared libraries ++. done
Breakpoint 1, 0x00001c30 in MAIN__ () at hello.f90:10
10 a =3.0_8
11 b =4.0_8
12 al = a+b
(gdb) print a
$1 = 3.1611237438705655
(gdb) print b
$2 = 23.601290952344122
(gdb) print al
$3 = 7
Clearly, GDB can not resolve the variables from module. I have searched
the mailing archive but find no clue on this.
Is this the problem of gfortran that it can not provide the information
of module variables to GDB or the GDB simply can't work with f90
standard to debug module variables?
It would be very appreciated if someone would give me a clue. The
system I'm using is Mac OS X 10.3.8. The gfortran is 20050128 version
and GDB is version 5.3.