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

tracking variables in intel fortran studio

steve_konarski
Beginner
1,381 Views
In digital visual fortran you could click on EDIT>BREAKPOINTS then on the tab DATA and put the name of the variable you wanted to track and it was great - you can track up to 3 break points - if i put more in then the program would crash ,

BUT in intel you bring up NEW BREAKPOINT on DEBUG tab and it asks you foar an ADDRESS and gives an example x12345678 ????? what on earth does this mean , is there an euivalnet system that was o DIGITAL which worked great.
0 Kudos
1 Solution
abhimodak
New Contributor I
1,381 Views
Steve and Rob

(1) In one of the posts by Jim Dempsey or Jugoslav, it was pointed out that LOC() intrinsic function can be used as well. I often use it to "break in" when the values of the variable changes. Thus, the fortran variable is "this" then (a) I first put a regular breakpoint at some location where variables this in scope, (b) when the program comes to this point, I use Debug > new breakpoint > New Data Breakpoint and in the corresponding address window type LOC(this).

(2) The above works for array elements as well; I type LOC(array(m)) to break when the value of array(m) changes.

(3) In VS 2005 and 2008, I don't see anoption for selecting Fortran as the langauge. I keep "C" when using LOC mentioned above.

(4) Additional options for printing message and running macro along with continuing execution can be used.

Abhi

View solution in original post

0 Kudos
6 Replies
Rob_Mueller-Albrecht
1,381 Views
Dear Steve,

the behavior you are commenting on is actually not specific to any of Intel's extensions to the Microsoft Visual Studio*. It rather is a standard Visual Studio* dialog box.

In Visual Studio* 2008 for instants you go to Debug > new breakpoint > New Data Breakpoint.

This will then bring up the dialog box you mentioned.

To add data breakpoints you can either provide a virtual hexaddress "0x12345678" or you can provide an expression to be evaluated "&expresssion". This follows standard C expression syntax.

In addtion you may want to specify the byte length for the breakpoint and in the language entry you may want to selectFortran so the expression you pick can be properly resolved.

Thanks, Rob
0 Kudos
abhimodak
New Contributor I
1,382 Views
Steve and Rob

(1) In one of the posts by Jim Dempsey or Jugoslav, it was pointed out that LOC() intrinsic function can be used as well. I often use it to "break in" when the values of the variable changes. Thus, the fortran variable is "this" then (a) I first put a regular breakpoint at some location where variables this in scope, (b) when the program comes to this point, I use Debug > new breakpoint > New Data Breakpoint and in the corresponding address window type LOC(this).

(2) The above works for array elements as well; I type LOC(array(m)) to break when the value of array(m) changes.

(3) In VS 2005 and 2008, I don't see anoption for selecting Fortran as the langauge. I keep "C" when using LOC mentioned above.

(4) Additional options for printing message and running macro along with continuing execution can be used.

Abhi
0 Kudos
steve_konarski
Beginner
1,381 Views
Abhi

thanks for the reply

you are right about statement (3) there does not appear to be a fortran option , - in digital visual fortran (DVF) this tracking was great - howvere if you put more than 3 variables to be tracked you got a crash with visial studio,

I will try LOC() but it seems cumbersome to the DVF facility which was invalubale

One Plus pint for INTEL is that if you have a library included in your build and also have a subroutine from the library in your program source , it will pick up the program source version when running and not the the library version when you run the program


steve
0 Kudos
steve_konarski
Beginner
1,381 Views
Abhi and Rob

I debugged the program and put a breakpoint at a specific location , then in thw WATCH window typed in loc(aa(21)) and loc(item) for 2 variables that i needed tracking , I got the addresses say 23221245 and 23221298 , then inserted these addresses as such in the "NEW DATA BREAKPOINT" dialog box( dont use quotes - just the number ) and found this worked fine and I could track my variables,

thanks to both of you steve
0 Kudos
abhimodak
New Contributor I
1,381 Views
Hi Steve

One quick point: you don't have to copy the address from the watch window. You can directly use the LOC() in the address textbox of the "NEW DATA BREAKPOINT".

Abhi
p.s. Thanks are passed to Jim/Jugoslav.
0 Kudos
steve_konarski
Beginner
1,381 Views

Thanks Abhi will try that , this had been a huge relief, since i found INTEL fortran very lacking without being able to use this facility

steve

0 Kudos
Reply