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

Setting a breakpoint

YertleTheTurtle
Beginner
895 Views
How do I set a breakpoint in the debugger so that the program stops if a module variable changes anytime during execution?

Thank you
0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
895 Views
In Visual Studio

Debug | Windows | Breakpoints | New | New Data Breakpoint

Jim Dempsey
0 Kudos
abhimodak
New Contributor I
895 Views
Hi

I am a bit confused...I add breakpoints using the "F9" key at the line or simply by clicking on the left most column (beyond line numbers) or by using Debug | Toggle Breakpoint.

On VS2005 there is Debug | New Breakpoint | New Data Breakpoint. Windows--> Breakpoint just takes you to the Breakpoint window. Importantly, however, the New Data Breakpoint option remains greyed out while Break at Function is black. What am I missing?

I set the breakpoint conditions by right clicking the breakpoint in the leftmost column and selecting the appropriate dropdown entry.

For breaking due to change in value, I use the method mentioned by Jim and Jugoslav here: http://software.intel.com/en-us/forums/showthread.php?t=74575&o=d&s=lr

Abhi


0 Kudos
abhimodak
New Contributor I
895 Views
Ah! I missed the simple fact that I need to "start debugging" before "New Data Breakpoint" becomes active....

See: http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/fortran/win/compiler_f/bldaps_for/win/bldaps_use_brpts.htm

Abhi
0 Kudos
YertleTheTurtle
Beginner
895 Views
Hi:

Thanks - it works, once one knows where it is.

If anyone from Intel is listening, here are some observations:

1. New user looking for the debugger manual, tries "help". Only obvious mention of a debugger is the "enhanced debugger for threaded applications". Not obviously what one needs in order to find out how to set a simple breakpoint. After posting question on the forum, eventually find debugger instructions buried at the third level of the Fortran manual. This is not exactly where one would expect to find it.

2. Instructions for "New data breakpoint" explicitly say not to use a Fortran variable name, but to convert to C++ address - e.g. loc(a(5)). Uninitiated user blindly goes and uses a variable name anyway (not knowing any better), and it works.

3. Well, it sort of works. If the breakpoint is set for a variable of a defined type (e.g. a%b), and you (try to) set the breakpoint to a%b (which happens to be an address since "b" is defined to be an integer), you get an error message saying this is not an address. If you set the breakpoint to be simply "a", it works, although this is not really an address. It turns out that the program breaks at the address of the first entry of the defined type "a". What would happen if a breakpoint at a%c was required?

4. The nomenclature "New Data Breakpoint" is confusing for a new user. Try "New Variable Breakpoint", or "New Symbol Breakpoint" or maybe "New Breakpoint for variables" all of which might mean something.

Thanks again to those who answered.
0 Kudos
Steven_L_Intel1
Employee
895 Views
Thanks for the comments. The user interface for the debugger is provided by Visual Studio. so we have no control over that. I'll pass your documentation comments on to our writers. However, when I look at the help and type "debug" into the Index field, I see quite a few entries that seem relevant, even for "Debugging", which includes a subtopic "Fortran debugging example". Were you perhaps looking at some other "help"?
0 Kudos
Reply