From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [pushed] Add 'nibbles' to gdb.print_options
Date: Fri, 15 Jul 2022 09:41:45 -0600 [thread overview]
Message-ID: <20220715154145.1607684-1-tromey@adacore.com> (raw)
When I rebased and updated the print_options patch, I forgot to update
print_options to add the new 'nibbles' feature to the result. This
patch fixes the oversight. I'm checking this in.
---
gdb/python/py-prettyprint.c | 2 ++
gdb/testsuite/gdb.python/py-format-string.exp | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 7b2aa588bb0..1f8dd26b1bc 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -753,6 +753,8 @@ gdbpy_print_options (PyObject *unused1, PyObject *unused2)
opts.static_field_print) < 0
|| set_boolean (result.get (), "deref_refs",
opts.deref_ref) < 0
+ || set_boolean (result.get (), "nibbles",
+ opts.nibblesprint) < 0
|| set_boolean (result.get (), "summary",
opts.summary) < 0
|| set_unsigned (result.get (), "max_elements",
diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/gdb.python/py-format-string.exp
index c432de97276..45b08512c0c 100644
--- a/gdb/testsuite/gdb.python/py-format-string.exp
+++ b/gdb/testsuite/gdb.python/py-format-string.exp
@@ -1122,11 +1122,13 @@ proc test_print_options {} {
gdb_test "python print('format' in gdb.print_options())" "False" \
"examine format"
- check_format_string "a_point_t" "format='t'" \
- "Pretty Point \\(101010, 1100\\)" \
+ check_format_string "a_point_t" "format='t', nibbles=True" \
+ "Pretty Point \\(0010.1010, 1100\\)" \
"print in binary to fetch options"
gdb_test "python print(saved_options\['format'\] == 't')" "True" \
"format was set"
+ gdb_test "python print(saved_options\['nibbles'\])" "True" \
+ "nibbles was set"
check_format_string "a_point_t" "summary=True" \
"No Data" \
--
2.34.1
reply other threads:[~2022-07-15 15:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220715154145.1607684-1-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/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).