aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r--gdb/ada-exp.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index f36aaba..c8a7b9c 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1390,7 +1390,10 @@ convert_char_literal (struct type *type, LONGEST val)
if (TYPE_CODE (type) != TYPE_CODE_ENUM)
return val;
- xsnprintf (name, sizeof (name), "QU%02x", (int) val);
+ if ((val >= 'a' && val <= 'z') || (val >= '0' && val <= '9'))
+ xsnprintf (name, sizeof (name), "Q%c", (int) val);
+ else
+ xsnprintf (name, sizeof (name), "QU%02x", (int) val);
size_t len = strlen (name);
for (f = 0; f < TYPE_NFIELDS (type); f += 1)
{