aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index f1d59d2..d44b090 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10187,7 +10187,7 @@ ada_resolvable::replace (operation_up &&owner,
return std::move (owner);
}
-/* Convert the character literal whose ASCII value would be VAL to the
+/* Convert the character literal whose value would be VAL to the
appropriate value of type TYPE, if there is a translation.
Otherwise return VAL. Hence, in an enumeration type ('A', 'B'),
the literal 'A' (VAL == 65), returns 0. */
@@ -10195,7 +10195,7 @@ ada_resolvable::replace (operation_up &&owner,
static LONGEST
convert_char_literal (struct type *type, LONGEST val)
{
- char name[7];
+ char name[12];
int f;
if (type == NULL)
@@ -10206,8 +10206,12 @@ convert_char_literal (struct type *type, LONGEST val)
if ((val >= 'a' && val <= 'z') || (val >= '0' && val <= '9'))
xsnprintf (name, sizeof (name), "Q%c", (int) val);
+ else if (val >= 0 && val < 256)
+ xsnprintf (name, sizeof (name), "QU%02x", (unsigned) val);
+ else if (val >= 0 && val < 0x10000)
+ xsnprintf (name, sizeof (name), "QW%04x", (unsigned) val);
else
- xsnprintf (name, sizeof (name), "QU%02x", (int) val);
+ xsnprintf (name, sizeof (name), "QWW%08lx", (unsigned long) val);
size_t len = strlen (name);
for (f = 0; f < type->num_fields (); f += 1)
{
@@ -13005,9 +13009,11 @@ public:
add (arch_integer_type (gdbarch, gdbarch_short_bit (gdbarch),
0, "short_integer"));
struct type *char_type = arch_character_type (gdbarch, TARGET_CHAR_BIT,
- 0, "character");
+ 1, "character");
lai->set_string_char_type (char_type);
add (char_type);
+ add (arch_character_type (gdbarch, 16, 1, "wide_character"));
+ add (arch_character_type (gdbarch, 32, 1, "wide_wide_character"));
add (arch_float_type (gdbarch, gdbarch_float_bit (gdbarch),
"float", gdbarch_float_format (gdbarch)));
add (arch_float_type (gdbarch, gdbarch_double_bit (gdbarch),