[Dwarf-Discuss] DWARF representation for Fortran descriptors
kendrick at ca.ibm.com
Fri Oct 29 15:02:58 PDT 2010
In this example, duplicating the base types does not significantly
increase the debug data size. But if the type is a more complex, then the
cost of duplication can be quite significant.
In my original email, I suggested adding additional DW_TAG_pointer_type
both carry either DW_AT_associated or DW_AT_allocated, and would point to
the same type. The DW_TAG_pointer_type is essentially a dummy entity to
avoid having to duplicate the type. To me the fortran descriptor does act
similar to a C/C++ pointer, so I borrowed the concept here. But I'm
wondering if this kind of usage is appropriate. The other question I have
with this approach is, where should the DW_AT_data_location go in this
From: David Anderson <davea42 at earthlink.net>
To: Kendrick Wong/Toronto/IBM at IBMCA
Date: 10/29/2010 05:29 PM
Subject: Re: [Dwarf-Discuss] DWARF representation for Fortran
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
descriptor value so one can know if the type instance is allocated or
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
having a single DW_TAG_base_type shared by obj2 and obj1.
I believe the above example requires two base types, one with only
one with only DW_AT_allocated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dwarf-Discuss