This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: More updates to the Fortran documentation.


I wrote:

> I applied the following to the 3.0 branch (gcc/f), after a `make info'
> and `make dvi' [cannot bootstrap at the moment on i686-pc-linux-gnu]:

The same change is applied to the trunk [that I couldn't bootstrap also
- nevertheless `make info' and `make dvi' succeeded], augmented by the
following (which removes all information about -fdebug-kludge):

*** g77.texi.orig       Tue May 22 21:53:22 2001
--- g77.texi    Tue May 22 22:00:35 2001
*************** by type.  Explanations are in the follow
*** 1436,1440 ****
  -fshort-double  -fno-common  -fpack-struct
  -fzeros  -fno-second-underscore
! -fdebug-kludge  -femulate-complex
  -falias-check  -fargument-alias
  -fargument-noalias  -fno-argument-noalias-global
--- 1436,1440 ----
  -fshort-double  -fno-common  -fpack-struct
  -fzeros  -fno-second-underscore
! -femulate-complex
  -falias-check  -fargument-alias
  -fargument-noalias  -fno-argument-noalias-global
*************** Produce debugging information in the ope
*** 2624,2646 ****
  (stabs, COFF, XCOFF, or DWARF).  GDB can work with this debugging
  information.
- 
- @cindex common blocks
- @cindex equivalence areas
- @cindex missing debug features
- Support for this option in Fortran programs was incomplete up till
- version 0.5.26 of @code{g77}.
- In particular, names of variables and arrays in common blocks
- or that are storage-associated via @code{EQUIVALENCE} were
- unavailable to the debugger.
- 
- However, version 0.5.19 of @code{g77} does provide this information
- in a rudimentary way, as controlled by the
- @samp{-fdebug-kludge} option.
- 
- Because version 0.5.26 of @code{g77} enables full debug information
- of COMMON BLOCK and EQUIVALENCE items, this option has been disabled.
- 
- @xref{Code Gen Options,,Options for Code Generation Conventions},
- for more information.
  @end table
  
--- 2624,2627 ----
*************** The interpretation changes will affect o
*** 3182,3261 ****
  programs; standard-conforming programs should not be affected.
  
- @cindex -fdebug-kludge option
- @cindex options, -fdebug-kludge
- @item -fdebug-kludge
- Emit information on @code{COMMON} and @code{EQUIVALENCE} members
- that might help users of debuggers work around lack of proper
debugging
- information on such members.
- 
- As of version 0.5.19, @code{g77} offers this option to emit
- information on members of aggregate areas to help users while
debugging.
- This information consists of establishing the type and contents of
each
- such member so that, when a debugger is asked to print the contents,
- the printed information provides rudimentary debugging information.
- This information identifies the name of the aggregate area (either the
- @code{COMMON} block name, or the @code{g77}-assigned name for the
- @code{EQUIVALENCE} name) and the offset, in bytes, of the member from
- the beginning of the area.
- 
- Using @code{gdb}, this information is not coherently displayed in the
Fortran
- language mode, so temporarily switching to the C language mode to
display the
- information is suggested.
- Use @samp{set language c} and @samp{set language fortran} to
accomplish this.
- 
- As of version 0.5.26 of @code{g77} this option has been disabled, as
the
- compiler is now able to emit correct and complete debug information
- for COMMON BLOCK and EQUIVALENCE items.
- 
- For example:
- 
- @smallexample
-       COMMON /X/A,B
-       EQUIVALENCE (C,D)
-       CHARACTER XX*50
-       EQUIVALENCE (I,XX(20:20))
-       END
- 
- GDB is free software and you are welcome to distribute copies of it
-  under certain conditions; type "show copying" to see the conditions.
- There is absolutely no warranty for GDB; type "show warranty" for
details.
- GDB 4.16 (lm-gnits-dwim), Copyright 1996 Free Software Foundation,
Inc...
- (gdb) b MAIN__
- Breakpoint 1 at 0t1200000201120112: file cd.f, line 5.
- (gdb) r
- Starting program: /home/user/a.out
- 
- Breakpoint 1, MAIN__ () at cd.f:5
- Current language:  auto; currently fortran
- (gdb) set language c
- Warning: the current language does not match this frame.
- (gdb) p a
- $2 = "At (COMMON) `x_' plus 0 bytes"
- (gdb) p b
- $3 = "At (COMMON) `x_' plus 4 bytes"
- (gdb) p c
- $4 = "At (EQUIVALENCE) `__g77_equiv_c' plus 0 bytes"
- (gdb) p d
- $5 = "At (EQUIVALENCE) `__g77_equiv_c' plus 0 bytes"
- (gdb) p i
- $6 = "At (EQUIVALENCE) `__g77_equiv_xx' plus 20 bytes"
- (gdb) p xx
- $7 = "At (EQUIVALENCE) `__g77_equiv_xx' plus 1 bytes"
- (gdb) set language fortran
- (gdb)
- @end smallexample
- 
- @noindent
- Use @samp{-fdebug-kludge} to generate this information,
- which might make some programs noticeably larger.
- 
- @emph{Caution:} Future versions of @code{g77} might disregard this
option
- (and its negative form).
- Current plans call for this to happen when published versions of
@code{g77}
- and @code{gdb} exist that provide proper access to debugging
information on
- @code{COMMON} and @code{EQUIVALENCE} members.  This is believed to
have
- happened as of version 0.5.26 of @code{g77}, so that this option has
been
- disabled starting with this release.
- 
  @cindex -femulate-complex option
  @cindex options, -femulate-complex
--- 3163,3166 ----
*************** the same way @code{f2c} does,
*** 8820,8871 ****
  for compatibility with @code{f2c}.
  
- Currently, @code{g77} does not emit ``true'' debugging information for
- members of a @code{COMMON} area, due to an apparent bug in the GBE.
- 
- (As of Version 0.5.19, @code{g77} emits debugging information for such
- members in the form of a constant string specifying the base name of
- the aggregate area and the offset of the member in bytes from the
start
- of the area.
- Use the @samp{-fdebug-kludge} option to enable this behavior.
- In @code{gdb}, use @samp{set language c} before printing the value
- of the member, then @samp{set language fortran} to restore the default
- language, since @code{gdb} doesn't provide a way to print a readable
- version of a character string in Fortran language mode.
- 
- This kludge will be removed in a future version of @code{g77} that,
- in conjunction with a contemporary version of @code{gdb},
- properly supports Fortran-language debugging, including access
- to members of @code{COMMON} areas.)
- 
- Version 0.5.26 of @code{g77} is believed to provide correct and
- complete debug information for COMMON BLOCK and EQUIVALENCE items -
- hence the @samp{-fdebug-kludge} option has been disabled.
- 
- @xref{Code Gen Options,,Options for Code Generation Conventions},
- for information on the @samp{-fdebug-kludge} option.
- 
- Moreover, @code{g77} currently implements a @code{COMMON} area such
that its
- type is an array of the C @code{char} data type.
- 
- So, when debugging, you must know the offset into a @code{COMMON} area
- for a particular item in that area, and you have to take into
- account the appropriate multiplier for the respective sizes
- of the types (as declared in your code) for the items preceding
- the item in question as compared to the size of the @code{char} type.
- 
- For example, using default implicit typing, the statement
- 
- @example
- COMMON I(15), R(20), T
- @end example
- 
- @noindent
- results in a public 144-byte @code{char} array named @samp{_BLNK__}
- with @samp{I} placed at @samp{_BLNK__[0]}, @samp{R} at
@samp{_BLNK__[60]},
- and @samp{T} at @samp{_BLNK__[140]}.
- (This is assuming that the target machine for
- the compilation has 4-byte @code{INTEGER(KIND=1)} and
@code{REAL(KIND=1)}
- types.)
- 
  @node Local Equivalence Areas
  @section Local Equivalence Areas (EQUIVALENCE)
--- 8725,8728 ----
*************** A local @code{EQUIVALENCE} area is a col
*** 8881,8921 ****
  connected to each other in any way via @code{EQUIVALENCE}, none of
which are
  listed in a @code{COMMON} statement.
- 
- Currently, @code{g77} does not emit ``true'' debugging information for
- members in a local @code{EQUIVALENCE} area, due to an apparent bug in
the GBE.
- 
- (As of Version 0.5.19, @code{g77} does emit debugging information for
such
- members in the form of a constant string specifying the base name of
- the aggregate area and the offset of the member in bytes from the
start
- of the area.
- Use the @samp{-fdebug-kludge} option to enable this behavior.
- In @code{gdb}, use @samp{set language c} before printing the value
- of the member, then @samp{set language fortran} to restore the default
- language, since @code{gdb} doesn't provide a way to print a readable
- version of a character string in Fortran language mode.
- 
- This kludge will be removed in a future version of @code{g77} that,
- in conjunction with a contemporary version of @code{gdb},
- properly supports Fortran-language debugging, including access
- to members of @code{EQUIVALENCE} areas.)
- 
- @xref{Code Gen Options,,Options for Code Generation Conventions},
- for information on the @samp{-fdebug-kludge} option.
- 
- Moreover, @code{g77} implements a local @code{EQUIVALENCE} area such
that its
- type is an array of the C @code{char} data type.
- 
- The name @code{g77} gives this array of @code{char} type is
@samp{__g77_equiv_@var{x}},
- where @var{x} is the name of the item that is placed at the beginning
(offset 0)
- of this array.
- If more than one such item is placed at the beginning, @var{x} is
- the name that sorts to the top in an alphabetical sort of the list of
- such items.
- 
- When debugging, you must therefore access members of
@code{EQUIVALENCE}
- areas by specifying the appropriate @samp{__g77_equiv_@var{x}}
- array section with the appropriate offset.
- See the explanation of debugging @code{COMMON} blocks
- for info applicable to debugging local @code{EQUIVALENCE} areas.
  
  (@emph{Note:} @code{g77} version 0.5.18 and earlier chose the name
--- 8738,8741 ----
*** bugs.texi.orig      Thu Dec 21 22:24:28 2000
--- bugs.texi   Tue May 22 21:56:42 2001
*************** for information on how to change the poi
*** 173,196 ****
  @end ifset
  
- @cindex debugging
- @cindex common blocks
- @cindex equivalence areas
- @cindex local equivalence areas
- @item
- Previous versions of @code{g77} didn't emit information on
- variable and array members of common blocks and equivalences
- for use with a debugger (the @samp{-g} command-line option).
- As of the version of @code{g77} shipped with version 3.0 of
- @code{GCC}, this is corrected.
- 
- As of Version 0.5.19, a temporary kludge solution is provided whereby
- some rudimentary information on a member is written as a string that
- is the member's value as a character string.
- 
- @ifset DOC-G77
- @xref{Code Gen Options,,Options for Code Generation Conventions},
- for information on the @samp{-fdebug-kludge} option.
- @end ifset
- 
  @cindex code, displaying main source
  @cindex displaying main source code
--- 173,176 ----

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


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