aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/ChangeLog
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2020-11-15 03:14:24 -0500
committerJoel Brobecker <brobecker@adacore.com>2020-11-15 03:14:24 -0500
commitb26daff97cd885640e23229a3d164cd9d93c49ef (patch)
treed32c394299fd968d93abeb4c49615dbb041443c0 /gdb/testsuite/ChangeLog
parent0958441403b92163dff851f0a78241c7fcb4e8eb (diff)
downloadgdb-b26daff97cd885640e23229a3d164cd9d93c49ef.zip
gdb-b26daff97cd885640e23229a3d164cd9d93c49ef.tar.gz
gdb-b26daff97cd885640e23229a3d164cd9d93c49ef.tar.bz2
fix printing of DWARF fixed-point type objects with format modifier
Consider a fixed-point type such the scaling factor is 1/16, as the following Ada code snippet would create: type FP1_Type is delta 0.1 range -1.0 .. +1.0; FP1_Var : FP1_Type := 0.25; Printing the value of this variable with a format modifier yields the wrong value. E.g.: (gdb) p /x fp1_var $6 = 0x4 Since the real value is 0.25, we therefore expected... (gdb) p /x fp1_var $6 = 0x0 What happens, in this case, is that the value being printed is actually the "raw" value of our object, before the scaling factor gets applied. This commit fixes the issue by using approach as for float values, where we convert the value into an integer value, prior to printing, knowing that the conversion takes the scaling factor into account. gdb/ChangeLog: * printcmd.c (print_scalar_formatted): Add fixed-point type handling when options->format is set. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-fixed-point.exp: Add "print /x" tests.
Diffstat (limited to 'gdb/testsuite/ChangeLog')
-rw-r--r--gdb/testsuite/ChangeLog4
1 files changed, 4 insertions, 0 deletions
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: