Treat Character as a discrete type in Ada
authorTom Tromey <tromey@adacore.com>
Mon, 26 Sep 2022 14:24:14 +0000 (08:24 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 28 Sep 2022 16:45:58 +0000 (10:45 -0600)
commit98847c1e38b717ceb7d186fe377be53171a9225f
tree3c95431404a12b25bc8f81f3eb44d1bf50129ca7
parentbe5f79aa3952accc5133875f523875c0fa397761
Treat Character as a discrete type in Ada

A user noticed that gdb would assert when printing a certain array
with array-indexes enabled.  This turned out to be caused by the array
having an index type of Character, which is completely valid in Ada.
This patch changes the Ada support to recognize Character as a
discrete type, and adds some tests.

Because this is Ada-specific and was also reviewed internally, I am
checking it in.
gdb/ada-lang.c
gdb/testsuite/gdb.ada/discrete-char.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/discrete-char/main.adb [new file with mode: 0644]