/* DWARF 2 location expression support for GDB.
- Copyright (C) 2003-2017 Free Software Foundation, Inc.
+ Copyright (C) 2003-2018 Free Software Foundation, Inc.
Contributed by Daniel Jacobowitz, MontaVista Software, Inc.
{
struct value *target_val = (struct value *) value_computed_closure (v);
- value_free (target_val);
+ value_decref (target_val);
}
/* Vector for methods for an entry value reference where the referenced value
target_type, caller_frame,
caller_per_cu);
- release_value (target_val);
+ release_value (target_val).release ();
val = allocate_computed_value (type, &entry_data_value_funcs,
target_val /* closure */);
struct frame_info *frame)
{
struct piece_closure *c = new piece_closure;
- int i;
c->refc = 1;
c->per_cu = per_cu;
= (struct piece_closure *) value_computed_closure (value);
struct type *type;
struct frame_info *frame;
- struct dwarf2_locexpr_baton baton;
int i, bit_length;
LONGEST bit_offset;
struct dwarf_expr_piece *piece = NULL;
{
for (dwarf_expr_piece &p : c->pieces)
if (p.location == DWARF_VALUE_STACK)
- value_free (p.v.value);
+ value_decref (p.v.value);
delete c;
}
{
struct piece_closure *c;
ULONGEST bit_size = 0;
- int i;
for (dwarf_expr_piece &piece : ctx.pieces)
bit_size += piece.size;
{
struct type *ptr_type;
CORE_ADDR address = ctx.fetch_address (0);
- int in_stack_memory = ctx.fetch_in_stack_memory (0);
+ bool in_stack_memory = ctx.fetch_in_stack_memory (0);
/* DW_OP_deref_size (and possibly other operations too) may
create a pointer instead of an address. Ideally, the
size_t len = TYPE_LENGTH (subobj_type);
size_t max = TYPE_LENGTH (type);
struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
- struct cleanup *cleanup;
if (subobj_byte_offset + len > max)
invalid_synthetic_pointer ();
/* Preserve VALUE because we are going to free values back
to the mark, but we still need the value contents
below. */
- value_incref (value);
+ value_ref_ptr value_holder (value_incref (value));
free_values.free_to_mark ();
- cleanup = make_cleanup_value_free (value);
retval = allocate_value (subobj_type);
memcpy (value_contents_raw (retval),
value_contents_all (value) + subobj_byte_offset, len);
-
- do_cleanups (cleanup);
}
break;
&setdebuglist, &showdebuglist);
#if GDB_SELF_TEST
- selftests::register_test (selftests::copy_bitwise_tests);
+ selftests::register_test ("copy_bitwise", selftests::copy_bitwise_tests);
#endif
}