diff options
author | Tom Tromey <tromey@adacore.com> | 2022-01-26 07:11:18 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-02-28 10:49:29 -0700 |
commit | c9f66f0005000492739dd063ea2949045bf70bc6 (patch) | |
tree | 7298f37b0e63711abc336fa0695d80a67d5c9144 /gdb/ada-exp.y | |
parent | a7041de85a0cc43b86989eb697cef7a6cecdbdb7 (diff) | |
download | gdb-c9f66f0005000492739dd063ea2949045bf70bc6.zip gdb-c9f66f0005000492739dd063ea2949045bf70bc6.tar.gz gdb-c9f66f0005000492739dd063ea2949045bf70bc6.tar.bz2 |
Handle multi-byte bracket sequences in Ada lexer
As noted in an earlier patch, the Ada lexer does not handle multi-byte
bracket sequences. This patch adds support for these for character
literals. gdb does not generally seem to handle the Ada wide string
types, so for the time being these continue to be excluded -- but an
explicit error is added to make this more clear.
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r-- | gdb/ada-exp.y | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 916b8ef..d3fce8d 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -98,7 +98,7 @@ static struct type *type_long_long (struct parser_state *); static struct type *type_long_double (struct parser_state *); -static struct type *type_char (struct parser_state *); +static struct type *type_for_char (struct parser_state *, ULONGEST); static struct type *type_boolean (struct parser_state *); @@ -1727,10 +1727,18 @@ type_long_double (struct parser_state *par_state) } static struct type * -type_char (struct parser_state *par_state) +type_for_char (struct parser_state *par_state, ULONGEST value) { - return language_string_char_type (par_state->language (), - par_state->gdbarch ()); + if (value <= 0xff) + return language_string_char_type (par_state->language (), + par_state->gdbarch ()); + else if (value <= 0xffff) + return language_lookup_primitive_type (par_state->language (), + par_state->gdbarch (), + "wide_character"); + return language_lookup_primitive_type (par_state->language (), + par_state->gdbarch (), + "wide_wide_character"); } static struct type * |