This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH V2 2/7] Fortran, typeprint: Fix wrong indentation when ptype nested structures.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]