[Dwarf-discuss] Constant expressions in locations lists

Daniel Berlin dberlin@dberlin.org
Wed Mar 7 22:12:11 GMT 2007


On 3/7/07, Cary Coutant <cary at cup.hp.com> wrote:
> A problem we've come up with in improving our support for optimized
> code on HP-UX is in trying to describe a variable that sometimes has
> a constant value (not available in memory or in a register) during
> portions of its live range. A variable that is constant everywhere
> can be described by DW_AT_const_value, but there is no way (that I
> can see) to represent a constant value in a location list.

There isn't.  For GCC, we actually punt and say the value is optimized
out during that portion, even though we know what the value is :(.

> I propose to add a new "DW_OP_addressof" operator (it could also be
> named "DW_OP_ref" or "DW_OP_lvalue" -- I haven't picked a favorite
> yet) that would turn the value on the top of the stack into a
> reference to that constant value. A location expression ending with
> this operator would be valid anywhere a DW_OP_regx operator is valid,
> and could also be applied to the portion of a location expression
> described by DW_OP_piece.
>
Why not just a DW_OP_constant_value?




More information about the Dwarf-discuss mailing list