[Dwarf-Discuss] decoding of form entries
Mon Aug 2 18:42:01 GMT 2010
> 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.
More information about the Dwarf-discuss