/* DWARF 2 Expression Evaluator.
- Copyright (C) 2001-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
Contributed by Daniel Berlin (dan@dberlin.org)
#include "gdbcore.h"
#include "dwarf2.h"
#include "dwarf2expr.h"
-#include "gdb_assert.h"
/* Local prototypes. */
case DW_OP_breg31:
{
op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset);
- result = (ctx->funcs->read_reg) (ctx->baton, op - DW_OP_breg0);
+ result = (ctx->funcs->read_addr_from_reg) (ctx->baton,
+ op - DW_OP_breg0);
result += offset;
result_val = value_from_ulongest (address_type, result);
}
{
op_ptr = safe_read_uleb128 (op_ptr, op_end, ®);
op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset);
- result = (ctx->funcs->read_reg) (ctx->baton, reg);
+ result = (ctx->funcs->read_addr_from_reg) (ctx->baton, reg);
result += offset;
result_val = value_from_ulongest (address_type, result);
}
if (ctx->location == DWARF_VALUE_MEMORY)
result = dwarf_expr_fetch_address (ctx, 0);
else if (ctx->location == DWARF_VALUE_REGISTER)
- result = (ctx->funcs->read_reg) (ctx->baton,
- value_as_long (dwarf_expr_fetch (ctx, 0)));
+ result = (ctx->funcs->read_addr_from_reg)
+ (ctx->baton,
+ value_as_long (dwarf_expr_fetch (ctx, 0)));
else
error (_("Not implemented: computing frame "
"base using explicit value operator"));
}
break;
+ case DW_OP_push_object_address:
+ /* Return the address of the object we are currently observing. */
+ result = (ctx->funcs->get_object_address) (ctx->baton);
+ result_val = value_from_ulongest (address_type, result);
+ break;
+
default:
error (_("Unhandled dwarf expression opcode 0x%x"), op);
}