ddd
[Top][All Lists]
Advanced

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

Re: printing out arrays in Fortran


From: Andreas Zeller
Subject: Re: printing out arrays in Fortran
Date: 10 Jan 2001 22:42:17 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Hi!

"Sall, David" <address@hidden> writes:

> I am trying to examine the contents of arrays using DDD/GDB with a code
> compiled in Fortran77.  For example, if I have an array that has say 10
> values, how do I examine (print) elements 3 to 8.
> 
>          integer ia(10)
>          do i  = 1,10
>            ia(i)=i
>          end do
>          end 
> 
> I would like to know the value of ia(3) - ia(8). [...]

I don't know too much about GDB's Fortran support, but the GDB
`artificial array' feature should work with Fortran as well.  Simply try

(gdb) print ia(3) @ 5

If this doesn't work, try C syntax (and C array indexes *sigh*)

(gdb) set language c
(gdb) print ia[2] @ 5

For more details, see `artificial arrays' in the GDB manual.

Greetings,

Andreas Zeller

-- 
Andreas Zeller     Universitaet Passau
                   http://www.fmi.uni-passau.de/st/staff/zeller/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]