7306e88
From f63782d25ebd593c4c4669d4c394a2706f15e660 Mon Sep 17 00:00:00 2001
7306e88
From: Bernhard Heckel <bernhard.heckel@intel.com>
7306e88
Date: Tue, 12 Jul 2016 08:19:34 +0200
7306e88
Subject: [PATCH 4/7] Fortran: Typeprint, fix dangling types.
7306e88
7306e88
Show the type of not-allocated and/or not-associated types
7306e88
as this is known.  For array types and pointer to array types
7306e88
we are going to print the number of ranks.
7306e88
7306e88
2016-06-30  Bernhard Heckel  <bernhard.heckel@intel.com>
7306e88
7306e88
gdb/ChangeLog:
7306e88
	* f-typeprint.c (f_print_type): Don't bypass dangling types.
7306e88
	  (f_type_print_varspec_suffix): Add print_rank parameter.
7306e88
	  (f_type_print_varspec_suffix): Print ranks of array types
7306e88
	  in case they dangling.
7306e88
	  (f_type_print_base): Add print_rank parameter.
7306e88
7306e88
gdb/Testsuite/ChangeLog:
7306e88
	* gdb.fortran/pointers.f90: New.
7306e88
	* gdb.fortran/print_type.exp: New.
7306e88
	* gdb.fortran/vla-ptype.exp: Adapt expected results.
7306e88
	* gdb.fortran/vla-type.exp: Likewise.
7306e88
	* gdb.fortran/vla-value.exp: Likewise.
7306e88
	* gdb.mi/mi-vla-fortran.exp: Likewise.
7306e88
7306e88
Change-Id: Ib55f28b4092cf88e34918449a2ebb6e5daafe512
7306e88
---
7306e88
 gdb/f-typeprint.c                        |  95 +++++++++++++++--------------
7306e88
 gdb/testsuite/gdb.fortran/pointers.f90   |  80 +++++++++++++++++++++++++
7306e88
 gdb/testsuite/gdb.fortran/print_type.exp | 100 +++++++++++++++++++++++++++++++
7306e88
 gdb/testsuite/gdb.fortran/vla-ptype.exp  |  12 ++--
7306e88
 gdb/testsuite/gdb.fortran/vla-type.exp   |   7 ++-
7306e88
 gdb/testsuite/gdb.fortran/vla-value.exp  |   4 +-
7306e88
 gdb/testsuite/gdb.mi/mi-vla-fortran.exp  |   9 +--
7306e88
 7 files changed, 248 insertions(+), 59 deletions(-)
7306e88
 create mode 100644 gdb/testsuite/gdb.fortran/pointers.f90
7306e88
 create mode 100755 gdb/testsuite/gdb.fortran/print_type.exp
7306e88
7306e88
Index: gdb-7.11.50.20160630/gdb/f-typeprint.c
7306e88
===================================================================
7306e88
--- gdb-7.11.50.20160630.orig/gdb/f-typeprint.c	2016-07-16 10:54:48.749099150 +0200
7306e88
+++ gdb-7.11.50.20160630/gdb/f-typeprint.c	2016-07-16 10:55:59.763667355 +0200
7306e88
@@ -37,7 +37,7 @@
7306e88
 #endif
7306e88
 
7306e88
 static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int,
7306e88
-					 int, int, int);
7306e88
+					 int, int, int, int);
7306e88
 
7306e88
 void f_type_print_varspec_prefix (struct type *, struct ui_file *,
7306e88
 				  int, int);
7306e88
@@ -54,18 +54,6 @@
7306e88
   enum type_code code;
7306e88
   int demangled_args;
7306e88
 
7306e88
-  if (type_not_associated (type))
7306e88
-    {
7306e88
-      val_print_not_associated (stream);
7306e88
-      return;
7306e88
-    }
7306e88
-
7306e88
-  if (type_not_allocated (type))
7306e88
-    {
7306e88
-      val_print_not_allocated (stream);
7306e88
-      return;
7306e88
-    }
7306e88
-
7306e88
   f_type_print_base (type, stream, show, level);
7306e88
   code = TYPE_CODE (type);
7306e88
   if ((varstring != NULL && *varstring != '\0')
7306e88
@@ -87,7 +75,7 @@
7306e88
          so don't print an additional pair of ()'s.  */
7306e88
 
7306e88
       demangled_args = varstring[strlen (varstring) - 1] == ')'; 
7306e88
-      f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0);
7306e88
+      f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0, 0);
7306e88
    }
7306e88
 }
7306e88
 
7306e88
@@ -157,7 +145,7 @@
7306e88
 static void
7306e88
 f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
7306e88
 			     int show, int passed_a_ptr, int demangled_args,
7306e88
-			     int arrayprint_recurse_level)
7306e88
+			     int arrayprint_recurse_level, int print_rank_only)
7306e88
 {
7306e88
   int upper_bound, lower_bound;
7306e88
 
7306e88
@@ -181,34 +169,50 @@
7306e88
 	fprintf_filtered (stream, "(");
7306e88
 
7306e88
       if (type_not_associated (type))
7306e88
-        val_print_not_associated (stream);
7306e88
+	print_rank_only = 1;
7306e88
       else if (type_not_allocated (type))
7306e88
-        val_print_not_allocated (stream);
7306e88
+	print_rank_only = 1;
7306e88
+      else if ((TYPE_ASSOCIATED_PROP (type)
7306e88
+		&& PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
7306e88
+	      || (TYPE_ALLOCATED_PROP (type)
7306e88
+		&& PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
7306e88
+	      || (TYPE_DATA_LOCATION (type)
7306e88
+		  && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
7306e88
+	/* This case exist when we ptype a typename which has the
7306e88
+	   dynamic properties but cannot be resolved as there is
7306e88
+	   no object.  */
7306e88
+	print_rank_only = 1;
7306e88
+
7306e88
+      if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
7306e88
+	f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
7306e88
+				     0, 0, arrayprint_recurse_level,
7306e88
+				     print_rank_only);
7306e88
+
7306e88
+      if (print_rank_only == 1)
7306e88
+	fprintf_filtered (stream, ":");
7306e88
       else
7306e88
-        {
7306e88
-          if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
7306e88
-            f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
7306e88
-                                        0, 0, arrayprint_recurse_level);
7306e88
-
7306e88
-          lower_bound = f77_get_lowerbound (type);
7306e88
-          if (lower_bound != 1)	/* Not the default.  */
7306e88
-            fprintf_filtered (stream, "%d:", lower_bound);
7306e88
-
7306e88
-          /* Make sure that, if we have an assumed size array, we
7306e88
-             print out a warning and print the upperbound as '*'.  */
7306e88
-
7306e88
-          if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
7306e88
-            fprintf_filtered (stream, "*");
7306e88
-          else
7306e88
-            {
7306e88
-              upper_bound = f77_get_upperbound (type);
7306e88
-              fprintf_filtered (stream, "%d", upper_bound);
7306e88
-            }
7306e88
-
7306e88
-          if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
7306e88
-            f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
7306e88
-                                        0, 0, arrayprint_recurse_level);
7306e88
-        }
7306e88
+	{
7306e88
+	  lower_bound = f77_get_lowerbound (type);
7306e88
+	  if (lower_bound != 1)	/* Not the default.  */
7306e88
+	    fprintf_filtered (stream, "%d:", lower_bound);
7306e88
+
7306e88
+	  /* Make sure that, if we have an assumed size array, we
7306e88
+	     print out a warning and print the upperbound as '*'.  */
7306e88
+
7306e88
+	  if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
7306e88
+	    fprintf_filtered (stream, "*");
7306e88
+	  else
7306e88
+	    {
7306e88
+	      upper_bound = f77_get_upperbound (type);
7306e88
+	      fprintf_filtered (stream, "%d", upper_bound);
7306e88
+	    }
7306e88
+	}
7306e88
+
7306e88
+      if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
7306e88
+	f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
7306e88
+				     0, 0, arrayprint_recurse_level,
7306e88
+				     print_rank_only);
7306e88
+
7306e88
       if (arrayprint_recurse_level == 1)
7306e88
 	fprintf_filtered (stream, ")");
7306e88
       else
7306e88
@@ -219,13 +223,14 @@
7306e88
     case TYPE_CODE_PTR:
7306e88
     case TYPE_CODE_REF:
7306e88
       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
7306e88
-				   arrayprint_recurse_level);
7306e88
+				   arrayprint_recurse_level, 0);
7306e88
       fprintf_filtered (stream, ")");
7306e88
       break;
7306e88
 
7306e88
     case TYPE_CODE_FUNC:
7306e88
       f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
7306e88
-				   passed_a_ptr, 0, arrayprint_recurse_level);
7306e88
+				   passed_a_ptr, 0, arrayprint_recurse_level,
7306e88
+				   0);
7306e88
       if (passed_a_ptr)
7306e88
 	fprintf_filtered (stream, ")");
7306e88
 
7306e88
@@ -376,7 +381,7 @@
7306e88
 	      fputs_filtered (" :: ", stream);
7306e88
 	      fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
7306e88
 	      f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
7306e88
-					   stream, show - 1, 0, 0, 0);
7306e88
+					   stream, show - 1, 0, 0, 0, 0);
7306e88
 	      fputs_filtered ("\n", stream);
7306e88
 	    }
7306e88
 	  fprintfi_filtered (level, stream, "End Type ");
7306e88
Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/pointers.f90
7306e88
===================================================================
7306e88
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
7306e88
+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/pointers.f90	2016-07-16 10:55:42.079525860 +0200
7306e88
@@ -0,0 +1,80 @@
7306e88
+! Copyright 2016 Free Software Foundation, Inc.
7306e88
+!
7306e88
+! This program is free software; you can redistribute it and/or modify
7306e88
+! it under the terms of the GNU General Public License as published by
7306e88
+! the Free Software Foundation; either version 3 of the License, or
7306e88
+! (at your option) any later version.
7306e88
+!
7306e88
+! This program is distributed in the hope that it will be useful,
7306e88
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
7306e88
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7306e88
+! GNU General Public License for more details.
7306e88
+!
7306e88
+! You should have received a copy of the GNU General Public License
7306e88
+! along with this program.  If not, see <http://www.gnu.org/licenses/>.
7306e88
+
7306e88
+program pointers
7306e88
+
7306e88
+  type :: two
7306e88
+    integer, allocatable :: ivla1 (:)
7306e88
+    integer, allocatable :: ivla2 (:, :)
7306e88
+  end type two
7306e88
+
7306e88
+  logical, target :: logv
7306e88
+  complex, target :: comv
7306e88
+  character, target :: charv
7306e88
+  character (len=3), target :: chara
7306e88
+  integer, target :: intv
7306e88
+  integer, target, dimension (10,2) :: inta
7306e88
+  real, target    :: realv
7306e88
+  type(two), target  :: twov
7306e88
+
7306e88
+  logical, pointer :: logp
7306e88
+  complex, pointer :: comp
7306e88
+  character, pointer:: charp
7306e88
+  character (len=3), pointer:: charap
7306e88
+  integer, pointer :: intp
7306e88
+  integer, pointer, dimension (:,:) :: intap
7306e88
+  real, pointer :: realp
7306e88
+  type(two), pointer :: twop
7306e88
+
7306e88
+  nullify (logp)
7306e88
+  nullify (comp)
7306e88
+  nullify (charp)
7306e88
+  nullify (charap)
7306e88
+  nullify (intp)
7306e88
+  nullify (intap)
7306e88
+  nullify (realp)
7306e88
+  nullify (twop)
7306e88
+
7306e88
+  logp => logv    ! Before pointer assignment
7306e88
+  comp => comv
7306e88
+  charp => charv
7306e88
+  charap => chara
7306e88
+  intp => intv
7306e88
+  intap => inta
7306e88
+  realp => realv
7306e88
+  twop => twov
7306e88
+
7306e88
+  logv = associated(logp)     ! Before value assignment
7306e88
+  comv = cmplx(1,2)
7306e88
+  charv = "a"
7306e88
+  chara = "abc"
7306e88
+  intv = 10
7306e88
+  inta(:,:) = 1
7306e88
+  inta(3,1) = 3
7306e88
+  realv = 3.14
7306e88
+
7306e88
+  allocate (twov%ivla1(3))
7306e88
+  allocate (twov%ivla2(2,2))
7306e88
+  twov%ivla1(1) = 11
7306e88
+  twov%ivla1(2) = 12
7306e88
+  twov%ivla1(3) = 13
7306e88
+  twov%ivla2(1,1) = 211
7306e88
+  twov%ivla2(2,1) = 221
7306e88
+  twov%ivla2(1,2) = 212
7306e88
+  twov%ivla2(2,2) = 222
7306e88
+
7306e88
+  intv = intv + 1 ! After value assignment
7306e88
+
7306e88
+end program pointers
7306e88
Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/print_type.exp
7306e88
===================================================================
7306e88
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
7306e88
+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/print_type.exp	2016-07-16 10:55:42.079525860 +0200
7306e88
@@ -0,0 +1,100 @@
7306e88
+# Copyright 2016 Free Software Foundation, Inc.
7306e88
+
7306e88
+# This program is free software; you can redistribute it and/or modify
7306e88
+# it under the terms of the GNU General Public License as published by
7306e88
+# the Free Software Foundation; either version 3 of the License, or
7306e88
+# (at your option) any later version.
7306e88
+#
7306e88
+# This program is distributed in the hope that it will be useful,
7306e88
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
7306e88
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7306e88
+# GNU General Public License for more details.
7306e88
+#
7306e88
+# You should have received a copy of the GNU General Public License
7306e88
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
7306e88
+
7306e88
+standard_testfile "pointers.f90"
7306e88
+load_lib fortran.exp
7306e88
+
7306e88
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
7306e88
+    {debug f90 quiet}] } {
7306e88
+    return -1
7306e88
+}
7306e88
+
7306e88
+
7306e88
+if ![runto_main] {
7306e88
+    untested "could not run to main"
7306e88
+    return -1
7306e88
+}
7306e88
+
7306e88
+# Depending on the compiler being used, the type names can be printed differently.
7306e88
+set logical [fortran_logical4]
7306e88
+set real [fortran_real4]
7306e88
+set int [fortran_int4]
7306e88
+set complex [fortran_complex4]
7306e88
+
7306e88
+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
7306e88
+gdb_continue_to_breakpoint "Before pointer assignment"
7306e88
+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)" "ptype logp, not associated"
7306e88
+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)" "ptype comp, not associated"
7306e88
+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)" "ptype charp, not associated"
7306e88
+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)" "ptype charap, not associated"
7306e88
+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)" "ptype intp, not associated"
7306e88
+set test "ptype intap, not associated"
7306e88
+gdb_test_multiple "ptype intap" $test {
7306e88
+    -re "type = PTR TO -> \\( $int \\(:,:\\)\\)\r\n$gdb_prompt $" {
7306e88
+        pass $test
7306e88
+    }
7306e88
+    -re "type = $int \\(:,:\\)\r\n$gdb_prompt $" {
7306e88
+        pass $test
7306e88
+    }
7306e88
+}
7306e88
+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" "ptype realp, not associated"
7306e88
+gdb_test "ptype twop" \
7306e88
+    [multi_line "type = PTR TO -> \\( Type two" \
7306e88
+                "    $int :: ivla1\\(:\\)" \
7306e88
+                "    $int :: ivla2\\(:,:\\)" \
7306e88
+                "End Type two \\)"] \
7306e88
+    "ptype twop, not associated"
7306e88
+gdb_test "ptype two" \
7306e88
+    [multi_line "type = Type two" \
7306e88
+                "    $int :: ivla1\\(:\\)" \
7306e88
+                "    $int :: ivla2\\(:,:\\)" \
7306e88
+                "End Type two"]
7306e88
+
7306e88
+
7306e88
+gdb_breakpoint [gdb_get_line_number "Before value assignment"]
7306e88
+gdb_continue_to_breakpoint "Before value assignment"
7306e88
+gdb_test "ptype twop" \
7306e88
+    [multi_line "type = PTR TO -> \\( Type two" \
7306e88
+                "    $int :: ivla1\\(:\\)" \
7306e88
+                "    $int :: ivla2\\(:,:\\)" \
7306e88
+                "End Type two \\)"]
7306e88
+
7306e88
+
7306e88
+gdb_breakpoint [gdb_get_line_number "After value assignment"]
7306e88
+gdb_continue_to_breakpoint "After value assignment"
7306e88
+gdb_test "ptype logv" "type = $logical"
7306e88
+gdb_test "ptype comv" "type = $complex"
7306e88
+gdb_test "ptype charv" "type = character\\*1"
7306e88
+gdb_test "ptype chara" "type = character\\*3"
7306e88
+gdb_test "ptype intv" "type = $int"
7306e88
+gdb_test "ptype inta" "type = $int \\(10,2\\)"
7306e88
+gdb_test "ptype realv" "type = $real"
7306e88
+
7306e88
+
7306e88
+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)"
7306e88
+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)"
7306e88
+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)"
7306e88
+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)"
7306e88
+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)"
7306e88
+set test "ptype intap"
7306e88
+gdb_test_multiple $test $test {
7306e88
+    -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {
7306e88
+        pass $test
7306e88
+    }
7306e88
+    -re "type = PTR TO -> \\( $int \\(10,2\\)\\)\r\n$gdb_prompt $" {
7306e88
+        pass $test
7306e88
+    }
7306e88
+}
7306e88
+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"
7306e88
Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/vla-ptype.exp
7306e88
===================================================================
7306e88
--- gdb-7.11.50.20160630.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp	2016-07-16 10:54:48.749099150 +0200
7306e88
+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/vla-ptype.exp	2016-07-16 10:55:42.079525860 +0200
7306e88
@@ -32,9 +32,9 @@
7306e88
 # Check the ptype of various VLA states and pointer to VLA's.
7306e88
 gdb_breakpoint [gdb_get_line_number "vla1-init"]
7306e88
 gdb_continue_to_breakpoint "vla1-init"
7306e88
-gdb_test "ptype vla1" "type = <not allocated>" "ptype vla1 not initialized"
7306e88
-gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not initialized"
7306e88
-gdb_test "ptype pvla" "type = <not associated>" "ptype pvla not initialized"
7306e88
+gdb_test "ptype vla1" "type = $real \\(:,:,:\\)" "ptype vla1 not initialized"
7306e88
+gdb_test "ptype vla2" "type = $real \\(:,:,:\\)" "ptype vla2 not initialized"
7306e88
+gdb_test "ptype pvla" "type = $real \\(:,:,:\\)" "ptype pvla not initialized"
7306e88
 gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \
7306e88
   "ptype vla1(3, 6, 9) not initialized"
7306e88
 gdb_test "ptype vla2(5, 45, 20)" \
7306e88
@@ -81,20 +81,20 @@
7306e88
 
7306e88
 gdb_breakpoint [gdb_get_line_number "pvla-deassociated"]
7306e88
 gdb_continue_to_breakpoint "pvla-deassociated"
7306e88
-gdb_test "ptype pvla" "type = <not associated>" "ptype pvla deassociated"
7306e88
+gdb_test "ptype pvla" "type = $real \\(:,:,:\\)" "ptype pvla deassociated"
7306e88
 gdb_test "ptype pvla(5, 45, 20)" \
7306e88
   "no such vector element \\\(vector not associated\\\)" \
7306e88
   "ptype pvla(5, 45, 20) not associated"
7306e88
 
7306e88
 gdb_breakpoint [gdb_get_line_number "vla1-deallocated"]
7306e88
 gdb_continue_to_breakpoint "vla1-deallocated"
7306e88
-gdb_test "ptype vla1" "type = <not allocated>" "ptype vla1 not allocated"
7306e88
+gdb_test "ptype vla1" "type = $real \\(:,:,:\\)" "ptype vla1 not allocated"
7306e88
 gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \
7306e88
   "ptype vla1(3, 6, 9) not allocated"
7306e88
 
7306e88
 gdb_breakpoint [gdb_get_line_number "vla2-deallocated"]
7306e88
 gdb_continue_to_breakpoint "vla2-deallocated"
7306e88
-gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not allocated"
7306e88
+gdb_test "ptype vla2" "type = $real \\(:,:,:\\)" "ptype vla2 not allocated"
7306e88
 gdb_test "ptype vla2(5, 45, 20)" \
7306e88
   "no such vector element \\\(vector not allocated\\\)" \
7306e88
   "ptype vla2(5, 45, 20) not allocated"
7306e88
Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/vla-type.exp
7306e88
===================================================================
7306e88
--- gdb-7.11.50.20160630.orig/gdb/testsuite/gdb.fortran/vla-type.exp	2016-07-16 10:54:48.749099150 +0200
7306e88
+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/vla-type.exp	2016-07-16 10:55:42.080525868 +0200
7306e88
@@ -132,7 +132,10 @@
7306e88
                      "End Type one" ]
7306e88
 
7306e88
 # Check allocation status of dynamic array and it's dynamic members
7306e88
-gdb_test "ptype fivedynarr" "type = <not allocated>"
7306e88
+gdb_test "ptype fivedynarr" \
7306e88
+         [multi_line "type = Type five" \
7306e88
+                     "    Type one :: tone" \
7306e88
+                     "End Type five \\(:\\)" ]
7306e88
 gdb_test "next" ""
7306e88
 gdb_test "ptype fivedynarr(2)" \
7306e88
          [multi_line "type = Type five" \
7306e88
@@ -141,7 +144,7 @@
7306e88
          "ptype fivedynarr(2), tone is not allocated"
7306e88
 gdb_test "ptype fivedynarr(2)%tone" \
7306e88
          [multi_line "type = Type one" \
7306e88
-                     "    $int :: ivla\\(<not allocated>\\)" \
7306e88
+                     "    $int :: ivla\\(:,:,:\\)" \
7306e88
                      "End Type one" ] \
7306e88
          "ptype fivedynarr(2)%tone, not allocated"
7306e88
 
7306e88
Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/vla-value.exp
7306e88
===================================================================
7306e88
--- gdb-7.11.50.20160630.orig/gdb/testsuite/gdb.fortran/vla-value.exp	2016-07-16 10:54:48.749099150 +0200
7306e88
+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.fortran/vla-value.exp	2016-07-16 10:55:42.080525868 +0200
7306e88
@@ -34,7 +34,7 @@
7306e88
 gdb_continue_to_breakpoint "vla1-init"
7306e88
 gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"
7306e88
 gdb_test "print &vla1" \
7306e88
-  " = \\\(PTR TO -> \\\( $real \\\(<not allocated>\\\)\\\)\\\) $hex" \
7306e88
+  " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
7306e88
   "print non-allocated &vla1"
7306e88
 gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \
7306e88
   "print member in non-allocated vla1 (1)"
7306e88
@@ -75,7 +75,7 @@
7306e88
 # Try to access values in undefined pointer to VLA (dangling)
7306e88
 gdb_test "print pvla" " = <not associated>" "print undefined pvla"
7306e88
 gdb_test "print &pvla" \
7306e88
-  " = \\\(PTR TO -> \\\( $real \\\(<not associated>\\\)\\\)\\\) $hex" \
7306e88
+  " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
7306e88
   "print non-associated &pvla"
7306e88
 gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
7306e88
   "print undefined pvla(1,3,8)"
7306e88
Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
7306e88
===================================================================
7306e88
--- gdb-7.11.50.20160630.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp	2016-07-16 10:54:48.749099150 +0200
7306e88
+++ gdb-7.11.50.20160630/gdb/testsuite/gdb.mi/mi-vla-fortran.exp	2016-07-16 10:55:42.080525868 +0200
7306e88
@@ -17,6 +17,7 @@
7306e88
 # Array (VLA).
7306e88
 
7306e88
 load_lib mi-support.exp
7306e88
+load_lib fortran.exp
7306e88
 set MIFLAGS "-i=mi"
7306e88
 load_lib "fortran.exp"
7306e88
 
7306e88
@@ -50,10 +51,10 @@
7306e88
 mi_gdb_test "500-data-evaluate-expression vla1" \
7306e88
   "500\\^done,value=\"<not allocated>\"" "evaluate not allocated vla"
7306e88
 
7306e88
-mi_create_varobj_checked vla1_not_allocated vla1 "<not allocated>" \
7306e88
+mi_create_varobj_checked vla1_not_allocated vla1 "$real \\(:\\)" \
7306e88
   "create local variable vla1_not_allocated"
7306e88
 mi_gdb_test "501-var-info-type vla1_not_allocated" \
7306e88
-  "501\\^done,type=\"<not allocated>\"" \
7306e88
+  "501\\^done,type=\"$real \\(:\\)\"" \
7306e88
   "info type variable vla1_not_allocated"
7306e88
 mi_gdb_test "502-var-show-format vla1_not_allocated" \
7306e88
   "502\\^done,format=\"natural\"" \
7306e88
@@ -140,10 +141,10 @@
7306e88
     -re "580\\^done,value=\"<not associated>\".*${mi_gdb_prompt}$" {
7306e88
 	pass $test
7306e88
 
7306e88
-	mi_create_varobj_checked pvla2_not_associated pvla2 "<not associated>" \
7306e88
+	mi_create_varobj_checked pvla2_not_associated pvla2 "$real \\(:,:\\)" \
7306e88
 	    "create local variable pvla2_not_associated"
7306e88
 	mi_gdb_test "581-var-info-type pvla2_not_associated" \
7306e88
-	    "581\\^done,type=\"<not associated>\"" \
7306e88
+	    "581\\^done,type=\"$real \\(:,:\\)\"" \
7306e88
 	    "info type variable pvla2_not_associated"
7306e88
 	mi_gdb_test "582-var-show-format pvla2_not_associated" \
7306e88
 	    "582\\^done,format=\"natural\"" \