From: Bob Rossi <bob@brasko.net>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb@sourceware.org
Subject: Re: source annotation now prints source line
Date: Tue, 14 Apr 2020 22:13:24 -0400 [thread overview]
Message-ID: <20200415021324.GB31494@xubuntu.brasko.net> (raw)
In-Reply-To: <20200414121705.GD2366@embecosm.com>
On Tue, Apr 14, 2020 at 01:17:05PM +0100, Andrew Burgess wrote:
> * Bob Rossi <bob@brasko.net> [2020-04-14 07:23:04 -0400]:
>
> > On Sat, Apr 04, 2020 at 07:54:24PM -0400, Bob Rossi wrote:
> > > When the source annotation is sent to the front end, the source line
> > > is now also sent to the front end console. I believe this commit
> > > introduced it,
> > > https://github.com/bminor/binutils-gdb/commit/ec8e2b6d3051f0b4b2a8eee9917898e95046c62f
> > >
> > > Now CGDB displays,
> > > (gdb) n
> > > 43 int i = 3;
> > > (gdb)
> > >
> > > Instead of,
> > > (gdb) n
> > > (gdb)
> > >
> > > CGDB is a front end, and so it has a source view to display the code to
> > > the user. Why did GDB decide to also print the line of code to the front
> > > end's console window as well? This is confusing.
> >
> > The concept behind this commit seems incorrect.
> >
> > The motivation for the patch isn't clearly explained in
> > the commit message. I believe I've given a reasonable explanation
> > on why this patch makes no sense for front ends.
> >
> > Should I submit a patch reverting it?
>
> The patch in context is discussed here:
>
> https://sourceware.org/pipermail/gdb-patches/2019-June/158310.html
> https://sourceware.org/pipermail/gdb-patches/2019-June/158350.html
> https://sourceware.org/pipermail/gdb-patches/2019-June/158351.html
> https://sourceware.org/pipermail/gdb-patches/2019-June/158352.html
> https://sourceware.org/pipermail/gdb-patches/2019-June/158353.html
>
> I'm not sure you've convinced me yet that the idea behind the patch is
> incorrect. Annotations should be a (deprecated) way for F/Es to parse
> GDB's output, but they shouldn't impact _what_ GDB prints.
Annotation are still useful for the single purpose of allowing GDB
to tell you when the user is at the prompt. This allows front ends
to know when to issue a new command.
> In this particular case, printing the source line actually updates
> some internal state, which impacts how later commands operate. What
> this means is that the users session will behave differently if they
> have annotations on than when annotations are off.
I see. Seems good to have fixed that. Although I wonder how relevant
that information was as front ends have been using annotations for
20+ years without having noticed. Was this found from a user bug report?
> I guess, what I don't understand is that if a F/E wants to hide a
> particular piece of the output, why can't it just strip that from the
> output stream? The F/E must already be removing the annotation
> markers, so all the output must be going through the F/E anyway.
Front ends can not parse gdb's output. It's the golden rule.
It's unreliable and will ultimately fail.
> Further, removing this particular piece of output makes sense for this
> F/E, but is it always going to be true for all F/Es?
Yes, it does. It worked this way for 20+ years, and everyone was happy.
Was this added in because an actual user complained?
Even the tui does not show the source output in the console, even
after your patch.
Thanks,
Bob Rossi
next prev parent reply other threads:[~2020-04-15 2:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-04 23:54 Bob Rossi
2020-04-14 11:23 ` Bob Rossi
2020-04-14 12:17 ` Andrew Burgess
2020-04-14 12:57 ` Andrew Burgess
2020-04-15 2:13 ` Bob Rossi [this message]
2020-04-16 17:41 ` Andrew Burgess
2021-03-13 17:01 ` Bob Rossi
2021-03-15 13:10 ` Pedro Alves via Gdb
2024-05-04 20:09 ` Robert Rossi
2024-05-05 15:36 ` Robert Rossi
2024-05-05 16:06 ` Eli Zaretskii via Gdb
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=20200415021324.GB31494@xubuntu.brasko.net \
--to=bob@brasko.net \
--cc=andrew.burgess@embecosm.com \
--cc=gdb@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