From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id A90203858C60 for ; Sun, 22 Oct 2023 15:01:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A90203858C60 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 A90203858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697986882; cv=none; b=kMDI6TLUjr/VMdKXM5EAFk27ynGqnvHy15c26RucRSHQclTiO13Qq4wMmdX65NZ5yQY/yQ4efbNAUO2ca4oiSRlaoZ/gQw2Ey1qj2ekHzwEimTxpc3MpbhW+w+D6rVhEifbrGCoE2TlwtaQIr3+qx4U/j7cIxtcV9BBPI2+j6Zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697986882; c=relaxed/simple; bh=ORfajscx8KSY4TxSsiAGHfhcYnLJ1WGpu9p0hbLpSxI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YPbYqk2Q3Wn01ZrYY229neH/dzB2BU0V/UVXISQwgz+UMgxPEuFCLEgk97aafZrvnVknFx6YNNnHU5MzNVwQJJtZ45dOvCrYrajtoP+TGgJsZLapUzGX62nMSJ9J8qhWVlaBQIVZHsisBWPg2jMPvBX77QsKWXuqr2m/spOSWGI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id uPufqNW3OL9AguZx8qfPSL; Sun, 22 Oct 2023 15:01:18 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id uZx7qJXlvGYrguZx7qf1gK; Sun, 22 Oct 2023 15:01:17 +0000 X-Authority-Analysis: v=2.4 cv=bYd47cDB c=1 sm=1 tr=0 ts=6535393d a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=edUnKgkxx8Jqm0vXj5gA:9 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: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=aqiMIdW67ajMvgV5N67LgbaUxQXsnvIb9OeF9KSVArQ=; b=cOa+a2Ltn/oEeT5ZDrm0xuc16O Yj/Hnf5w7c95FERWWPNhqlCbt7KPlHNQPoggPoS8D0kfyZOnCtDZIyhW67tgH5+12ynBx7XNJUBBQ 4OxTSx5fP3jtFBRcrGN5Trd/K; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:43970 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1quZx6-003kj3-2O; Sun, 22 Oct 2023 09:01:16 -0600 From: Tom Tromey To: Andrew Burgess via Gdb-patches Cc: Tom Tromey , Andrew Burgess Subject: Re: [PATCH] Style history variable output References: <20230612231100.18608-1-tom@tromey.com> <87jzw6w8e0.fsf@redhat.com> X-Attribution: Tom Date: Sun, 22 Oct 2023 09:01:18 -0600 In-Reply-To: <87jzw6w8e0.fsf@redhat.com> (Andrew Burgess via Gdb-patches's message of "Wed, 14 Jun 2023 13:11:51 +0100") Message-ID: <87a5savgzl.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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.77.73 X-Source-L: No X-Exim-ID: 1quZx6-003kj3-2O X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (prentzel) [97.122.77.73]:43970 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIWpd3rIJWfEPjeJ/xSeXtlg6huLKMNQDTiZ0DbRNqKm9/Q/XhO4h4f6tNRXTPwjVhQem/X/3LDglNdCLDzAZZh7b1RwX4rPy/MyK0vrWWqqYCgNiB3G AGhsMEwMITAEmAhomEycL7K4nlammJ6mOWTDw2a061PwoCKvLnQoSMp6RSnVL4LW2L9//WrM2bco+2larzG1Xxjq9TRRWLDig9k= X-Spam-Status: No, score=-3018.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Andrew" == Andrew Burgess via Gdb-patches writes: [ old patch ] >> - gdb_printf ("$%d = ", histindex); >> + gdb_printf ("%p[$%d%p] = ", variable_name_style.style ().ptr (), >> + histindex, nullptr); Andrew> How about: Andrew> std::string idx = string_printf ("$%d", histindex); Andrew> gdb_printf ("%ps = ", styled_string (variable_name_style.style (), Andrew> idx.c_str ())); Andrew> Then the '$' and the '%d' part will be styled as one... I spent some time trying to fix gdb_printf here, but eventually gave up on it. It's probably doable but a bit tricky. Meanwhile I've applied your suggestion and I'm going to finally check this in. Tom