This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix too many "no debugging symbols found" warnings.
On Wednesday 01 July 2009 20:55:33, Doug Evans wrote:
> On Wed, Jul 1, 2009 at 11:02 AM, Pedro Alves<pedro@codesourcery.com> wrote:
> > On Wednesday 01 July 2009 18:52:50, Doug Evans wrote:
> >> Does anyone have any other concerns with the patch?
> >
> > Does this mean that there will be no way anymore to say
> > that you don't want symbol loading info? ?I was assuming
> > we'd still have that option. ?:-/
> >
> > I find "set print symbol-loading-warnings" a bit
> > misnamed, since this isn't about *all* warnings. ?In fact,
> > it's about *no* symbols. ?I don't really want to get
> > bishedy, but, why was it that keeping the existing
> > option and adding a new one wasn't good?
> >
> > set print symbol-loading on|off
> > set print no-symbols-found-warnings on|off
>
> First, there's a bit of history here.
> I added "print symbol-loading" to be able to turn off the "no
> debugging symbols found" verbosity, but it wasn't working out the way
> I wanted - it was all or nothing when what I really wanted was a way
> to turn off the verbosity for automatically loaded libraries (for
> which there can be 100's or even >1000) and not, for example,
> executables, or anything manually done from the command line (one can
> think of executables as falling in this category).
Okay, I saw the original patch now. Let's focus on that first. This could be
reasonable, I suppose:
set print symbol-loading auto|on|off
^ ^ ^
| | |
| | +- never
| |
| +----- always, output even when gdb auto-loads
|
+-------- default, output only when gdb auto-loads
although IIUC, GDB never behaved like that "on" setting, so maybe we can
ignore that option, and think of "auto" -> "on". OTOH, the "on" above
matches what "set verbose" does. Keep reading.
> Secondly, it's not clear to me that users would ever want to turn off
> messages for things they do from the command line. i.e. "if
> (from_tty)" is a sufficient check for these particular messages and
> that's what 6.8 does (well, it also tests info_verbose). I realize
> scripts might cause an excess of verbosity from command-line related
> symbol loading, but I don't know of any existing examples of that, so
> I didn't want to keep two options if just for that.
> Thirdly, symbol-loading-warnings is a compatible renaming of
> symbol-loading - any distributions that have already shipped "print
> symbol-loading" will see a minor change in behavior in 7.0 but nothing
> will break. [I realize this isn't a strong argument to some. I don't
> have a strong opinion on the option name choice, I just mention it as
> it did factor into the choice.]
That's ingenious, but overboard, if you ask me. An even more compatible
change would be to not change the command name at all.
>
> Fourth, gdb doesn't print symbol loading messages if (!from_tty &&
> !info_verbose).
Right...
> Except for the "no debugging symbols found" warning,
> "print symbol-loading" doesn't apply unless either of those flags are
> true (in current cvs).
... and isn't this the real problem here? If we're not printing the
"Reading symbols from foo...done." part, then we should not print the
"no debugging symbols found" message either, ever, should we? Can't we
just decide to output that latter warning under the same predicate as
for the former "Reading..." output? It seems clear to me that it's
formatting intent was to be always output in between
the "from foo.so..." and "...done." bits.
"Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done."
That is, it was missing a "(from_tty || info_verbose)" check?
Why do we need the new option for this specific warning at all?
> Fifth, in the past I've observed pushback on unnecessary options, and
> so here I was trying to "go with the flow".
There's the "flow" again :-)
> Put this all together and that's why the patch is the way it is.
>
> Ultimately, I don't have a strong opinion on having both options. I
> do have a strong opinion on providing an option to the user to let
> them turn off the "no debugging symbols found" message (and other such
> messages) from automatically loaded libraries.
I think we're complicating things. If GDB is *already printing something*,
like:
"Reading symbols from /lib/librt.so.1... ...done."
... then it should not be a problem for anyone to see this:
"Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done."
OTOH, if GDB is printing nothing, then printing a sole:
"(no debugging symbols found)"
out of the blue, doesn't ever seem useful to me. Is that ever really useful?
Wouldn't tweaking the "no debugging symbols found" predicate make everyone happy?
--
Pedro Alves