From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ecwULiqwfGl6rx0AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 08:20:42 -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=BkqMxcD2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B95091E08D; Fri, 30 Jan 2026 08:20:42 -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 556BA1E08D for ; Fri, 30 Jan 2026 08:20:42 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id D9CB04BB58CE for ; Fri, 30 Jan 2026 13:20:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9CB04BB58CE 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=BkqMxcD2 Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 1D3E84BB3BC6 for ; Fri, 30 Jan 2026 13:17:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D3E84BB3BC6 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 1D3E84BB3BC6 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=1769779046; cv=none; b=svzjIei6cBxemHZBkg1hlRtoBTuvOXCbTuvoqo4WCs7lUJfekacE54TjDCotOtAFDixG84rsq+2OXmMkbBcGGeUb0uGX5XAW75aeTbtmkP2T6LtfGL0vWpVL7avvG2vvFxoKHMVQ50ouGz/vtXG22+X8VpkuVsNBYmMzJ6fPiXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769779046; c=relaxed/simple; bh=W4E9JPYGjbTZgnS84mfYCfRH4qEocO2KnTB+JzrkpsQ=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=tClnS08SwMtgMCAeefDigm5QZ2Yvp+l0g08Hogg5bq5DvmN8Tx+LN1gRaNBUnxfcXTYooGa4ZqbuMg/IgwtelCf1PnNLRAcyaJWMcR8WJw+AlHP1N/7wCtGplqzDkK6FpeD4ZlQEeAZ5F+ymttRkyZy0qXd4fA752qevVXDXhUY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D3E84BB3BC6 Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id lmEOv36BnipkCloNJvWPG1; Fri, 30 Jan 2026 13:17:25 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id loNIvfeDBSqlVloNIvPsmB; Fri, 30 Jan 2026 13:17:24 +0000 X-Authority-Analysis: v=2.4 cv=I7FlRMgg c=1 sm=1 tr=0 ts=697caf65 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=VUuhKsu0LjnmKoBN3KUA: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=pXdsDqUkKxOxMXAAlve4LIfd9zi4ZONSmcwK4jRSkgc=; b=BkqMxcD2Si5OxN+RFgTfADMbQ5 t3TVR8vyWZ+MruJ4M+cY+Cam457xVIApagbpl3o41Fh2TyYGUdgJWPo3e1lEuAJeGxxUGRq4v9+4R a8T4t43Q3jBtI6GxWnWqx8ckE; 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 1vloNI-00000001JjQ-0xib; Fri, 30 Jan 2026 06:17:24 -0700 From: Tom Tromey Date: Fri, 30 Jan 2026 06:17:24 -0700 Subject: [PATCH v3 10/21] Add stream to buffer_group::output_unit constructor MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260130-pr-28948-logging-5-v3-10-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 , Andrew Burgess 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: 1vloNI-00000001JjQ-0xib 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: 18 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIPSZjoSsn5Js2GeeYbmXk2p33R7bxkbk7250hBYHKzYAMmVlrE+/Qv9SIxf0quSxQL1fxIWEuCCheoCT7Y4TGvWV6sJX3fla/1xylHbPmQ1+0niP0wq T/W9qIUJT+NCS6N1bjormgi8wEX73BuiVy5AOG2ZX7knY0VgAyKqUiYpYbI3z/2zQt8txvFpAOaXY3byG1Mim4qz56Or6G9K2so= 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 I noticed that when creating a new output_unit, all the calls looked like: m_buffered_output.emplace_back ("", indent).m_stream = stream; It seems better to simply pass the stream to the constructor. Approved-By: Andrew Burgess --- gdb/buffered-streams.c | 6 +++--- gdb/buffered-streams.h | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/buffered-streams.c b/gdb/buffered-streams.c index a9d3fcf4f5d..71122c7f237 100644 --- a/gdb/buffered-streams.c +++ b/gdb/buffered-streams.c @@ -51,7 +51,7 @@ buffer_group::write (const char *buf, long length_buf, ui_file *stream) && m_buffered_output.back ().m_msg.back () != '\n') m_buffered_output.back ().m_msg.append (msg); else - m_buffered_output.emplace_back (msg).m_stream = stream; + m_buffered_output.emplace_back (stream, msg); prev = cur + 1; } } @@ -61,7 +61,7 @@ buffer_group::write (const char *buf, long length_buf, ui_file *stream) void buffer_group::wrap_here (int indent, ui_file *stream) { - m_buffered_output.emplace_back ("", indent).m_stream = stream; + m_buffered_output.emplace_back (stream, "", indent); } /* See buffered-streams.h. */ @@ -69,7 +69,7 @@ buffer_group::wrap_here (int indent, ui_file *stream) void buffer_group::flush_here (ui_file *stream) { - m_buffered_output.emplace_back ("", -1, true).m_stream = stream; + m_buffered_output.emplace_back (stream, "", -1, true); } /* See buffered-streams.h. */ diff --git a/gdb/buffered-streams.h b/gdb/buffered-streams.h index 0da2d8a8f43..9da45b08b6b 100644 --- a/gdb/buffered-streams.h +++ b/gdb/buffered-streams.h @@ -48,8 +48,10 @@ struct buffer_group struct output_unit { - output_unit (std::string msg, int wrap_hint = -1, bool flush = false) - : m_msg (msg), m_wrap_hint (wrap_hint), m_flush (flush) + output_unit (ui_file *stream, std::string msg, int wrap_hint = -1, + bool flush = false) + : m_stream (stream), m_msg (msg), m_wrap_hint (wrap_hint), + m_flush (flush) {} /* Write contents of this output_unit to the underlying stream. */ -- 2.49.0