public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove make_command_window Date: Wed, 17 Jul 2019 18:40:00 -0000 [thread overview] Message-ID: <20190717184023.77485.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=76d2be8e92a900558648eeba6b4ff95cba62801e commit 76d2be8e92a900558648eeba6b4ff95cba62801e Author: Tom Tromey <tom@tromey.com> Date: Mon Jul 1 14:26:42 2019 -0600 Remove make_command_window This unifies the creation and re-initialization cases for the command window. When this is done, it becomes clear that make_command_window isn't needed -- it can be replaced with a simple "new", so this is removed as well. gdb/ChangeLog 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: --- gdb/ChangeLog | 6 ++++++ gdb/tui/tui-layout.c | 50 ++++++++++++++++---------------------------------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6d50df1..5d2c7ad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 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. + +2019-07-17 Tom Tromey <tom@tromey.com> + * tui/tui-layout.c (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 83eb0df..3c26360 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -44,7 +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_command_window (int, int); 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); @@ -480,17 +479,6 @@ prev_layout (void) } - -static struct tui_win_info * -make_command_window (int height, int origin_y) -{ - struct tui_win_info *result = new tui_cmd_window (); - result->reset (height, tui_term_width (), 0, origin_y); - tui_make_window (result, DONT_BOX_WINDOW); - return result; -} - - /* make_source_window(). */ static struct tui_win_info * @@ -589,16 +577,14 @@ show_source_disasm_command (void) tui_show_source_content (TUI_DISASM_WIN); if (TUI_CMD_WIN == NULL) - tui_win_list[CMD_WIN] - = make_command_window (cmd_height, tui_term_height () - cmd_height); - else - { - TUI_CMD_WIN->reset (TUI_CMD_WIN->height, - TUI_CMD_WIN->width, - 0, - TUI_CMD_WIN->origin.y); - tui_make_visible (TUI_CMD_WIN); - } + tui_win_list[CMD_WIN] = new tui_cmd_window (); + TUI_CMD_WIN->reset (cmd_height, + tui_term_width (), + 0, + tui_term_height () - cmd_height); + /* FIXME tui_cmd_window won't recreate the handle on + make_visible, so we need this instead. */ + tui_make_window (TUI_CMD_WIN, DONT_BOX_WINDOW); tui_set_current_layout_to (SRC_DISASSEM_COMMAND); } } @@ -734,18 +720,14 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type) tui_show_source_content (win_info); if (TUI_CMD_WIN == NULL) - { - tui_win_list[CMD_WIN] = make_command_window (cmd_height, - src_height); - } - else - { - TUI_CMD_WIN->reset (TUI_CMD_WIN->height, - TUI_CMD_WIN->width, - TUI_CMD_WIN->origin.x, - TUI_CMD_WIN->origin.y); - tui_make_visible (TUI_CMD_WIN); - } + tui_win_list[CMD_WIN] = new tui_cmd_window (); + TUI_CMD_WIN->reset (cmd_height, + tui_term_width (), + 0, + src_height); + /* FIXME tui_cmd_window won't recreate the handle on + make_visible, so we need this instead. */ + tui_make_window (TUI_CMD_WIN, DONT_BOX_WINDOW); tui_set_current_layout_to (layout_type); } }
reply other threads:[~2019-07-17 18:40 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190717184023.77485.qmail@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).