]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Remove dwarf_expr_context from expr.h interface
authorZoran Zaric <Zoran.Zaric@amd.com>
Mon, 7 Dec 2020 19:00:23 +0000 (19:00 +0000)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 8 Dec 2020 16:16:20 +0000 (11:16 -0500)
commitc12b925f78ae5ae9ea22ec360d15c12559c292d8
tree4381697546a572de16ca9284c04cd56bc2fb151f
parentbedecfcbeac2828e5601013182dfbf39fe842daf
Remove dwarf_expr_context from expr.h interface

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.

Change-Id: I5b2cce5424546d48fd00fb95d53681e41478cd09
gdb/dwarf2/expr.c
gdb/dwarf2/expr.h
gdb/dwarf2/frame.c
gdb/dwarf2/loc.c