gdb bug in Fortran langauge mode

Andy Vaught andy@maxwell.la.asu.edu
Wed Jun 16 15:51:00 GMT 1999


On 16 Jun 1999 craig@jcb-sc.com wrote:

> [bug-gdb people: This is just follow-up on a previous g77-related gdb bug
> report I submitted the other day.]
> 
> 
> >Craig notes that the 'whatis' command of gdb produces the correct
> >result.  This is because gdb's 'whatis' command is buggy-- it prints
> >the array elements in the wrong order!
> 
> As Jeff pointed out, this is not clear.

Well, have a look at the code.  The 'whatis' does a real weird recursion
thing, while the array-element address calculation uses the textbook
method reminiscient of Horner's method.

It still remains that g77 and xlf emit array info in opposite orders.  Gdb
reads those stabs to figure out the rank and shape of an array. 

If the gdb people implement what you are asking for, and reverse the
ordering of array elements, then printing array elements will break on
AIX/RS6k.  From what I recall, Sun invented the stabs format, not IBM, so
you can probably expect gdb to break on Sun's f77 as well.  The gdb people
are welcome to the patch I posted to gdb-patches months ago that does
exactly this.

Is there anyone out there on a Sun or different machine who can tell us
if gdb correctly prints elements of multidimensional fortran arrays?

     Andy


-----------------                        XOLD(K,IC,I)=
Andy Vaught               ....        DO ITERS=1, 10  XOLD(K,IC,I)
andy@maxwell.la.asu.edu   |  |   /CALLMSOLVE(A,B,X,I,ITERS,TOL)+(RANNYU(0)
Arizona State University  ======|WRITE(6,'(I5,2X,F12.6)')ITERS,TOL -HALF)
Tempe, Arizona USA        OOOOOO \ENDDORETURN PARAMETER(ZERO=1.D0)*TENTH*DELTA




More information about the Gcc mailing list