This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: plan: VLA (Variable Length Arrays) and Fortran dynamic types


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> Rename "struct type" to "struct abstract_type".  Make all
Jan> TYPE_LENGTH, TYPE_ARRAY_UPPER_BOUND_VALUE etc. macros accessing
Jan> concrete sizes requiring to provide also "struct value *".  Remove
Jan> check_typedef, that is hide it under the TYPE_LENGTH etc. macros.

Jan> This would also include work to pass "struct value *" mostly
Jan> everywhere instead of where current "struct type *" is passed as
Jan> one needs the inferior memory to find out the concrete dimensions
Jan> of inferior type.  This then makes the current *-vla implementation
Jan> of DW_AT_object_pointer easy.

[...]

Jan> Alternative approach would be to "concretize" abstract types by
Jan> check_typedef (which would be kept there).  In such case there
Jan> still would be "struct abstract_type" but there would be also
Jan> "struct concrete_type" which would automatically cache all the
Jan> values for better performance.  check_typedef would still be
Jan> impossible to forget like nowadays due to the non-compatible GDB
Jan> types "struct abstract_type" vs. "struct concrete_type".
Jan> archer-jankratochvil-vla does it this way (but still keeping
Jan> "struct type" being both the input and output GDB type of
Jan> check_typedef).  I do not think this approach is worth the pain.

Passing a struct value everywhere seems pretty awful though too,
especially considering that one may not generally have a value.
'ptype' and plenty of other things have to work on the abstract type.
But I think maybe I don't understand some details here.  Could you give
an example of where we pass a type now that we would have to pass a
value in the future?

I note that Ada already uses the concretizing approach.
Maybe Joel could share their experiences with this.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]