Re: [PATCH 1/2] fort_dyn_array: add basic fortran dyn array support

Joel Brobecker
2015-10-21T19:41:45Z

> Thanks for the review and sorry for the long delay. Here is the updated patch.

Not to worry. At this point of the process, the number of changes
that were left to be made before making the patch acceptable were
very small, so it was easy for me to get back into it.

> 2015-03-13 Keven Boell <keven.boell@intel.com>
>
> * dwarf2read.c (set_die_type): Add read of
> DW_AT_allocated and DW_AT_associated.
> * f-typeprint.c: New include of typeprint.h
> (f_print_type): Add check for allocated/associated
> status of type.
> (f_type_print_varspec_suffix): Add check for
> allocated/associated status of type.
> * gdbtypes.c (create_array_type_with_stride):
> Add check for valid data location of type in
> case allocated or associated attributes are set.
> Length of an array should be only calculated if
> allocated or associated is resolved as true.
> (is_dynamic_type_internal): Add check for allocated/
> associated.
> (resolve_dynamic_array): Evaluate allocated/associated
> properties.
> * gdbtypes.h (enum dynamic_prop_node_kind): <DYN_PROP_ALLOCATED>
> <DYN_PROP_ASSOCIATED>: New enums.
> (TYPE_ALLOCATED_PROP, TYPE_ASSOCIATED_PROP): New macros.
> (type_not_allocated): New function.
> (type_not_associated): New function.
> * valarith.c (value_subscripted_rvalue): Add check for
> allocated/associated.
> * valprint.c: New include of typeprint.h.
> (valprint_check_validity): Add check for allocated/associated.
> (value_check_printable): Add check for allocated/
> associated.
> * typeprint.h (val_print_not_allocated): New function.
> (val_print_not_associated): New function.
> * typeprint.c (val_print_not_allocated): New function.
> (val_print_not_associated): New function.
>
> testsuite/gdb.fortran:
>
> * vla-alloc-assoc.exp: New file.
> * vla-datatypes.exp: New file.
> * vla-datatypes.f90: New file.
> * vla-history.exp: New file.
> * vla-ptype-sub.exp: New file.
> * vla-ptype.exp: New file.
> * vla-sizeof.exp: New file.
> * vla-sub.f90: New file.
> * vla-value-sub-arbitrary.exp: New file.
> * vla-value-sub-finish.exp: New file.
> * vla-value-sub.exp: New file.
> * vla-value.exp: New file.
> * vla-ptr-info.exp: New file.
> * vla.f90: New file.
>
> testsuite/gdb.mi:
>
> * mi-vla-fortran.exp: New file.
> * vla.f90: New file.

The patch is approved, and I have now pushed it. Congratulations!
(and thank you for your perseverance :-)).

Small note, on something I noticed only at the very end. For
the ChangeLog entries, and in particular for the testsuite files,
therer is only one ChangeLog file, in gdb/testsuite/ChangeLog.
So, all the entries in the testsuite directory should be together,
and relative to the testsuite, which means the filenames needed
to be prefixed with either gdb.fortran/ or gdb.mi. In other words,
I changed it to the following entry in gdb/testsuite/ChangeLog:

* gdb.fortran/vla-alloc-assoc.exp: New file.
* gdb.fortran/vla-datatypes.exp: New file.
* gdb.fortran/vla-datatypes.f90: New file.
* gdb.fortran/vla-history.exp: New file.
* gdb.fortran/vla-ptype-sub.exp: New file.
* gdb.fortran/vla-ptype.exp: New file.
* gdb.fortran/vla-sizeof.exp: New file.
* gdb.fortran/vla-sub.f90: New file.
* gdb.fortran/vla-value-sub-arbitrary.exp: New file.
* gdb.fortran/vla-value-sub-finish.exp: New file.
* gdb.fortran/vla-value-sub.exp: New file.
* gdb.fortran/vla-value.exp: New file.
* gdb.fortran/vla-ptr-info.exp: New file.
* gdb.mi/mi-vla-fortran.exp: New file.
* gdb.mi/vla.f90: New file.

--
Joel