From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 788183858C2D for ; Fri, 8 Sep 2023 19:04:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 788183858C2D Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com 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 EE3AD1E0C3; Fri, 8 Sep 2023 15:04:30 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 10/21] gdb/mi: use m_ui instead of current_ui in mi_interp::init Date: Fri, 8 Sep 2023 14:23:04 -0400 Message-ID: <20230908190227.96319-11-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 Content-Transfer-Encoding: 8bit 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 List-Id: gdb_stdout accesses current_ui under the hood. Use m_ui to get the stdout file instead. Add an stdout method to ui to help with that (it would feel wrong to access ui::m_gdb_stdout directly). Change-Id: I03739df387c8de01bc692d7ddddbb66544555630 --- gdb/mi/mi-interp.c | 2 +- gdb/ui.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 3095301b2f11..f260d98837cf 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -86,7 +86,7 @@ mi_interp::init (bool top_level) /* Store the current output channel, so that we can create a console channel that encapsulates and prefixes all gdb_output-type bits coming from the rest of the debugger. */ - mi->raw_stdout = gdb_stdout; + mi->raw_stdout = m_ui->stdout (); /* Create MI console channels, each with a different prefix so they can be distinguished. */ diff --git a/gdb/ui.h b/gdb/ui.h index b9ca9c0c80a0..be89ab3d6848 100644 --- a/gdb/ui.h +++ b/gdb/ui.h @@ -150,6 +150,9 @@ struct ui : public intrusive_list_node /* The current ui_out. */ struct ui_out *m_current_uiout = nullptr; + ui_file *stdout () + { return m_gdb_stdout; } + /* Register the UI's input file descriptor in the event loop. */ void register_file_handler (); -- 2.42.0