From patchwork Fri Sep 8 18:23:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 75578 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E23D387093F for ; Fri, 8 Sep 2023 19:06:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E23D387093F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694200019; bh=Bxo1Qaiq98qw7JK2jg/z2WTvrvfjO5wRS+M9h1HcQ+U=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BaKrldxV1KlhqpOJlF2fGNXHqIBQJ/jZUVgusphVUdtxEyHA3wieyedxbWWePRNGp ZXV9rbiZJsaEIMmKyWPGPzDzGAlpVcGrm3Pi/TggfPo+XxYmfxxdHiUXimHlAW1+cN tU0TMhAVEiVtoEne7fCTgLk0dZYnfFtkQicBIU/s= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C96923857355 for ; Fri, 8 Sep 2023 19:06:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C96923857355 Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3985C1E0C2; Fri, 8 Sep 2023 15:06:32 -0400 (EDT) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 17/21] gdb: pass current_ui down to interp_set Date: Fri, 8 Sep 2023 14:23:11 -0400 Message-ID: <20230908190227.96319-18-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908190227.96319-1-simon.marchi@efficios.com> References: <20230908190227.96319-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3497.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" In preparation for making interp_set a method of struct ui. No behavior changes expected. Change-Id: I507c7701438967502d714ecda99401d785806cab --- gdb/interps.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/interps.c b/gdb/interps.c index 0575128b8124..18758f1f7af6 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -92,24 +92,24 @@ find_interp_factory (const char *name) are caused by CLI commands. */ static void -interp_set (struct interp *interp, bool top_level) +interp_set (ui *ui, struct interp *interp, bool top_level) { - struct interp *old_interp = current_ui->current_interpreter; + struct interp *old_interp = ui->current_interpreter; /* If we already have an interpreter, then trying to set top level interpreter is kinda pointless. */ - gdb_assert (!top_level || !current_ui->current_interpreter); - gdb_assert (!top_level || !current_ui->top_level_interpreter); + gdb_assert (!top_level || !ui->current_interpreter); + gdb_assert (!top_level || !ui->top_level_interpreter); if (old_interp != NULL) { - current_ui->m_current_uiout->flush (); + ui->m_current_uiout->flush (); old_interp->suspend (); } - current_ui->current_interpreter = interp; + ui->current_interpreter = interp; if (top_level) - current_ui->top_level_interpreter = interp; + ui->top_level_interpreter = interp; if (interpreter_p != interp->name ()) interpreter_p = interp->name (); @@ -127,7 +127,7 @@ interp_set (struct interp *interp, bool top_level) } /* Do this only after the interpreter is initialized. */ - current_ui->m_current_uiout = interp->interp_ui_out (); + ui->m_current_uiout = interp->interp_ui_out (); /* Clear out any installed interpreter hooks/event handlers. */ clear_interpreter_hooks (); @@ -151,7 +151,7 @@ set_top_level_interpreter (const char *name) if (interp == NULL) error (_("Interpreter `%s' unrecognized"), name); /* Install it. */ - interp_set (interp, true); + interp_set (current_ui, interp, true); } void @@ -267,10 +267,10 @@ interpreter_exec_cmd (const char *args, int from_tty) if (interp_to_use == NULL) error (_("Could not find interpreter \"%s\"."), prules[0]); - interp_set (interp_to_use, false); + interp_set (current_ui, interp_to_use, false); SCOPE_EXIT { - interp_set (old_interp, false); + interp_set (current_ui, old_interp, false); }; for (i = 1; i < nrules; i++)