From: Enze Li <lienze2010@hotmail.com>
To: pedro@palves.net, tom@tromey.com
Cc: gdb-patches@sourceware.org
Subject: [PATCH v8 2/3] gdb/doc: Documentation for the new print command
Date: Sat, 23 Apr 2022 17:15:57 +0800 [thread overview]
Message-ID: <MEAP282MB029309CDBB1C7DBF06A0152EDDF69@MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <MEAP282MB0293F859A4DA5B33CB9096A0DDF69@MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM>
Document the new command "print nibbles" and add a NEWS entry.
---
gdb/NEWS | 5 +++++
gdb/doc/gdb.texinfo | 35 +++++++++++++++++++++++++++++++----
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/gdb/NEWS b/gdb/NEWS
index 760cb2b7abc..f8502d5d238 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -23,6 +23,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
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index c1e9b09e833..7be872570a1 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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
@@ -10021,6 +10021,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}.
@@ -11385,6 +11389,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
--
2.35.3
next prev parent reply other threads:[~2022-04-23 9:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-23 9:12 [PING][PATCH v8 0/3] gdb: Add new 'print nibbles' feature Enze Li
2022-04-23 9:14 ` [PATCH v8 1/3] " Enze Li
2022-04-23 9:15 ` Enze Li [this message]
2022-04-23 9:20 ` [PATCH v8 2/3] gdb/doc: Documentation for the new print command Eli Zaretskii
2022-04-23 9:16 ` [PATCH v8 3/3] gdb/python: Export nibbles to python layer Enze Li
2022-04-23 9:22 ` Eli Zaretskii
2022-06-07 13:44 ` Enze Li
2022-06-07 13:44 ` Enze Li
2022-06-06 13:41 ` [PING][PATCH v8 0/3] gdb: Add new 'print nibbles' feature Tom Tromey
2022-06-07 13:29 ` Enze Li
2022-06-18 3:29 ` Enze Li
[not found] <20220416175963.3211-1-lienze2010@hotmail.com>
[not found] ` <20220416181725.7176-1-lienze2010@hotmail.com>
2022-04-16 18:17 ` [PATCH v8 2/3] gdb/doc: Documentation for the new print command Enze Li
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=MEAP282MB029309CDBB1C7DBF06A0152EDDF69@MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM \
--to=lienze2010@hotmail.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--cc=tom@tromey.com \
/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).