This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug fortran/11104] gdb 7.0 does not print two dimensional Fortranarrays correctly.
- From: "smirta at mail dot ru" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 5 Apr 2011 14:43:49 +0000
- Subject: [Bug fortran/11104] gdb 7.0 does not print two dimensional Fortranarrays correctly.
- Auto-submitted: auto-generated
- References: <bug-11104-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=11104
Saha Smirnovsky <smirta at mail dot ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
CC| |smirta at mail dot ru
Version|7.1 |HEAD
Resolution|FIXED |
Target Milestone|7.1 |7.3
--- Comment #12 from Saha Smirnovsky <smirta at mail dot ru> 2011-04-05 14:42:59 UTC ---
gdb gives wrong results in case when one-dimensional array is passed as
argument to subroutine and is treated as multidimensional array with dimensions
which were passed as arguments.
Please see this Fortran code:
test.f90
===
program test_array
integer foo(4)
do I=1,4
foo(I)=I
enddo
call test(foo,2)
end
subroutine test(M,N)
integer N
integer M(N,N)
do J=1,N
do I=1,N
write(*,*) "I,J,M = ",I,J,M(I,J)
enddo
enddo
end
===
This is output:
$ gfortran -ggdb -o test test.f90
$ ./test
I,J,M = 1 1 1
I,J,M = 2 1 2
I,J,M = 1 2 3
I,J,M = 2 2 4
This is debugging:
$ gdb test
...
(gdb) break test
Breakpoint 1 at 0x804863e: file test.f90, line 11.
(gdb) run
Starting program: /home/????/test
Breakpoint 1, test (m=..., n=2) at test.f90:11
11 subroutine test(M,N)
(gdb) print M(2,2)
$1 = 2
I use gdb 7.3.50.20110405
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.