Add 'nibbles' to gdb.print_options
authorTom Tromey <tromey@adacore.com>
Fri, 15 Jul 2022 15:38:32 +0000 (09:38 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 15 Jul 2022 15:42:39 +0000 (09:42 -0600)
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
gdb/testsuite/gdb.python/py-format-string.exp

index 7b2aa588bb0370b01aeef7748863d48b6b94c095..1f8dd26b1bcda8ebcdf5c3f590e0ffc797cd9058 100644 (file)
@@ -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",
index c432de9727678a61f436b7b567110223c8c7fece..45b08512c0cdfa157ee3b40ae9f379ecf938cff1 100644 (file)
@@ -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" \