diff options
author | Tom Tromey <tromey@redhat.com> | 2013-07-23 06:56:53 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-07-23 06:56:53 +0000 |
commit | 365156ada142ed158af533d83ed88521e06439d7 (patch) | |
tree | 1481322c0bb545a69c3996ef7e755caa3b6b122f /gdb/dwarf2read.c | |
parent | 2eb14a9b5c2e04fb3a7329e1d4395b35a8553350 (diff) | |
download | gdb-365156ada142ed158af533d83ed88521e06439d7.zip gdb-365156ada142ed158af533d83ed88521e06439d7.tar.gz gdb-365156ada142ed158af533d83ed88521e06439d7.tar.bz2 |
* dwarf2read.c (init_cutu_and_read_dies): Revert patch from
2013-07-22.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0538816..70ab302 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -5015,7 +5015,7 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, struct die_info *comp_unit_die; int has_children; struct attribute *attr; - struct cleanup *cleanups; + struct cleanup *cleanups, *free_cu_cleanup = NULL; struct signatured_type *sig_type = NULL; struct dwarf2_section_info *abbrev_section; /* Non-zero if CU currently points to a DWO file and we need to @@ -5074,7 +5074,7 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, init_one_comp_unit (cu, this_cu); /* If an error occurs while loading, release our storage. */ - make_cleanup (free_heap_comp_unit, cu); + free_cu_cleanup = make_cleanup (free_heap_comp_unit, cu); } /* Get the header. */ @@ -5203,22 +5203,27 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, die_reader_func (&reader, info_ptr, comp_unit_die, has_children, data); /* Done, clean up. */ - if (keep) + if (free_cu_cleanup != NULL) { - /* We've successfully allocated this compilation unit. Let our - caller clean it up when finished with it. */ - discard_cleanups (cleanups); + if (keep) + { + /* We've successfully allocated this compilation unit. Let our + caller clean it up when finished with it. */ + discard_cleanups (free_cu_cleanup); - /* We can only discard free_cu_cleanup and all subsequent cleanups. - So we have to manually free the abbrev table. */ - dwarf2_free_abbrev_table (cu); + /* We can only discard free_cu_cleanup and all subsequent cleanups. + So we have to manually free the abbrev table. */ + dwarf2_free_abbrev_table (cu); - /* Link this CU into read_in_chain. */ - this_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain; - dwarf2_per_objfile->read_in_chain = this_cu; + /* Link this CU into read_in_chain. */ + this_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain; + dwarf2_per_objfile->read_in_chain = this_cu; + } + else + do_cleanups (free_cu_cleanup); } - else - do_cleanups (cleanups); + + do_cleanups (cleanups); } /* Read CU/TU THIS_CU in section SECTION, |