g77 assumed length arrays--debugging with gdb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux