From patchwork Thu Jul 4 17:02:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33594 Received: (qmail 98050 invoked by alias); 4 Jul 2019 17:26:14 -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 97934 invoked by uid 89); 4 Jul 2019 17:26:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.5 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: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.46.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 17:26:12 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 910E91DEC7 for ; Thu, 4 Jul 2019 12:03:31 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id j58thGipa2qH7j58thNqFk; 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=zHq9OE88OmOw20xiYR2VA+qXf4YnsE1kXaQlX9RrnQY=; b=dciIWc3NyssKSJZH41ZFMRQwTO zFIWKtlA/G6Ic88AMqIx8aKTWu4J8/gCRj3nOfjFV/7x+1cSxBVFWTH3YcrW7K7FPV9ZeBWVXKGRP fjmyONYPLG1H6TfwensBZ7RtH; 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 1hj58t-002sKm-Aq; Thu, 04 Jul 2019 12:03:31 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 47/61] Remove make_source_window and make_disasm_window Date: Thu, 4 Jul 2019 11:02:57 -0600 Message-Id: <20190704170311.15982-48-tom@tromey.com> In-Reply-To: <20190704170311.15982-1-tom@tromey.com> References: <20190704170311.15982-1-tom@tromey.com> 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. 2019-07-04 Tom Tromey * tui/tui-layout.c (make_source_window, make_disasm_window): Remove. (show_data): Unify creation and re-initialization cases. --- gdb/ChangeLog | 6 ++++ gdb/tui/tui-layout.c | 66 ++++++++++---------------------------------- 2 files changed, 21 insertions(+), 51 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 3c263604e82..b1f784609d5 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); }