For Programmers: Free Programming Magazines  


Home > Archive > Fortran > March 2007 > How to inspect an array value in gdb?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to inspect an array value in gdb?
www

2007-03-27, 7:09 pm

Hi,

I am stepping through my Fortran program using gdb. I hope to inspect an
array value. I cannot make it. My array is smc(*). My program line I am
inspecting is:

if(smc(1) .eq. -1) then
...



I set a break point here. Now in gdb, after reaching this line, I want
to see the value of smc(1). How can I do it? I did the following based
on Google,

(gdb)print smc(1)

It gives a very strange number. I guess it is memory address.

Thank you very much.
FX

2007-03-27, 7:09 pm

> I am stepping through my Fortran program using gdb. I hope to inspect
> an array value. I cannot make it. My array is smc(*).


What compiler and OS?

--
FX
www

2007-03-27, 7:09 pm

FX wrote:
>
> What compiler and OS?
>

Sorry. I am running on Linux RedHat. Compiler: pgf90. I am using gdb
from gnu.
FX

2007-03-27, 7:09 pm

> Sorry. I am running on Linux RedHat. Compiler: pgf90. I am using gdb
> from gnu.


Hum. gdb segfaults when I try to run it on pgf90-compiled code, so I
won't be able to help you :(

--
FX
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com