Fix bug with character enumeration literal
authorTom Tromey <tromey@adacore.com>
Thu, 1 Aug 2019 17:41:32 +0000 (11:41 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 15 Aug 2019 19:42:31 +0000 (13:42 -0600)
commit272560b577894c388a3d0d3fda8294683714f582
tree3d1482fc1b7b8d3585b59a06bd5120c198c13cde
parent08235187bcdd66599884f33b046cf8abcf949727
Fix bug with character enumeration literal

gnat encodes character enumeration literals using a few different
schemes.  The gnat compiler documented the "QU" and "QW" encodings,
but failed to document that a simpler encoding was used for certain
characters.

This patch updates gdb to handle this simple Q encoding.  Note that
wide character literals are still not handled.

gdb/ChangeLog
2019-08-15  Tom Tromey  <tromey@adacore.com>

* ada-exp.y (convert_char_literal): Handle "Q%c" encoding.
* ada-lang.c (ada_enum_name): Likewise.

gdb/testsuite/ChangeLog
2019-08-15  Tom Tromey  <tromey@adacore.com>

* gdb.ada/char_enum.exp: Add regression tests.
* gdb.ada/char_enum/foo.adb (Char_Enum_Type): Use '_'
and '0'.
(Char, Gchar): Update.
* gdb.ada/char_enum/pck.ads (Global_Enum_Type): Use '+'.
gdb/ChangeLog
gdb/ada-exp.y
gdb/ada-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/char_enum.exp
gdb/testsuite/gdb.ada/char_enum/foo.adb
gdb/testsuite/gdb.ada/char_enum/pck.ads