From patchwork Fri Dec 27 16:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37104 Received: (qmail 125634 invoked by alias); 27 Dec 2019 16:42:34 -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 125601 invoked by uid 89); 27 Dec 2019 16:42:33 -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=Tromey, tom@tromey.com, tomtromeycom, tromey X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.50.161) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Dec 2019 16:42:32 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway23.websitewelcome.com (Postfix) with ESMTP id E7ACF2FAA for ; Fri, 27 Dec 2019 10:42:30 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ksh4iNirl4kpjksh4itgat; Fri, 27 Dec 2019 10:42:30 -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=mf7g7Z5GOHVFmRz9jsPwTyJZL0MT2KPsyVAIbyV8mYQ=; b=rj/p+/+XYOfshxNXZixOsDZSyO 2H/jMw2HDHVnAl9tk5Q1m7QcCQwgQ/+ZnI5+GVndZONnigWNCnrKULFLsIhEUh5S/lGBwOPIlt77b /XmSoTtoaziEM90lxOv7hn3PZ; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:36592 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iksh4-001xYc-Ny; Fri, 27 Dec 2019 09:42:30 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI 3/3] Reorder an "if" in print_disassembly Date: Fri, 27 Dec 2019 09:42:28 -0700 Message-Id: <20191227164228.27948-4-tom@tromey.com> In-Reply-To: <20191227164228.27948-1-tom@tromey.com> References: <20191227164228.27948-1-tom@tromey.com> I noticed that print_disassembly has two #if blocks for TUI code, where one would do. This patch rearranges the code slightly to remove a #if. gdb/ChangeLog 2019-12-27 Tom Tromey * cli/cli-cmds.c (print_disassembly): Reorder "if". Change-Id: I36f3f682f5685b3d9b148da5aed26eb3cc7d598e --- gdb/ChangeLog | 4 ++++ gdb/cli/cli-cmds.c | 10 +++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 681d53c574d..e1410690aaf 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1338,7 +1338,9 @@ print_disassembly (struct gdbarch *gdbarch, const char *name, gdb_disassembly_flags flags) { #if defined(TUI) - if (!tui_is_window_visible (DISASSEM_WIN)) + if (tui_is_window_visible (DISASSEM_WIN)) + tui_show_assembly (gdbarch, low); + else #endif { printf_filtered ("Dump of assembler code "); @@ -1368,12 +1370,6 @@ print_disassembly (struct gdbarch *gdbarch, const char *name, } printf_filtered ("End of assembler dump.\n"); } -#if defined(TUI) - else - { - tui_show_assembly (gdbarch, low); - } -#endif } /* Subroutine of disassemble_command to simplify it.