From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41842 invoked by alias); 10 May 2016 14:16:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 41785 invoked by uid 89); 10 May 2016 14:16:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 May 2016 14:16:18 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 10 May 2016 07:16:17 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 10 May 2016 07:16:11 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u4AEGALQ001784; Tue, 10 May 2016 15:16:10 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id u4AEGAsI030642; Tue, 10 May 2016 16:16:10 +0200 Received: (from heckel@localhost) by ulvlx001.iul.intel.com with œ id u4AEG9WX030638; Tue, 10 May 2016 16:16:10 +0200 From: Bernhard Heckel To: qiyaoltc@gmail.com Cc: gdb-patches@sourceware.org, Bernhard Heckel Subject: [PATCH 1/4] Fortran, typeprint: Fix wrong indentation when ptype nested structures. Date: Tue, 10 May 2016 14:16:00 -0000 Message-Id: <1462889739-30359-2-git-send-email-bernhard.heckel@intel.com> In-Reply-To: <1462889739-30359-1-git-send-email-bernhard.heckel@intel.com> References: <1462889739-30359-1-git-send-email-bernhard.heckel@intel.com> X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00169.txt.bz2 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 gdb/Changelog: * f-typeprint.c (f_type_print_base): Take print level into account. gdb/testsuite/Changelog: * print_type.exp: Fix expected output. --- gdb/f-typeprint.c | 2 +- gdb/testsuite/gdb.fortran/whatis_type.exp | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 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 af897a6..edaf4fd 100644 --- a/gdb/testsuite/gdb.fortran/whatis_type.exp +++ b/gdb/testsuite/gdb.fortran/whatis_type.exp @@ -39,15 +39,25 @@ 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" \ - "whatis t1" + [multi_line "type = Type t1" \ + " $t1_i" \ + " $t1_r" \ + "End Type t1"] + gdb_test "whatis t1v" \ - "type = Type t1\r\n${t1_i}\r\n${t1_r}\r\nEnd Type t1" \ - "whatis t1v" + [multi_line "type = Type t1" \ + " $t1_i" \ + " $t1_r" \ + "End Type t1"] gdb_test "ptype t1" \ - "type = Type t1\r\n ${t1_i}\r\n ${t1_r}\r\nEnd Type t1" \ - "ptype t1" + [multi_line "type = Type t1" \ + " $t1_i" \ + " $t1_r" \ + "End Type t1"] + gdb_test "ptype t1v" \ - "type = Type t1\r\n ${t1_i}\r\n ${t1_r}\r\nEnd Type t1" \ - "ptype t1v" + [multi_line "type = Type t1" \ + " $t1_i" \ + " $t1_r" \ + "End Type t1"] -- 2.7.1.339.g0233b80