This is the mail archive of the dwarf2@corp.sgi.com mailing list for the dwarf2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PROPOSAL: Restore location list for data member of structure/class


Ron 603-884-2088 wrote:
> 
> Proposal
> --------
> 
> Restore the ability to associate a location list with a data member of a class.
> 
> Changes
> -------
> 
> In Section 5.5.6, fourth paragraph (of *Draft 3*) replace the last two
> sentences, which now read
> 
>     "... If the value is a constant, then the value of that constant is
>     the offset in bytes from the beginning of the structure or class to
>     the beginning of the member. Otherwise, the value must be a location
>     description."
> 
> with
> 
>     "... If the value is of class constant, then the value of that constant
>     is the offset in bytes from the beginning of the structure or class to
>     the beginning of the member. If the value is of class block, then
>     the value is a DWARF expression, whose evaluation gives that same offset.
>     Otherwise, the value can be of class loclist, in which case the offset
>     is specified by the associated location list."
> 
> In Figure 18, change the DW_AT_data_member_location line to read:
> 
>     DW_AT_data_member_location  0x38    block, constant, loclist
> 
> Discussion
> ----------
> 
> Now that we approved 410.3 (as revised), think back to 000302.1, in which
> we changed the definition of a "constant" class operand for a data member
> location from being an offset into the location list section to being an
> immediate offset in the object. With the above reformulation, we can have
> it both ways!

0410.3 didn't change any definitions, it was editorial.  It proposed
descriptions for previous uses of constant.  It doesn't offer any additional 
ways to distinguish between these constants.  The definition of constant
was not changed; merely the use of the constant was clarified.  Note that
it did not restrict the meaning of constant to be less than it was before.

Loclist is a description of a use of DW_FORM_data4 and DW_FORM_data8.  
In current use, with DW_AT_data_member_location, a DW_FORM_data4/8 
represents offsets from the beginning of the structure.  In your proposal,
this would not be the case; they would point to a loclist.  This is an 
incompatible change.

In your proposal, only DW_FORM_data1, data2, sdata, and udata could be used 
to represent offsets.  

It appears to me that your proposal has both loclist and constant as 
permitted types.  Since loclist is a constant, it looks to be ambiguous.

-- 
Michael Eager	 Eager Consulting     eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]