This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: FORTRAN debugging
- To: egcs at egcs dot cygnus dot com
- Subject: Re: FORTRAN debugging
- From: Andy Vaught <andy at maxwell dot la dot asu dot edu>
- Date: Thu, 14 Jan 1999 23:16:25 -0700 (MST)
Craig Burley (burley@gnu.org) writes:
>The debugging-info problem is mostly separate from this, but changing
>this to use the back-end record (`struct' in C) facility is probably
>one of the very first things to get working as part of fixing the
>debug-info problem.
>
>The front-end's decision-making process, regarding the underlying
>type it chooses for an aggregate, might be sensitive enough to
>the underlying types of the Fortran types it knows about to cause it to
>*not* have the same behavior on all targets. I wouldn't assume
>it'd make the same choices without investigating carefully first.
I made a patch available to the g77 folks a while back that appears to
fix the common debug problem in the present incarnation of g77-- anyone
here is welcome to it as well. I've been using the resulting g77 for a
while with no apparent problems.
In both stabs and in the resulting assembly code, variables inside
common blocks appear to be vanilla static variables, just as if they were
SAVEd. What happens is that the compiler generates assembly code that
indeed has the address of a common variable as a base of the common block
plus a constant offset. Since two constants add to a constant, the
assembler generates an instruction that references a constant address. The
addition of the two constants is done later by the linker. Under my
patch, stabs associated with variables are emitted in the same manner by
g77, and fixed up in the same manner by the linker so that in the end,
common variables have constant addresses.
Craig is clearly grappling with a long term "clean" solution, but it is
not clear that the generated code (or stabs) would be any different with a
"struct" solution to the problem. One reason for doing this would be so
that stabs marking the common variables could be output in order that the
gdb 'common' command would work (no real loss IMHO).
Andy
----------------- XOLD(K,IC,I)=
Andy Vaught .... DO ITERS=1, 10 XOLD(K,IC,I)
andy@maxwell.la.asu.edu | | /CALLMSOLVE(A,B,X,I,ITERS,TOL)+(RANNYU(0)
Arizona State University ======|WRITE(6,'(I5,2X,F12.6)')ITERS,TOL -HALF)
Tempe, Arizona USA OOOOOO \ENDDORETURN PARAMETER(ZERO=1.D0)*TENTH*DELTA