diff options
author | Tom Tromey <tom@tromey.com> | 2019-07-05 12:29:18 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-08-13 14:52:09 -0600 |
commit | 3f3ffe54e229482bdb0785ae2162f03d60870400 (patch) | |
tree | f8a5c7ae3054cb1661cb92c91277824ab5c31264 /gdb/tui | |
parent | 69258091762bce83b0f3dc9e07800b87bdc0649f (diff) | |
download | gdb-3f3ffe54e229482bdb0785ae2162f03d60870400.zip gdb-3f3ffe54e229482bdb0785ae2162f03d60870400.tar.gz gdb-3f3ffe54e229482bdb0785ae2162f03d60870400.tar.bz2 |
Simplify tui_make_all_invisible
This simplifies the implementation of tui_make_all_invisible. Also,
because show_data is only called by show_layout, this hoists the call
to tui_make_all_invisible and removes the call from show_data.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (make_all_visible): Remove.
(tui_make_all_invisible): Simplify.
* tui/tui-layout.c (tui_make_all_invisible): Move from
tui-wingeneral.c; simplify.
(show_layout): Hoist call to tui_make_all_invisible.
(show_data): Don't call tui_make_all_invisible.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-layout.c | 9 | ||||
-rw-r--r-- | gdb/tui/tui-wingeneral.c | 12 | ||||
-rw-r--r-- | gdb/tui/tui-wingeneral.h | 4 |
3 files changed, 9 insertions, 16 deletions
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 2b25e7a..3ee3354 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -80,6 +80,9 @@ show_layout (enum tui_layout_type layout) should free the content and reallocate on next display of source/asm. */ tui_clear_source_windows (); + /* First make the current layout be invisible. */ + tui_make_all_invisible (); + tui_locator_win_info_ptr ()->make_visible (false); if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND) { @@ -88,10 +91,6 @@ show_layout (enum tui_layout_type layout) } else { - /* First make the current layout be invisible. */ - tui_make_all_invisible (); - tui_locator_win_info_ptr ()->make_visible (false); - switch (layout) { /* Now show the new layout. */ @@ -571,8 +570,6 @@ show_data (enum tui_layout_type new_layout) data_height = total_height / 2; src_height = total_height - data_height; - tui_make_all_invisible (); - locator->make_visible (false); if (tui_win_list[DATA_WIN] == nullptr) tui_win_list[DATA_WIN] = new tui_data_window (); tui_win_list[DATA_WIN]->reset (data_height, tui_term_width (), 0, 0); diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 92a678c..79f93ce 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -165,19 +165,13 @@ tui_gen_win_info::make_visible (bool visible) } } -/* Makes all windows invisible (except the command and locator - windows). */ -static void -make_all_visible (bool visible) -{ - for (tui_win_info *win_info : all_tui_windows ()) - win_info->make_visible (visible); -} +/* See tui-wingeneral.h. */ void tui_make_all_invisible (void) { - make_all_visible (false); + for (tui_win_info *win_info : all_tui_windows ()) + win_info->make_visible (false); } /* Function to refresh all the windows currently displayed. */ diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h index 3c035aa..051be6d 100644 --- a/gdb/tui/tui-wingeneral.h +++ b/gdb/tui/tui-wingeneral.h @@ -27,8 +27,10 @@ struct tui_win_info; struct tui_gen_win_info; -extern void tui_unhighlight_win (struct tui_win_info *); +/* Makes all windows invisible. */ extern void tui_make_all_invisible (void); + +extern void tui_unhighlight_win (struct tui_win_info *); extern void tui_make_window (struct tui_gen_win_info *, enum tui_box); extern void tui_highlight_win (struct tui_win_info *); extern void tui_check_and_display_highlight_if_needed (struct tui_win_info *); |