case TYPE_CODE_RANGE:
*lowp = TYPE_LOW_BOUND (type);
*highp = TYPE_HIGH_BOUND (type);
+ if (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ENUM)
+ {
+ if (!discrete_position (TYPE_TARGET_TYPE (type), *lowp, lowp)
+ || ! discrete_position (TYPE_TARGET_TYPE (type), *highp, highp))
+ return 0;
+ }
return 1;
case TYPE_CODE_ENUM:
if (type->num_fields () > 0)
int
discrete_position (struct type *type, LONGEST val, LONGEST *pos)
{
+ if (type->code () == TYPE_CODE_RANGE)
+ type = TYPE_TARGET_TYPE (type);
+
if (type->code () == TYPE_CODE_ENUM)
{
int i;