From: Robert Rossi <bob@brasko.net>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Optionally print source code to gdb console window
Date: Tue, 7 May 2024 17:33:58 -0400 [thread overview]
Message-ID: <CA+L9JkgVTv1ZBnb==JKR45dEwghzuGxPMSNXffNbLaeYh4QexQ@mail.gmail.com> (raw)
In-Reply-To: <87ikzpa7k6.fsf@tromey.com>
[-- Attachment #1: Type: text/plain, Size: 2761 bytes --]
Hi Tom,
Thanks for the feedback. This is wrong in a few directions unfortunately.
The first is that the output looks like this in the suggested case,
(gdb) n
43 in test_main.cpp
(gdb)
44 in test_main.cpp
(gdb) n
47 in test_main.cpp
(gdb) list
42 in test_main.cpp
Which is not what the user wants. They don't want to see the updates in the
console
regarding source positions.
In addition, you can see capabilities they may want, 'list', no longer work.
The reason this issue was noticed in the first place is because this was the
vision of the original gdb maintainers when using annotate=2. In that mode,
no source code would be printed to the console. However, in mi new-ui mode
gdb does print the source code to the console.
My personal opinion is that gdb shouldn't print code to the console in mi
mode
or in new-ui mode. However, there were some people from eclipse a few years
ago that said they disagreed and that gdb should behave identical in new-ui
mode and not in new-ui mode, so i've attempted to make an option.
I'm happy to add docs and a test case.
Can you give me some pointers on how the implementation should change?
I should also ask, is an option even necessary?
I think if we remove the source printing from the console when in new-ui
mode
or in mi-mode it would make the most sense. After all, there is a front end
displaying
this information, no?
Thanks,
Bob Rossi
On Tue, May 7, 2024 at 12:52 PM Tom Tromey <tom@tromey.com> wrote:
> >>>>> "Robert" == Robert Rossi <bob@brasko.net> writes:
>
> Thank you for the patch.
>
> Robert> A little history. When using --annotations, gdb did not print
> Robert> the source code to the gdb console window. When using mi with
> Robert> new-ui it does. When I reported this in the past, several
> Robert> people said it was a feature that gdb printed the source code
> Robert> lines to the console.
>
> Robert> I've had several users of cgdb say they do not want gdb to print
> Robert> the source code to the gdb console window as they can see the
> Robert> code in the code view.
>
> Robert> I've created and attached a patch that I hope makes it optional
> Robert> to have gdb print the source code to the gdb console
> Robert> window. Could I have some feedback?
>
> I was reviewing your patch and I found is a pre-existing setting that
> claims to do what you want: "set source open off".
>
> Could you try this and see if it works? I suspect this is the way to
> go.
>
> Otherwise, we can look at your patch. From a first read, I think the
> idea is totally fine, but the implementation would need to be changed.
> Also it would need documentation and a test case.
>
> thanks,
> Tom
>
[-- Attachment #2: Type: text/html, Size: 3601 bytes --]
next prev parent reply other threads:[~2024-05-07 21:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 20:57 Robert Rossi
2024-05-06 22:18 ` Robert Rossi
2024-05-07 16:52 ` Tom Tromey
2024-05-07 21:33 ` Robert Rossi [this message]
2024-05-08 0:52 ` Tom Tromey
2024-05-08 1:29 ` Bob Rossi
2024-05-08 15:46 ` Tom Tromey
2024-05-08 23:07 ` Bob Rossi
2024-05-09 13:58 ` Tom Tromey
2024-05-10 10:19 ` Andrew Burgess
2024-05-10 18:07 ` Tom Tromey
2024-05-10 19:29 ` Pedro Alves
2024-05-10 19:23 ` Pedro Alves
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='CA+L9JkgVTv1ZBnb==JKR45dEwghzuGxPMSNXffNbLaeYh4QexQ@mail.gmail.com' \
--to=bob@brasko.net \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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