diff options
author | Tom Tromey <tromey@adacore.com> | 2022-02-16 10:07:18 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-03-07 08:27:38 -0700 |
commit | 63fc2437deda87a566059444630ccc402945ae99 (patch) | |
tree | ff778d7fab7aea1716f23f4c36c5553d9c5c1449 /gdb/NEWS | |
parent | c9bfa277e9e6467dad91641357e09bf0a7ac0dc2 (diff) | |
download | binutils-gdb-63fc2437deda87a566059444630ccc402945ae99.tar.gz |
Implement real literal extension for Ada
Sometimes it is convenient to be able to specify the exact bits of a
floating-point literal. For example, you may want to set a
floating-point register to a denormalized value, or to a particular
NaN.
In C, you can do this by combining the "{}" cast with an array
literal, like:
(gdb) p {double}{0x576488BDD2AE9FFE}
$1 = 9.8765449999999996e+112
This patch adds a somewhat similar idea to Ada. It extends the lexer
to allow "l" and "f" suffixes in a based literal. The "f" indicates a
floating-point literal, and the "l"s control the size of the
floating-point type.
Note that this differs from Ada's based real literals. I believe
those can also be used to control the bits of a floating-point value,
but they are a bit more cumbersome to use (simplest is binary but
that's also very lengthy). Also, these aren't implemented in GDB.
I chose not to allow this extension to work with based integer
literals with exponents. That didn't seem very useful.
Diffstat (limited to 'gdb/NEWS')
-rw-r--r-- | gdb/NEWS | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -142,6 +142,14 @@ info win This command now includes information about the width of the tui windows in its output. +* GDB's Ada parser now supports an extension for specifying the exact + byte contents of a floating-point literal. This can be useful for + setting floating-point registers to a precise value without loss of + precision. The syntax is an extension of the based literal syntax. + Use, e.g., "16lf#0123abcd#" -- the number of "l"s controls the width + of the floating-point type, and the "f" is the marker for floating + point. + * New targets GNU/Linux/LoongArch loongarch*-*-linux* |