From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id E7C153858CDA for ; Thu, 30 Mar 2023 14:19:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7C153858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pht84-00024b-Pi; Thu, 30 Mar 2023 10:19:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RPw75Zh3BlKT14HMNwwHusMYXGGtDFVJNmtWPb/5DiM=; b=ovhlSGaljckY 9XZwrqB+E0jb366pQg/X4eVrjwoD+8NL2WUlOFw56N4Zk3o6h08LpVXvN2zZ3YcNHl+5kQ+RrgA3v doNvoQW3JQgrthcdlB0d/LRQbw5LQ9mzXQ/ayWddm9iKkejVrjAM0RzHVhnE4WfMLaKxpE8HOd6Oa qD01VwRHMJZhhFeMC5jWFSlHH5wTYiKyQDAHatRrzeISFR+m2qjDMFlcGsX73khwt4nABXP+ZjLLd A9AYicESWc3FWP/PCr9espvo/8s5tPVIjj1ebPvyeMy2a9J1kcfP1ZwnbB/2aAziIsxo7x6Efqlg7 x8eOKQWiXGBsL6t+tpVlZg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pht81-0005mV-3z; Thu, 30 Mar 2023 10:19:51 -0400 Date: Thu, 30 Mar 2023 17:20:00 +0300 Message-Id: <83o7oa48z3.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: <775f2ae1297bff92b09c3b6a58596a5e65f212eb.1680178345.git.aburgess@redhat.com> (message from Andrew Burgess via Gdb-patches on Thu, 30 Mar 2023 13:22:10 +0100) Subject: Re: [PATCH] gdb: add support for %V to printf command References: <775f2ae1297bff92b09c3b6a58596a5e65f212eb.1680178345.git.aburgess@redhat.com> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Cc: Andrew Burgess > Date: Thu, 30 Mar 2023 13:22:10 +0100 > From: Andrew Burgess via Gdb-patches > > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -63,6 +63,15 @@ > break foo thread 1 task 1 > watch var thread 2 task 3 > > +* The printf command now accepts a '%V' output format which will > + format an expression just as the 'print' command would. Print > + options can be placed withing '[...]' after the '%V' to modify how > + the value is printed. E.g: > + printf "%V", some_array > + printf "%V[-array-indexes on]", some_array > + Will print the array without, or with array indexes included, just ^^^^ That "Will" should not be capitalized. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -13131,6 +13131,10 @@ > > @findex $_as_string@r{, convenience function} > @item $_as_string(@var{value}) > +This convenience function is considered deprecated, and could be > +removed from future versions of @value{GDBN}. Use the @kbd{%V} format > +specifier instead (@pxref{%V Format Specifier}). ^^^^^^^^ Please use @samp, not @kbd there, as we are not describing commands typed by the user. > +@anchor{%V Format Specifier} > +Additionally, @code{printf} supports a special @kbd{%V} output format. ^^^^^^^^ Likewise. > +Additionally, it is possible to include print options with the > +@kbd{%V} format by placing them in @kbd{[...]} immediately after the > +@kbd{%V}, like this: ^^^^^^^^^^^ ^^^^^^^^ @samp again there. Thanks. Reviewed-By: Eli Zaretskii