From: Doug Evans Date: Mon, 1 Apr 2013 21:11:31 +0000 (+0000) Subject: * dwarf2read.c (free_dwo_file): Add comment. X-Git-Tag: gdb_7_6-2013-04-26-release~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f530979bd661fd195f57b3103c834b8f9d5c9f8;p=thirdparty%2Fbinutils-gdb.git * dwarf2read.c (free_dwo_file): Add comment. (dwarf2_per_objfile_free): Unref dwp bfd. * dwarf2read.c (open_and_init_dwp_file): Remove incorrect, and unnecessary, cleanup. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c5847882809..cb6114f132c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2013-04-01 Doug Evans + + * dwarf2read.c (free_dwo_file): Add comment. + (dwarf2_per_objfile_free): Unref dwp bfd. + +2013-03-29 Doug Evans + + * dwarf2read.c (open_and_init_dwp_file): Remove incorrect, and + unnecessary, cleanup. + 2013-03-28 Doug Evans * python/python.c (finish_python_initialization): Provide suggestion diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index faee1a83304..6151b3d5151 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -9079,8 +9079,6 @@ open_and_init_dwp_file (const char *comp_dir) dwp_file->dbfd = dbfd; do_cleanups (cleanups); - cleanups = make_cleanup (free_dwo_file_cleanup, dwp_file); - /* +1: section 0 is unused */ dwp_file->num_sections = bfd_count_sections (dbfd) + 1; dwp_file->elf_sections = @@ -9095,8 +9093,6 @@ open_and_init_dwp_file (const char *comp_dir) dwp_file->loaded_cutus = allocate_dwp_loaded_cutus_table (objfile); - discard_cleanups (cleanups); - if (dwarf2_read_debug) { fprintf_unfiltered (gdb_stdlog, "DWP file found: %s\n", dwp_file->name); @@ -9253,6 +9249,7 @@ free_dwo_file (struct dwo_file *dwo_file, struct objfile *objfile) int ix; struct dwarf2_section_info *section; + /* Note: dbfd is NULL for virtual DWO files. */ gdb_bfd_unref (dwo_file->dbfd); VEC_free (dwarf2_section_info_def, dwo_file->sections.types); @@ -19702,6 +19699,8 @@ dwarf2_per_objfile_free (struct objfile *objfile, void *d) if (data->dwo_files) free_dwo_files (data->dwo_files, objfile); + if (data->dwp_file) + gdb_bfd_unref (data->dwp_file->dbfd); if (data->dwz_file && data->dwz_file->dwz_bfd) gdb_bfd_unref (data->dwz_file->dwz_bfd);