This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g77 assumed length arrays--debugging with gdb
- From: Gary W Howell <gwhowell at unity dot ncsu dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 31 Mar 2004 15:42:14 -0500 (EST)
- Subject: g77 assumed length arrays--debugging with gdb
Hi,
I've been writing up some stuff about available debuggers
on our machines.
Starting with gdb
One main use of a debugger is to see values of variables runtime w/o
having to write print statement. Particularly, it's nice to see
sections of arrays.
So far I've found two ways to see assumed dimension array values for g77
programs using the gdb debugger under linux.
1) go to an old version (I have a version I installed in 1998 that
lets me use C syntax to display Fortran arrays) Plausibly I could
install that g77 compiler and gdb as the debug option. Though that
machine only communicates with the rest of the work by floppy disk,
so transferring that program could be a bit tricky. (did that work
because the old g77 translated to C in such a straightforward way that the
back conversion of the array did not break? Is it necessary to have
both old versions of g77 and old versions of gdb? New g77, old gdb?
Or old gdb, new g77? ) But my two or three installations since about
2001 don't seem to work.
2) Avoid g77 and use the Intel ifc compiler. gdb seems to be able
to cope with that (maybe that is the gdb from Intel?)
More Usually, I either get a message
(gdb) p *a
Cannot access memory at address 0x0
or I get a list of blank parentheses.
Looking through g77 websites, I haven't found much hope
of using the current versions of g77 with gdb for the purposes
of examining arrays in subroutines.
I appreciate any assistance.
Regards,
Gary Howell
Applications Scientist for High Performance Computation