Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Eli Zaretskii <eliz@gnu.org>,
	brobecker@adacore.com,         gdb-patches@sourceware.org
Subject: Re: too many "no debugging symbols found" messages from shared libs
Date: Fri, 21 Nov 2008 18:46:00 -0000	[thread overview]
Message-ID: <e394668d0811201734l737cbf2cx659a46f9ad703173@mail.gmail.com> (raw)
In-Reply-To: <20081111041958.GA30329@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

On Mon, Nov 10, 2008 at 8:19 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Tue, Nov 11, 2008 at 06:10:46AM +0200, Eli Zaretskii wrote:
>> I thought the original patch came with a suggestion to add an option,
>> in case user wanted to see these messages.
>
> OK, I understand now.  I'd be fine with the shared library messages
> disabled or made consistent under 'set verbose'.  I don't think adding
> a new option would be great.

How about this?

I changed the calls to have_{partial,full}_symbols to two new
functions objfile_has_{partial,full}_symbols.  I think it's TRTTD
here.
This patch also adds a test for info_verbose so the messages are
printed for shared libs if verbosity turned on.

2008-11-20  Doug Evans  <dje@google.com>

        * 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.

[-- Attachment #2: gdb-081120-symfile-3.patch.txt --]
[-- Type: text/plain, Size: 3464 bytes --]

2008-11-20  Doug Evans  <dje@google.com>

	* 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 ();
 }
 \f
+/* 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"));

  reply	other threads:[~2008-11-21  1:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03 21:35 Doug Evans
2008-10-30  5:19 ` Joel Brobecker
2008-11-07 22:45   ` Doug Evans
2008-11-08  9:15     ` Eli Zaretskii
2008-11-10 16:46       ` Daniel Jacobowitz
2008-11-10 18:32         ` Joel Brobecker
2008-11-10 20:33         ` Eli Zaretskii
2008-11-10 20:51           ` Daniel Jacobowitz
2008-11-11  5:03             ` Eli Zaretskii
2008-11-11  5:34               ` Daniel Jacobowitz
2008-11-21 18:46                 ` Doug Evans [this message]
2008-11-21 19:16                   ` Eli Zaretskii
2008-11-21 19:24 Mark Kettenis
2008-11-21 22:08 ` Eli Zaretskii
2008-11-22  4:43   ` Doug Evans
2008-11-22  6:38     ` Eli Zaretskii
2008-11-22 16:49 Mark Kettenis
2008-11-22 17:49 ` Doug Evans
2008-11-22 21:41   ` Eli Zaretskii
2008-11-24  3:23     ` Paul Pluzhnikov
2008-11-24 16:54       ` Eli Zaretskii
2008-11-24 19:42         ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e394668d0811201734l737cbf2cx659a46f9ad703173@mail.gmail.com \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox