||Describing Fortran descriptors
Section 5.14, pg 102
Adding DW_TAG_descriptor_type to describe descriptors-specific attributes.
Some languages, such as Fortran, provide types whose values may be dynamically
allocated or associated with a variable under explicit program control. Currently,
these attributes, such as DW_AT_allocated and DW_AT_associated are placed on the
corresponding type DIE. This approach forces creation of duplicate types for a
single Fortran type.
Consider this Fortran example:
type :: dt (l)
integer, len :: l
integer :: arr(l)
integer :: n = 4
type (dt(n)) :: t1
type (dt(n)), pointer :: t2
type (dt(n)), allocatable :: t3
t1, t2 and t3 all share the same type 'dt'. The current DWARF spec
places all descriptor related attributes (DW_AT_data_location, DW_AT_associated
and DW_AT_allocated) on the DW_TAG_structure_type DIE for 'dt'. However, we
can't put all the descriptor specific attributes on the same DW_TAG_structure_type
DIE because there is a need to differentiate between t1, t2 and t3. This forces 3
different 'dt' DW_TAG_structure_type to be created to describe this program.
This would modify the wording to 5.14 "Dynamic Type Properties".
A base or user-defined type may be accessed through a descriptor. A descriptor
is represented in DWARF by the debug information entry with the tag
DW_TAG_descriptor_type. It has a DW_AT_type attribute, whose value is a reference
to a debugging information entry describing a base type, a user-defined type or a
5.14.1 Data Location
The DW_AT_data_location attribute may be used with DW_TAG_descriptor_type that
provides one or more levels of hidden indirection and/or run-time parameters in its
representation. (Rest of text same as current text...)
5.14.2 Allocation and Association Status
The DW_AT_allocated attribute may optionally be used with DW_TAG_descriptor_type
for which objects of the associated type can be explicitly allocated and deallocated.
(Rest of text same as current text...)
The DW_AT_associated attribute may optionally be used with DW_TAG_descriptor_type
for which objects of the associated type can be dynamically associated with other
objects. (Rest of text same as current text...)
The new DWARF for the example program would look like:
$12: DW_TAG_member ...
$13: DW_TAG_descriptor_type ! plain version
DW_AT_associated (...) ! 'pointer'
DW_AT_allocated (...) ! 'allocatable'
Possibly merge with 090824.1
12/27/12 -- Withdrawn, see 121112.1