]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/doc: Documentation for the new print command
authorEnze Li <enze.li@hotmail.com>
Sun, 12 Jun 2022 05:24:02 +0000 (13:24 +0800)
committerEnze Li <enze.li@hotmail.com>
Sat, 18 Jun 2022 03:23:12 +0000 (11:23 +0800)
Document the new command "print nibbles" and add a NEWS entry.

gdb/NEWS
gdb/doc/gdb.texinfo

index c570681a9775accf1b4a61af5a4c9e60643dcbf9..5576c355b7a7d004a8ae0a46827ee54402616a6b 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -36,6 +36,11 @@ maintenance show ignore-prologue-end-flag
   used to force GDB to use prologue analyzers if the line-table is constructed
   from erroneous debug information.
 
+set print nibbles [on|off]
+show print nibbles
+  This controls whether the 'print/t' command will display binary values
+  in groups of four bits, known as "nibbles".  The default is 'off'.
+
 * Changed commands
 
 maintenance info line-table
index 2178b476f5316bd901f8cc59bbe649fec220d865..b3e995f166b49fe49c33d16c069fecf46199af26 100644 (file)
@@ -2142,10 +2142,10 @@ on @code{-} after the command name.  For example:
 
 @smallexample
 (@value{GDBP}) print -@key{TAB}@key{TAB}
--address         -max-depth               -pretty          -symbol
--array           -memory-tag-violations   -raw-values      -union
--array-indexes   -null-stop               -repeats         -vtbl
--elements        -object                  -static-members
+-address         -max-depth               -object          -static-members
+-array           -memory-tag-violations   -pretty          -symbol
+-array-indexes   -nibbles                 -raw-values      -union
+-elements        -null-stop               -repeats         -vtbl
 @end smallexample
 
 Completion will in some cases guide you with a suggestion of what kind
@@ -10154,6 +10154,10 @@ Set limit on string chars or array elements to print.  The value
 Set the threshold after which nested structures are replaced with
 ellipsis.  Related setting: @ref{set print max-depth}.
 
+@item -nibbles [@code{on}|@code{off}]
+Set whether to print binary values in groups of four bits, known
+as ``nibbles''.  @xref{set print nibbles}.
+
 @item -memory-tag-violations [@code{on}|@code{off}]
 Set printing of additional information about memory tag violations.
 @xref{set print memory-tag-violations}.
@@ -11518,6 +11522,29 @@ Stop printing element indexes when displaying arrays.
 Show whether the index of each element is printed when displaying
 arrays.
 
+@anchor{set print nibbles}
+@item set print nibbles
+@itemx set print nibbles on
+@cindex print binary values in groups of four bits
+Print binary values in groups of four bits, known as @dfn{nibbles},
+when using the print command of @value{GDBN} with the option @samp{/t}.
+For example, this is what it looks like with @code{set print nibbles on}:
+
+@smallexample
+@group
+(@value{GDBP}) print val_flags
+$1 = 1230
+(@value{GDBP}) print/t val_flags
+$2 = 0100 1100 1110
+@end group
+@end smallexample
+
+@item set print nibbles off
+Don't printing binary values in groups.  This is the default.
+
+@item show print nibbles
+Show whether to print binary values in groups of four bits.
+
 @anchor{set print elements}
 @item set print elements @var{number-of-elements}
 @itemx set print elements unlimited