Merge evaluate_for_locexpr_baton evaluator
authorZoran Zaric <zoran.zaric@amd.com>
Tue, 15 Sep 2020 11:35:56 +0000 (12:35 +0100)
committerZoran Zaric <zoran.zaric@amd.com>
Thu, 5 Aug 2021 15:40:26 +0000 (16:40 +0100)
commitf9e4ed8baa9eeebc71be88f863c52f81e42bed34
treefae4b1fd02894866edb1fd00402028afb5b7ca4b
parent14a62404c9845827d92986af2dfcdbb7e48c65fc
Merge evaluate_for_locexpr_baton evaluator

The evaluate_for_locexpr_baton is the last derived class from the
dwarf_expr_context class. It's purpose is to support the passed in
buffer functionality.

Although, it is not really necessary to merge this class with it's
base class, doing that simplifies new expression evaluator design.

Considering that this functionality is going around the DWARF standard,
it is also reasonable to expect that with a new evaluator design and
extending the push object address functionality to accept any location
description, there will be no need to support passed in buffers.

Alternatively, it would also makes sense to abstract the interaction
between the evaluator and a given resource in the near future. The
passed in buffer would then be a specialization of that abstraction.

gdb/ChangeLog:

* dwarf2/expr.c (dwarf_expr_context::read_mem): Merge with
evaluate_for_locexpr_baton implementation.
* dwarf2/loc.c (class evaluate_for_locexpr_baton): Remove
class.
(evaluate_for_locexpr_baton::read_mem): Move to
dwarf_expr_context.
(dwarf2_locexpr_baton_eval): Instantiate dwarf_expr_context
instead of evaluate_for_locexpr_baton class.
gdb/dwarf2/expr.c
gdb/dwarf2/expr.h
gdb/dwarf2/loc.c