[Dwarf-Discuss] PROPOSAL: Constant expressions in location lists
Mon Jan 7 19:36:51 GMT 2008
Robinson, Paul T (NonStop) wrote:
> A tangential question regarding DW_AT_location...
> Alexandre Oliva wrote:
>> The effect would be equivalent to that of adding a deref to
>> each piece of each DW_AT_location location expression that mentions a
>> memory address, except that DW_AT_location locations are assumed to be
>> modifiable (and thus exclusively assigned to the mentioned variable),
>> whereas a dereferenced address or a register in a DW_AT_value is
>> expected to be non-modifiable or shared.
> I didn't think DW_AT_location locations must be "exclusively assigned."
> Copy propagation could cause multiple variables to be assigned to the
> same machine location simultaneously, and their DWARF descriptions
> should accurately reflect that. (Modifying one variable implicitly
> modifies the other.) Did I misunderstand something?
I think you understand correctly. There is one location list for
each (extant) variable. In that respect, you might call it
"exclusively assigned". But the location that it references does
not need to be unique.
If you had code like
a = b = 999;
printf ("a = %d\n", a);
printf ("b = %d\n", b);
and you had your debugger stop between the assignment and the first
printf and change the value of b, you might find that the value of
a is also changed if the compiler performed copy propogation and
replaced a with b.
Michael Eager eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Dwarf-discuss