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

Cary Coutant ccoutant@gmail.com
Mon Mar 23 22:58:41 GMT 2020


> I think that the description has become a bit less clear with the
> addition of the Implicit Location Descriptions in Section 2.6.1.1.4,
> which do compute values, rather than locations.  Perhaps these should
> have been described in Section 2.5 as parts of a DWARF expression, not
> as parts of a Location Description.

Strongly disagree. The whole point of an implicit location description
is to give a (pseudo/virtual) location to a value that has no
location. A DWARF *expression* has no use for these operators.

> The description (and implementation) of DWARF expressions and locations
> are somewhat muddled together.  This can be seen in the first sentence
> of Section 2.5:
>     DWARF expressions describe how to compute a value or specify a
>     location.
> A clearer definition would specify that the DWARF expression only
> computes a value, and leaving what that value means (e.g.,
> register/memory contents, arbitrary computation, memory address) to the
> context in which the expression is used.  A more precise definition of a
> location, especially a composite location, would help.
>
> Part of this is historical, with the expression evaluation initially
> used to compute a memory address and then extended to accommodate
> composite locations and further extended to compute arbitrary values.
> These extensions were in divergent directions, affecting both location
> composition and value computation.  It would have been better if the two
> concepts were clearly distinguished.

Other than that first sentence of 2.5, I think they are pretty clearly
distinguished. Location descriptions, covered by Section 2.6, are
built on top of DWARF expressions, and provide additional operators
for specifying locations other than simple memory locations.

-cary



More information about the Dwarf-discuss mailing list