From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17046 invoked by alias); 24 Feb 2006 07:53:59 -0000 Received: (qmail 17037 invoked by uid 22791); 24 Feb 2006 07:53:58 -0000 X-Spam-Check-By: sourceware.org Received: from ausmtp04.au.ibm.com (HELO ausmtp04.au.ibm.com) (202.81.18.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Feb 2006 07:53:57 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp04.au.ibm.com (8.12.10/8.13.5) with ESMTP id k1O80Q0t275900 for ; Fri, 24 Feb 2006 19:00:29 +1100 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0208e0.au.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id k1O7uhqA083818 for ; Fri, 24 Feb 2006 18:56:48 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11/8.13.3) with ESMTP id k1O7rOmN026257 for ; Fri, 24 Feb 2006 18:53:24 +1100 Received: from [9.181.133.236] ([9.181.133.236]) by d23av04.au.ibm.com (8.12.11/8.12.11) with ESMTP id k1O7rKvb026063 for ; Fri, 24 Feb 2006 18:53:22 +1100 Date: Fri, 24 Feb 2006 08:13:00 -0000 From: Wu Zhou To: gdb-patches@sources.redhat.com Subject: [RFC]: Document patch for F90 derived type support Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00455.txt.bz2 Eli, Here is the modified document patch for F90 derived type support. Please review and comment. I had tested it with "make info". It displays ok. 2006-02-24 Wu Zhou * gdb.texinfo (Fortran): Document the "%" operator for member access. Document the type-print and value-print operation of Fortran 90 derived types. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.314 diff -c -p -r1.314 gdb.texinfo *** gdb.texinfo 18 Feb 2006 20:45:01 -0000 1.314 --- gdb.texinfo 24 Feb 2006 07:16:56 -0000 *************** of the second one. *** 9399,9404 **** --- 9399,9408 ---- @item : The range operator. Normally used in the form of array(low:high) to represent a section of array. + + @item % + Fortran 90 and later use this to access the members of derived + type, which is also introduced after the Fortran 90. @end table @node Fortran Defaults *************** This command prints the values contained *** 9427,9432 **** --- 9431,9506 ---- block whose name is @var{common-name}. With no argument, the names of all @code{COMMON} blocks visible at current program location are printed. + + @cindex structure type-print + @item ptype @var{derived-type} + Fortran 90 and later support derived type (a.k.a structure). For a + variable of derived type, the @code{ptype} command will output all its + members, including nested derived type. + + For example, for this derived type declaration: + + @smallexample + type bar + integer :: c + real :: d + end type + + type foo + real :: a + type(bar) :: x + character*7 :: b + end type foo + @end smallexample + + @noindent + the @code{ptype} commands give this output: + + @smallexample + @group + (@value{GDBP}) ptype bar + type = Type bar + int4 :: c + real*4 :: d + End Type bar + (@value{GDBP}) ptype foo + type = Type foo + real*4 :: a + Type bar + int4 :: c + real*4 :: d + End Type bar :: x + character (7) :: b + End Type foo + @end group + @end smallexample + + @cindex structure value-print + @item print @var{derived-type} + For a variable of derived type, the @code{print} command will output the + value of all its members, including its nested derived type . + + For example, for variable q of type foo defined above: + + @smallexample + type(foo) :: q + @end smallexample + + @noindent + the @code{print} command will output this: + + @smallexample + @group + (@value{GDBP}) print q + $1 = @{ 3.125, @{ 1, 2.375@}, + (97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g')@} + @end group + @end smallexample + + Please be noted that in the above example, the result of @code{print q} + is a single long line, broken only for clarity. + @noindent + @end table @node Pascal Regards - Wu Zhou