diff options
author | Doug Evans <dje@google.com> | 2014-01-13 17:15:42 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2014-01-13 17:15:42 -0800 |
commit | 13aaf454542c1028a033ac836d7a0d47c63a7029 (patch) | |
tree | ef8e7526a16ef704d182a4bb80a30dae3f07e3dc /gdb/dwarf2read.c | |
parent | 067c5c1de23cff42597ec35d4c2a0730d8c16fbe (diff) | |
download | gdb-13aaf454542c1028a033ac836d7a0d47c63a7029.zip gdb-13aaf454542c1028a033ac836d7a0d47c63a7029.tar.gz gdb-13aaf454542c1028a033ac836d7a0d47c63a7029.tar.bz2 |
PR symtab/16426
* dwarf2read.c (dwarf2_get_dwz_file): Call gdb_bfd_record_inclusion.
(try_open_dwop_file): Ditto.
* gdb_bfd.c: #include "vec.h".
(bfdp): New typedef.
(struct gdb_bfd_data): New member included_bfds.
(gdb_bfd_unref): Unref all included bfds.
(gdb_bfd_record_inclusion): New function.
* gdb_bfd.h (gdb_bfd_record_inclusion): Declare.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index cbe04be..36e8a62 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2432,6 +2432,7 @@ dwarf2_get_dwz_file (void) do_cleanups (cleanup); + gdb_bfd_record_inclusion (dwarf2_per_objfile->objfile->obfd, dwz_bfd); dwarf2_per_objfile->dwz_file = result; return result; } @@ -10122,6 +10123,8 @@ lookup_dwo_unit_in_dwp (struct dwp_file *dwp_file, const char *comp_dir, If IS_DWP is TRUE, we're opening a DWP file, otherwise a DWO file. SEARCH_CWD is true if the current directory is to be searched. It will be searched before debug-file-directory. + If successful, the file is added to the bfd include table of the + objfile's bfd (see gdb_bfd_record_inclusion). If unable to find/open the file, return NULL. NOTE: This function is derived from symfile_bfd_open. */ @@ -10169,6 +10172,12 @@ try_open_dwop_file (const char *file_name, int is_dwp, int search_cwd) return NULL; } + /* Success. Record the bfd as having been included by the objfile's bfd. + This is important because things like demangled_names_hash lives in the + objfile's per_bfd space and may have references to things like symbol + names that live in the DWO/DWP file's per_bfd space. PR 16426. */ + gdb_bfd_record_inclusion (dwarf2_per_objfile->objfile->obfd, sym_bfd); + return sym_bfd; } |