After the switch to the new evaluator implementation, it is now
possible to completely remove the dwarf_expr_context class from the
expr.h interface and encapsulate it inside the expr.c file.
The new interface consists of a new function called dwarf2_eval_exp
that takes a DWARF expression stream, initial DWARF stack elements (in
a form of a vector of a struct value objects), evaluation context and
expected result type information. Function returns an evaluation result
in a form of a struct value object.
Currently, there is ever only one initial stack element provided to the
evaluator and that element is always a memory address, so having a
vector of struct value object might seems like an overkill.
In reality this new flexibility allows implementation of a new DWARF
attribute extensions that could provide any number of initial stack
elements to describe any location description or value.
gdb/ChangeLog:
* dwarf2/expr.c (dwarf2_eval_exp): New function.
(struct dwarf_expr_context): Move from expr.h.
(dwarf_expr_context::push_address): Remove function.
* dwarf2/expr.h (struct dwarf_expr_context): Move to expr.c.
* dwarf2/frame.c (execute_stack_op): Now calls dwarf2_eval_exp.
* dwarf2/loc.c (dwarf2_evaluate_loc_desc_full): Now calls
dwarf2_eval_exp.
(dwarf2_locexpr_baton_eval): Now calls dwarf2_eval_exp.