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 /binutils/dwarf.c | |
parent | c9bfa277e9e6467dad91641357e09bf0a7ac0dc2 (diff) | |
download | gdb-63fc2437deda87a566059444630ccc402945ae99.zip gdb-63fc2437deda87a566059444630ccc402945ae99.tar.gz gdb-63fc2437deda87a566059444630ccc402945ae99.tar.bz2 |
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 'binutils/dwarf.c')
0 files changed, 0 insertions, 0 deletions