[PATCH] Debug support for Fortran 90 assumed shape and other descriptor using arrays (PR fortran/22244)

Tobias Burnus burnus@net-b.de
Fri Nov 16 16:14:00 GMT 2007


Jakub Jelinek wrote:
> Can you look at with idb on gfortran (vanilla or patched) generated MAIN__
> x and y arrays after the bar subroutine returns and see if they are
> displayed in the expected order or not?
>   
For the a5.f90 test case, compiled with ifort (!) I get:

Breakpoint 1, test () at a5.f90:70
70        if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4)
call abort
(idb) p x
$1 = {{<no value>,  <no value>, ...
(idb) p y
$2 = <no value>
(idb) ptype x
type = REAL(4)(10)(10)
(idb) ptype y
type = REAL(4)(5)

while using gdb and ifort (!):

(gdb) p x
$1 = (( 8, 4, 4, 4, 4, 4, 4, 4, 4, 4) ( 4, 9, 4, ...
(gdb) p y
$2 = (4, 5, 4, 2, 2)
(gdb) ptype y
type = real*4 (5)
(gdb) ptype x
type = real*4 (10,10)

But now to your question, using (an unpatched) gfortran -g and idb:

(idb) p x
$1 = {{8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, {9, 4, 4, 4, 4, 4, 4, 4, 4, 10,
4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4}, {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, {4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8.11898326e-11}}
(idb) p y
$2 = {4, 5, 4, 2, 2, 0}
(idb) ptype x
type = REAL(4)(11)(11)
(idb) ptype y
type = REAL(4)(6)

While with the same binary and gdb:

(gdb) p x
$1 = (( 8, 4, 4, 4, 4, 4, 4, 4, 4, 4) ( 4, 9, 4, 4, 4, 4, 4, 4, 4, 4) (
10, 4, 4, 4, 4, 4, 4, 4, 4, 4) ( 4, 4, 4, 4, 4, 4, 4, 4, 4, 4) ( 4, 4,
4, 4, 4, 4, 4, 4, 4, 4) ( 4, 4, 4, 4, 4, 4, 4, 4, 4, 4) ( 4, 4, 4, 4, 4,
4, 4, 4, 4, 4) ( 4, 4, 4, 4, 4, 4, 4, 4, 4, 4) ( 4, 4, 4, 4, 4, 4, 4, 4,
4, 4) ( 4, 4, 4, 4, 4, 4, 4, 4, 4, 4) )
(gdb) p y
$2 = (4, 5, 4, 2, 2)
(gdb) ptype x
type = real*4 (10,10)
(gdb) ptype y
type = real*4 (5)

Tobias

(PS: The gdb is w/o the patches.)



More information about the Fortran mailing list