mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
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.
This commit is contained in:
@ -4149,7 +4149,9 @@ scalar_type_p (struct type *type)
|
||||
}
|
||||
}
|
||||
|
||||
/* True iff TYPE is discrete (INT, RANGE, ENUM). */
|
||||
/* True iff TYPE is discrete, as defined in the Ada Reference Manual.
|
||||
This essentially means one of (INT, RANGE, ENUM) -- but note that
|
||||
"enum" includes character and boolean as well. */
|
||||
|
||||
static int
|
||||
discrete_type_p (struct type *type)
|
||||
@ -4164,6 +4166,7 @@ discrete_type_p (struct type *type)
|
||||
case TYPE_CODE_RANGE:
|
||||
case TYPE_CODE_ENUM:
|
||||
case TYPE_CODE_BOOL:
|
||||
case TYPE_CODE_CHAR:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user