From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7872) id 8183E3857BB7; Sat, 18 Jun 2022 03:31:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8183E3857BB7 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Enze Li To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/doc: Documentation for the new print command X-Act-Checkin: binutils-gdb X-Git-Author: Enze Li X-Git-Refname: refs/heads/master X-Git-Oldrev: 21a527dfc85d62c9e90c65ac4076f517a6b76a48 X-Git-Newrev: 153b3c1117d02c2893c5be1b3af53ec7f161a211 Message-Id: <20220618033156.8183E3857BB7@sourceware.org> Date: Sat, 18 Jun 2022 03:31:56 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2022 03:31:56 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D153b3c1117d0= 2c2893c5be1b3af53ec7f161a211 commit 153b3c1117d02c2893c5be1b3af53ec7f161a211 Author: Enze Li Date: Sun Jun 12 13:24:02 2022 +0800 gdb/doc: Documentation for the new print command =20 Document the new command "print nibbles" and add a NEWS entry. Diff: --- gdb/NEWS | 5 +++++ gdb/doc/gdb.texinfo | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index c570681a977..5576c355b7a 100644 --- 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 constru= cted from erroneous debug information. =20 +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 =20 maintenance info line-table diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2178b476f53..b3e995f166b 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2142,10 +2142,10 @@ on @code{-} after the command name. For example: =20 @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 =20 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 pri= nt. The value Set the threshold after which nested structures are replaced with ellipsis. Related setting: @ref{set print max-depth}. =20 +@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 arra= ys. Show whether the index of each element is printed when displaying arrays. =20 +@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 =3D 1230 +(@value{GDBP}) print/t val_flags +$2 =3D 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