/* 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. */
{
struct dwarf_expr_context *retval;
- retval = xcalloc (1, sizeof (struct dwarf_expr_context));
+ retval = XCNEW (struct dwarf_expr_context);
retval->stack_len = 0;
retval->stack_allocated = 10;
- retval->stack = xmalloc (retval->stack_allocated
- * sizeof (struct dwarf_stack_value));
+ retval->stack = XNEWVEC (struct dwarf_stack_value, retval->stack_allocated);
retval->num_pieces = 0;
retval->pieces = 0;
retval->max_recursion_depth = 0x100;
while (op_ptr < op_end)
{
- enum dwarf_location_atom op = *op_ptr++;
+ enum dwarf_location_atom op = (enum dwarf_location_atom) *op_ptr++;
ULONGEST result;
/* Assume the value is not in stack memory.
Code that knows otherwise sets this to 1.
}
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);
}