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

How to watch a variable

aj10599
Beginner
854 Views

Does anyone knowan easyway to "watch" a variable? (i.e. detect when it changes)

using the debbugger?

0 Kudos
5 Replies
kooka
Beginner
854 Views
you mut place a breakpoint in your code, and then in debug mode, place the mouse icon on the variable you want to know, instead you can select it and press the quikwatch icon
0 Kudos
Steven_L_Intel1
Employee
854 Views
This is available as long as you are not using the bundled Visual Studio 2005 Premier Partner Edition. When you are in the program unit with the variable, select Debug > New Breakpoint > New Data Breakpoint. Enter the name of the variable. Leave the "language" as C.

I will comment that this often does not work.
0 Kudos
aj10599
Beginner
854 Views

Is there a way to get the program to break if the variable changes? (This is not the

same as conditional breakpoint which assumes a location)

0 Kudos
aj10599
Beginner
854 Views

You are right about "that this often does not work". It was asking for "address" so I

did a LOC(varname) in the itermediate window and put a number in for address (very awkward.)This worked for a while; however,when I reinstalled VS5 (PPE.exe) the"New Data Breakpoint" does not even appear as a selection when the debugger breaks.Is there a simple way to get the debugger to stop when it detects a change in a variable?

0 Kudos
Steven_L_Intel1
Employee
854 Views
As mentioned in the Release Notes, data breakpoints are not available when you're using VSPPE. This requires a "retail" version of VS. This was not intentional and we are working with Microsoft to see if we can resolve it in the future (it requires Microsoft's assistance.)

Data breakpoints in Visual Studio have never worked well in my experience, going back to VS97. You ought to be able to just type a variable name there - sometimes it works, sometimes it doesn't. Watching an address is somewhat more reliable, if that's available to you.
0 Kudos
Reply