ld -plugin options when plugins are disabled
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 4fe8d9a8e9cc3b439113427b0694676dd0f76023..fa90bd1c051252636ade5d56bb658fca5db51705 100644 (file)
@@ -1038,6 +1038,12 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
     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)
@@ -1155,6 +1161,9 @@ get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound)
 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;
This page took 0.024319 seconds and 4 git commands to generate.