[Dwarf-Discuss] DW_FORM_data1 and DW_AT_const_value
David Anderson
davea42@earthlink.net
Mon Jul 26 23:38:33 GMT 2010
Michael Eager wrote:
>> There is a distinction between "ambiguous" and "unspecified".
>> The interpretation of the value of DW_FORM_data is unspecified.
>> I don't believe that there is any ambiguity.
>>
>
If gcc simply avoided using a DW_FORM_data<n> that was unspecified-meaning
the problem would go away. For the value 204, DW_FORM_data2 (and
some other FORMs) would do fine
without treading unspecified waters.
When the data<n> is an offset (as in DWARF3 data4, data8) then it
clearly is 'unsigned'.
If a data type is 'char', and char is 8 bits,
and a data object's DW_AT_const_value has form DW_FORM_data1
there is no ambiguity at all.
DW_TAG_subrange gives reason to think that if the basis type and the
DW_FORM_data<n> are the same size that the DW_AT_upper (and lower)
bounds would use the signedness of the basis type to 'extend' the bits
if one is expanding the value to a larger integer.
So not all uses of DW_FORM_data<n> have any value ambiguity.
But some uses of data<n> stray into unspecified waters.
DavidA.
More information about the Dwarf-discuss
mailing list