OSDN Git Service

handle character-based enumeration typedefs
authorbrobecke <brobecke>
Fri, 1 Jul 2011 18:25:15 +0000 (18:25 +0000)
committerbrobecke <brobecke>
Fri, 1 Jul 2011 18:25:15 +0000 (18:25 +0000)
commitc0cdc94761dac36caafa3ef69a48d6cf8d257600
treedc893cbef27e5ccd61175d2ac43fc39b4f93f56a
parentf4221ea0189f6fdc7367aec58c9692f1f9fa832d
handle character-based enumeration typedefs

Consider the following type:

   type Char_Enum_Type is ('A', 'B', 'C', 'D');

If the compiler generates a Char_Enum_Type typedef in the debugging
information, the debugger fails in the following case:

   (gdb) p Char_Enum_Type'('B')
   $1 = 66

For our type, the underlying value of 'B' is actually 1, not 66
(ASCII 'B').  We are failing this case because we were not handling
typedef to enum types before.  This patch fixes this.

gdb/ChangeLog:

        * ada-exp.y (convert_char_literal): Handle typedef types.

gdb/testsuite/ChangeLog:

        * gdb.ada/char_enum: New testcase.
gdb/ChangeLog
gdb/ada-exp.y
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/char_enum.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/char_enum/foo.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/char_enum/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/char_enum/pck.ads [new file with mode: 0644]