This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Implement 'print -raw-values' and 'set print raw-values on|off'
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 08 Aug 2019 20:25:30 +0300
- Subject: Re: [RFA] Implement 'print -raw-values' and 'set print raw-values on|off'
- References: <20190807193924.32268-1-philippe.waroquiers@skynet.be>
> From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Date: Wed, 7 Aug 2019 21:39:24 +0200
>
> diff --git a/gdb/NEWS b/gdb/NEWS
> index fa01adf6e8..8f27b102ea 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -101,6 +101,12 @@ show print max-depth
> The default max-depth is 20, but this can be set to unlimited to get
> the old behavior back.
>
> +set print raw-values [on|off]
> +show print raw-values
> + By default, GDB applies the enabled pretty printers when printing a
> + value. This allows to ignore the enabled pretty printers for a series
> + of commands. The default is 'off'.
> +
> set logging debugredirect [on|off]
> By default, GDB debug output will go to both the terminal and the logfile.
> Set if you want debug output to go only to the log file.
> @@ -200,6 +206,7 @@ maint show test-options-completion-result
> -null-stop [on|off]
> -object [on|off]
> -pretty [on|off]
> + -raw-values [on|off]
> -repeats NUMBER|unlimited
> -static-members [on|off]
> -symbol [on|off]
> @@ -244,11 +251,11 @@ maint show test-options-completion-result
> "on" if omitted. This allows writing compact command invocations,
> like for example:
>
> - (gdb) p -r -p -o 0 -- *myptr
> + (gdb) p -ra -p -o 0 -- *myptr
>
> The above is equivalent to:
>
> - (gdb) print -raw -pretty -object off -- *myptr
> + (gdb) print -raw-values -pretty -object off -- *myptr
>
> ** The "info types" command now supports the '-q' flag to disable
> printing of some header information in a similar fashion to "info
This part is OK.
> +@item set print raw-values off
> +Print values in pretty-printed form, if there is a pretty-printer
> +for the value (@pxref{Pretty Printing}),
> +otherwise print the value in raw form.
> +This is the default.
I suggest a slight rewording:
+@anchor{set print raw-values}
+@item set print raw-values on
+Print values in raw form, without applying the pretty
+printers for the value.
+
+@item set print raw-values off
+Print values in pretty-printed form, if there is a pretty-printer
+for the value (@pxref{Pretty Printing}),
+otherwise print the value in raw form.
+
+The default setting is OFF.
> +The print option @code{-raw-values} and @value{GDBN} setting @xref{set
> +print raw-values} can be used to print values without applying the
This use of @xref is a bad idea, because the printed output and even
the Info output that result from this look like a typo. For starters,
@xref produces a capitalized "See", which is inappropriate in the
middle of a sentence.
My suggestion is to use the following style:
The print option @code{-raw-values} and @value{GDBN} setting
@code{set print raw-values} (@pxref{set print raw-values}) can be
used to print ...
Yes, this repeats some of the text, but there's nothing much we can do
about that.
> +Similarly, the backtrace option @code{-raw-frame-arguments} and
> +@value{GDBN} setting @xref{set print raw-frame-arguments} can be used
> +to ignore the enabled pretty printers when printing frame argument
> +values
Likewise here. Also, a period is missing at the end of the last
sentence.
Thanks.