From patchwork Sat Jan 4 18:33:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37173 Received: (qmail 130164 invoked by alias); 4 Jan 2020 18:34:17 -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 130104 invoked by uid 89); 4 Jan 2020 18:34:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 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.55.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 Jan 2020 18:34:14 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 9BE6E400D20F2 for ; Sat, 4 Jan 2020 11:22:36 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id noFZinbFqOdBHnoFZis7he; Sat, 04 Jan 2020 12:34:13 -0600 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=u+UzblAhSoVjtTrWv5MEGiPXCLeH6zdgIv0ptByan3Q=; b=Kh53erWm+w9NKpj3zyKbvnxk2E bSSlPh4W4Q3KkZFgy9El+Jc6vAP+xW4nlnu8Gn3VGvr94MkYyp52oCF19KdvYHY6aeI7dQTZYUN/C KLZhTj4uVht/yD2sm+kGxxDq2; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:48942 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1inoFZ-0026Lh-GL; Sat, 04 Jan 2020 11:34:13 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 02/24] Simplify tui_add_win_to_layout Date: Sat, 4 Jan 2020 11:33:48 -0700 Message-Id: <20200104183410.17114-3-tom@tromey.com> In-Reply-To: <20200104183410.17114-1-tom@tromey.com> References: <20200104183410.17114-1-tom@tromey.com> tui_add_win_to_layout is only ever called for the source or assembly windows. This simplifies the function by removing the DATA_WIN case. gdb/ChangeLog 2020-01-04 Tom Tromey * tui/tui-layout.h (tui_add_win_to_layout): Add comment. * tui/tui-layout.c (tui_add_win_to_layout): Add assert. Remove DATA_WIN case. Change-Id: Idfca902c6c90153acc5d19af4c33aa74bc3caf31 --- gdb/ChangeLog | 6 ++++++ gdb/tui/tui-layout.c | 19 ++++--------------- gdb/tui/tui-layout.h | 5 +++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 1e9c5c53e3f..8be98e9ba48 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -185,12 +185,13 @@ tui_set_layout (enum tui_layout_type layout_type) } } -/* Add the specified window to the layout in a logical way. This - means setting up the most logical layout given the window to be - added. */ +/* See tui-layout.h. */ + void tui_add_win_to_layout (enum tui_win_type type) { + gdb_assert (type == SRC_WIN || type == DISASSEM_WIN); + enum tui_layout_type cur_layout = tui_current_layout (); switch (type) @@ -217,18 +218,6 @@ tui_add_win_to_layout (enum tui_win_type type) show_layout (DISASSEM_COMMAND); } break; - case DATA_WIN: - if (cur_layout != SRC_DATA_COMMAND - && cur_layout != DISASSEM_DATA_COMMAND) - { - if (cur_layout == DISASSEM_COMMAND) - show_layout (DISASSEM_DATA_COMMAND); - else - show_layout (SRC_DATA_COMMAND); - } - break; - default: - break; } } diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h index c2380b3c0a7..37f07c24e4f 100644 --- a/gdb/tui/tui-layout.h +++ b/gdb/tui/tui-layout.h @@ -173,7 +173,12 @@ private: bool m_applied = false; }; +/* Add the specified window to the layout in a logical way. This + means setting up the most logical layout given the window to be + added. Only the source or disassembly window can be added this + way. */ extern void tui_add_win_to_layout (enum tui_win_type); + extern void tui_set_layout (enum tui_layout_type); /* Apply the current layout. */