Fortran, typeprint: Fix wrong indentation when ptype nested structures.
authorBernhard Heckel <bernhard.heckel@intel.com>
Wed, 25 May 2016 06:47:16 +0000 (08:47 +0200)
committerBernhard Heckel <bernhard.heckel@intel.com>
Wed, 25 May 2016 06:47:16 +0000 (08:47 +0200)
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-05-25  Bernhard Heckel  <bernhard.heckel@intel.com>

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

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

gdb/ChangeLog
gdb/f-typeprint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/whatis_type.exp

index 00e0ddbf3485ad83046399adcf8fe785a6a189dd..cba01ef14df36b36643e0fc93563df7f29f045eb 100644 (file)
@@ -1,3 +1,7 @@
+2016-05-25  Bernhard Heckel  <bernhard.heckel@intel.com>
+
+       * f-typeprint.c (f_type_print_base): Take print level into account.
+
 2016-05-24  Tom Tromey  <tom@tromey.com>
 
        PR python/17386:
index 32989d41a55a2dd628fde9f9a8adeadcaa3c72e5..1990e1bb15f80622abb3ec93e237c34972609e5f 100644 (file)
@@ -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;
     }
 
index c518f153f945e0be281070fe5bdf0ba8b25d3bd5..2b0519261b10b625a7c3f3fe385ed0d65b1363ff 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-25  Bernhard Heckel  <bernhard.heckel@intel.com>
+
+       * gdb.fortran/print_type.exp: Fix expected output.
+       * gdb.fortran/whatis_type.exp: Fix expected output.
+
 2016-05-25  Bernhard Heckel  <bernhard.heckel@intel.com>
 
        * gdb.fortran/whatis_type.exp: Use multi_line.
index b6324e69762819b6c17de8d94ffbd26ec75cefb2..7265923447874417d88bdbef3eea5dcd3bb7a529 100644 (file)
@@ -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"