mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
Remove get_frame_cfa from dwarf_expr_context
Following the idea of merging the evaluators, the get_frame_cfa method can be moved from dwarf_expr_executor and dwarf_evaluate_loc_desc classes to their base class dwarf_expr_context. Once this is done, it becomes apparent that the method is only called once and it can be inlined. It is also necessary to check if the frame context information was provided before the DW_OP_call_frame_cfa operation is executed. gdb/ChangeLog: * dwarf2/expr.c (dwarf_expr_context::get_frame_cfa): Remove method. (dwarf_expr_context::execute_stack_op): Call frame context info check for DW_OP_call_frame_cfa. Remove use of get_frame_cfa. * dwarf2/expr.h (dwarf_expr_context::get_frame_cfa): Remove method. * dwarf2/frame.c (dwarf_expr_context::get_frame_cfa): Remove method. * dwarf2/loc.c (dwarf_expr_context::get_frame_cfa): Remove method.
This commit is contained in:
@ -29,6 +29,7 @@
|
|||||||
#include "dwarf2/expr.h"
|
#include "dwarf2/expr.h"
|
||||||
#include "dwarf2/loc.h"
|
#include "dwarf2/loc.h"
|
||||||
#include "dwarf2/read.h"
|
#include "dwarf2/read.h"
|
||||||
|
#include "frame.h"
|
||||||
#include "gdbsupport/underlying.h"
|
#include "gdbsupport/underlying.h"
|
||||||
#include "gdbarch.h"
|
#include "gdbarch.h"
|
||||||
|
|
||||||
@ -1217,7 +1218,9 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_OP_call_frame_cfa:
|
case DW_OP_call_frame_cfa:
|
||||||
result = this->get_frame_cfa ();
|
ensure_have_frame (this->frame, "DW_OP_call_frame_cfa");
|
||||||
|
|
||||||
|
result = dwarf2_frame_cfa (this->frame);
|
||||||
result_val = value_from_ulongest (address_type, result);
|
result_val = value_from_ulongest (address_type, result);
|
||||||
in_stack_memory = true;
|
in_stack_memory = true;
|
||||||
break;
|
break;
|
||||||
|
@ -192,9 +192,6 @@ struct dwarf_expr_context
|
|||||||
/* Read LENGTH bytes at ADDR into BUF. */
|
/* Read LENGTH bytes at ADDR into BUF. */
|
||||||
virtual void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t length) = 0;
|
virtual void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t length) = 0;
|
||||||
|
|
||||||
/* Return the CFA for the frame. */
|
|
||||||
virtual CORE_ADDR get_frame_cfa () = 0;
|
|
||||||
|
|
||||||
/* Return the PC for the frame. */
|
/* Return the PC for the frame. */
|
||||||
virtual CORE_ADDR get_frame_pc ()
|
virtual CORE_ADDR get_frame_pc ()
|
||||||
{
|
{
|
||||||
|
@ -249,11 +249,6 @@ public:
|
|||||||
invalid ("DW_OP_push_object_address");
|
invalid ("DW_OP_push_object_address");
|
||||||
}
|
}
|
||||||
|
|
||||||
CORE_ADDR get_frame_cfa () override
|
|
||||||
{
|
|
||||||
invalid ("DW_OP_call_frame_cfa");
|
|
||||||
}
|
|
||||||
|
|
||||||
CORE_ADDR get_tls_address (CORE_ADDR offset) override
|
CORE_ADDR get_tls_address (CORE_ADDR offset) override
|
||||||
{
|
{
|
||||||
invalid ("DW_OP_form_tls_address");
|
invalid ("DW_OP_form_tls_address");
|
||||||
|
@ -699,14 +699,6 @@ public:
|
|||||||
struct dwarf2_per_cu_data *per_cu;
|
struct dwarf2_per_cu_data *per_cu;
|
||||||
CORE_ADDR obj_address;
|
CORE_ADDR obj_address;
|
||||||
|
|
||||||
/* Helper function for dwarf2_evaluate_loc_desc. Computes the CFA for
|
|
||||||
the frame in BATON. */
|
|
||||||
|
|
||||||
CORE_ADDR get_frame_cfa () override
|
|
||||||
{
|
|
||||||
return dwarf2_frame_cfa (frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Helper function for dwarf2_evaluate_loc_desc. Computes the PC for
|
/* Helper function for dwarf2_evaluate_loc_desc. Computes the PC for
|
||||||
the frame in BATON. */
|
the frame in BATON. */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user