public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: add support for %V to printf command
Date: Thu, 30 Mar 2023 17:20:00 +0300	[thread overview]
Message-ID: <83o7oa48z3.fsf@gnu.org> (raw)
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)

> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Thu, 30 Mar 2023 13:22:10 +0100
> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
> 
> --- 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 <eliz@gnu.org>

  reply	other threads:[~2023-03-30 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 12:22 Andrew Burgess
2023-03-30 14:20 ` Eli Zaretskii [this message]
2023-04-11 12:34   ` Andrew Burgess
2023-04-17 15:47 ` Tom Tromey
2023-04-28 13:14   ` [PATCHv2] " Andrew Burgess
2023-04-28 15:34     ` Eli Zaretskii
2023-05-12 13:01     ` [PATCHv3] " Andrew Burgess
2023-05-12 13:47       ` Simon Marchi
2023-05-26 20:44       ` Tom Tromey
2023-05-30 20:56         ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o7oa48z3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).