]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add as_lval argument to expression evaluator
authorZoran Zaric <Zoran.Zaric@amd.com>
Mon, 7 Dec 2020 19:00:16 +0000 (19:00 +0000)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 8 Dec 2020 16:16:19 +0000 (11:16 -0500)
commit0dc32c82c33bae82df269ff26b6f2fa550b9d18f
tree7ca4d864d3c7056d5afdba2574d1e9dab35ee6db
parente6bada58ebb64f9356e8912f921f30715b6c7308
Add as_lval argument to expression evaluator

There are cases where the result of the expression evaluation is
expected to be in a form of a value and not location description.

One place that has this requirement is dwarf_entry_parameter_to_value
function, but more are expected in the future. Until now, this
requirement was fulfilled by extending the evaluated expression with
a DW_OP_stack_value operation at the end.

New implementation, introduces a new evaluation argument instead.

* dwarf2/expr.c (dwarf_expr_context::fetch_result): Add as_lval
argument.
(dwarf_expr_context::eval_exp): Add as_lval argument.
* dwarf2/expr.h (struct dwarf_expr_context): Add as_lval
argument to fetch_result and eval_exp methods.
* dwarf2/frame.c (execute_stack_op): Add as_lval argument.
* dwarf2/loc.c (dwarf_entry_parameter_to_value): Remove
DWARF expression extension.
(dwarf2_evaluate_loc_desc_full): Add as_lval argument support.
(dwarf2_evaluate_loc_desc): Add as_lval argument support.
(dwarf2_locexpr_baton_eval): Add as_lval argument support.

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