From patchwork Thu Jul 4 17:02:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33582 Received: (qmail 111505 invoked by alias); 4 Jul 2019 17:04:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 107381 invoked by uid 89); 4 Jul 2019 17:03:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.60.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:03:32 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway20.websitewelcome.com (Postfix) with ESMTP id CD905400D3D85 for ; Thu, 4 Jul 2019 11:01:19 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58thkjjpiQerj58thEYn2; Thu, 04 Jul 2019 12:03:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KCofbD7RVYKeDKzTQBxUyn39q9FHL0XWyuznXwLVeAc=; b=E264QvytoOcIvbT1Mn/azhe6AA XwUIW6efnx6qqnUtyyaG0BIMXVvc7j7VTk6DWhff/tEBYDJba+6Sw9eO57XSXp+W6tzfVf2I+r27P /QwLIdYyQleV+2O5xpNTTgadP; Received: from 174-29-58-150.hlrn.qwest.net ([174.29.58.150]:34702 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1hj58s-002sKm-VM; Thu, 04 Jul 2019 12:03:31 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 46/61] Remove make_command_window Date: Thu, 4 Jul 2019 11:02:56 -0600 Message-Id: <20190704170311.15982-47-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> 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. 2019-07-04 Tom Tromey * tui/tui-layout.c (make_command_window): Remove. (show_source_disasm_command, show_source_or_disasm_and_command): Unify creation and re-initialization cases. --- gdb/ChangeLog | 6 ++++++ gdb/tui/tui-layout.c | 50 ++++++++++++++------------------------------ 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 83eb0dfeb46..3c263604e82 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); } }