[Dwarf-Discuss] DWARF expression evaluation
jakub at redhat.com
Thu Jul 14 08:46:19 PDT 2016
On Thu, Jul 14, 2016 at 11:36:06AM -0400, Trevor Harrison wrote:
> I'm trying to evaluate DWARF expressions and I'm looking for a hint
> or some documentation about the state of the expression evaluator's
> stack prior to beginning the expression.
> The reason I'm asking about this is I'm seeing expressions (a
> DW_AT_data_member_location for example) that start with DW_OP_dup,
> which implies that there is something on the stack for it to dup.
Of course there is, just read e.g. in DWARF4 p. 87 in the first paragraph:
"Otherwise, the value must be a location description. In this latter case,
the beginning address of the derived class is pushed on the expression stack
before the location description is evaluated and the result of the evaluation
is the location of the inherited type."
Similarly on p. 88.
More information about the Dwarf-Discuss