diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-08-07 20:50:54 +0200 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-12-11 04:31:05 +0100 |
commit | d8edc8b768f0f611088161161392e1075134d635 (patch) | |
tree | 37f073313f2bf23e8dcbddbd19c815e7b3a0fba6 /gdb/doc | |
parent | 5afa80e9a8e6585eeaac44ca51be9c6b2471bf80 (diff) | |
download | gdb-d8edc8b768f0f611088161161392e1075134d635.zip gdb-d8edc8b768f0f611088161161392e1075134d635.tar.gz gdb-d8edc8b768f0f611088161161392e1075134d635.tar.bz2 |
Implement 'print -raw-values' and 'set print raw-values on|off'
The option framework documentation was speaking about a 'print -raw'
option, but this option does not exist.
This patch implements -raw-values option that tells to ignore the
active pretty printers when printing a value.
As we already have -raw-frame-arguments, I thought -raw-values
was more clear, in particular to differentiate
set print raw-values and set print raw-frame-arguments.
gdb/doc/ChangeLog
2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.texinfo (Command Options): Use -p and -pretty in the example,
as -r is ambiguous. Update the print - TAB TAB completion result.
(Data): Document new option -raw-values. Use -p and -pretty in the
example, as -r is ambiguous.
(Print Settings): Document set print raw values.
(Pretty-Printer Commands): Document interaction between enabled
pretty printers and -raw-values/-raw-frame-arguments.
gdb/ChangeLog
2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Document -raw-values option and the related setting commands.
* printcmd.c (print_command_parse_format): Do not set opts->raw off,
only set it on when /r is given.
* valprint.c (value_print_option_defs): New element raw-values.
* Makefile.in: Add the new file.
gdb/testsuite/ChangeLog
2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/options.exp: Add -raw-values in the print completion list.
* gdb.python/py-prettyprint.exp: Add tests for -raw-values.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 52 |
2 files changed, 52 insertions, 10 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 57ad682..6db33e1 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,13 @@ +2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be> + + * gdb.texinfo (Command Options): Use -p and -pretty in the example, + as -r is ambiguous. Update the print - TAB TAB completion result. + (Data): Document new option -raw-values. Use -p and -pretty in the + example, as -r is ambiguous. + (Print Settings): Document set print raw values. + (Pretty-Printer Commands): Document interaction between enabled + pretty printers and -raw-values/-raw-frame-arguments. + 2019-12-10 Tom Tromey <tom@tromey.com> * python.texi (gdb.prompt): Use correct quotes in example. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 544e632..a4e2c4f 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1949,8 +1949,8 @@ Some commands take raw input as argument. For example, the print command processes arbitrary expressions in any of the languages supported by @value{GDBN}. With such commands, because raw input may start with a leading dash that would be confused with an option or any -of its abbreviations, e.g.@: @code{print -r} (short for @code{print --raw} or printing negative @code{r}?), if you specify any command +of its abbreviations, e.g.@: @code{print -p} (short for @code{print +-pretty} or printing negative @code{p}?), if you specify any command option, then you must use a double-dash (@code{--}) delimiter to indicate the end of options. @@ -1976,10 +1976,10 @@ on @code{-} after the command name. For example: @smallexample (@value{GDBP}) print -@key{TAB}@key{TAB} --address -max-depth -repeats -vtbl --array -null-stop -static-members --array-indexes -object -symbol --elements -pretty -union +-address -max-depth -raw-values -union +-array -null-stop -repeats -vtbl +-array-indexes -object -static-members +-elements -pretty -symbol @end smallexample Completion will in some cases guide you with a suggestion of what kind @@ -9646,6 +9646,11 @@ Set printing C@t{++} virtual function tables. Related setting: Set pretty formatting of structures. Related setting: @ref{set print pretty}. +@item -raw-values [@code{on}|@code{off}] +Set whether to print values in raw form, bypassing any +pretty-printers for that value. Related setting: @ref{set print +raw-values}. + @item -repeats @var{number-of-repeats}|@code{unlimited} Set threshold for repeated print elements. @code{unlimited} causes all elements to be individually printed. Related setting: @ref{set @@ -9673,17 +9678,17 @@ may look like options (including abbreviations), if you specify any command option, then you must use a double dash (@code{--}) to mark the end of option processing. -For example, this prints the value of the @code{-r} expression: +For example, this prints the value of the @code{-p} expression: @smallexample -(@value{GDBP}) print -r +(@value{GDBP}) print -p @end smallexample While this repeats the last value in the value history (see below) -with the @code{-raw} option in effect: +with the @code{-pretty} option in effect: @smallexample -(@value{GDBP}) print -r -- +(@value{GDBP}) print -p -- @end smallexample Here is an example including both on option and an expression: @@ -11274,6 +11279,21 @@ This is the default format. @item show print pretty Show which format @value{GDBN} is using to print structures. +@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''. + +@item show print raw-values +Show whether to print values in raw form. + @item set print sevenbit-strings on @cindex eight-bit characters in strings @cindex octal escapes in strings @@ -11613,6 +11633,18 @@ library2.so: Note that for @code{bar} the entire printer can be disabled, as can each individual subprinter. +Printing values and frame arguments is done by default using +the enabled pretty printers. + +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 values without applying the enabled pretty printers. + +Similarly, the backtrace option @code{-raw-frame-arguments} and +@value{GDBN} setting @code{set print raw-frame-arguments} +(@pxref{set print raw-frame-arguments}) can be used to ignore the +enabled pretty printers when printing frame argument values. + @node Value History @section Value History |