Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28591 Discussions

Using Watch..and how to search help and this forum?

chris-sn
Beginner
473 Views
Two related questions...

1. I have a large FORTRAN program with many subroutines, somewhere along the line a common block variable is getting overwritten. Is there some way I can set up a watch so that I can step over and through chunks of code looking for the place that the overwrite happens?

2. I spent a frustrating time trying to find something in the online Help, or on this website, that I could search to find out if this question had already been answered. All I could find was a general search for the whole of the Intel site. Am I going blind...what am I missing ???

Thx

Chris
0 Kudos
1 Solution
Les_Neilson
Valued Contributor II
473 Views
1. Insert a break point at the start of your program.
1.1 start debugging your program. When it stops at your breakpoint then get the address of the variable you want to watch. (e.g. in a watch window type LOC(commonVariable) +right click and select Hexadecimal display, which will give you the address of the variable)
1.2 select Debug->New Breakpoint->New Data Breakpoint and enter the address of the variable yu are "watching". (leave the language as C )
This will cause the program to break whenever the value of the variable changes.


Just above the list of threads there is a dark grey bar with :
"Threads in forum ..." [] Subscribe to the forum "SEARCH FORUM" ......

Les

View solution in original post

0 Kudos
3 Replies
chris-sn
Beginner
473 Views
Ah, some progress by downloading the chm file from here:
C:\Program Files\Intel\Compiler\11.1\060\Documentation\en_US\compiler_f\compiler_documentation_f.htm

I now have a searchable resource that tells me how to use Watch on a module variable as opposed to a COMMON variable.

Close, but no cigar
0 Kudos
Les_Neilson
Valued Contributor II
474 Views
1. Insert a break point at the start of your program.
1.1 start debugging your program. When it stops at your breakpoint then get the address of the variable you want to watch. (e.g. in a watch window type LOC(commonVariable) +right click and select Hexadecimal display, which will give you the address of the variable)
1.2 select Debug->New Breakpoint->New Data Breakpoint and enter the address of the variable yu are "watching". (leave the language as C )
This will cause the program to break whenever the value of the variable changes.


Just above the list of threads there is a dark grey bar with :
"Threads in forum ..." [] Subscribe to the forum "SEARCH FORUM" ......

Les
0 Kudos
chris-sn
Beginner
473 Views
Les, that's excellent thank you. Actually I guess the same technique works inpretty much any situation or language where you are watching a static memorylocation, so double thanks!

Thanks also forpointing out the search facility, yes it was me going blind then (or, as my wife would put it, "man looking").

0 Kudos
Reply