From 08039c9efdbe7602bfb0d1b4396a3f3a39130239 Mon Sep 17 00:00:00 2001 From: Sanimir Agovic Date: Thu, 29 Aug 2013 12:25:03 +0000 Subject: cleanup: use value_lazy_at instead of allocate_value_lazy/attribute setter I came across a pattern used to construct a value in the following way: struct value *val = allocate_value_lazy (type); VALUE_LVAL (val) = lval_memory; set_value_address (val, address); Instead we fold the above call into: value_at_lazy (type, addr); 2013-08-27 Sanimir Agovic * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use value_at_lazy instead of assembling value via allocate_value_lazy and attribute setter. * findvar.c (default_read_var_value): Use value_at_lazy instead of assembling value via allocate_value_lazy and attribute setter. * valops.c (do_search_struct_field): Use value_at_lazy instead of assembling value via allocate_value_lazy and attribute setter. --- gdb/dwarf2loc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/dwarf2loc.c') diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 02afcdf..a1a384a 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -2303,11 +2303,9 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); do_cleanups (value_chain); - retval = allocate_value_lazy (type); - VALUE_LVAL (retval) = lval_memory; + retval = value_at_lazy (type, address + byte_offset); if (in_stack_memory) set_value_stack (retval, 1); - set_value_address (retval, address + byte_offset); } break; -- cgit v1.1