Problem with track command in pgdbg

Hi all, I’m a new user to pgdbg and a somewhat new user to unix so please bear with me.

I’ve been trying to understand pgdbg and the track command on a very simple Fortran program. Here is the code (courtesy of J.J. Hogan-O’Neill Summer 2005):

program debugtest
implicit none
integer :: i,myarray(5)
do i=1,6
myarray(i)=2i
write(
,*)i,myarray(i)
enddo
stop
end program debugtest

I know the array goes out of bounds but whenever I try using track i, I get the following error:

ERROR: No current thread.

Any help would be appreciated. Thanks!

PGDBG requires that the program be loaded into memory before it can execute the track command. This can be accomplished by simply setting a breakpoint at “main” and running to that breakpoint.

Here is a sample debug session using your test program that demonstrates this:

$ pgdbg -text track
PGDBG 11.9-0 x86-64 (Cluster, 256 Process)
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved.
Loaded: /home/donb/current/track/track

pgdbg> track myarray(2)
ERROR: No current thread

pgdbg> b main
(1)breakpoint set at: debugtest line: "track.f90"@4 address: 0x4024C4 
1
pgdbg> r
libpthread.so.0 loaded by ld-linux-x86-64.so.2.
librt.so.1 loaded by ld-linux-x86-64.so.2.
libm.so.6 loaded by ld-linux-x86-64.so.2.
libc.so.6 loaded by ld-linux-x86-64.so.2.
Breakpoint at 0x4024C4, function debugtest, file track.f90, line 4
 #4:     do i=1,6

pgdbg> track myarray(2)
Initial value is: 0
 2: track myarray(2)  [0] 
2
pgdbg> c
            1            2

The watched expression: myarray(2) 
has changed.  The new value is: 4
            2            4
            3            6
            4            8
            5           10
            6           12
FORTRAN STOP
(Process Exited)

pgdbg> quit

Thanks for the help donb! This will make my life easier!