Make DWARF evaluator return a single struct value
authorZoran Zaric <zoran.zaric@amd.com>
Tue, 15 Sep 2020 15:52:11 +0000 (16:52 +0100)
committerZoran Zaric <zoran.zaric@amd.com>
Thu, 5 Aug 2021 15:40:47 +0000 (16:40 +0100)
commitba5bc3e5a9268bcdc701d5a6701a9b41538a3f51
treed90bed1f7780e64faf9fe4e92cc7060ab8533745
parentefa86d3c26457c4c619fddef8232738d5091978b
Make DWARF evaluator return a single struct value

The patch is addressing the issue of class users writing and reading
the internal data of the dwarf_expr_context class.

At this point, all conditions are met for the DWARF evaluator to return
an evaluation result in a form of a single struct value object.

gdb/ChangeLog:

* dwarf2/expr.c (pieced_value_funcs): Chenge to static
function.
(allocate_piece_closure): Change to static function.
(dwarf_expr_context::fetch_result): New function.
* dwarf2/expr.h (struct piece_closure): Remove declaration.
(struct dwarf_expr_context): fetch_result new declaration.
fetch, fetch_address and fetch_in_stack_memory members move
to private.
(allocate_piece_closure): Remove.
* dwarf2/frame.c (execute_stack_op): Change to use
fetch_result.
* dwarf2/loc.c (dwarf2_evaluate_loc_desc_full): Change to use
fetch_result.
(dwarf2_locexpr_baton_eval): Change to use fetch_result.
        * dwarf2/loc.h (invalid_synthetic_pointer): Expose function.
gdb/dwarf2/expr.c
gdb/dwarf2/expr.h
gdb/dwarf2/frame.c
gdb/dwarf2/loc.c
gdb/dwarf2/loc.h