2008-11-20 Doug Evans * objfiles.h (objfile_has_partial_symbols): Declare. (objfile_has_full_symbols): Declare. * objfiles.c (objfile_has_partial_symbols): New function. (objfile_has_full_symbols): New function. * symfile.c (symbol_file_add_with_addrs_or_offsets): Only print "no debugging symbols found" for main program, unless the user turns on verbosity. Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.79 diff -u -p -r1.79 objfiles.c --- objfiles.c 5 Sep 2008 11:37:17 -0000 1.79 +++ objfiles.c 21 Nov 2008 01:18:12 -0000 @@ -675,6 +675,22 @@ objfile_relocate (struct objfile *objfil breakpoint_re_set (); } +/* Return nonzero if OBJFILE has partial symbols. */ + +int +objfile_has_partial_symbols (struct objfile *objfile) +{ + return objfile->psymtabs != NULL; +} + +/* Return nonzero if OBJFILE has full symbols. */ + +int +objfile_has_full_symbols (struct objfile *objfile) +{ + return objfile->symtabs != NULL; +} + /* Many places in gdb want to test just to see if we have any partial symbols available. This function returns zero if none are currently available, nonzero otherwise. */ Index: objfiles.h =================================================================== RCS file: /cvs/src/src/gdb/objfiles.h,v retrieving revision 1.57 diff -u -p -r1.57 objfiles.h --- objfiles.h 18 Nov 2008 21:31:26 -0000 1.57 +++ objfiles.h 21 Nov 2008 01:18:12 -0000 @@ -472,6 +472,10 @@ extern void free_all_objfiles (void); extern void objfile_relocate (struct objfile *, struct section_offsets *); +extern int objfile_has_partial_symbols (struct objfile *); + +extern int objfile_has_full_symbols (struct objfile *); + extern int have_partial_symbols (void); extern int have_full_symbols (void); Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.218 diff -u -p -r1.218 symfile.c --- symfile.c 3 Oct 2008 16:36:10 -0000 1.218 +++ symfile.c 21 Nov 2008 01:18:12 -0000 @@ -1048,10 +1048,18 @@ symbol_file_add_with_addrs_or_offsets (b xfree (debugfile); } - if (!have_partial_symbols () && !have_full_symbols () + /* Only print "no debugging symbols found" for the main program, + unless the user turns on verbosity. There can be many shared libs + and the message is more noise than signal then. */ + if ((mainline || info_verbose) + && !objfile_has_partial_symbols (objfile) + && !objfile_has_full_symbols (objfile) && print_symbol_loading) { wrap_here (""); + /* No need to print the file name here for shared libs. + We only get here for shared libs if info_verbose is set, and if + info_verbose is set we've already printed the file name above. */ printf_unfiltered (_("(no debugging symbols found)")); if (from_tty || info_verbose) printf_unfiltered ("..."); @@ -2422,7 +2430,8 @@ reread_symbols (void) zero is OK since dbxread.c also does what it needs to do if objfile->global_psymbols.size is 0. */ (*objfile->sf->sym_read) (objfile, 0); - if (!have_partial_symbols () && !have_full_symbols ()) + if (!objfile_has_partial_symbols (objfile) + && !objfile_has_full_symbols (objfile)) { wrap_here (""); printf_unfiltered (_("(no debugging symbols found)\n"));