From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yb+iKtKvfGl6rx0AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 08:19:14 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=N/THMx04; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id AAB6D1E0DD; Fri, 30 Jan 2026 08:19:14 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 ESMTPS id 38A001E08D for ; Fri, 30 Jan 2026 08:19:14 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id A259A4BAD149 for ; Fri, 30 Jan 2026 13:19:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A259A4BAD149 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=N/THMx04 Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 2EC2C4BA23C4 for ; Fri, 30 Jan 2026 13:17:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2EC2C4BA23C4 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2EC2C4BA23C4 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769779043; cv=none; b=H8iMzYjxtZVIBiaPcjqbJDu2hBqHQRwojivoQNQh0Z1rd6V4K8+HnmwWTAgNFmLbHuKcrx4k2RnffH6OzU1QVeDVecZoubInuDBF86ob7g25t1m583LjL/nlKOg+V1kv2Fkjiz2lADAevLo79nY1ikOrNG9LlwKW9JKN7mjGpqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769779043; c=relaxed/simple; bh=qH0vvoMyaE7+l8Jcjf+229Upqn0nrmpx8KyfaSFPx3w=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=t+lG32XM+VWEqrAVBwi2xc7ZwSnuCOR6kispoI0wrbgkgTa5h3yv61VZTz7UBVcxubySiR2uvpQNmbgPJa6/u2sjq0Kw+46UVQJslVs0ecxxxJJgZR2fjkxI5kRqbbgzF6fKINBj4/aGKmZwNRwt0wP1NXsfUaBfjZsx/OSrD+U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EC2C4BA23C4 Received: from eig-obgw-6006b.ext.cloudfilter.net ([10.0.30.211]) by cmsmtp with ESMTPS id llwIv31d7ipkCloNGvWPDx; Fri, 30 Jan 2026 13:17:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id loNFvVayUvXvHloNFvTyCg; Fri, 30 Jan 2026 13:17:21 +0000 X-Authority-Analysis: v=2.4 cv=e4IGSbp/ c=1 sm=1 tr=0 ts=697caf61 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=ItBw4LHWJt0A:10 a=NZDYkAIzOErSP6C8vV0A:9 a=QEXdDO2ut3YA:10 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=9FnVTSeiGwXoc2Hz4V2fkrlxFagnHwFWg78kgxYUxmA=; b=N/THMx04g2n49Jjuwh0SDrV6ap cu0HdidKsnTNPB3caV/goSsW4Ndlg6JME0VMUPMQMQiHgCdU5arD6o8S+OqQPqNj0g1psArzMehu/ LEzdGHRYheb76GDPG8NpzPmex; Received: from 97-122-114-32.hlrn.qwest.net ([97.122.114.32]:33716 helo=[192.168.122.1]) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vloNF-00000001JjQ-1eXQ; Fri, 30 Jan 2026 06:17:21 -0700 From: Tom Tromey Date: Fri, 30 Jan 2026 06:17:16 -0700 Subject: [PATCH v3 02/21] Move stdtarg to ui MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260130-pr-28948-logging-5-v3-2-3eec47ef3cba@tromey.com> References: <20260130-pr-28948-logging-5-v3-0-3eec47ef3cba@tromey.com> In-Reply-To: <20260130-pr-28948-logging-5-v3-0-3eec47ef3cba@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.114.32 X-Source-L: No X-Exim-ID: 1vloNF-00000001JjQ-1eXQ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-114-32.hlrn.qwest.net ([192.168.122.1]) [97.122.114.32]:33716 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOMVT70hjnFVrIYcxiziBYMu29PSdiM/HHOl8sgI/Rligq5hD7zpGJ2PW+EH0uQ/sl/++LzaRSNNL/XN9FGMn9DcANJgvMgn9UIb80wyz0c5VxgU+S2f LOxncW/cyakMPIkJqpAAyAzkNkoYk9lt2oEUi6Hrv1J7/Jt0nJKrCEfDV6xV9hRwGGq4vIwn94nlOgjFemJmOlumKJe/FwVaxM0= 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: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Currently, most of the output streams are handled by the UI -- with the sole exception of gdb_stdtarg. This doesn't make sense to me, and it is is useful in the longer term to make it per-UI so that the logging approach can be uniform across all streams. So, this moves it to the UI, following the implementation approach of all other output streams. --- gdb/main.c | 2 -- gdb/top.c | 6 ++++++ gdb/ui.c | 3 ++- gdb/ui.h | 2 ++ gdb/utils.h | 5 +++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gdb/main.c b/gdb/main.c index 296f59b0b57..ac83b953cf2 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -81,7 +81,6 @@ std::string python_libdir; /* Target IO streams. */ struct ui_file *gdb_stdtargin; -struct ui_file *gdb_stdtarg; /* True if --batch or --batch-silent was seen. */ int batch_flag = 0; @@ -695,7 +694,6 @@ captured_main_1 (struct captured_main_args *context) gdb_internal_backtrace_init_str (); current_ui = main_ui; - gdb_stdtarg = gdb_stderr; gdb_stdtargin = gdb_stdin; /* Put a CLI based uiout in place early. If the early initialization diff --git a/gdb/top.c b/gdb/top.c index f1d0baeb3f4..e7d1ded96e4 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -115,6 +115,12 @@ current_ui_gdb_stdlog_ptr () return ¤t_ui->m_gdb_stdlog; } +struct ui_file ** +current_ui_gdb_stdtarg_ptr () +{ + return ¤t_ui->m_gdb_stdtarg; +} + struct ui_out ** current_ui_current_uiout_ptr () { diff --git a/gdb/ui.c b/gdb/ui.c index 3e1ef9f8a34..6d29026117e 100644 --- a/gdb/ui.c +++ b/gdb/ui.c @@ -51,7 +51,8 @@ ui::ui (FILE *instream_, FILE *outstream_, FILE *errstream_) m_gdb_stdout (new pager_file (new stdio_file (outstream))), m_gdb_stdin (new stdio_file (instream)), m_gdb_stderr (new stderr_file (errstream)), - m_gdb_stdlog (new timestamped_file (m_gdb_stderr)) + m_gdb_stdlog (new timestamped_file (m_gdb_stderr)), + m_gdb_stdtarg (m_gdb_stderr) { unbuffer_stream (instream_); diff --git a/gdb/ui.h b/gdb/ui.h index 10159b1c38e..ba98d2500af 100644 --- a/gdb/ui.h +++ b/gdb/ui.h @@ -155,6 +155,8 @@ struct ui /* Log/debug/trace messages that should bypass normal stdout/stderr filtering. */ struct ui_file *m_gdb_stdlog; + /* Target output. */ + struct ui_file *m_gdb_stdtarg; /* The current ui_out. */ struct ui_out *m_current_uiout = nullptr; diff --git a/gdb/utils.h b/gdb/utils.h index 5f6b54d2953..4f11cbf379f 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -169,6 +169,7 @@ extern struct ui_file **current_ui_gdb_stdout_ptr (void); extern struct ui_file **current_ui_gdb_stdin_ptr (void); extern struct ui_file **current_ui_gdb_stderr_ptr (void); extern struct ui_file **current_ui_gdb_stdlog_ptr (void); +extern struct ui_file **current_ui_gdb_stdtarg_ptr (); /* Flush STREAM. */ extern void gdb_flush (struct ui_file *stream); @@ -185,11 +186,11 @@ extern void gdb_flush (struct ui_file *stream); /* Log/debug/trace messages that bypasses the pager, if one is in use. */ #define gdb_stdlog (*current_ui_gdb_stdlog_ptr ()) +/* Target output. */ +#define gdb_stdtarg (*current_ui_gdb_stdtarg_ptr ()) /* Truly global ui_file streams. These are all defined in main.c. */ -/* Target output that should bypass the pager, if one is in use. */ -extern struct ui_file *gdb_stdtarg; extern struct ui_file *gdb_stdtargin; /* Set the screen dimensions to WIDTH and HEIGHT. */ -- 2.49.0