From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +XLmK/mwfGl6rx0AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 08:24:09 -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=ABDtF6MP; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id AEC2D1E0DD; Fri, 30 Jan 2026 08:24:09 -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 41C9E1E08D for ; Fri, 30 Jan 2026 08:24:09 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id AC5234BB5884 for ; Fri, 30 Jan 2026 13:24:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC5234BB5884 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=ABDtF6MP Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 9CE9C4BB5888 for ; Fri, 30 Jan 2026 13:17:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9CE9C4BB5888 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 9CE9C4BB5888 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=1769779046; cv=none; b=DVrS0kj+ltaphsDeQZUPa0m3OcmPtwvFROAVi6O4iQjKRLjrFtw3ylbla2H6gkKyUu7wIY0KWDQS4lErB+nXTLc8AvMkqoc2LmvFmp3/u8W/hDazjK+44aeyDFNnPkhmVQw4IA/4V8Wjf9lXCWAeH9UuRCzooVE7FzVBgpYZkIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769779046; c=relaxed/simple; bh=kxEg3h69gbTEzOTsqZopbyAkwuxbLN5UwAlbNOQttvI=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=iOMjoA9r/vt31eLEdYv7WsNigUdQcv+zruPigNI2VER4S6+IIe83h8nfLFrbWDh3vpFp4phyMw20jFUpxRJVzPs7GLzFW7ZKA1nKNmqqTRiHlV59RYJoit30XFoYi07wbt1U+muMLQwwRlMIhlWdYeyeA+/iTampgOmKmaC1YvY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CE9C4BB5888 Received: from eig-obgw-6003b.ext.cloudfilter.net ([10.0.30.175]) by cmsmtp with ESMTPS id llMmvHMaHKjfoloNJvUHlR; Fri, 30 Jan 2026 13:17:25 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id loNJvKp6JhoT4loNJv2yl3; Fri, 30 Jan 2026 13:17:25 +0000 X-Authority-Analysis: v=2.4 cv=XZyJzJ55 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=tthpUKUCX1FNGHySM-UA: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=LmksDyT7sNtF+mJPHeTM/eXSehIXl009YEcKjOo7XZM=; b=ABDtF6MPi1cP0SkoCnpizeK55E j6lwGVtubU7ZDu3Q4cGhFETxE84n97+iq/I3o16yMEq/vqm3teO/r7McYyrbmqnWBYzCc/5KS/Jjl 5XzAZyGQ6agMJldrwFnZpRfI0; 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-3lGD; Fri, 30 Jan 2026 06:17:24 -0700 From: Tom Tromey Date: Fri, 30 Jan 2026 06:17:26 -0700 Subject: [PATCH v3 12/21] Rewrite cli-style.c:do_show MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260130-pr-28948-logging-5-v3-12-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-3lGD 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: 21 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHX7srK6KSdOiKiNDLGvfANXNMSld5/+VjIFNH5oFUnfPkmynziOImV8G3XVvd9786pkFAJ9U8XT/Zrshbtzked0wcEaJm6vwXLCfaZxmBB1iQ8/ZhT4 fQYtK25jeGzS7dEYtoSN4zQTmBkwR9i5YlE0jbsMhNATuukGREfDA7J8CBH88jlaUzlxSD24ZZ0j5LisotCjKYFUY+aSOAW6d4Y= 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 IMO it looks a little nicer if cli-style.c:do_show uses a single printf to display its output. This is also slightly more i18-friendly. I noticed this while debugging a case where multiple redundant ANSI escapes were sent. In conjunction with a subsequent patch, this approach happens to fix that problem. FWIW I don't consider such redundancies to be bugs, but it was convenient to change this one. Approved-By: Andrew Burgess --- gdb/cli/cli-style.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c index 411d8d91347..ac4fb27e725 100644 --- a/gdb/cli/cli-style.c +++ b/gdb/cli/cli-style.c @@ -262,9 +262,8 @@ do_show (const char *what, struct ui_file *file, const char *value) { cli_style_option *cso = (cli_style_option *) cmd->context (); - gdb_puts (_("The "), file); - fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ()); - gdb_printf (file, _(" %s is: %s\n"), what, value); + gdb_printf (file, _("The %p[\"%s\" style%p] %s is: %s\n"), + cso->style ().ptr (), cso->name (), nullptr, what, value); } /* See cli-style.h. */ -- 2.49.0