2004-11-18 Andrew Cagney * dwarf2read.c: Include "top.c". (dwarf2_has_info): Check for readnever_symbol_files. * symfile.c (readnever_symbol_files): Define. * top.h (readnever_symbol_files): Declare. * main.c (captured_main): Add --readnever option. ================================================================================ --- gdb/Makefile.in +++ gdb/Makefile.in @@ -2101,7 +2101,7 @@ dwarf2read.o: dwarf2read.c $(defs_h) $(b $(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) $(demangle_h) \ $(expression_h) $(filenames_h) $(macrotab_h) $(language_h) \ $(complaints_h) $(bcache_h) $(dwarf2expr_h) $(dwarf2loc_h) \ - $(cp_support_h) $(hashtab_h) $(command_h) $(gdbcmd_h) \ + $(cp_support_h) $(hashtab_h) $(command_h) $(gdbcmd_h) $(top_h) \ $(addrmap_h) $(gdb_string_h) $(gdb_assert_h) elfread.o: elfread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(elf_bfd_h) \ $(elf_mips_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ --- gdb/dwarf2read.c +++ gdb/dwarf2read.c @@ -46,6 +46,7 @@ #include "command.h" #include "gdbcmd.h" #include "addrmap.h" +#include "top.h" #include #include "gdb_string.h" @@ -1094,7 +1095,8 @@ dwarf2_has_info (struct objfile *objfile dwarf_loc_section = 0; bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL); - return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL); + return (!readnever_symbol_files + && dwarf_info_section != NULL && dwarf_abbrev_section != NULL); } /* When loading sections, we can either look for ".", or for --- gdb/main.c +++ gdb/main.c @@ -295,6 +295,7 @@ captured_main (void *data) {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 1}, {"readnow", no_argument, &readnow_symbol_files, 1}, + {"readnever", no_argument, &readnever_symbol_files, 1}, {"r", no_argument, &readnow_symbol_files, 1}, {"quiet", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1}, --- gdb/symfile.c +++ gdb/symfile.c @@ -76,6 +76,7 @@ static void clear_symtab_users_cleanup ( /* Global variables owned by this file */ int readnow_symbol_files; /* Read full symbols immediately */ +int readnever_symbol_files; /* Never read full symbols. */ /* External variables and functions referenced. */ --- gdb/top.h +++ gdb/top.h @@ -59,6 +59,7 @@ extern void set_prompt (char *); /* From random places. */ extern int readnow_symbol_files; +extern int readnever_symbol_files; /* Perform _initialize initialization */ extern void gdb_init (char *);