From: Patrick Palka <patrick@parcs.ath.cx>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/3] Replace TUI's select_frame hook (PR tui/13378)
Date: Tue, 30 Jun 2015 15:12:00 -0000 [thread overview]
Message-ID: <CA+C-WL8Zcf766aJjuPQ1rfUriJoTsoz4jJcQHuX8C--L_D4Kcw@mail.gmail.com> (raw)
In-Reply-To: <CA+C-WL-fK2tXDEyYwSWS7KmA4ek8QZ_QaoQBmwS3x-iYMK0nfg@mail.gmail.com>
On Tue, Jun 30, 2015 at 10:54 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> On Tue, Jun 30, 2015 at 10:08 AM, Pedro Alves <palves@redhat.com> wrote:
>> On 06/30/2015 01:37 PM, Patrick Palka wrote:
>>> This version adds a tui_normal_stop observer in place of augmenting the
>>> tui_on_sync_execution_done observer. And tui_refresh_frame_and_register_information
>>> can now be made a static function.
>>>
>>> The observer takes a print_frame parameter that is supposed to inform us
>>> whether the frame should be printed. This boolean seems to only be true for
>>
>> s/only be true/only be false/
>>
>>> when the inferior has exited. Since tui_refresh_frame_and_register_information
>>> already handles this case by checking has_stack_frames() this patch elects to
>>> ignore this parameter in the observer.
>>
>> This is OK. I'll take a look at patch 2 soon.
>>
>> Did you find that we still need deprecated_print_frame_info_listing_hook?
>
> It still seems to be "necessary" -- at least, I can't outright remove it.
>
> The only caller of deprecated_print_frame_info_listing_hook is in
> print_frame_info and its use looks like this:
>
> if (deprecated_print_frame_info_listing_hook)
> (*deprecated_print_frame_info_listing_hook) (...);
> else
> { ... other code ... }
>
> If I remove the hook by replacing the above code with
>
> { ... other code ... }
>
> Then a regression occurs: the TUI decides to make sure that the
> currently executing line always sits at the top of the window instead
> of only scrolling the screen when the currently executing line is not
> invisible.
>
> But if I disable the hook by replacing the body of code in print_frame_info with
>
> if (deprecated_print_frame_info_listing_hook)
> ;
> else
> { ... other code ... }
>
> Then everything seems to be OK. So the code in the else branch is
> interfering with TUI somehow. I will investigate further.
The call to "print_source_lines (sal.symtab, sal.line, sal.line + 1,
0);" in the else branch eventually calls "tui_show_source (sal.line);"
which adjusts the source window so that sal.line is the very first
line visible.
I'm not sure how easy this would be to fix properly. We want to avoid
calling print_source_lines in print_frame_info when the TUI is active.
Of course, I can just guard the code with "if (tui_active)" but that's
not a good fix. Instead of removing the hook yet, what about making
it (tui_print_frame_info_listing_hook) a no-op in the interim?
BTW, in the CLI, this call to print_source_lines is responsible for
printing the stopped-at source line to stdout, e.g.
(gdb) start
....
Temporary breakpoint 2, main () at 13378.c:9
9 int i = 0; // THIS LINE
(gdb)
next prev parent reply other threads:[~2015-06-30 15:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-27 2:35 [PATCH 1/3] Correctly initialize the TUI locator window Patrick Palka
2015-06-27 2:35 ` [PATCH 2/3] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378) Patrick Palka
2015-06-30 2:32 ` [PATCH] " Patrick Palka
2015-06-30 14:27 ` Pedro Alves
2015-06-30 14:45 ` Patrick Palka
2015-06-30 15:11 ` Pedro Alves
2015-06-30 15:15 ` Patrick Palka
2015-06-30 16:51 ` [PATCH 2/3] " Patrick Palka
2015-06-30 17:26 ` Pedro Alves
2015-06-27 2:35 ` [PATCH 3/3] Replace TUI's select_frame hook " Patrick Palka
2015-06-27 2:50 ` Patrick Palka
2015-06-30 9:32 ` Pedro Alves
2015-06-30 12:16 ` Patrick Palka
2015-06-30 12:37 ` Patrick Palka
2015-06-30 14:08 ` Pedro Alves
2015-06-30 14:54 ` Patrick Palka
2015-06-30 14:56 ` Patrick Palka
2015-06-30 15:12 ` Patrick Palka [this message]
2015-06-30 15:47 ` Pedro Alves
2015-06-30 16:40 ` Patrick Palka
2015-06-30 17:07 ` Pedro Alves
2015-06-30 17:11 ` Patrick Palka
2015-06-30 17:32 ` Pedro Alves
2015-06-30 17:49 ` Patrick Palka
2015-07-01 12:40 ` Patrick Palka
2015-06-30 13:23 ` Pedro Alves
2015-06-30 14:03 ` Patrick Palka
2015-06-30 8:36 ` [PATCH 1/3] Correctly initialize the TUI locator window 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+C-WL8Zcf766aJjuPQ1rfUriJoTsoz4jJcQHuX8C--L_D4Kcw@mail.gmail.com \
--to=patrick@parcs.ath.cx \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.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