2013-08-30 Phil Muldoon <pmuldoon@redhat.com>
[deliverable/binutils-gdb.git] / gdb / dwarf2expr.c
index 40ce608731851e886396671911841c3216520340..752d7826014c3a1e714fc8c9f166771597ef1e9d 100644 (file)
@@ -1,7 +1,6 @@
 /* DWARF 2 Expression Evaluator.
 
-   Copyright (C) 2001-2003, 2005, 2007-2012 Free Software Foundation,
-   Inc.
+   Copyright (C) 2001-2013 Free Software Foundation, Inc.
 
    Contributed by Daniel Berlin (dan@dberlin.org)
 
@@ -342,7 +341,7 @@ add_piece (struct dwarf_expr_context *ctx, ULONGEST size, ULONGEST offset)
     }
   else if (p->location == DWARF_VALUE_IMPLICIT_POINTER)
     {
-      p->v.ptr.die.cu_off = ctx->len;
+      p->v.ptr.die.sect_off = ctx->len;
       p->v.ptr.offset = value_as_long (dwarf_expr_fetch (ctx, 0));
     }
   else if (p->location == DWARF_VALUE_REGISTER)
@@ -725,6 +724,12 @@ execute_stack_op (struct dwarf_expr_context *ctx,
          break;
 
        case DW_OP_GNU_addr_index:
+         op_ptr = safe_read_uleb128 (op_ptr, op_end, &uoffset);
+         result = (ctx->funcs->get_addr_index) (ctx->baton, uoffset);
+         result += ctx->offset;
+         result_val = value_from_ulongest (address_type, result);
+         break;
+       case DW_OP_GNU_const_index:
          op_ptr = safe_read_uleb128 (op_ptr, op_end, &uoffset);
          result = (ctx->funcs->get_addr_index) (ctx->baton, uoffset);
          result_val = value_from_ulongest (address_type, result);
@@ -866,7 +871,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
              error (_("DWARF-2 expression error: DW_OP_GNU_implicit_pointer "
                       "is not allowed in frame context"));
 
-           /* The referred-to DIE of cu_offset kind.  */
+           /* The referred-to DIE of sect_offset kind.  */
            ctx->len = extract_unsigned_integer (op_ptr, ctx->ref_addr_size,
                                                 byte_order);
            op_ptr += ctx->ref_addr_size;
This page took 0.025263 seconds and 4 git commands to generate.