From patchwork Sat Aug 3 13:29:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33937 Received: (qmail 95434 invoked by alias); 3 Aug 2019 13:29:36 -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 95010 invoked by uid 89); 3 Aug 2019 13:29:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.0 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: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.38) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Aug 2019 13:29:32 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 49F76400C8629 for ; Sat, 3 Aug 2019 08:29:31 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id tu6Fhsg9KiQertu6FhGraJ; Sat, 03 Aug 2019 08:29: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=+9eqXJvN2iEx59s5K4NaaLAPWnWU71Zn8QjxYnArn4Q=; b=LXfnyRjJwX6/6nLtGEcz6btoy9 ektIbS/MzO/NBqDHcQfw+SaJQf6prx9wAPCEXjgKaHFOJIq/QrCiOLvi81+wXVeq2I4RuF56jc80V b1hwLiLf2UKyMc0K69IpIbNys; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:36980 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1htu6F-003nqS-1m; Sat, 03 Aug 2019 08:29:31 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 08/19] Simplify tui_show_disassem Date: Sat, 3 Aug 2019 07:29:14 -0600 Message-Id: <20190803132925.25074-9-tom@tromey.com> In-Reply-To: <20190803132925.25074-1-tom@tromey.com> References: <20190803132925.25074-1-tom@tromey.com> tui_show_disassem does not need to call tui_add_win_to_layout, because the callers that could change the layout have already ensured that it exists. gdb/ChangeLog 2019-08-03 Tom Tromey * tui/tui-disasm.c (tui_show_disassem): Add assertion. Don't call tui_add_win_to_layout. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-disasm.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 80f8d47f0ac..a442a00019e 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -255,9 +255,10 @@ tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr) struct tui_win_info *win_with_focus = tui_win_with_focus (); struct tui_line_or_address val; + gdb_assert (TUI_DISASM_WIN != nullptr && TUI_DISASM_WIN->is_visible); + val.loa = LOA_ADDRESS; val.u.addr = start_addr; - tui_add_win_to_layout (DISASSEM_WIN); tui_update_source_window (TUI_DISASM_WIN, gdbarch, s, val, FALSE); /* If the focus was in the src win, put it in the asm win, if the