Add an objfile getter to gdb.Type
[deliverable/binutils-gdb.git] / gdb / dwarf2loc.c
index d712c29a7c268e49acd87a9d2dbc90cceab29f57..37cda40ecf35e8f9257b0e8899ed67477a215fbf 100644 (file)
@@ -36,6 +36,7 @@
 #include "dwarf2.h"
 #include "dwarf2expr.h"
 #include "dwarf2loc.h"
+#include "dwarf2read.h"
 #include "dwarf2-frame.h"
 #include "compile/compile.h"
 #include "common/selftest.h"
@@ -636,7 +637,7 @@ class dwarf_evaluate_loc_desc : public dwarf_expr_context
   }
 
   /* Callback function for dwarf2_evaluate_loc_desc.
-     Fetch the address indexed by DW_OP_GNU_addr_index.  */
+     Fetch the address indexed by DW_OP_addrx or DW_OP_GNU_addr_index.  */
 
   CORE_ADDR get_addr_index (unsigned int index) override
   {
@@ -1199,7 +1200,7 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
     {
       retval = call_site_find_chain_1 (gdbarch, caller_pc, callee_pc);
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const gdb_exception_error &e)
     {
       if (e.error == NO_ENTRY_VALUE_ERROR)
        {
@@ -1209,7 +1210,7 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
          return NULL;
        }
       else
-       throw_exception (e);
+       throw;
     }
 
   return retval;
@@ -2167,7 +2168,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
     {
       ctx.eval (data, size);
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        {
@@ -2185,7 +2186,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
          return allocate_optimized_out_value (subobj_type);
        }
       else
-       throw_exception (ex);
+       throw;
     }
 
   if (ctx.pieces.size () > 0)
@@ -2384,7 +2385,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
     {
       ctx.eval (dlbaton->data, dlbaton->size);
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        {
@@ -2397,7 +2398,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
          return 0;
        }
       else
-       throw_exception (ex);
+       throw;
     }
 
   switch (ctx.location)
@@ -2493,8 +2494,12 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
        struct value *val;
 
        for (pinfo = addr_stack; pinfo != NULL; pinfo = pinfo->next)
-         if (pinfo->type == baton->referenced_type)
-           break;
+         {
+           /* This approach lets us avoid checking the qualifiers.  */
+           if (TYPE_MAIN_TYPE (pinfo->type)
+               == TYPE_MAIN_TYPE (baton->referenced_type))
+             break;
+         }
        if (pinfo == NULL)
          error (_("cannot find reference address for offset property"));
        if (pinfo->valaddr != NULL)
@@ -2642,7 +2647,7 @@ class symbol_needs_eval_context : public dwarf_expr_context
     push_address (0, 0);
   }
 
-  /* DW_OP_GNU_addr_index doesn't require a frame.  */
+  /* DW_OP_addrx and DW_OP_GNU_addr_index doesn't require a frame.  */
 
    CORE_ADDR get_addr_index (unsigned int index) override
    {
@@ -4086,6 +4091,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
          fprintf_filtered (stream, " offset %s", phex_nz (ul, 4));
          break;
 
+       case DW_OP_addrx:
        case DW_OP_GNU_addr_index:
          data = safe_read_uleb128 (data, end, &ul);
          ul = dwarf2_read_addr_index (per_cu, ul);
This page took 0.052644 seconds and 4 git commands to generate.