diff options
author | Tom Tromey <tom@tromey.com> | 2019-07-01 14:37:04 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:19:18 -0600 |
commit | 4a8a5e84a777c7c267503a1d1ee15bce2ba19d1d (patch) | |
tree | 77077ba9d64d1ab3354ba14cb4cda06a61d84565 | |
parent | 76d2be8e92a900558648eeba6b4ff95cba62801e (diff) | |
download | gdb-4a8a5e84a777c7c267503a1d1ee15bce2ba19d1d.zip gdb-4a8a5e84a777c7c267503a1d1ee15bce2ba19d1d.tar.gz gdb-4a8a5e84a777c7c267503a1d1ee15bce2ba19d1d.tar.bz2 |
Remove make_source_window and make_disasm_window
This unifies the remaining creation and re-initialization cases for
the source and disassembly windows. Once this is done, it's clear
that make_source_window and make_disasm_window aren't needed any more,
so remove them.
gdb/ChangeLog
2019-07-17 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (make_source_window, make_disasm_window):
Remove.
(show_data): Unify creation and re-initialization cases.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/tui/tui-layout.c | 66 |
2 files changed, 21 insertions, 51 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5d2c7ad..23852c7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-layout.c (make_source_window, make_disasm_window): + Remove. + (show_data): Unify creation and re-initialization cases. + +2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-layout.c (make_command_window): Remove. (show_source_disasm_command, show_source_or_disasm_and_command): Unify creation and re-initialization cases. diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 3c26360..b1f7846 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -44,8 +44,6 @@ ********************************/ static void show_layout (enum tui_layout_type); static void show_source_or_disasm_and_command (enum tui_layout_type); -static struct tui_win_info *make_source_window (int, int); -static struct tui_win_info *make_disasm_window (int, int); static void show_source_command (void); static void show_disasm_command (void); static void show_source_disasm_command (void); @@ -479,30 +477,6 @@ prev_layout (void) } -/* make_source_window(). - */ -static struct tui_win_info * -make_source_window (int height, int origin_y) -{ - tui_win_info *result = new tui_source_window (); - result->reset (height, tui_term_width (), 0, origin_y); - result->make_visible (true); - return result; -} - - -/* make_disasm_window(). - */ -static struct tui_win_info * -make_disasm_window (int height, int origin_y) -{ - tui_win_info *result = new tui_disasm_window (); - result->reset (height, tui_term_width (), 0, origin_y); - result->make_visible (true); - return result; -} - - static tui_win_info * make_data_window (int height, int origin_y) { @@ -617,39 +591,29 @@ show_data (enum tui_layout_type new_layout) else win_type = DISASSEM_WIN; - tui_source_window_base *base; if (tui_win_list[win_type] == NULL) { if (win_type == SRC_WIN) - tui_win_list[win_type] - = make_source_window (src_height, data_height - 1); + tui_win_list[win_type] = new tui_source_window (); else - tui_win_list[win_type] - = make_disasm_window (src_height, data_height - 1); - locator->reset (2 /* 1 */ , - tui_term_width (), - 0, - total_height - 1); - base = (tui_source_window_base *) tui_win_list[win_type]; - } - else - { - base = (tui_source_window_base *) tui_win_list[win_type]; - tui_win_list[win_type]->reset (src_height, - tui_term_width (), - 0, - data_height - 1); - tui_make_visible (tui_win_list[win_type]); - locator->reset (2 /* 1 */ , - tui_term_width (), - 0, - total_height - 1); + tui_win_list[win_type] = new tui_disasm_window (); } + + tui_source_window_base *base + = (tui_source_window_base *) tui_win_list[win_type]; + tui_win_list[win_type]->reset (src_height, + tui_term_width (), + 0, + data_height - 1); + locator->reset (2 /* 1 */ , + tui_term_width (), + 0, + total_height - 1); + base->make_visible (true); base->m_has_locator = true; tui_make_visible (locator); tui_show_locator_content (); - tui_add_to_source_windows - ((tui_source_window_base *) tui_win_list[win_type]); + tui_add_to_source_windows (base); tui_set_current_layout_to (new_layout); } |