public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: FORTRAN debugging
@ 1999-01-31 23:58 N8TM
  1999-01-31 23:58 ` Theodore Todorov
  1999-01-31 23:58 ` Dave Love
  0 siblings, 2 replies; 12+ messages in thread
From: N8TM @ 1999-01-31 23:58 UTC (permalink / raw)
  To: Theodore.Todorov, egcs

In a message dated 1/6/99 7:52:32 AM Pacific Standard Time,
Theodore.Todorov@cern.ch writes:

<< I tried gdb 4.17 (via ddd 3.1.2) on some code compiled
 with g77 (egcs 1.1b version), and couldn't
 print or display floating point variables >>
You didn't state your compiler options.  If you wish to see local variables in
gdb with -O, you must make them SAVE variables or use equivalent compiler
options.  As you saw, the rest is on the TODO list.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* FORTRAN debugging
@ 1999-01-31 23:58 Theodore Todorov
  1999-01-31 23:58 ` Dave Love
  0 siblings, 1 reply; 12+ messages in thread
From: Theodore Todorov @ 1999-01-31 23:58 UTC (permalink / raw)
  To: egcs

Hello,

Is there a combination of g77 and gdb versions that allows
reasonable debugging of FORTRAN source?
I tried gdb 4.17 (via ddd 3.1.2) on some code compiled
with g77 (egcs 1.1b version), and couldn't
print or display floating point variables, while arrays
in common blocks were definitely unreachable.

After digging through the documentation a bit I found
that gdb does not support FORTRAN, and that g77
has no debugging support yet for common blocks.

Is this really the situation?

                 Thank you in advance,
                            Teddy Todorov (t.todorov@cern.ch)

P.S. Please reply to my mail address above, since I am not
subscribed to the egcs list - the list archieves on the web
are so convinient!



^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: FORTRAN debugging
@ 1999-01-31 23:58 Andy Vaught
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Vaught @ 1999-01-31 23:58 UTC (permalink / raw)
  To: egcs

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1999-01-31 23:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-31 23:58 FORTRAN debugging N8TM
1999-01-31 23:58 ` Theodore Todorov
1999-01-31 23:58   ` Dave Love
1999-01-31 23:58     ` Craig Burley
1999-01-31 23:58       ` Toon Moene
1999-01-31 23:58         ` Craig Burley
1999-01-31 23:58           ` Toon Moene
1999-01-31 23:58             ` Craig Burley
1999-01-31 23:58 ` Dave Love
  -- strict thread matches above, loose matches on Subject: below --
1999-01-31 23:58 Theodore Todorov
1999-01-31 23:58 ` Dave Love
1999-01-31 23:58 Andy Vaught

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).