Issue 030603.1: Static data members

Author: Keith Walker
Champion: Matthew Gretton-Dann
Date submitted: 2003-06-03
Date revised:
Date closed:
Type: Clarification
Status: Accepted with modification
DWARF Version: 3
In the DWARF2 specification there was the following statement in section 
5.5.4 "Structure Data Member Entries":

    "If the member entry is defined in the structure or class
     body, it has a DW_AT_data_member_location attribute
     whose value is a location description that describes
     the location of that member relative to the base address
     of the structure, union, or class that most closely
     encloses the corresponding member declaration."

However in the DWARF3 draft 8 specification this has been reworded in 
section 5.6.6 "Data Member Entries" to read:

    "For a data member of a structure, union or class, the
     corresponding member entry has a DW_AT_data_member_location
     attribute whose value describes the location of that
     member relative to the base address of the structure
     union, or class the most closely encloses the member
     declaration."



If we consider static data members the original DWARF2 wording allowed for 
the DW_AT_data_member_location attribute to be omitted (as the actual 
location would be defined in the corresponding DW_TAG_variables 
entry).      However the DWARF3 wording implies that there should always be 
a DW_AT_data_member_location attribute.

Is this new wording in the DWARF3 specification correct?


---------------------------
Others affirmed that Draft 8 seems wrong.


PROPOSAL:

Revert to the earlier sentence (change the sentence in 5.6.6
back to DWARF2 wording).

-------------------------------------------------------------

Accepted with following modification:

Replacing the new text with the old text isn't such a good idea,
but adding a "for a data member defined in a structure" addition
would be good.