gdb/fortran: Handle dynamic string types when printing types
[deliverable/binutils-gdb.git] / gdb / f-typeprint.c
index 80dbfe1116742aada78cd02d22d3e0dfcac45ca9..65ec93af9f419c03674bc6aa6e9bf4057934d656 100644 (file)
@@ -406,16 +406,20 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
       break;
 
     case TYPE_CODE_STRING:
-      /* Strings may have dynamic upperbounds (lengths) like arrays.  */
+      /* Strings may have dynamic upperbounds (lengths) like arrays.  We
+        check specifically for the PROP_CONST case to indicate that the
+        dynamic type has been resolved.  If we arrive here having been
+        asked to print the type of a value with a dynamic type then the
+        bounds will not have been resolved.  */
 
-      if (type->bounds ()->high.kind () == PROP_UNDEFINED)
-       fprintfi_filtered (level, stream, "character*(*)");
-      else
+      if (type->bounds ()->high.kind () == PROP_CONST)
        {
          LONGEST upper_bound = f77_get_upperbound (type);
 
          fprintf_filtered (stream, "character*%s", pulongest (upper_bound));
        }
+      else
+       fprintfi_filtered (level, stream, "character*(*)");
       break;
 
     case TYPE_CODE_STRUCT:
This page took 0.023597 seconds and 4 git commands to generate.