mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 17:40:49 +00:00
* ch-valprint.c (calculate_array_length): New function to determine
the length of an array type (see comment).
(chill_val_print (case TYPE_CODE_ARRAY)): If the length of an
array type is zero, call calculate_array_length.
* gdbtypes.c (get_discrete_bounds (case TYPE_CODE_ENUM)): They values
may not be sorted. Scan all entries and set the real lower and
This commit is contained in:
@@ -356,8 +356,18 @@ get_discrete_bounds (type, lowp, highp)
|
||||
case TYPE_CODE_ENUM:
|
||||
if (TYPE_NFIELDS (type) > 0)
|
||||
{
|
||||
*lowp = TYPE_FIELD_BITPOS (type, 0);
|
||||
*highp = TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1);
|
||||
/* The enums may not be sorted by value, so search all
|
||||
entries */
|
||||
int i;
|
||||
|
||||
*lowp = *highp = TYPE_FIELD_BITPOS (type, 0);
|
||||
for (i = 0; i < TYPE_NFIELDS (type); i++)
|
||||
{
|
||||
if (TYPE_FIELD_BITPOS (type, i) < *lowp)
|
||||
*lowp = TYPE_FIELD_BITPOS (type, i);
|
||||
if (TYPE_FIELD_BITPOS (type, i) > *highp)
|
||||
*highp = TYPE_FIELD_BITPOS (type, i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user