From 70454ee70ad63c77d39768f057d722214adef658 Mon Sep 17 00:00:00 2001 From: Zoran Zaric Date: Tue, 22 Sep 2020 10:44:45 +0100 Subject: 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. --- gdb/dwarf2/frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/dwarf2/frame.c') diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index ae26a8868d1..f3d38771708 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -233,7 +233,7 @@ execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size, scoped_value_mark free_values; ctx.push_address (initial, initial_in_stack_memory); - value *result_val = ctx.evaluate (exp, len, nullptr, this_frame); + value *result_val = ctx.evaluate (exp, len, true, nullptr, this_frame); if (VALUE_LVAL (result_val) == lval_memory) return value_address (result_val); -- cgit v1.2.1