This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378)
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Tue, 30 Jun 2015 18:26:40 +0100
- Subject: Re: [PATCH 2/3] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378)
- Authentication-results: sourceware.org; auth=none
- References: <5592B187 dot 20507 at redhat dot com> <1435683072-7810-1-git-send-email-patrick at parcs dot ath dot cx>
On 06/30/2015 05:51 PM, Patrick Palka wrote:
> [ This version just changes tui_set_locator_info as you suggested. ]
>
> tui_show_frame_info is responsible for updating the visible windows
> following a change in frame information (that being the currently
> selected frame, PC, line number, etc). Currently it always redraws and
> refreshes each window even if frame information has not changed. This
> behavior is inefficient and helps contribute to the occassional
> flickering of the TUI as described in the mentioned PR.
>
> This patch makes tui_show_frame_info refresh the windows only if frame
> information has changed. Determining whether frame information has
> changed is done indirectly by determining whether the locator has
> changed. This approach is convenient and yet sensible because the
> locator contains all the relevant info we need to check anyway: the
> current PC, the line number, the name of the executable and the name of
> the current function. Probably only the PC is really necessary to
> check, but it doesn't hurt to check every field.
>
> Effectively, with this patch, consecutive calls to select_frame with the
> same frame/PC no longer cause TUI's frame information to be updated
> multiple times.
>
> gdb/ChangeLog:
>
> * tui/tui-stack.c (tui_set_locator_info): Change prototype to
> return an int instead of void. Return whether the locator
> window has changed.
> (tui_show_frame_info): If the locator info has not changed, then
> bail out early to avoid refreshing the windows.
OK.
Thanks,
Pedro Alves