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

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

chris-sn
初学者
880 次查看
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 项奖励
1 解答
Les_Neilson
重要分销商 II
880 次查看
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 项奖励
3 回复数
chris-sn
初学者
880 次查看
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 项奖励
Les_Neilson
重要分销商 II
881 次查看
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 项奖励
chris-sn
初学者
880 次查看
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 项奖励
回复