[Dwarf-Discuss] Use of Location Description operations in DWARF Expressions?

Cary Coutant ccoutant@gmail.com
Tue Mar 24 00:09:08 GMT 2020

> DW_OP_implicit_value and DW_OP_stack_value produce values (that is
> R-values), not locations.  I might be able to read
> DW_OP_implicit_pointer as providing a location; I'm not sure.

No, they don't produce a value. The expression that precedes them
produces a value, and these operators produce a location description
for that value.

> As I said, values and locations are muddled.  If you think that a
> variable which has been eliminated has a location which is described by
> a DW_OP_implicit_value, then we aren't working with the same definition
> of "location".

Evidently not. For values that don't have a location, we have these
operators that provide a location description anyway. Even though
they're not real locations in the sense of existing in memory or a
register, they are locations in the sense that they are described by a
location description.

Perhaps it would help to think of "locations" as what you think of as
locations, and "location descriptions" as something a bit more
general. A location description can describe a real location, or it
can describe something more ethereal.

> This doesn't work with any of the Implicit Location Descriptions,
> because there isn't any "there" there.  They don't result in locations;
> they give the values which would be found if the variable did exist.  So
> they implicitly perform the dereference operation.

Quite the opposite; they perform the inverse of a dereference
operation. They provide something at the level of a location
description that can be dereferenced but has no other purpose.


More information about the Dwarf-discuss mailing list