diff options
-rw-r--r-- | gdb/dwarf2/expr.h | 10 | ||||
-rw-r--r-- | gdb/dwarf2/frame.c | 5 | ||||
-rw-r--r-- | gdb/dwarf2/loc.c | 12 |
3 files changed, 9 insertions, 18 deletions
diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index 52f5051..d10bf9c 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -188,6 +188,9 @@ struct dwarf_expr_context /* Compilation unit used for the evaluation. */ 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. */ 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; /* 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: diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 6aaad94..37d3a40 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -244,11 +244,6 @@ public: invalid ("DW_OP_entry_value"); } - CORE_ADDR get_object_address () override - { - invalid ("DW_OP_push_object_address"); - } - private: void invalid (const char *op) ATTRIBUTE_NORETURN diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index e63b339..217d74c 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -674,18 +674,6 @@ public: : 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 KIND_U. Choose DEREF_SIZE value of that parameter. Search caller of this objects's frame. |