]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/dwarf2/expr.h
Add dwarf2_per_objfile to dwarf_expr_context and dwarf2_frame_cache
[thirdparty/binutils-gdb.git] / gdb / dwarf2 / expr.h
index 2f3d2ce042d3fa5a799b2e93cc27b225c4e0f244..fd9c2bb6243c21707b5a7d36c2e2dc1a4f4dfabf 100644 (file)
@@ -25,6 +25,8 @@
 #include "leb128.h"
 #include "gdbtypes.h"
 
+struct dwarf2_per_objfile;
+
 /* The location of a value.  */
 enum dwarf_value_location
 {
@@ -117,7 +119,7 @@ struct dwarf_stack_value
    its current state and its callbacks.  */
 struct dwarf_expr_context
 {
-  dwarf_expr_context ();
+  dwarf_expr_context (dwarf2_per_objfile *per_objfile);
   virtual ~dwarf_expr_context () = default;
 
   void push_address (CORE_ADDR value, bool in_stack_memory);
@@ -139,10 +141,6 @@ struct dwarf_expr_context
      context and operations depending on DW_FORM_ref_addr are not allowed.  */
   int ref_addr_size;
 
-  /* Offset used to relocate DW_OP_addr, DW_OP_addrx, and
-     DW_OP_GNU_addr_index arguments.  */
-  CORE_ADDR offset;
-
   /* The current depth of dwarf expression recursion, via DW_OP_call*,
      DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum
      depth we'll tolerate before raising an error.  */
@@ -185,6 +183,9 @@ struct dwarf_expr_context
      two cases need to be handled separately.)  */
   std::vector<dwarf_expr_piece> pieces;
 
+  /* We evaluate the expression in the context of this objfile.  */
+  dwarf2_per_objfile *per_objfile;
+
   /* Return the value of register number REGNUM (a DWARF register number),
      read as an address.  */
   virtual CORE_ADDR read_addr_from_reg (int regnum) = 0;