gdb and g77

craig@jcb-sc.com craig@jcb-sc.com
Wed Jun 30 15:43:00 GMT 1999


>  When g77 emits debug info for arrays, the dimensions are reversed.  If
>your array is palindromic, ie "dimension a(10,20,10)", it will work OK,
>but otherwise gdb will be looking at the wrong memory location for the
>data.  I originally thought the problem was with gdb reversing the
>dimensions, but after building gdb on an RS6K, it correctly read the
>dimension info from the native RS6K compiler.  Ergo g77 is incorrect.

Sounds reasonable, though the likely cause of the problem is the gcc
back end.  The g77 front end (presumably) passes to the back end
the proper info on the array, else there'd be *huge* problems, either
in correctness or performance.  What is probably happening, then, is
that the back end's debug modules (sdbout.c, dbxout.c, dwarfout.c,
dwarf2out.c, etc.) aren't coping properly with multi-dimensional
arrays.

But I'm speaking on this without actually looking at any of the code,
or -g output, etc.  I'm real busy this weekend, but will try to catch
up on things like this shortly, though the fact that nobody else seems
to have found the problem already suggests that it isn't an easy problem
to spot!

        tq vm, (burley)



More information about the Gcc mailing list