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

David Stenberg david.stenberg@ericsson.com
Thu Mar 19 16:30:59 GMT 2020


This is something that has popped up in a number of LLVM patch reviews,
and is something that we would like to get some help with clarifying.

For DWARF[345], may a DWARF Expression (described in section 2.5)
contain any of the operations listed under the Location Descriptions
section (2.6)? For example, may a DW_AT_call_value in DWARF5, which
"is a DWARF expression", contain any of those operations
(e.g. a DW_OP_piece)?

DWARF5 section 2.5 specifies the following for the operations under
section 2.6:

"In addition to the general operations that are defined here, operations
 that are specific to location descriptions are defined in Section 2.6
 on page 38."

Reading section 2.5 and 2.6, I have interpreted the standard as if DWARF
Expressions and Location Descriptions are disparate things; Location
Descriptions may describe locations _using_ DWARF Expressions, but in
places where a DWARF Expression is expected, you may not have a Location
Description in its place. Is that correct?

Given the above quote, and if my interpretation of how DWARF Expressions
and Location Descriptions correlate is correct, I would assume that the
answer to this mail's initial question is no. Or am I overlooking
somethere here?

Best regards,

More information about the Dwarf-discuss mailing list