aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-01-06 10:11:04 +0000
committerTristan Gingold <gingold@adacore.com>2010-01-06 10:11:04 +0000
commit15d123c99f48b4b4620d87a0e9ee124de1a0659f (patch)
tree5587ecb3e8a4b88fe4d4a5f7aaac474728405d4d /gdb/symfile.c
parentd2ca6b5b4227727844a9ba907ac40038504b4476 (diff)
downloadgdb-15d123c99f48b4b4620d87a0e9ee124de1a0659f.zip
gdb-15d123c99f48b4b4620d87a0e9ee124de1a0659f.tar.gz
gdb-15d123c99f48b4b4620d87a0e9ee124de1a0659f.tar.bz2
2010-01-06 Tristan Gingold <gingold@adacore.com>
* symtab.c (lookup_global_symbol_from_objfile): Rename objfile parameter to main_objfile. Iterate on all separate debug objfiles. * symfile.h (symbol_file_add_separate) (find_separate_debug_file_by_debuglink): Remove parameter names. * symfile.c (symbol_file_add_separate): Use add_separate_objfile. (reread_symbols): Use free_objfile_separate_debug. * objfiles.h (struct objfile): Add separate_debug_objfile_link. Adjust comment. (objfile_separate_debug_iterate, add_separate_debug_objfile) (free_objfile_separate_debug): New prototypes. * objfiles.c (objfile_separate_debug_iterate): New function. (add_separate_debug_objfile, free_objfile_separate_debug): New functions. (free_objfile): Use free_objfile_separate_debug. Adjust for multiple separate debug objfile. (objfile_has_symbols): Adjust comment. Iterate on all separate debug objfiles. * minsyms.c (lookup_minimal_symbol): Adjust for multiple separate debug objfile. (lookup_minimal_symbol_text): Ditto. (lookup_minimal_symbol_by_pc_name): Ditto. (lookup_minimal_symbol_solib_trampoline): Ditto. (lookup_minimal_symbol_by_pc_section_1): Iterate on all separate debug objfiles.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index fe91fb6..91b7870 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1042,22 +1042,16 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
void
symbol_file_add_separate (bfd *bfd, int symfile_flags, struct objfile *objfile)
{
- /* Currently only one separate debug objfile is supported. */
- gdb_assert (objfile && objfile->separate_debug_objfile == NULL);
+ struct objfile *new_objfile;
- objfile->separate_debug_objfile =
- symbol_file_add_with_addrs_or_offsets
+ new_objfile = symbol_file_add_with_addrs_or_offsets
(bfd, symfile_flags,
0, /* No addr table. */
objfile->section_offsets, objfile->num_sections,
objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW
| OBJF_USERLOADED));
- objfile->separate_debug_objfile->separate_debug_objfile_backlink
- = objfile;
- /* Put the separate debug object before the normal one, this is so that
- usage of the ALL_OBJFILES_SAFE macro will stay safe. */
- put_objfile_before (objfile->separate_debug_objfile, objfile);
+ add_separate_debug_objfile (new_objfile, objfile);
}
/* Process the symbol file ABFD, as either the main file or as a
@@ -2272,14 +2266,9 @@ reread_symbols (void)
clear_objfile_data (objfile);
- /* Free the separate debug objfile if there is one. It will be
+ /* Free the separate debug objfiles. It will be
automatically recreated by sym_read. */
- if (objfile->separate_debug_objfile)
- {
- /* Note: no need to clear separate_debug_objfile field as it is
- done by free_objfile. */
- free_objfile (objfile->separate_debug_objfile);
- }
+ free_objfile_separate_debug (objfile);
/* FIXME: Do we have to free a whole linked list, or is this
enough? */