Re: [PATCH/RFA] PR gdb/648

Jim Blandy
2004-08-13T22:14:15Z

David Lecomber <david@streamline-computing.com> writes:
> 2004-08-06 David Lecomber <dsl@sources.redhat.com>
>
> Fix PR gdb/648
> * dwarf2read.c (read_array_type): Handle column major arrays
> correctly. Assume column major for Fortran except with G77
> compiler.
> * eval.c (evaluate_subexp_standard): Assume Fortran arrays are
> oriented large to small in type structure.

Thanks very much for the patch and test program. It was helpful to be
able to actually look at what GNU F77 was producing for a real Fortran
program.

For the dwarf2read.c part, I think the essential approach is fine.
However:

- Rather than recognizing Fortran specially in read_array_type, I'd
rather have a new member of 'struct language_defn' giving the array
ordering for that language.

- I'd like to have the logic that chooses a byte order pulled out of
read_array_type into its own function that takes a die, a cu, and
returns a DW_ORD_ value. That function would take care of looking
for a DW_AT_ordering attribute, recognizing the appropriate versions
of GNU F77, and so on. read_array_type should call that function
and build the type appropriately.