|
| View previous topic :: View next topic |
| Author |
Message |
tboland
Joined: 24 Oct 2011 Posts: 2
|
Posted: Tue Oct 25, 2011 2:59 pm Post subject: 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)=2*i
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! |
|
| Back to top |
|
 |
donb
Joined: 20 Jul 2004 Posts: 82 Location: The Portland Group, Inc.
|
Posted: Wed Oct 26, 2011 9:32 am Post subject: |
|
|
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:
| Code: |
$ 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
|
|
|
| Back to top |
|
 |
tboland
Joined: 24 Oct 2011 Posts: 2
|
Posted: Wed Oct 26, 2011 10:00 am Post subject: |
|
|
| Thanks for the help donb! This will make my life easier! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|