From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eURzG7qwfGl6rx0AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 08:23:06 -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=Tq86Tav2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 69F2B1E0E1; Fri, 30 Jan 2026 08:23:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham 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 3486D1E0BA for ; Fri, 30 Jan 2026 08:23:05 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id C06CB4BB3BC3 for ; Fri, 30 Jan 2026 13:23:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C06CB4BB3BC3 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=Tq86Tav2 Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 1BB894BB3BCC for ; Fri, 30 Jan 2026 13:17:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BB894BB3BCC 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 1BB894BB3BCC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769779049; cv=none; b=Oo9x/v+EOVewFBxvgGUXPQVrw9an2VOaItVmBe0dRd0DrHWrEWrUlrTTxXd/rAaaSXwWXjpjJrnQc69r2lPIaGztSa/f6lV/R7TfPS36H75QbiQdgl2LhND92gFxrO9AJ11cnJoVaMFt92+sPKi+wAmYFNMsL4pFKDVuNF5tqYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769779049; c=relaxed/simple; bh=OIu7UI/m+F+wIByONXOLi/rsDiPHCrv6o1i+gEUOO94=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=ATmzYGhlxHgipI41zpPO4uhWmnSwiF60MsaCvuT0nUjL3reqBXN2dMwWK0mdlFylPS43wltA3UwCV8lN7od1jr8BEOczMKo75wWyfCwDL9WM43MeGfW51UK2x1UvG0b+OlV0KU8+r4YNPJZVWP3V3nQIXPibDQ1y3uLxD8FhR/Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BB894BB3BCC Received: from eig-obgw-5002b.ext.cloudfilter.net ([10.0.29.226]) by cmsmtp with ESMTPS id lgc1vGCzHKjfoloNMvUHmz; Fri, 30 Jan 2026 13:17:28 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id loNLvd1eZN3K1loNLvQwS1; Fri, 30 Jan 2026 13:17:28 +0000 X-Authority-Analysis: v=2.4 cv=UdRRSLSN c=1 sm=1 tr=0 ts=697caf68 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=ItBw4LHWJt0A:10 a=ZqrPknxXshOrWhFHgpMA:9 a=+jEqtf1s3R9VXZ0wqowq2kgwd+I=:19 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=a8fLDOgmKkqo2FuD12CL+WaB7uVEGclAvVPtUo7LOHw=; b=Tq86Tav2fDaON9veyilJdrmg9D ABAcnnAVXreHxhA2wWq6FCnrc1rwOnMtCJG9JwAinV0ZvtKAfHOd35f3H/A3LP3lUd1YUg8qt1A2R CUezrkI6sXFHFisiXNewHXLiZ; 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 1vloNL-00000001JjQ-1AlN; Fri, 30 Jan 2026 06:17:27 -0700 From: Tom Tromey Date: Fri, 30 Jan 2026 06:17:34 -0700 Subject: [PATCH v3 20/21] Style filenames in cli-logging.c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260130-pr-28948-logging-5-v3-20-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: 1vloNL-00000001JjQ-1AlN 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: 32 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOhjhndhp9Nv5QgnzISh9QKrufjvexyGyWpqlf6P56qosjtrTsW3x1MbLC9S6MSicJk6D7QRPVFE1pmHFfUcfCK4OZ4hSn11M612rzG2wxhEd5lL1dLy zBf1dHXrpxmm4uUpY1LdyZgcBVBO40kx53Z7EXDM2REo5F1kuCKxyiuP2DzLWdx5QcCDQz2mRMJMUgIuMvoQVW66zh9tqx0U8R0= 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 Andrew pointed out that some code in cli-logging.c should use the filename style. This patch fixes these spots. --- gdb/cli/cli-logging.c | 37 +++++++++++++++++++++++-------------- gdb/testsuite/gdb.base/style.exp | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c index 836c24445bc..38c16fbf18f 100644 --- a/gdb/cli/cli-logging.c +++ b/gdb/cli/cli-logging.c @@ -30,8 +30,10 @@ static void maybe_warn_already_logging () { if (!saved_filename.empty ()) - warning (_("Currently logging to %s. Turn the logging off and on to " - "make the new setting effective."), saved_filename.c_str ()); + warning (_("Currently logging to %ps. Turn the logging off and on to " + "make the new setting effective."), + styled_string (file_name_style.style (), + saved_filename.c_str ())); } static std::string logging_filename = "gdb.txt"; @@ -227,8 +229,9 @@ handle_redirections (int from_tty) { if (!saved_filename.empty ()) { - gdb_printf ("Already logging to %s.\n", - saved_filename.c_str ()); + gdb_printf ("Already logging to %ps.\n", + styled_string (file_name_style.style (), + saved_filename.c_str ())); return; } @@ -240,18 +243,22 @@ handle_redirections (int from_tty) if (from_tty) { if (!logging_redirect) - gdb_printf ("Copying output to %s.\n", - logging_filename.c_str ()); + gdb_printf ("Copying output to %ps.\n", + styled_string (file_name_style.style (), + logging_filename.c_str ())); else - gdb_printf ("Redirecting output to %s.\n", - logging_filename.c_str ()); + gdb_printf ("Redirecting output to %ps.\n", + styled_string (file_name_style.style (), + logging_filename.c_str ())); if (!debug_redirect) - gdb_printf ("Copying debug output to %s.\n", - logging_filename.c_str ()); + gdb_printf ("Copying debug output to %ps.\n", + styled_string (file_name_style.style (), + logging_filename.c_str ())); else - gdb_printf ("Redirecting debug output to %s.\n", - logging_filename.c_str ()); + gdb_printf ("Redirecting debug output to %ps.\n", + styled_string (file_name_style.style (), + logging_filename.c_str ())); } saved_filename = logging_filename; @@ -279,8 +286,10 @@ set_logging_off (const char *args, int from_tty) log_file.reset (); if (from_tty) - gdb_printf ("Done logging to %s.\n", - saved_filename.c_str ()); + gdb_printf ("Done logging to %ps.\n", + styled_string (file_name_style.style (), + saved_filename.c_str ())); + saved_filename.clear (); } diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 23d50f4cfad..5c07541b18b 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -1047,6 +1047,25 @@ proc test_finish_styling {} { gdb_test "finish" "Value returned is [style \\\$$::decimal variable] = 0" } +# Test some logging styling. +proc test_logging_styling {} { + with_ansi_styling_terminal { + clean_restart + } + + set filename [standard_output_file logging.txt] + gdb_test_no_output "set logging file $filename" \ + "set logging file" + gdb_test "set logging enabled on" \ + [multi_line \ + "Copying output to [style $filename file]\\." \ + "Copying debug output to [style $filename file]\\."] \ + "logging filenames are styled" + gdb_test "set logging enabled off" \ + "Done logging to [style $filename file]\\." \ + "filename styled when logging disabled" +} + # Check to see if the Python styling of disassembler output is # expected or not, this styling requires Python support in GDB, and # the Python pygments module to be available. @@ -1093,3 +1112,4 @@ test_pagination_cmd_after_quit_styling test_pagination_prompt_styling test_pagination_continue_styling test_finish_styling +test_logging_styling -- 2.49.0