From d83e736b1168bed98e6e67b473d0fa26603c2780 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 13 Sep 2011 21:44:27 +0000 Subject: gdb/ Remove excessive DWARF expressions memory duplication. * dwarf2loc.c (per_cu_dwarf_call): Remove variable back_to and its use for block.data. (indirect_pieced_value): Remove variable result. Remove variable back_to and its use for baton.data. (dwarf2_compile_expr_to_ax): Remove variable back_to and its use for block.data. * dwarf2read.c (dwarf2_fetch_die_location_block): Remove xmemdup. Update the function comment. --- gdb/dwarf2read.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gdb/dwarf2read.c') diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 6b87d2a..fc6a4d5 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -13854,9 +13854,9 @@ follow_die_ref (struct die_info *src_die, struct attribute *attr, return die; } -/* Return DWARF block and its CU referenced by OFFSET at PER_CU. Returned - value is intended for DW_OP_call*. You must call xfree on returned - dwarf2_locexpr_baton->data. */ +/* Return DWARF block referenced by DW_AT_location of DIE at OFFSET at PER_CU. + Returned value is intended for DW_OP_call*. Returned + dwarf2_locexpr_baton->data has lifetime of PER_CU->OBJFILE. */ struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block (unsigned int offset, @@ -13912,9 +13912,6 @@ dwarf2_fetch_die_location_block (unsigned int offset, } retval.per_cu = cu->per_cu; - if (retval.data) - retval.data = xmemdup (retval.data, retval.size, retval.size); - age_cached_comp_units (); return retval; -- cgit v1.1