aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-09-13 21:44:27 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-09-13 21:44:27 +0000
commitd83e736b1168bed98e6e67b473d0fa26603c2780 (patch)
tree610895bec6ec5b49229ff2b30061832b0de33043 /gdb/dwarf2read.c
parent0935723e5e203625c49e97753a79902f919fbded (diff)
downloadfsf-binutils-gdb-d83e736b1168bed98e6e67b473d0fa26603c2780.zip
fsf-binutils-gdb-d83e736b1168bed98e6e67b473d0fa26603c2780.tar.gz
fsf-binutils-gdb-d83e736b1168bed98e6e67b473d0fa26603c2780.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c9
1 files changed, 3 insertions, 6 deletions
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;