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

Watching a variable change while debugging

david_l_oakley
Beginner
778 Views
I am new to Visual Fortran. I have been using a debugger on an SGI. With that debugger, I can have the program running in debug mode, and every time a variable of my choosing is written from or read to the debugger will break at that point allowing me to examine the program. I have not found anything similar to that with Visual Fortran. My question is if there is a way for me to set a variable (ex. "loft") and have the debugger stop every time that the variable is written to or read from without me having to set a break point at every occurance of that variable?
0 Kudos
6 Replies
Jugoslav_Dujic
Valued Contributor II
778 Views

Debug->Breakpoints (Ctrl+B) -> Data tab. You can set the break wheneverthe value is changed.

Be aware that the feature is little quirky -- it tends to "forget" the value in subsequent debugging sessions (if the variable is out of scope). Best way is to set a normal breakpoint somewhere at variable's initialization and then set or enable the "data" breakpoint.

Jugoslav

0 Kudos
Nick2
New Contributor I
778 Views

It might be that I'm just repeatedly banging my head on the same brick wall and nobody's told me I should best stop; it might be that the brick wall should not be there to begin with, and nobody has acknowledged this; but either way, I cannot get the data breakpoints to work.

I've written a simple program in Fortran, to the effect of hello world, now we asign the values to variables a, b, and c, assign to c some arithmetic expression of a and b, and then I'd F5 the program, break on the first line, and attempt to set a data breakpoint. This breakpoint was unconditionally ignored. Then I figured this might be a wider Micro$oft issue, so I repeated my problem in C++ 2005, effortlessly. My data breakpoints are unconditionally skipped.

But M$ was at best ignoring me, and at worst dancing around the issue on their support forums. So, my question would be,

1) is anyone able to actually use the data breakpoints in VS 2005 with IVF 9.1?

and if you're extremely bored, and the answer to the above question is "no,"

2) can you use the same feature with M$ V$ 2005 C++?

For reference, here are my codes:

program FortranConsole1

implicit none
real a,b,c
c=0
a=0.23
b=0.45
c=a+b

print *, 'Hello World'
print *, c

(note I break on the first line, then set my data breakpoint when c changes. I've tried every combination of variable size, C or C++ language that I can think of.)

#include
using namespace std;


void main()
{
float a,b,c;
(breakpoint) a=.23f;
b=.45f;
c=0;
c=a+b;
cout<<"Hi there!";
(breakpoint) cout<<"What Up Dawg!";
}

(note, at the first breakpoint, I set my data point, as usual).

If anyone can acknowledge this to be a problem, what would be the best strategy to (get the required attention ofthe right people who can and will)fix it?

Seriously, I'd love to move from CVF to IVF, as would a lot of people I've talked to at my company due to execution speeds of the compiled product. But the data breakpoint will make or break the switch.

0 Kudos
Steven_L_Intel1
Employee
778 Views
Submitting an issue to Intel Premier Support is the way to get the attention of the right people.
0 Kudos
Nick2
New Contributor I
778 Views

Premier Support has been very helpful indeed; but once they "reproduce/escalate" the issue, I end up stuck waiting for at least about a month for a response that may require my clarification, and another round of several weeks/months worth of waiting.

0 Kudos
Steven_L_Intel1
Employee
778 Views
Once it has been escalated, it is sent to the developers and you typically won't get more feedback until the developer either fixes the problem or needs clarification. As it happens, I've spoken with the developer in question on this issue in the past and I know he's aware of it. I'll try to find out where he is with it. But please do submit the issue, as the more customers who complain, the higher the priority is. When you do,. tell them that the reference is T68496.

This is a problem in VS2005 only - it works in VS2003.
0 Kudos
Nick2
New Contributor I
778 Views

I already submitted it in June, heh...but I've added the reference number, thanks for the info!

0 Kudos
Reply