From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id CD61D385702A; Fri, 15 Jul 2022 15:43:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD61D385702A Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Add 'nibbles' to gdb.print_options X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: ebbac1687d0075c8666b25438fc4f35d3dd1daaa X-Git-Newrev: 3028a2dbbffb2e15cc2364d0c962951f6f2230f2 Message-Id: <20220715154347.CD61D385702A@sourceware.org> Date: Fri, 15 Jul 2022 15:43:47 +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: Fri, 15 Jul 2022 15:43:47 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3028a2dbbffb= 2e15cc2364d0c962951f6f2230f2 commit 3028a2dbbffb2e15cc2364d0c962951f6f2230f2 Author: Tom Tromey Date: Fri Jul 15 09:38:32 2022 -0600 Add 'nibbles' to gdb.print_options =20 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. Diff: --- 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 *unuse= d2) 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" =20 - check_format_string "a_point_t" "format=3D't'" \ - "Pretty Point \\(101010, 1100\\)" \ + check_format_string "a_point_t" "format=3D't', nibbles=3DTrue" \ + "Pretty Point \\(0010.1010, 1100\\)" \ "print in binary to fetch options" gdb_test "python print(saved_options\['format'\] =3D=3D 't')" "True" \ "format was set" + gdb_test "python print(saved_options\['nibbles'\])" "True" \ + "nibbles was set" =20 check_format_string "a_point_t" "summary=3DTrue" \ "No Data" \