[Dwarf-Discuss] decoding of form entries
eager at eagercon.com
Mon Aug 2 12:43:40 PDT 2010
David Gross wrote:
> Michael wrote:
>> Mathieu Lacage wrote:
>>> On Mon, Aug 2, 2010 at 18:07, Michael Eager <eager at eagercon.com> wrote:
>>>>> So, I have a very practical question: if I want to get the value of
>>>>> this form, I read the reference, that gives me a new location to parse
>>>>> in the dwarf sections. What is the content of that new location ? Does
>>>>> it point to an entry (meaning, I am going to find there an abbrev
>>>>> code) ? If so, how do I know which attribute in this entry is going to
>>>>> contain the value of my original attribute ? Would it be expected to
>>>>> be the same attribute with a different non-reference form ?
>>>> In the most common cases, the "entity" will be another DIE in the
>>>> same compilation unit, which you will need to parse to find the
>>>> value of attribute you are looking for.
>>> That is what I suspected but, I am not sure I really understand your
>>> answer so, let me restate my question again.
>>> How do I know which attribute to look for in the new DIE ? Is it
>>> expected that the new DIE will contain the same attribute I looked at
>>> originally but with a non-reference form ? For the sake of discussion,
>>> what about DW_AT_byte_size ?
>> Yes, generally you would search the referenced DIE to find the same
> I see a different pattern in D.2.2 (Ada Example): 13$ contains a
> DW_AT_upper_bound whose value is a reference to a variable. The
> variable does not contain a DW_AT_upper_bound; the value of the
> variable itself is the value of the DW_AT_upper_bound. That's the
> pattern that I expected to see; I wasn't aware that the standard
> intends to support the delegation pattern you describe above.
For DW_AT_upper_bound and DW_AT_lower_bound, the intent of a reference
is to point to the DIE for a variable which contains the value. But
this does not appear to be stated explicitly in the description of
5.11 Subrange Type Entries.
Can you add an issue so that we fix this in the next version?
Michael Eager eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Dwarf-Discuss