From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109396 invoked by alias); 1 Feb 2019 13:06:46 -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 109208 invoked by uid 89); 1 Feb 2019 13:06:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*eu X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Feb 2019 13:06:44 +0000 Received: by mail-wm1-f65.google.com with SMTP id t200so6206077wmt.0 for ; Fri, 01 Feb 2019 05:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Vou6CCEd7Jm3ZzsZtiWAHE2Fg8aoI99yzh/juPMSRUk=; b=c2N05AYaUx9yAeLTy2xo8Rl7Awr4dksPcZDSFiYV7tZzkCqfTQd89Axorb4hr4cuM4 5zQVA5OE278UVWKfEddAGK7yyFXBGrIg2qHGPhET8gcgV505ajs/mgtLUuo0H7wzl9cU /J7yIcdPclWshxhOfwA6ZdHCroKpR1OTmULeYRdmrrEZWJFIdSHDXBylQ2W1T16+HWsU 9nte5zERBm6FdlKl63BxH1N93Xk06N1MapK9YVQQEUg4cw9m8bSx/mXY69YQpZ+IeOYJ hR4U5RyGyQ6m8mno2DpxpAbc8dKCoVbfNZ1AEV8N76fLn8CVVZ6tM22SV93gBgOt6Y37 PWHQ== Return-Path: Received: from localhost (host86-164-85-126.range86-164.btcentralplus.com. [86.164.85.126]) by smtp.gmail.com with ESMTPSA id c13sm7385424wrb.38.2019.02.01.05.06.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Feb 2019 05:06:41 -0800 (PST) Date: Fri, 01 Feb 2019 13:06:00 -0000 From: Andrew Burgess To: Pawel Wodkowski Cc: gdb-patches@sourceware.org, murbanski@pl.sii.eu, sbasierski@pl.sii.eu, tim.wiederhake@intel.com, dragos.carciumaru@intel.com, Bernhard Heckel Subject: Re: [PATCH v2 4/7] Fortran: Ptype, print type extension. Message-ID: <20190201130640.GD17699@embecosm.com> References: <1542663530-140490-1-git-send-email-pwodkowski@pl.sii.eu> <1542663530-140490-4-git-send-email-pwodkowski@pl.sii.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542663530-140490-4-git-send-email-pwodkowski@pl.sii.eu> X-Fortune: The early worm gets the late bird. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00005.txt.bz2 * Pawel Wodkowski [2018-11-19 22:38:47 +0100]: > From: Bernhard Heckel > > Print base-class of an extended type when doing a ptype. > > 2016-05-24 Bernhard Heckel > > gdb/Changelog: > * gdb/f-typeprint.c (f_type_print_derivation_info): New. > (f_type_print_base): Print baseclass info. Could this patch have a test case please. Also there's a minor whitespace issue I've pointed out below. Thanks, Andrew > > Changes from V1 to V2: > clear commit message. > --- > gdb/f-typeprint.c | 30 +++++++++++++++++++++++++++--- > 1 file changed, 27 insertions(+), 3 deletions(-) > > diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c > index 3f13c111ac56..133eaf9b9848 100644 > --- a/gdb/f-typeprint.c > +++ b/gdb/f-typeprint.c > @@ -256,6 +256,25 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, > } > } > > +/* If TYPE is an extended type, then print out derivation information. > + > + A typical output could look like this: > + "Type, extends(point) :: waypoint" > + " Type point :: point" > + " real(kind=4) :: angle" > + "End Type waypoint" > + */ > + > +static void > +f_type_print_derivation_info (struct type *type, struct ui_file *stream) > +{ > + /* Fortran doesn't support multiple inheritance. */ Extra whitespace after '.'. > + int i = 0; > + > + if (TYPE_N_BASECLASSES (type) > 0) > + fprintf_filtered (stream, ", extends(%s) ::", TYPE_NAME (TYPE_BASECLASS (type, i))); > +} > + > /* Print the name of the type (or the ultimate pointer target, > function value or array element), or the description of a > structure or union. > @@ -372,10 +391,15 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, > case TYPE_CODE_STRUCT: > case TYPE_CODE_UNION: > if (TYPE_CODE (type) == TYPE_CODE_UNION) > - fprintfi_filtered (level, stream, "Type, C_Union :: "); > + fprintfi_filtered (level, stream, "Type, C_Union ::"); > else > - fprintfi_filtered (level, stream, "Type "); > - fputs_filtered (TYPE_NAME (type), stream); > + fprintfi_filtered (level, stream, "Type"); > + > + if (show > 0) > + f_type_print_derivation_info (type, stream); > + > + fprintf_filtered (stream, " %s", TYPE_NAME (type)); > + > /* According to the definition, > we only print structure elements in case show > 0. */ > if (show > 0) > -- > 2.7.4 >