public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: "Andrew Burgess" <aburgess@redhat.com>,
	"Alexandra Hájková" <ahajkova@redhat.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: defer warnings when loading separate debug files
Date: Mon, 19 Dec 2022 21:29:45 -0500	[thread overview]
Message-ID: <737f6e56-efe3-1b5f-03cb-41a629692bf1@simark.ca> (raw)
In-Reply-To: <87cz8fzc5u.fsf@redhat.com>


> I think we should not underestimate the concern a warning can cause.
> Sure, it's not an error, but there are some users who, upon seeing a
> warning, will stop and seek help until they have resolved the issue for
> fear that it's important.
> 
> Maybe if we extended the warning to say "... but don't worry I found
> some debug information elsewhere." then this would stop the worry?
> 
> But, I would suggest that the above message could fall into a category
> below warning.  In my mind the "levels" are:
> 
>   error - something went wrong and GDB can't continue,
> 
>   warning - something went wrong, GDB can continue, but your experience
>   is not going to be what you expect in some way,
> 
>   info? (this doesn't exist right now) - just some useful information,
>   but everything is just fine.
> 
> The message Alexandra is changing could be an 'info' message when GDB is
> able to find debug elsewhere, but could be promoted to 'warning' when
> GDB is unable to find any alternative debug information.

Yeah that makes sense.  But given that my view appears to be the
exception, I'm fine with going with no message at all as well, if we
think regular users don't care.  I'm not a regular GDB user, that's
probably why I want to be warned about everything that can possibly make
GDB misbehave, so I can fix it.

> Right now, some 'info' messages are just printed to the console by GDB,
> e.g. when we print 'Reading symbols from /tmp/test...', but there are
> plenty of cases where GDB doesn't print out all the intermediate steps
> that it tries when looking for a result, e.g. if I do 'file ls' then GDB
> will find /usr/bin/ls, but GDB doesn't tell me where it looked and
> didn't find 'ls'.  I know this isn't exactly the same, but, it isn't
> unrelated I think.
> 
>>                                                              Maybe it's
>> an old one I installed by hand, that I should delete, maybe the package
>> from the distro is broken.  In any case it's good for the user to know
>> so they can fix the situation.
> 
> In my experience, in most cases, the user doesn't care about fixing the
> problem, unless it is somehow stopping them debug their issue.  If GDB
> can find what it needs, then I think most users don't care, things just
> work, and they're fine with that.

I personally would like to be warned, but you're probably right about
the average user.

> And it's not like GDB is hiding what its doing, there are info messages
> printed that GDB is downloading a file, then that GDB is reading debug
> from the freshly downloaded file, so if the user does have some
> expectations about which debug file should be used, this should inform
> them that something isn't going quite right.
> 
> Maybe one thing we could do, which might help in this area, would be, at
> the point where the (potential) warning is added to the warning list we
> could emit a debug print guarded by separate_debug_file_debug.  That
> way, if a user asks the question, "why is GDB failing to find the
> expected debug file?", they can 'set debug separate-debug-file' and the
> answer would be there?

Agreed, it's so difficult to figure out why GDB doesn't find separate
debug info sometimes, we need good debug messages.

Simon

      reply	other threads:[~2022-12-20  2:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 12:15 AlexandraH=?UTF-8?B?w6E=?=jkov=?UTF-8?B?w6E=?=ahajkova
2022-12-15 15:57 ` Bruno Larsen
2022-12-15 16:35 ` Simon Marchi
     [not found]   ` <CAJVr-EOShPVS_ZBvfHqKkbPK1O3d+92DDbpEoeBVr1_s7_XWYA@mail.gmail.com>
2022-12-19 12:28     ` Fwd: " Alexandra Petlanova Hajkova
2022-12-19 13:04   ` Frank Ch. Eigler
2022-12-19 14:43   ` Andrew Burgess
2022-12-20  2:29     ` Simon Marchi [this message]

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=737f6e56-efe3-1b5f-03cb-41a629692bf1@simark.ca \
    --to=simark@simark.ca \
    --cc=aburgess@redhat.com \
    --cc=ahajkova@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).