[Bug fortran/24790] New: arguments are displayed as reference or pointer to normal type in GDB

woodzltc at sources dot redhat dot com gcc-bugzilla@gcc.gnu.org
Fri Nov 11 09:09:00 GMT 2005


Here is a testcase:

fmain.f:
=========
        dimension a(10)
        call sub(a,10)
fsub.f:
=========
        subroutine sub(a,n)
        dimension a(n)
        do i = 1, n
          a(i) = sqr(i)
        end do
        return
        end subroutine

        function sqr(m)
          sqr = m * m
        end function


build a binary:
# gfortran -g -o fbase fmain.f fsub.f
# gdb -q ./fbase
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) b sub_
Breakpoint 1 at 0x804876b: file fsub.f, line 21.
(gdb) b sqr_
Breakpoint 2 at 0x80487c1: file fsub.f, line 30.
(gdb) r
Starting program: /root/DE/gdb-6.4/src/gdb/testsuite/gdb.fortran/fbase
 Test begin.

Breakpoint 1, sub_ (a=0xbff5cf30, n=@0x8048918) at fsub.f:21
21              do i = 1, n
Current language:  auto; currently fortran
(gdb) p a
$1 = (PTR TO -> ( real*4 (0:-1))) 0xbff5cf30
(gdb) p n
$2 = (REF TO -> ( int4 )) @0x8048918: 10
(gdb) c
Continuing.

Breakpoint 2, sqr_ (m=@0xbff5cf00) at fsub.f:30
30                tmp1 = m
(gdb) p m
$3 = (REF TO -> ( int4 )) @0xbff5cf00: 1
(gdb)

In the above debugging session, argument 'a' of sub is displayed as pointer of
the normal type, 'n' of sub and 'm' of sqr are displayed as reference to normal
type.


-- 
           Summary: arguments are displayed as reference or pointer to
                    normal type in GDB
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: woodzltc at sources dot redhat dot com


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



More information about the Gcc-bugs mailing list