www.delorie.com/gnu/docs/gcc/g77_528.html   search  
Buy the book!

Using and Porting GNU Fortran

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13. Debugging and Interfacing

GNU Fortran currently generates code that is object-compatible with the f2c converter. Also, it avoids limitations in the current GBE, such as the inability to generate a procedure with multiple entry points, by generating code that is structured differently (in terms of procedure names, scopes, arguments, and so on) than might be expected.

As a result, writing code in other languages that calls on, is called by, or shares in-memory data with g77-compiled code generally requires some understanding of the way g77 compiles code for various constructs.

Similarly, using a debugger to debug g77-compiled code, even if that debugger supports native Fortran debugging, generally requires this sort of information.

This section describes some of the basic information on how g77 compiles code for constructs involving interfaces to other languages and to debuggers.

Caution: Much or all of this information pertains to only the current release of g77, sometimes even to using certain compiler options with g77 (such as `-fno-f2c'). Do not write code that depends on this information without clearly marking said code as nonportable and subject to review for every new release of g77. This information is provided primarily to make debugging of code generated by this particular release of g77 easier for the user, and partly to make writing (generally nonportable) interface code easier. Both of these activities require tracking changes in new version of g77 as they are installed, because new versions can change the behaviors described in this section.

13.1 Main Program Unit (PROGRAM)  How g77 compiles a main program unit.
13.2 Procedures (SUBROUTINE and FUNCTION)  How g77 constructs parameter lists for procedures.
13.3 Functions (FUNCTION and RETURN)  Functions returning floating-point or character data.
13.4 Names  Naming of user-defined variables, procedures, etc.
13.5 Common Blocks (COMMON)  Accessing common variables while debugging.
13.6 Local Equivalence Areas (EQUIVALENCE)  Accessing EQUIVALENCE while debugging.
13.7 Complex Variables (COMPLEX)  How g77 performs complex arithmetic.
13.8 Arrays (DIMENSION)  Dealing with (possibly multi-dimensional) arrays.
13.9 Adjustable Arrays (DIMENSION)  Special consideration for adjustable arrays.
13.10 Alternate Entry Points (ENTRY)  How g77 implements alternate ENTRY.
13.11 Alternate Returns (SUBROUTINE and RETURN)  How g77 handles alternate returns.
13.12 Assigned Statement Labels (ASSIGN and GOTO)  How g77 handles ASSIGN.
13.13 Run-time Library Errors  Meanings of some IOSTAT= values.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003