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.
This commit is contained in:
Tristan Gingold
2010-01-06 10:11:04 +00:00
parent d2ca6b5b42
commit 15d123c99f
7 changed files with 199 additions and 82 deletions

View File

@ -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? */