public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH V2 0/7] Fortran, typeprint
@ 2016-05-13  9:34 Bernhard Heckel
  2016-05-13  9:35 ` [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure Bernhard Heckel
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:34 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

This series fixes various issues in fortran's typeprint.
Tested on Ubuntu1504, Fedora23, Fedora21

Addressed in V2: 
* Split Patch V1 1/4
* Patch V2 3/7 Move "show -1" to next patch.
* Patch V2 3/7 Print only the elements of the outermost structure.
* Patch V2 5/7 New.
* Patch V2 6/7 New.


Bernhard Heckel (7):
  Fortran, testsuite: Use multi_line in whatis_type testcase.
  Fortran, typeprint: Fix wrong indentation when ptype nested
    structures.
  Fortran, typeprint: Take level of details into account when printing
    elements of a structure.
  Fortran, typeprint: Decrease level of details when printing elements
    of a structure.
  Fortran, testsuite: Add testcases for nested structures.
  Fortran, testsuite: Fix duplicate testcase name.
  Fortran, typeprint: Forward level of details to be printed for
    pointers.

 gdb/f-typeprint.c                          | 33 +++++++++++--------
 gdb/testsuite/gdb.fortran/derived-type.exp |  4 +--
 gdb/testsuite/gdb.fortran/type.f90         | 27 +++++++++++++++-
 gdb/testsuite/gdb.fortran/vla-type.exp     | 52 +++++++++++++++++++-----------
 gdb/testsuite/gdb.fortran/whatis_type.exp  | 41 ++++++++++++++++++-----
 5 files changed, 113 insertions(+), 44 deletions(-)

-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 15:58   ` Yao Qi
  2016-05-13  9:35 ` [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name Bernhard Heckel
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

According to the typeprint's description, elements of a structure
should not be printed when show is < 1.
This variable is also used to distinguish the level of details
between "ptype" and "whatis" expressions.

Before:
(gdb) whatis t1v
type = Type t1
    integer(kind=4) :: t1_i
    real(kind=4) :: t1_r
End Type t1

After:
(gdb) whatis t1v
type = Type t1

2016-05-09  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/Changelog:
	* f-typeprint.c (f_type_print_base): Don't print structure fields when show < 0.

gdb/testsuite/Changelog:
	* gdb.fortran/whatis_type.exp: Adapt expected output.

---
 gdb/f-typeprint.c                         | 27 ++++++++++++++++-----------
 gdb/testsuite/gdb.fortran/whatis_type.exp | 14 ++------------
 2 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 1990e1b..f38a3a0 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -364,19 +364,24 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
       else
 	fprintfi_filtered (level, stream, "Type ");
       fputs_filtered (TYPE_TAG_NAME (type), stream);
-      fputs_filtered ("\n", stream);
-      for (index = 0; index < TYPE_NFIELDS (type); index++)
+      /* According to the definition,
+         we only print structure elements in case show > 0.  */
+      if (show > 0)
 	{
-	  f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show,
-			     level + 4);
-	  fputs_filtered (" :: ", stream);
-	  fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
-	  f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
-				       stream, 0, 0, 0, 0);
 	  fputs_filtered ("\n", stream);
-	} 
-      fprintfi_filtered (level, stream, "End Type ");
-      fputs_filtered (TYPE_TAG_NAME (type), stream);
+	  for (index = 0; index < TYPE_NFIELDS (type); index++)
+	    {
+	      f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show,
+				 level + 4);
+	      fputs_filtered (" :: ", stream);
+	      fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
+	      f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
+					   stream, 0, 0, 0, 0);
+	      fputs_filtered ("\n", stream);
+	    }
+	  fprintfi_filtered (level, stream, "End Type ");
+	  fputs_filtered (TYPE_TAG_NAME (type), stream);
+	}
       break;
 
     case TYPE_CODE_MODULE:
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
index 7265923..0b7a1b7 100644
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -38,18 +38,8 @@ gdb_continue_to_breakpoint "bp1"
 set t1_i "$int :: t1_i"
 set t1_r "$real :: t1_r"
 
-gdb_test "whatis t1" \
-  [multi_line "type = Type t1" \
-	          "    $t1_i" \
-	          "    $t1_r" \
-	          "End Type t1"] \
-  "whatis t1"
-gdb_test "whatis t1v" \
-  [multi_line "type = Type t1" \
-	          "    $t1_i" \
-	          "    $t1_r" \
-	          "End Type t1"] \
-  "whatis t1v"
+gdb_test "whatis t1" "type = Type t1"
+gdb_test "whatis t1v" "type = Type t1"
 
 gdb_test "ptype t1" \
   [multi_line "type = Type t1" \
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 7/7] Fortran, typeprint: Forward level of details to be printed for pointers.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
                   ` (3 preceding siblings ...)
  2016-05-13  9:35 ` [PATCH V2 4/7] Fortran, typeprint: Decrease level of details when printing elements of a structure Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 15:57   ` Yao Qi
  2016-05-13  9:35 ` [PATCH V2 1/7] Fortran, testsuite: Use multi_line in whatis_type testcase Bernhard Heckel
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

Variable "show" was hardcoded to zero for pointer and reference types.
This implementation didn't allow a correct "whatis" print
for those types and results in same output for "ptype" and "whatis".

Before:
(gdb) whatis t3p
type = PTR TO -> ( Type t3
    integer(kind=4) :: t3_i
    Type t2 :: t2_n
End Type t3 )

After:
(gdb) whatis t3p
type = PTR TO -> ( Type t3 )

2016-05-09  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/Changelog:
	* f-typeprint.c (f_type_print_base): Replace 0 by show.

gdb/testsuite/Changelog:
	* gdb.fortran/type.f90: Add pointer variable.
	* gdb.fortran/whatis_type.exp: Add whatis/ptype of pointers.

---
 gdb/f-typeprint.c                         |  4 ++--
 gdb/testsuite/gdb.fortran/type.f90        | 10 ++++++++--
 gdb/testsuite/gdb.fortran/whatis_type.exp |  7 +++++++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 350def0..920c21f 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -308,12 +308,12 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
 
     case TYPE_CODE_PTR:
       fprintf_filtered (stream, "PTR TO -> ( ");
-      f_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
+      f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
       break;
 
     case TYPE_CODE_REF:
       fprintf_filtered (stream, "REF TO -> ( ");
-      f_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
+      f_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
       break;
 
     case TYPE_CODE_VOID:
diff --git a/gdb/testsuite/gdb.fortran/type.f90 b/gdb/testsuite/gdb.fortran/type.f90
index 00dc650..ad3d6ee 100644
--- a/gdb/testsuite/gdb.fortran/type.f90
+++ b/gdb/testsuite/gdb.fortran/type.f90
@@ -33,7 +33,10 @@ program type
 
   type (t1) :: t1v
   type (t2) :: t2v
-  type (t3) :: t3v
+  type (t3), target :: t3v
+  type(t3), pointer :: t3p
+
+  nullify (t3p)
 
   t1v%t1_i = 42
   t1v%t1_r = 42.24
@@ -42,6 +45,9 @@ program type
   t2v%t1_n%t1_i = 21
   t3v%t3_i = 3
   t3v%t2_n%t2_i = 32
-  t3v%t2_n%t1_n%t1_i = 321    ! bp1
+  t3v%t2_n%t1_n%t1_i = 321
+
+  t3p => t3v
+  nullify (t3p)    ! bp1
 
 end program type
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
index 955f853..6ebcb52 100644
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -44,6 +44,7 @@ gdb_test "whatis t2" "type = Type t2"
 gdb_test "whatis t2v" "type = Type t2"
 gdb_test "whatis t3" "type = Type t3"
 gdb_test "whatis t3v" "type = Type t3"
+gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)"
 
 gdb_test "ptype t1" \
   [multi_line "type = Type t1" \
@@ -69,3 +70,9 @@ gdb_test "ptype t3v" \
               "    $int :: t3_i" \
               "    Type t2 :: t2_n" \
               "End Type t3"]
+
+gdb_test "ptype t3p" \
+  [multi_line "type = PTR TO -> \\( Type t3" \
+              "    $int :: t3_i" \
+              "    Type t2 :: t2_n" \
+              "End Type t3 \\)"]
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
                   ` (5 preceding siblings ...)
  2016-05-13  9:35 ` [PATCH V2 1/7] Fortran, testsuite: Use multi_line in whatis_type testcase Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 14:05   ` Yao Qi
  2016-05-25  7:13 ` [PUSHED][PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

Level of indentation was not proper handled when printing
the elements type's name.

Before:
type = Type t1
integer(kind=4) :: var_1
integer(kind=4) :: var_2
End Type t1

After:
type = Type t1
    integer(kind=4) :: var_1
    integer(kind=4) :: var_2
End Type t1

2016-03-18  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/Changelog:
	* f-typeprint.c (f_type_print_base): Take print level into account.

gdb/testsuite/Changelog:
	* print_type.exp: Fix expected output.
        * whatis_type.exp: Fix expected output.

---
 gdb/f-typeprint.c                         | 2 +-
 gdb/testsuite/gdb.fortran/whatis_type.exp | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 32989d4..1990e1b 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -288,7 +288,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
 
   if ((show <= 0) && (TYPE_NAME (type) != NULL))
     {
-      fputs_filtered (TYPE_NAME (type), stream);
+      fprintfi_filtered (level, stream, "%s", TYPE_NAME (type));
       return;
     }
 
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
index b6324e6..7265923 100644
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -40,14 +40,14 @@ set t1_r "$real :: t1_r"
 
 gdb_test "whatis t1" \
   [multi_line "type = Type t1" \
-	          "$t1_i" \
-	          "$t1_r" \
+	          "    $t1_i" \
+	          "    $t1_r" \
 	          "End Type t1"] \
   "whatis t1"
 gdb_test "whatis t1v" \
   [multi_line "type = Type t1" \
-	          "$t1_i" \
-	          "$t1_r" \
+	          "    $t1_i" \
+	          "    $t1_r" \
 	          "End Type t1"] \
   "whatis t1v"
 
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 4/7] Fortran, typeprint: Decrease level of details when printing elements of a structure.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
                   ` (2 preceding siblings ...)
  2016-05-13  9:35 ` [PATCH V2 5/7] Fortran, testsuite: Add testcases for nested structures Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 14:12   ` Yao Qi
  2016-05-13  9:35 ` [PATCH V2 7/7] Fortran, typeprint: Forward level of details to be printed for pointers Bernhard Heckel
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

According to the typeprint's description, the level of details is
decreased by one for the typeprint of elements of a structure.

Before:
(gdb) ptype t3v
type = Type t3
    integer(kind=4) :: t3_i
    Type t2
        integer(kind=4) :: t2_i
        Type t1
            integer(kind=4) :: t1_i
            real(kind=4) :: t1_r
        End Type t1 :: t1_n
    End Type t2 :: t2_n
End Type t3

After:
(gdb) ptype t3v
type = Type t3
    integer(kind=4) :: t3_i
    Type t2 :: t2_n
End Type t3

2016-05-09  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/Changelog:
	* f-typeprint.c (f_type_print_base): Decrease show by one.

gdb/testsuite/Changelog:
	* gdb.fortran/type.f90: Add nested structures.
	* gdb.fortran/whatis-type.exp: Whatis/ptype nested structures.
	* gdb.fortran/derived-type.exp: Adapt expected output.
	* gdb.fortran/vla-type.exp: Adapt expected output.

---
 gdb/f-typeprint.c                          |  6 +++---
 gdb/testsuite/gdb.fortran/derived-type.exp |  4 ++--
 gdb/testsuite/gdb.fortran/type.f90         | 21 ++++++++++++++++++++-
 gdb/testsuite/gdb.fortran/vla-type.exp     | 24 ++++++------------------
 gdb/testsuite/gdb.fortran/whatis_type.exp  | 16 ++++++++++++++++
 5 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index f38a3a0..350def0 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -371,12 +371,12 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
 	  fputs_filtered ("\n", stream);
 	  for (index = 0; index < TYPE_NFIELDS (type); index++)
 	    {
-	      f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show,
-				 level + 4);
+	      f_type_print_base (TYPE_FIELD_TYPE (type, index), stream,
+				 show - 1, level + 4);
 	      fputs_filtered (" :: ", stream);
 	      fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
 	      f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
-					   stream, 0, 0, 0, 0);
+					   stream, show - 1, 0, 0, 0);
 	      fputs_filtered ("\n", stream);
 	    }
 	  fprintfi_filtered (level, stream, "End Type ");
diff --git a/gdb/testsuite/gdb.fortran/derived-type.exp b/gdb/testsuite/gdb.fortran/derived-type.exp
index 017c6b1..73eb1f4 100644
--- a/gdb/testsuite/gdb.fortran/derived-type.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type.exp
@@ -40,10 +40,10 @@ gdb_test "ptype p" "type = Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type
 
 set test "type-printing for derived type"
 gdb_test_multiple "ptype q" $test {
-    -re "type = Type foo\r\n *$real :: a\r\n *Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type bar :: x\r\n *character\\*7 :: b\r\n *End Type foo\r\n$gdb_prompt $" {
+    -re "type = Type foo\r\n *$real :: a\r\n *Type bar :: x\r\n *character\\*7 :: b\r\n *End Type foo\r\n$gdb_prompt $" {
 	pass $test
     }
-    -re "type = Type foo\r\n *$real :: a\r\n *Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type bar :: x\r\n *character :: b\\(7\\)\r\n *End Type foo\r\n$gdb_prompt $" {
+    -re "type = Type foo\r\n *$real :: a\r\n *Type bar :: x\r\n *character :: b\\(7\\)\r\n *End Type foo\r\n$gdb_prompt $" {
 	# Compiler should produce string, not an array of characters.
 	setup_xfail "*-*-*"
 	fail $test
diff --git a/gdb/testsuite/gdb.fortran/type.f90 b/gdb/testsuite/gdb.fortran/type.f90
index b3ae693..00dc650 100644
--- a/gdb/testsuite/gdb.fortran/type.f90
+++ b/gdb/testsuite/gdb.fortran/type.f90
@@ -21,8 +21,27 @@ program type
     real    :: t1_r
   end type t1
 
+  type :: t2
+    integer :: t2_i
+    type (t1) :: t1_n
+  end type t2
+
+  type :: t3
+    integer :: t3_i
+    type (t2) :: t2_n
+  end type t3
+
   type (t1) :: t1v
+  type (t2) :: t2v
+  type (t3) :: t3v
 
   t1v%t1_i = 42
-  t1v%t1_r = 42.24    ! bp1
+  t1v%t1_r = 42.24
+
+  t2v%t2_i = 2
+  t2v%t1_n%t1_i = 21
+  t3v%t3_i = 3
+  t3v%t2_n%t2_i = 32
+  t3v%t2_n%t1_n%t1_i = 321    ! bp1
+
 end program type
diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
index 23c287f..e1a5db1 100755
--- a/gdb/testsuite/gdb.fortran/vla-type.exp
+++ b/gdb/testsuite/gdb.fortran/vla-type.exp
@@ -99,9 +99,7 @@ gdb_test "print fivev%tone%ivla(1, 2, 3)" " = 123"
 gdb_test "print fivev%tone%ivla(3, 2, 1)" " = 321"
 gdb_test "ptype fivev" \
          [multi_line "type = Type five" \
-                     "\\s+Type one" \
-                     "\\s+$int :: ivla\\\(10,10,10\\\)" \
-                     "\\s+End Type one :: tone" \
+                     "\\s+Type one :: tone" \
                      "End Type five" ]
 
 # Check array of types containing a VLA
@@ -114,15 +112,11 @@ gdb_test "print fivearr(2)%tone%ivla(12, 14, 16)" " = 2"
 gdb_test "print fivearr(2)%tone%ivla(6, 7, 8)" " = 678"
 gdb_test "ptype fivearr(1)" \
          [multi_line "type = Type five" \
-                     "\\s+Type one" \
-                     "\\s+$int :: ivla\\\(2,4,6\\\)" \
-                     "\\s+End Type one :: tone" \
+                     "\\s+Type one :: tone" \
                      "End Type five" ]
 gdb_test "ptype fivearr(2)" \
          [multi_line "type = Type five" \
-                     "\\s+Type one" \
-                     "\\s+$int :: ivla\\\(12,14,16\\\)" \
-                     "\\s+End Type one :: tone" \
+                     "\\s+Type one :: tone" \
                      "End Type five" ]
 
 # Check allocation status of dynamic array and it's dynamic members
@@ -130,9 +124,7 @@ gdb_test "ptype fivedynarr" "type = <not allocated>"
 gdb_test "next" ""
 gdb_test "ptype fivedynarr(2)" \
          [multi_line "type = Type five" \
-                     "\\s+Type one" \
-                     "\\s+$int :: ivla\\\(<not allocated>\\\)" \
-                     "\\s+End Type one :: tone" \
+                     "\\s+Type one :: tone" \
                      "End Type five" ]
 
 # Check dynamic array of types containing a VLA
@@ -145,13 +137,9 @@ gdb_test "print fivedynarr(2)%tone%ivla(12, 14, 16)" " = 2"
 gdb_test "print fivedynarr(2)%tone%ivla(6, 7, 8)" " = 678"
 gdb_test "ptype fivedynarr(1)" \
          [multi_line "type = Type five" \
-                     "\\s+Type one" \
-                     "\\s+$int :: ivla\\\(2,4,6\\\)" \
-                     "\\s+End Type one :: tone" \
+                     "\\s+Type one :: tone" \
                      "End Type five" ]
 gdb_test "ptype fivedynarr(2)" \
          [multi_line "type = Type five" \
-                     "\\s+Type one" \
-                     "\\s+$int :: ivla\\\(12,14,16\\\)" \
-                     "\\s+End Type one :: tone" \
+                     "\\s+Type one :: tone" \
                      "End Type five" ]
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
index 0b7a1b7..955f853 100644
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -40,6 +40,10 @@ set t1_r "$real :: t1_r"
 
 gdb_test "whatis t1" "type = Type t1"
 gdb_test "whatis t1v" "type = Type t1"
+gdb_test "whatis t2" "type = Type t2"
+gdb_test "whatis t2v" "type = Type t2"
+gdb_test "whatis t3" "type = Type t3"
+gdb_test "whatis t3v" "type = Type t3"
 
 gdb_test "ptype t1" \
   [multi_line "type = Type t1" \
@@ -53,3 +57,15 @@ gdb_test "ptype t1v" \
 	          "    $t1_r" \
 	          "End Type t1"] \
   "ptype t1v"
+
+gdb_test "ptype t2v" \
+  [multi_line "type = Type t2" \
+              "    $int :: t2_i" \
+              "    Type t1 :: t1_n" \
+              "End Type t2"]
+
+gdb_test "ptype t3v" \
+  [multi_line "type = Type t3" \
+              "    $int :: t3_i" \
+              "    Type t2 :: t2_n" \
+              "End Type t3"]
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 5/7] Fortran, testsuite: Add testcases for nested structures.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
  2016-05-13  9:35 ` [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure Bernhard Heckel
  2016-05-13  9:35 ` [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 14:17   ` Yao Qi
  2016-05-13  9:35 ` [PATCH V2 4/7] Fortran, typeprint: Decrease level of details when printing elements of a structure Bernhard Heckel
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

As as result of printing only the outer elements of nested structures,
some testcases have to be added to check for corner cases with VLA's.

2016-05-13  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/testsuite/Changelog:
	* gdb.fortran/vla-type.exp: Access elements in nested structs.

---
 gdb/testsuite/gdb.fortran/vla-type.exp | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
index e1a5db1..6c547e2 100755
--- a/gdb/testsuite/gdb.fortran/vla-type.exp
+++ b/gdb/testsuite/gdb.fortran/vla-type.exp
@@ -101,6 +101,10 @@ gdb_test "ptype fivev" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
                      "End Type five" ]
+gdb_test "ptype fivev%tone" \
+         [multi_line "type = Type one" \
+                     "    $int :: ivla\\(10,10,10\\)" \
+                     "End Type one" ]
 
 # Check array of types containing a VLA
 gdb_breakpoint [gdb_get_line_number "fivearr-filled"]
@@ -114,10 +118,18 @@ gdb_test "ptype fivearr(1)" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
                      "End Type five" ]
+gdb_test "ptype fivearr(1)%tone" \
+         [multi_line "type = Type one" \
+                     "    $int :: ivla\\(2,4,6\\)" \
+                     "End Type one" ]
 gdb_test "ptype fivearr(2)" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
                      "End Type five" ]
+gdb_test "ptype fivearr(2)%tone" \
+         [multi_line "type = Type one" \
+                     "    $int :: ivla\\(12,14,16\\)" \
+                     "End Type one" ]
 
 # Check allocation status of dynamic array and it's dynamic members
 gdb_test "ptype fivedynarr" "type = <not allocated>"
@@ -126,6 +138,11 @@ gdb_test "ptype fivedynarr(2)" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
                      "End Type five" ]
+gdb_test "ptype fivedynarr(2)%tone" \
+         [multi_line "type = Type one" \
+                     "    $int :: ivla\\(<not allocated>\\)" \
+                     "End Type one" ] \
+         "ptype fivedynarr(2)%tone, not allocated"
 
 # Check dynamic array of types containing a VLA
 gdb_breakpoint [gdb_get_line_number "fivedynarr-filled"]
@@ -139,7 +156,15 @@ gdb_test "ptype fivedynarr(1)" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
                      "End Type five" ]
+gdb_test "ptype fivedynarr(1)%tone" \
+         [multi_line "type = Type one" \
+                     "    $int :: ivla\\(2,4,6\\)" \
+                     "End Type one" ]
 gdb_test "ptype fivedynarr(2)" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
                      "End Type five" ]
+gdb_test "ptype fivedynarr(2)%tone" \
+         [multi_line "type = Type one" \
+                     "    $int :: ivla\\(12,14,16\\)" \
+                     "End Type one" ]
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 1/7] Fortran, testsuite: Use multi_line in whatis_type testcase.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
                   ` (4 preceding siblings ...)
  2016-05-13  9:35 ` [PATCH V2 7/7] Fortran, typeprint: Forward level of details to be printed for pointers Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 14:01   ` Yao Qi
  2016-05-13  9:35 ` [PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures Bernhard Heckel
  2016-05-25  7:13 ` [PUSHED][PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

2016-05-11  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/testsuite/Changelog:
	* whatis_type.exp: Use multi_line.

---
 gdb/testsuite/gdb.fortran/whatis_type.exp | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
index af897a6..b6324e6 100644
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -39,15 +39,27 @@ set t1_i "$int :: t1_i"
 set t1_r "$real :: t1_r"
 
 gdb_test "whatis t1" \
-  "type = Type t1\r\n${t1_i}\r\n${t1_r}\r\nEnd Type t1" \
+  [multi_line "type = Type t1" \
+	          "$t1_i" \
+	          "$t1_r" \
+	          "End Type t1"] \
   "whatis t1"
 gdb_test "whatis t1v" \
-  "type = Type t1\r\n${t1_i}\r\n${t1_r}\r\nEnd Type t1" \
+  [multi_line "type = Type t1" \
+	          "$t1_i" \
+	          "$t1_r" \
+	          "End Type t1"] \
   "whatis t1v"
 
 gdb_test "ptype t1" \
-  "type = Type t1\r\n    ${t1_i}\r\n    ${t1_r}\r\nEnd Type t1" \
+  [multi_line "type = Type t1" \
+	          "    $t1_i" \
+	          "    $t1_r" \
+	          "End Type t1"] \
   "ptype t1"
 gdb_test "ptype t1v" \
-  "type = Type t1\r\n    ${t1_i}\r\n    ${t1_r}\r\nEnd Type t1" \
+  [multi_line "type = Type t1" \
+	          "    $t1_i" \
+	          "    $t1_r" \
+	          "End Type t1"] \
   "ptype t1v"
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name.
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
  2016-05-13  9:35 ` [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure Bernhard Heckel
@ 2016-05-13  9:35 ` Bernhard Heckel
  2016-05-13 14:20   ` Yao Qi
  2016-05-13  9:35 ` [PATCH V2 5/7] Fortran, testsuite: Add testcases for nested structures Bernhard Heckel
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-13  9:35 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches, Bernhard Heckel

2016-05-13  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/testsuite/Changelog:
	* gdb.fortran/vla-type.exp: Fix testcase name.

---
 gdb/testsuite/gdb.fortran/vla-type.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
index 6c547e2..f2d434e 100755
--- a/gdb/testsuite/gdb.fortran/vla-type.exp
+++ b/gdb/testsuite/gdb.fortran/vla-type.exp
@@ -137,7 +137,8 @@ gdb_test "next" ""
 gdb_test "ptype fivedynarr(2)" \
          [multi_line "type = Type five" \
                      "\\s+Type one :: tone" \
-                     "End Type five" ]
+                     "End Type five" ] \
+         "ptype fivedynarr(2), not allocated"
 gdb_test "ptype fivedynarr(2)%tone" \
          [multi_line "type = Type one" \
                      "    $int :: ivla\\(<not allocated>\\)" \
-- 
2.7.1.339.g0233b80

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 1/7] Fortran, testsuite: Use multi_line in whatis_type testcase.
  2016-05-13  9:35 ` [PATCH V2 1/7] Fortran, testsuite: Use multi_line in whatis_type testcase Bernhard Heckel
@ 2016-05-13 14:01   ` Yao Qi
  0 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-13 14:01 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

> 2016-05-11  Bernhard Heckel  <bernhard.heckel@intel.com>
>
> gdb/testsuite/Changelog:
> 	* whatis_type.exp: Use multi_line.
        ^^^^^^^^^^^^^^^^ gdb.fortran/whatis_type.exp

Patch is OK to me.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures.
  2016-05-13  9:35 ` [PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures Bernhard Heckel
@ 2016-05-13 14:05   ` Yao Qi
  0 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-13 14:05 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

> 2016-03-18  Bernhard Heckel  <bernhard.heckel@intel.com>
>
> gdb/Changelog:
> 	* f-typeprint.c (f_type_print_base): Take print level into account.
>
> gdb/testsuite/Changelog:
> 	* print_type.exp: Fix expected output.

print_type.exp is not changed by this patch.

>         * whatis_type.exp: Fix expected output.
          ^^^^^^^^^^^^^^^^^ * gdb.fortran/whatis_type.exp:

Patch is good to me.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 4/7] Fortran, typeprint: Decrease level of details when printing elements of a structure.
  2016-05-13  9:35 ` [PATCH V2 4/7] Fortran, typeprint: Decrease level of details when printing elements of a structure Bernhard Heckel
@ 2016-05-13 14:12   ` Yao Qi
  0 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-13 14:12 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

Patch is good to me.

> --- a/gdb/testsuite/gdb.fortran/derived-type.exp
> +++ b/gdb/testsuite/gdb.fortran/derived-type.exp
> @@ -40,10 +40,10 @@ gdb_test "ptype p" "type = Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type
>  
>  set test "type-printing for derived type"
>  gdb_test_multiple "ptype q" $test {
> -    -re "type = Type foo\r\n *$real :: a\r\n *Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type bar :: x\r\n *character\\*7 :: b\r\n *End Type foo\r\n$gdb_prompt $" {
> +    -re "type = Type foo\r\n *$real :: a\r\n *Type bar :: x\r\n *character\\*7 :: b\r\n *End Type foo\r\n$gdb_prompt $" {
>  	pass $test
>      }
> -    -re "type = Type foo\r\n *$real :: a\r\n *Type bar\r\n *$int :: c\r\n *$real :: d\r\n *End Type bar :: x\r\n *character :: b\\(7\\)\r\n *End Type foo\r\n$gdb_prompt $" {
> +    -re "type = Type foo\r\n *$real :: a\r\n *Type bar :: x\r\n *character :: b\\(7\\)\r\n *End Type foo\r\n$gdb_prompt $" {
>  	# Compiler should produce string, not an array of characters.
>  	setup_xfail "*-*-*"
>  	fail $test

Before you apply this patch, can you convert these patterns to using
multi_line?  Then, this patch is much cleaner.  The change to using
multi_line is obvious, so you don't need review/approval for it.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 5/7] Fortran, testsuite: Add testcases for nested structures.
  2016-05-13  9:35 ` [PATCH V2 5/7] Fortran, testsuite: Add testcases for nested structures Bernhard Heckel
@ 2016-05-13 14:17   ` Yao Qi
  0 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-13 14:17 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

> 2016-05-13  Bernhard Heckel  <bernhard.heckel@intel.com>
>
> gdb/testsuite/Changelog:
> 	* gdb.fortran/vla-type.exp: Access elements in nested structs.

Looks good to me.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name.
  2016-05-13  9:35 ` [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name Bernhard Heckel
@ 2016-05-13 14:20   ` Yao Qi
  2016-05-17 12:53     ` Bernhard Heckel
  0 siblings, 1 reply; 20+ messages in thread
From: Yao Qi @ 2016-05-13 14:20 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

> @@ -137,7 +137,8 @@ gdb_test "next" ""
>  gdb_test "ptype fivedynarr(2)" \
>           [multi_line "type = Type five" \
>                       "\\s+Type one :: tone" \
> -                     "End Type five" ]
> +                     "End Type five" ] \
> +         "ptype fivedynarr(2), not allocated"

I don't understand why do we need this change.  Looks the element "tone"
of type "five" is not allocated, but type "five" is.

>  gdb_test "ptype fivedynarr(2)%tone" \
>           [multi_line "type = Type one" \
>                       "    $int :: ivla\\(<not allocated>\\)" \

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 7/7] Fortran, typeprint: Forward level of details to be printed for pointers.
  2016-05-13  9:35 ` [PATCH V2 7/7] Fortran, typeprint: Forward level of details to be printed for pointers Bernhard Heckel
@ 2016-05-13 15:57   ` Yao Qi
  0 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-13 15:57 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

> 2016-05-09  Bernhard Heckel  <bernhard.heckel@intel.com>
>
> gdb/Changelog:
> 	* f-typeprint.c (f_type_print_base): Replace 0 by show.
>
> gdb/testsuite/Changelog:
> 	* gdb.fortran/type.f90: Add pointer variable.
> 	* gdb.fortran/whatis_type.exp: Add whatis/ptype of pointers.

Looks good to me.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure.
  2016-05-13  9:35 ` [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure Bernhard Heckel
@ 2016-05-13 15:58   ` Yao Qi
  0 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-13 15:58 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: qiyaoltc, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

Patch is good to me, one nit below,

> 2016-05-09  Bernhard Heckel  <bernhard.heckel@intel.com>
>
> gdb/Changelog:
> 	* f-typeprint.c (f_type_print_base): Don't print structure fields when show < 0.

This line is too long.

>
> gdb/testsuite/Changelog:
> 	* gdb.fortran/whatis_type.exp: Adapt expected output.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name.
  2016-05-13 14:20   ` Yao Qi
@ 2016-05-17 12:53     ` Bernhard Heckel
  2016-05-18 13:29       ` Bernhard Heckel
                         ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-17 12:53 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 13/05/2016 16:19, Yao Qi wrote:
> Bernhard Heckel <bernhard.heckel@intel.com> writes:
>
>> @@ -137,7 +137,8 @@ gdb_test "next" ""
>>   gdb_test "ptype fivedynarr(2)" \
>>            [multi_line "type = Type five" \
>>                        "\\s+Type one :: tone" \
>> -                     "End Type five" ]
>> +                     "End Type five" ] \
>> +         "ptype fivedynarr(2), not allocated"
> I don't understand why do we need this change.  Looks the element "tone"
> of type "five" is not allocated, but type "five" is.
I found a duplicate testname in the same file, therefore I just added a 
post-fix to the testname.
This test above handles not allocated elements of an array.
Specific here, the element of an allocatable array is a struct which has 
the allocatable variable "tone" which is not allocated yet.
There is not change to the test itself, only the testname
>>   gdb_test "ptype fivedynarr(2)%tone" \
>>            [multi_line "type = Type one" \
>>                        "    $int :: ivla\\(<not allocated>\\)" \

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name.
  2016-05-17 12:53     ` Bernhard Heckel
@ 2016-05-18 13:29       ` Bernhard Heckel
  2016-05-23 11:15       ` [PING][PATCH " Bernhard Heckel
  2016-05-23 13:22       ` [PATCH " Yao Qi
  2 siblings, 0 replies; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-18 13:29 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 17/05/2016 14:53, Bernhard Heckel wrote:
> On 13/05/2016 16:19, Yao Qi wrote:
>> Bernhard Heckel <bernhard.heckel@intel.com> writes:
>>
>>> @@ -137,7 +137,8 @@ gdb_test "next" ""
>>>   gdb_test "ptype fivedynarr(2)" \
>>>            [multi_line "type = Type five" \
>>>                        "\\s+Type one :: tone" \
>>> -                     "End Type five" ]
>>> +                     "End Type five" ] \
>>> +         "ptype fivedynarr(2), not allocated"
>> I don't understand why do we need this change.  Looks the element "tone"
>> of type "five" is not allocated, but type "five" is.
> I found a duplicate testname in the same file, therefore I just added 
> a post-fix to the testname.
> This test above handles not allocated elements of an array.
> Specific here, the element of an allocatable array is a struct which 
> has the allocatable variable "tone" which is not allocated yet.
> There is not change to the test itself, only the testname
Good to go?
>
>>>   gdb_test "ptype fivedynarr(2)%tone" \
>>>            [multi_line "type = Type one" \
>>>                        "    $int :: ivla\\(<not allocated>\\)" \
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PING][PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name.
  2016-05-17 12:53     ` Bernhard Heckel
  2016-05-18 13:29       ` Bernhard Heckel
@ 2016-05-23 11:15       ` Bernhard Heckel
  2016-05-23 13:22       ` [PATCH " Yao Qi
  2 siblings, 0 replies; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-23 11:15 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 17/05/2016 14:53, Bernhard Heckel wrote:
> On 13/05/2016 16:19, Yao Qi wrote:
>> Bernhard Heckel <bernhard.heckel@intel.com> writes:
>>
>>> @@ -137,7 +137,8 @@ gdb_test "next" ""
>>>   gdb_test "ptype fivedynarr(2)" \
>>>            [multi_line "type = Type five" \
>>>                        "\\s+Type one :: tone" \
>>> -                     "End Type five" ]
>>> +                     "End Type five" ] \
>>> +         "ptype fivedynarr(2), not allocated"
>> I don't understand why do we need this change.  Looks the element "tone"
>> of type "five" is not allocated, but type "five" is.
> I found a duplicate testname in the same file, therefore I just added 
> a post-fix to the testname.
> This test above handles not allocated elements of an array.
> Specific here, the element of an allocatable array is a struct which 
> has the allocatable variable "tone" which is not allocated yet.
> There is no change to the test itself, only the testname
>>>   gdb_test "ptype fivedynarr(2)%tone" \
>>>            [multi_line "type = Type one" \
>>>                        "    $int :: ivla\\(<not allocated>\\)" \

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name.
  2016-05-17 12:53     ` Bernhard Heckel
  2016-05-18 13:29       ` Bernhard Heckel
  2016-05-23 11:15       ` [PING][PATCH " Bernhard Heckel
@ 2016-05-23 13:22       ` Yao Qi
  2 siblings, 0 replies; 20+ messages in thread
From: Yao Qi @ 2016-05-23 13:22 UTC (permalink / raw)
  To: Bernhard Heckel; +Cc: Yao Qi, gdb-patches

Bernhard Heckel <bernhard.heckel@intel.com> writes:

>>>   gdb_test "ptype fivedynarr(2)" \
>>>            [multi_line "type = Type five" \
>>>                        "\\s+Type one :: tone" \
>>> -                     "End Type five" ]
>>> +                     "End Type five" ] \
>>> +         "ptype fivedynarr(2), not allocated"
>> I don't understand why do we need this change.  Looks the element "tone"
>> of type "five" is not allocated, but type "five" is.
> I found a duplicate testname in the same file, therefore I just added
> a post-fix to the testname.
> This test above handles not allocated elements of an array.
> Specific here, the element of an allocatable array is a struct which
> has the allocatable variable "tone" which is not allocated yet.
> There is not change to the test itself, only the testname

Yes, I know this only changes the test name, but that is confusing.  As
I said, variable "tone" is not allocated yet, but variable of type
"five" is.  This test is printing the type "five".  Probably you can
rename the test to "ptype fivedynarr(2), tone is not allocated".

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PUSHED][PATCH V2 0/7] Fortran, typeprint
  2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
                   ` (6 preceding siblings ...)
  2016-05-13  9:35 ` [PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures Bernhard Heckel
@ 2016-05-25  7:13 ` Bernhard Heckel
  7 siblings, 0 replies; 20+ messages in thread
From: Bernhard Heckel @ 2016-05-25  7:13 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb-patches

On 13/05/2016 11:34, Bernhard Heckel wrote:
> This series fixes various issues in fortran's typeprint.
> Tested on Ubuntu1504, Fedora23, Fedora21
>
> Addressed in V2:
> * Split Patch V1 1/4
> * Patch V2 3/7 Move "show -1" to next patch.
> * Patch V2 3/7 Print only the elements of the outermost structure.
> * Patch V2 5/7 New.
> * Patch V2 6/7 New.
>
>
> Bernhard Heckel (7):
>    Fortran, testsuite: Use multi_line in whatis_type testcase.
>    Fortran, typeprint: Fix wrong indentation when ptype nested
>      structures.
>    Fortran, typeprint: Take level of details into account when printing
>      elements of a structure.
>    Fortran, typeprint: Decrease level of details when printing elements
>      of a structure.
>    Fortran, testsuite: Add testcases for nested structures.
>    Fortran, testsuite: Fix duplicate testcase name.
>    Fortran, typeprint: Forward level of details to be printed for
>      pointers.
>
>   gdb/f-typeprint.c                          | 33 +++++++++++--------
>   gdb/testsuite/gdb.fortran/derived-type.exp |  4 +--
>   gdb/testsuite/gdb.fortran/type.f90         | 27 +++++++++++++++-
>   gdb/testsuite/gdb.fortran/vla-type.exp     | 52 +++++++++++++++++++-----------
>   gdb/testsuite/gdb.fortran/whatis_type.exp  | 41 ++++++++++++++++++-----
>   5 files changed, 113 insertions(+), 44 deletions(-)
>
Hi Yao,

thanks a lot for reviewing.
I just pushed the patches.

Regards,
Bernhard
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-05-25  7:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13  9:34 [PATCH V2 0/7] Fortran, typeprint Bernhard Heckel
2016-05-13  9:35 ` [PATCH V2 3/7] Fortran, typeprint: Take level of details into account when printing elements of a structure Bernhard Heckel
2016-05-13 15:58   ` Yao Qi
2016-05-13  9:35 ` [PATCH V2 6/7] Fortran, testsuite: Fix duplicate testcase name Bernhard Heckel
2016-05-13 14:20   ` Yao Qi
2016-05-17 12:53     ` Bernhard Heckel
2016-05-18 13:29       ` Bernhard Heckel
2016-05-23 11:15       ` [PING][PATCH " Bernhard Heckel
2016-05-23 13:22       ` [PATCH " Yao Qi
2016-05-13  9:35 ` [PATCH V2 5/7] Fortran, testsuite: Add testcases for nested structures Bernhard Heckel
2016-05-13 14:17   ` Yao Qi
2016-05-13  9:35 ` [PATCH V2 4/7] Fortran, typeprint: Decrease level of details when printing elements of a structure Bernhard Heckel
2016-05-13 14:12   ` Yao Qi
2016-05-13  9:35 ` [PATCH V2 7/7] Fortran, typeprint: Forward level of details to be printed for pointers Bernhard Heckel
2016-05-13 15:57   ` Yao Qi
2016-05-13  9:35 ` [PATCH V2 1/7] Fortran, testsuite: Use multi_line in whatis_type testcase Bernhard Heckel
2016-05-13 14:01   ` Yao Qi
2016-05-13  9:35 ` [PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures Bernhard Heckel
2016-05-13 14:05   ` Yao Qi
2016-05-25  7:13 ` [PUSHED][PATCH V2 0/7] Fortran, typeprint Bernhard Heckel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).