From patchwork Wed Nov 6 14:27:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35674 Received: (qmail 53213 invoked by alias); 6 Nov 2019 14:27:47 -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 53203 invoked by uid 89); 6 Nov 2019 14:27:47 -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 autolearn=ham version=3.3.1 spammy=consolidate, HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Nov 2019 14:27:45 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 23F2E2048C; Wed, 6 Nov 2019 09:27:44 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 8253B20C7E for ; Wed, 6 Nov 2019 09:27:40 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 4C39125B28 for ; Wed, 6 Nov 2019 09:27:40 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Wed, 6 Nov 2019 09:27:38 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] Consolidate setting of current_layout X-Gerrit-Change-Id: Id8b23797d68e607f0fcd6d29b8801869d40d1869 X-Gerrit-Change-Number: 363 X-Gerrit-ChangeURL: X-Gerrit-Commit: 45e401e1f669a0cf48287c1e02ac7cf44b190878 In-Reply-To: References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Message-Id: <20191106142740.4C39125B28@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/363 ...................................................................... Consolidate setting of current_layout Currently several functions in tui-layout.c set current_layout after their work is done. This moves this assignment to show_layout, instead. gdb/ChangeLog 2019-11-06 Tom Tromey * tui/tui-layout.c (show_layout): Set current_layout. (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Don't set current_layout. Change-Id: Id8b23797d68e607f0fcd6d29b8801869d40d1869 --- M gdb/ChangeLog M gdb/tui/tui-layout.c 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e66b957..3939d43 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2019-11-06 Tom Tromey + * tui/tui-layout.c (show_layout): Set current_layout. + (show_source_disasm_command, show_data) + (show_source_or_disasm_and_command): Don't set current_layout. + +2019-11-06 Tom Tromey + * tui/tui-layout.c (_initialize_tui_layout): Move to end. 2019-11-06 Tom Tromey diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index c7f6545..ba0b367 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -91,6 +91,7 @@ break; } + current_layout = layout; tui_delete_invisible_windows (); } } @@ -418,7 +419,6 @@ tui_term_width (), 0, tui_term_height () - cmd_height); - current_layout = SRC_DISASSEM_COMMAND; } @@ -461,8 +461,6 @@ 0, total_height - 1); TUI_CMD_WIN->resize (TUI_CMD_WIN->height, tui_term_width (), 0, total_height); - - current_layout = new_layout; } void @@ -541,7 +539,6 @@ tui_term_width (), 0, src_height); - current_layout = layout_type; }