mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 00:32:30 +08:00
Move get_object_address to dwarf_expr_context
Following the idea of merging the evaluators, the get_object_address and can be moved from dwarf_expr_executor and dwarf_evaluate_loc_desc classes to their base class dwarf_expr_context. gdb/ChangeLog: * dwarf2/expr.c (dwarf_expr_context::get_object_address): Move from dwarf_evaluate_loc_desc. (class dwarf_expr_context): Add object address member to dwarf_expr_context. * dwarf2/expr.h (dwarf_expr_context::get_frame_pc): Remove method. * dwarf2/frame.c (dwarf_expr_executor::get_object_address): Remove method. * dwarf2/loc.c (dwarf_evaluate_loc_desc::get_object_address): move to dwarf_expr_context. (class dwarf_evaluate_loc_desc): Move object address member to dwarf_expr_context.
This commit is contained in:
@ -188,6 +188,9 @@ struct dwarf_expr_context
|
|||||||
/* Compilation unit used for the evaluation. */
|
/* Compilation unit used for the evaluation. */
|
||||||
dwarf2_per_cu_data *per_cu = nullptr;
|
dwarf2_per_cu_data *per_cu = nullptr;
|
||||||
|
|
||||||
|
/* Object address used for the evaluation. */
|
||||||
|
CORE_ADDR obj_address = 0;
|
||||||
|
|
||||||
/* 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;
|
||||||
|
|
||||||
@ -200,7 +203,12 @@ struct dwarf_expr_context
|
|||||||
int deref_size) = 0;
|
int deref_size) = 0;
|
||||||
|
|
||||||
/* Return the `object address' for DW_OP_push_object_address. */
|
/* Return the `object address' for DW_OP_push_object_address. */
|
||||||
virtual CORE_ADDR get_object_address () = 0;
|
virtual CORE_ADDR get_object_address ()
|
||||||
|
{
|
||||||
|
if (obj_address == 0)
|
||||||
|
error (_("Location address is not set."));
|
||||||
|
return obj_address;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -244,11 +244,6 @@ public:
|
|||||||
invalid ("DW_OP_entry_value");
|
invalid ("DW_OP_entry_value");
|
||||||
}
|
}
|
||||||
|
|
||||||
CORE_ADDR get_object_address () override
|
|
||||||
{
|
|
||||||
invalid ("DW_OP_push_object_address");
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void invalid (const char *op) ATTRIBUTE_NORETURN
|
void invalid (const char *op) ATTRIBUTE_NORETURN
|
||||||
|
@ -674,18 +674,6 @@ public:
|
|||||||
: dwarf_expr_context (per_objfile)
|
: dwarf_expr_context (per_objfile)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
CORE_ADDR obj_address;
|
|
||||||
|
|
||||||
/* Callback function for get_object_address. Return the address of the VLA
|
|
||||||
object. */
|
|
||||||
|
|
||||||
CORE_ADDR get_object_address () override
|
|
||||||
{
|
|
||||||
if (obj_address == 0)
|
|
||||||
error (_("Location address is not set."));
|
|
||||||
return obj_address;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Execute DWARF block of call_site_parameter which matches KIND and
|
/* Execute DWARF block of call_site_parameter which matches KIND and
|
||||||
KIND_U. Choose DEREF_SIZE value of that parameter. Search
|
KIND_U. Choose DEREF_SIZE value of that parameter. Search
|
||||||
caller of this objects's frame.
|
caller of this objects's frame.
|
||||||
|
Reference in New Issue
Block a user