diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/printcmd.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp | 12 |
4 files changed, 23 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 16905ac..0d322da 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-11-15 Joel Brobecker <brobecker@adacore.com> + * printcmd.c (print_scalar_formatted): Add fixed-point type + handling when options->format is set. + +2020-11-15 Joel Brobecker <brobecker@adacore.com> + * ada-valprint.c (ada_value_print_1): Add fixed-point type handling. * dwarf2/read.c (get_dwarf2_rational_constant) (get_dwarf2_unsigned_rational_constant, finish_fixed_point_type) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index f7186c2..6651424 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -421,7 +421,8 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, range case, we want to avoid this, so we store the unpacked value here for possible use later. */ gdb::optional<LONGEST> val_long; - if ((type->code () == TYPE_CODE_FLT + if (((type->code () == TYPE_CODE_FLT + || is_fixed_point_type (type)) && (options->format == 'o' || options->format == 'x' || options->format == 't' diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0f629bd..9b9ffe5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2020-11-15 Joel Brobecker <brobecker@adacore.com> + * gdb.dwarf2/dw2-fixed-point.exp: Add "print /x" tests. + +2020-11-15 Joel Brobecker <brobecker@adacore.com> + * gdb.ada/fixed_cmp.exp: Force compilation to use -fgnat-encodings=all. * gdb.ada/fixed_points.exp: Add fixed-point variables printing tests. * gdb.ada/fixed_points/pck.ads, gdb.ada/fixed_points/pck.adb: diff --git a/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp b/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp index bf88ffe..27c549c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp @@ -122,11 +122,23 @@ gdb_test_no_output "set lang ada" gdb_test "print pck.fp1_var" \ " = 0.25" +gdb_test "print /x pck.fp1_var" \ + " = 0x0" + gdb_test "print pck.fp2_var" \ " = -0.01" +gdb_test "print /x pck.fp2_var" \ + " = 0x0" + gdb_test "print pck.fp3_var" \ " = 0.1" +gdb_test "print /x pck.fp3_var" \ + " = 0x0" + gdb_test "print pck.fp1_range_var" \ " = 1" + +gdb_test "print /x pck.fp1_range_var" \ + " = 0x1" |