]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* dwarf2read.c (free_dwo_file): Add comment.
authorDoug Evans <dje@google.com>
Mon, 1 Apr 2013 21:11:31 +0000 (21:11 +0000)
committerDoug Evans <dje@google.com>
Mon, 1 Apr 2013 21:11:31 +0000 (21:11 +0000)
(dwarf2_per_objfile_free): Unref dwp bfd.

* dwarf2read.c (open_and_init_dwp_file): Remove incorrect, and
unnecessary, cleanup.

gdb/ChangeLog
gdb/dwarf2read.c

index c5847882809cefb67f4220059e0c79e50c9d6de2..cb6114f132ce8dc34485bfa06fe03e9c2eb03be1 100644 (file)
@@ -1,3 +1,13 @@
+2013-04-01  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (free_dwo_file): Add comment.
+       (dwarf2_per_objfile_free): Unref dwp bfd.
+
+2013-03-29  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (open_and_init_dwp_file): Remove incorrect, and
+       unnecessary, cleanup.
+
 2013-03-28  Doug Evans  <dje@google.com>
 
        * python/python.c (finish_python_initialization): Provide suggestion
index faee1a83304c4eb19bb76091f6e8c54780e840b8..6151b3d5151d74994dd256a2661ca38eb792ce20 100644 (file)
@@ -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);