This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC/Doc]: Some words about Fortran debugging


Hi Eli,

I added some words in chapter 12 to describe some Fortran specific support.  
Appended is the patch.  I use "made info" to verify that it does works.  
Do I need to do anything other to verify that?  What things I need to keep 
in mind if I want to add something into the document?

As you might know, it is the first time for me to work on texinfo.  So if 
there is anything wrong or inproper, please feel free to correct me.  
Thanks a lot!

Here goes the patch:

Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.282
diff -c -3 -p -r1.282 gdb.texinfo
*** gdb.texinfo	1 Nov 2005 11:09:18 -0000	1.282
--- gdb.texinfo	7 Nov 2005 03:10:21 -0000
*************** function, @code{_NSPrintForDebugger}, de
*** 9089,9094 ****
--- 9089,9153 ----
  @subsection Fortran
  @cindex Fortran-specific support in @value{GDBN}
  
+ @value{GDBN} can be used to debug programs written in Fortran, but it
+ mainly support the old Fortran 77 language features.  For most of these
+ new language feature introduced after Fortran 77 standard, such as
+ derived type, modular, pointer and so on, @value{GDBN} doesn't support
+ yet.  But there are some effort trying to add support for them.
+ 
+ @cindex Add a trailing underscore or not
+ To debug some Fortran compilers generated code, you may need to refer to
+ some variables or functions with a trailing underscore.  GNU Fortran 77
+ and Fortran 95 compiler are among this kind of compilers.  As far as I
+ know, you don't need to do that for IBM's XL Fortran compiler and Intel's
+ Fortran compiler.  If you are not sure, you can use the command completion
+ feature of @value{GDBN} to see whether there is a trailing underscore or
+ not.
+ 
+ @menu
+ * Fortran Operators::           Fortran operators and expressions
+ * Fortran Defaults::            Default settings for Fortran
+ * Special commands::            Special @value{GDBN} commands for Fortran
+ * Known Problems::              Known problems and workaround (if exists)
+ @end menu
+ 
+ @node Fortran Operators
+ @subsubsection Fortran operators and expressions
+ 
+ @cindex Fortran operators and expressions
+ 
+ Operators must be defined on values of specific types.  For instance,
+ @code{+} is defined on numbers, but not on structures.  Operators are
+ often defined on groups of types.
+ 
+ @table @code
+ @item **
+ The exponentiation operator. It raises the first operand to the power
+ of the second one.
+ 
+ @item :
+ The range operator.  Normally used in the form of array(low:high) to
+ represent a section of array.
+ @end table
+ 
+ @node Fortran Defaults
+ @subsubsection Fortran Defaults
+ 
+ @cindex Fortran Defaults
+ 
+ Fortran symbols are usually case-insensitive, so @value{GDBN} by
+ default uses case-insensitive matches for Fortran symbols.  You can
+ change that with the @samp{set case-insensitive} command, see
+ @ref{Symbols}, for the details.
+ 
+ @node Special commands
+ @subsubsection Special commands
+ 
+ @cindex Special commands
+ 
+ @value{GDBN} had some commands to support Fortran specific feature,
+ such as common block display.
+ 
  @table @code
  @cindex @code{COMMON} blocks, Fortran
  @kindex info common
*************** all @code{COMMON} blocks visible at curr
*** 9099,9108 ****
  printed.
  @end table
  
! Fortran symbols are usually case-insensitive, so @value{GDBN} by
! default uses case-insensitive matches for Fortran symbols.  You can
! change that with the @samp{set case-insensitive} command, see
! @ref{Symbols}, for the details.
  
  @node Pascal
  @subsection Pascal
--- 9158,9172 ----
  printed.
  @end table
  
! @node Known Problems
! @subsubsection Known Problems
! 
! @cindex Known Problems
! 
! There are a few known problems while using @value{GDBN} to debug Fortran
! code.  Some of them might even crash GDB or the debugged program.  So
! you need to pay attention to them when using @value{GDBN} to debug Fortran
! program.
  
  @node Pascal
  @subsection Pascal

Regards
- Wu Zhou

P.S: This patch is quite an initial one.  I am mainly use this to solicit 
comment to see if I am on the correct track. 


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