aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-wingeneral.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-28 23:17:24 -0600
committerTom Tromey <tom@tromey.com>2019-07-17 12:19:10 -0600
commitfd6c75eecd92ad888cc369489b31d2ed9015130e (patch)
treea24918acae65b8422a94842553e954cb1c5ff9eb /gdb/tui/tui-wingeneral.c
parentf6cc34a91c173634b6afcc1a48601a601fbace37 (diff)
downloadfsf-binutils-gdb-fd6c75eecd92ad888cc369489b31d2ed9015130e.zip
fsf-binutils-gdb-fd6c75eecd92ad888cc369489b31d2ed9015130e.tar.gz
fsf-binutils-gdb-fd6c75eecd92ad888cc369489b31d2ed9015130e.tar.bz2
Merge refresh and refresh_window methods
Earlier refactorings introduced the refresh and refresh_window methods, following the previous TUI code. However, these methods are essentially the same, so this patch merges them. It also removes some redundant refresh_window calls, because the execution window is updated automatically by the corresponding source (or disassembly) window. gdb/ChangeLog 2019-07-17 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_show_exec_info_content): Don't call refresh_window. * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Call touchwin. (tui_data_window::refresh_window): Call refresh_window on data items. Always call superclass refresh_window. (tui_win_info::refresh): Remove. (tui_source_window_base::refresh_window): Update. (tui_refresh_all): Update. * tui/tui-layout.c (show_source_disasm_command): Remove call to refresh_window. (show_source_or_disasm_and_command): Likewise. * tui/tui-data.h (struct tui_win_info) <refresh>: Remove. (struct tui_source_window_base) <refresh>: Likewise.
Diffstat (limited to 'gdb/tui/tui-wingeneral.c')
-rw-r--r--gdb/tui/tui-wingeneral.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 22f841e..2902b80 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -37,7 +37,10 @@ void
tui_gen_win_info::refresh_window ()
{
if (handle != NULL)
- wrefresh (handle);
+ {
+ touchwin (handle);
+ wrefresh (handle);
+ }
}
/* See tui-data.h. */
@@ -49,12 +52,11 @@ tui_data_window::refresh_window ()
{
for (auto &&win : regs_content)
{
- if (win != NULL && win->handle != NULL)
- wrefresh (win->handle);
+ if (win != NULL)
+ win->refresh_window ();
}
}
- else
- tui_gen_win_info::refresh_window ();
+ tui_gen_win_info::refresh_window ();
}
/* Function to delete the curses window, checking for NULL. */
@@ -231,20 +233,10 @@ tui_make_all_invisible (void)
/* See tui-data.h. */
void
-tui_win_info::refresh ()
-{
- touchwin (handle);
- refresh_window ();
-}
-
-/* See tui-data.h. */
-
-void
-tui_source_window_base::refresh ()
+tui_source_window_base::refresh_window ()
{
- touchwin (execution_info->handle);
execution_info->refresh_window ();
- tui_win_info::refresh ();
+ tui_win_info::refresh_window ();
}
/* Function to refresh all the windows currently displayed. */
@@ -257,13 +249,10 @@ tui_refresh_all ()
for (tui_win_info *win_info : all_tui_windows ())
{
if (win_info->is_visible)
- win_info->refresh ();
+ win_info->refresh_window ();
}
if (locator->is_visible)
- {
- touchwin (locator->handle);
- locator->refresh_window ();
- }
+ locator->refresh_window ();
}