[Dwarf-Discuss] DWARF representation for Fortran descriptors
David Anderson
davea42@earthlink.net
Fri Oct 29 21:28:53 GMT 2010
On 10/29/2010 11:07 AM, Kendrick Wong wrote:
> The descriptor for obj1 and obj2 in this example
> INTEGER, POINTER :: obj1
> INTEGER, ALLOCATABLE :: obj2
>
> is similar to the array example in D.2.1. In that the we have obj1
> containing the address of the descriptor, and the descriptor would
> carry the address of the raw data.
>
> According to D.2.1, the DWARF would look like this:
>
> $1a: DW_TAG_base_type
> DW_AT_name (INTEGER)
> DW_AT_encoding (DW_ATE_signed)
> DW_AT_data_location (...) // address of raw data
> DW_AT_associated (...) // is associated?
> DW_AT_allocated (...) // is allocated?
>
...
>
> My question is: Since the type is shared by both obj1 and obj2, how
> would consumer know that obj1 is a pointer and obj2 is an allocatable?
DW_AT_allocated and DW_AT_associated give instructions on how to read
the (object-dependent)
descriptor value so one can know if the type instance is allocated or
associated.
DWARF4 D.2 (page 254 printed on that page) shows this. Fine so far.
However, because of the way 5.14.2 reads, the example provided is
incorrect in
having a single DW_TAG_base_type shared by obj2 and obj1.
I believe the above example requires two base types, one with only
DW_AT_associated and
one with only DW_AT_allocated.
DavidA.
More information about the Dwarf-discuss
mailing list