[Dwarf-discuss] RE: Issue 050222.1

Jim Blandy jimb
Tue May 17 16:14:04 PDT 2005

"Bishop, John E" <john.e.bishop at intel.com> writes:
> So a zero-length entry with an expression could mean
> "Variable X is _not_ live here, but if you evaluate
> the expression, you'd get the right value".

Can't you do that now, with a non-empty address range, and an empty
location expression?  From section 2.5.2:

        An expression with zero operations is used to denote an object
        that is present in the source code but not present in the
        object code (perhaps because of optimization).

To allow debuggers to recover the values of such variables, you'd
still want the ability to say "in this address range, here's how to do
it."  Perhaps the variable could have a DW_AT_value_expression
attribute, whose value would be a Dwarf expression (or a location
list of Dwarf expressions) computing the *value* of the variable, and
not its address (since it might not have one).

If Dwarf expressions had assignment operators (store; set register),
we could have DW_AT_set_value_expression attributes, too.

More information about the Dwarf-Discuss mailing list