From: Wu Zhou <woodzltc@cn.ibm.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC]: Document patch for F90 derived type support
Date: Mon, 27 Feb 2006 05:59:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.0602262204560.9819@localhost.localdomain> (raw)
In-Reply-To: <uek1t9nu6.fsf@gnu.org>
Eli,
Thanks for your quick review! Please see my answers below.
On Fri, 24 Feb 2006, Eli Zaretskii wrote:
> > Date: Fri, 24 Feb 2006 02:54:16 -0500 (EST)
> > From: Wu Zhou <woodzltc@cn.ibm.com>
> >
> > Here is the modified document patch for F90 derived type support. Please
> > review and comment.
>
> Reviewed; comments below.
>
> > + Fortran 90 and later support derived type (a.k.a structure). For a
> ^^^^^
> This should be "a.k.a.@:". You forgot the last period, and @: tells
> TeX that this period does not end a sentence, so that TeX typeset it
> correctly.
Thanks for the correction. Modified.
> > + type = Type bar
> > + int4 :: c
> > + real*4 :: d
> > + End Type bar
>
> Btw, isn't it more consistent to print "integer*4" instead of "int4"?
> Either that, or just "integer", I think. Or is "int4" a valid type
> name in f90? (The last Fortran I used was f77, so please forgive my
> ignorance.)
Yes. I also think so. But the name of "int4" is got from the DWARF tag:
<1><e6>: Abbrev Number: 4 (DW_TAG_base_type)
DW_AT_name : int4
DW_AT_byte_size : 4
DW_AT_encoding : 5 (signed)
Maybe we can suggest the compiler to generate integer or integer*4
instead.
> > + For example, for variable q of type foo defined above:
>
> "q" and "foo" should be in @code (they are program symbols).
Modified.
>
> > + Please be noted that in the above example, the result of @code{print q}
> ^^^^^^^^^^^^^^^
> "Please note".
Thanks. The modified patch is appended below:
2006-02-27 Wu Zhou <woodzltc@cn.ibm.com>
* 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 27 Feb 2006 02:59:47 -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 @code{q} of type @code{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 note 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
next prev parent reply other threads:[~2006-02-27 5:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-24 8:13 Wu Zhou
2006-02-24 8:34 ` Eli Zaretskii
2006-02-27 5:59 ` Wu Zhou [this message]
2006-02-28 6:43 ` Eli Zaretskii
2006-02-28 15:05 ` Daniel Jacobowitz
2006-02-28 20:09 ` Eli Zaretskii
2006-03-01 2:51 ` Wu Zhou
2006-03-01 4:32 ` Daniel Jacobowitz
2006-03-01 4:53 ` Eli Zaretskii
2006-03-01 5:05 ` Daniel Jacobowitz
2006-03-01 19:02 ` Eli Zaretskii
2006-03-01 19:38 ` Daniel Jacobowitz
2006-03-02 2:32 ` Wu Zhou
2006-03-02 4:36 ` Eli Zaretskii
2006-03-02 4:40 ` Daniel Jacobowitz
2006-03-03 9:09 ` Wu Zhou
2006-03-02 4:25 ` Eli Zaretskii
2006-03-02 4:27 ` Daniel Jacobowitz
2006-03-01 4:51 ` Eli Zaretskii
2006-03-02 2:43 ` Wu Zhou
2006-03-02 3:22 ` Daniel Jacobowitz
2006-03-02 4:38 ` Eli Zaretskii
2006-03-02 4:37 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0602262204560.9819@localhost.localdomain \
--to=woodzltc@cn.ibm.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox