]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix hex floating point lexing
authorTom Tromey <tom@tromey.com>
Thu, 11 Jun 2020 16:34:31 +0000 (10:34 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 11 Jun 2020 16:34:31 +0000 (10:34 -0600)
commit2b4e6a3f4b66284556254f548716c7b21b93524a
tree347344736ca24012aceb5c9c8bc4e0dd06e50dcd
parent4412332f4b3a4ec570c378ff98ec671dd83a2959
Fix hex floating point lexing

PR gdb/18318 notes that gdb will sometimes incorrectly handle hex
floating point input.  This turns out to be a bug in the C lexer; the
'p' was not being correctly recognized, and so the exponent was not
always passed to the floating point "from_string" method.

Tested by the buildbot "Fedora-x86_64-m64" builder.

gdb/ChangeLog
2020-06-11  Tom Tromey  <tom@tromey.com>

PR gdb/18318:
* c-exp.y (lex_one_token): Handle 'p' like 'e'.

gdb/testsuite/ChangeLog
2020-06-11  Tom Tromey  <tom@tromey.com>

PR gdb/18318:
* gdb.base/printcmds.exp (test_float_accepted): Add more hex
floating point tests.
gdb/ChangeLog
gdb/c-exp.y
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/printcmds.exp