aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-03-07 16:17:29 +0000
committerTom Tromey <tromey@redhat.com>2011-03-07 16:17:29 +0000
commitb11896a5276900e7fda0bb6b7cd9d2b31a4945b3 (patch)
tree733433e09eb05de160b4549265cf1134e1b2dce3 /gdb/symfile.c
parentfda326dd1d341f03a75a36c8331b8cc8d1f637fa (diff)
downloadgdb-b11896a5276900e7fda0bb6b7cd9d2b31a4945b3.zip
gdb-b11896a5276900e7fda0bb6b7cd9d2b31a4945b3.tar.gz
gdb-b11896a5276900e7fda0bb6b7cd9d2b31a4945b3.tar.bz2
* xcoffread.c (xcoff_sym_fns): Update.
* symfile.h (struct sym_fns) <sym_read_psymbols>: New field. (enum symfile_add_flags) <SYMFILE_NO_READ>: New constant. * symfile.c (syms_from_objfile): Handle SYMFILE_NO_READ. (symbol_file_add_with_addrs_or_offsets): Likewise. (reread_symbols): Handle OBJF_PSYMTABS_READ. * somread.c (som_sym_fns): Update. * psymtab.h (require_partial_symbols): Declare. * psymtab.c (require_partial_symbols): New function. (ALL_OBJFILE_PSYMTABS_REQUIRED): New macro. (ALL_OBJFILE_PSYMTABS): Undef. (ALL_PSYMTABS): Move from psympriv.h. (lookup_partial_symtab, find_pc_sect_psymtab) (lookup_symbol_aux_psymtabs, relocate_psymtabs) (find_last_source_symtab_from_partial) (forget_cached_source_info_partial) (print_psymtab_stats_for_objfile, read_symtabs_for_function) (expand_partial_symbol_tables, read_psymtabs_with_filename) (map_symbol_names_psymtab, map_symbol_filenames_psymtab) (find_symbol_file_from_partial, map_matching_symbols_psymtab) (expand_symtabs_matching_via_partial, maintenance_info_psymtabs): Use ALL_OBJFILE_PSYMTABS_REQUIRED. * psympriv.h (ALL_PSYMTABS): Move to psymtab.c. * objfiles.h (OBJF_PSYMTABS_READ): New macro. * objfiles.c (objfile_has_partial_symbols): Handle lazily-read psymtabs. * mipsread.c (ecoff_sym_fns): Update. * machoread.c (macho_sym_fns): Update. * elfread.c (elf_symfile_read): Set up for lazy psymtab reading. (read_psyms): New function. (elf_sym_fns, elf_sym_fns_gdb_index): Update. (elf_sym_fns_lazy_psyms): New global. * dwarf2read.c (dwarf2_initialize_objfile): Don't call dwarf2_build_psymtabs. * dbxread.c (aout_sym_fns): Update. * coffread.c (coff_sym_fns): Update.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index de0b369..06b5dec 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1019,6 +1019,9 @@ syms_from_objfile (struct objfile *objfile,
(*objfile->sf->sym_read) (objfile, add_flags);
+ if ((add_flags & SYMFILE_NO_READ) == 0)
+ require_partial_symbols (objfile, 0);
+
/* Discard cleanups as symbol reading was successful. */
discard_cleanups (old_chain);
@@ -1079,9 +1082,15 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
struct cleanup *my_cleanups;
const char *name = bfd_get_filename (abfd);
const int from_tty = add_flags & SYMFILE_VERBOSE;
+ const int should_print = ((from_tty || info_verbose)
+ && (readnow_symbol_files
+ || (add_flags & SYMFILE_NO_READ) == 0));
if (readnow_symbol_files)
- flags |= OBJF_READNOW;
+ {
+ flags |= OBJF_READNOW;
+ add_flags &= ~SYMFILE_NO_READ;
+ }
my_cleanups = make_cleanup_bfd_close (abfd);
@@ -1100,7 +1109,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
/* We either created a new mapped symbol table, mapped an existing
symbol table file which has not had initial symbol reading
performed, or need to read an unmapped symbol table. */
- if (from_tty || info_verbose)
+ if (should_print)
{
if (deprecated_pre_add_symbol_hook)
deprecated_pre_add_symbol_hook (name);
@@ -1121,7 +1130,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
if ((flags & OBJF_READNOW))
{
- if (from_tty || info_verbose)
+ if (should_print)
{
printf_unfiltered (_("expanding to full symbols..."));
wrap_here ("");
@@ -1132,15 +1141,14 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
objfile->sf->qf->expand_all_symtabs (objfile);
}
- if ((from_tty || info_verbose)
- && !objfile_has_symbols (objfile))
+ if (should_print && !objfile_has_symbols (objfile))
{
wrap_here ("");
printf_unfiltered (_("(no debugging symbols found)..."));
wrap_here ("");
}
- if (from_tty || info_verbose)
+ if (should_print)
{
if (deprecated_post_add_symbol_hook)
deprecated_post_add_symbol_hook ();
@@ -2497,6 +2505,12 @@ reread_symbols (void)
/* Do not set flags as this is safe and we don't want to be
verbose. */
(*objfile->sf->sym_read) (objfile, 0);
+ if ((objfile->flags & OBJF_PSYMTABS_READ) != 0)
+ {
+ objfile->flags &= ~OBJF_PSYMTABS_READ;
+ require_partial_symbols (objfile, 0);
+ }
+
if (!objfile_has_symbols (objfile))
{
wrap_here ("");