summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran
diff options
context:
space:
mode:
authorBernhard Heckel <bernhard.heckel@intel.com>2016-05-25 08:47:18 +0200
committerBernhard Heckel <bernhard.heckel@intel.com>2016-05-25 08:47:18 +0200
commit2bbad2ea1102733a2a4143be4afe195caf730cd0 (patch)
treeee58f4354b2a548dcdf49d28ca2a82e38dd16230 /gdb/testsuite/gdb.fortran
parent8b70175dfa76c97e28d83cd09f3604933a7c05f5 (diff)
Fortran, typeprint: Forward level of details to be printed for pointers.
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-25 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.
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rw-r--r--gdb/testsuite/gdb.fortran/type.f9010
-rw-r--r--gdb/testsuite/gdb.fortran/whatis_type.exp7
2 files changed, 15 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.fortran/type.f90 b/gdb/testsuite/gdb.fortran/type.f90
index 00dc650076..ad3d6eee11 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 955f85343e..6ebcb52c1e 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 \\)"]