I currently use Intel Visual Fortran 2013 with Visual Studio 2012. I am working with a large 3rd party program including dozens of source files with thousands of lines of code. To facilitate understanding/debugging the code, I have two questions:
1) Does there exist a way, while stepping through the code, to determine all NEWLY assigned variables? Currently I use a whole lot of Debug.Print on the command line to determine what such and such variable is. However I would like to determine only the variables updated by the most recent step.
2) Does there exist a way to visualize some of the modular, function and subroutine calls in this large program? Does Visual Studio 2012 coupled with Intel Fortran provide a way to generate, say a flowchart for the call stack or anything visual to help me work with this program?
In the debugger you have a locals watch window and you can assign any variable to user watch window. As you step variables values that have changed go red in the watch windows.
I am already familiar with the watch window. However my program contains hundreds if not thousands of variables and derived types. What I was wondering is if there was any programmatic (say using the command window or other) way to determine only the newly assigned variables from one step to another.
Such a tool would need to know the address and type of every variable you want to check even for non static ones for which the address is known only at subroutine entry.
That would be an interesting feature: Memory Changed window (symbolic) and at entry into debugger (step or break).
You could write a trace subroutine that does this, but this would be a lot of editing (maybe not so bad if you restrict the activity to a few places). The subroutine would contain a capture area (user defined type) and a flag to indicate if capture only or display changed variables then capture. The flag can be a global variable that you can set or clear using the debugger. Start with it set to capture-only. Run to break point of interest, edit flag to display and capture, then step through calls.
back to the original post I think the answer to 1] is no. As for 2) the call stack is shown in the drop downs on the tool bar or are you looking for a call 'MAP' of application?
I sounds to me that you have a (badly documented?) application you have inherited and you are at the stage of trying to understand how it works.
The call stack helps but what I could really use is, like you said, a call MAP.
I believe the software is reasonably well documented. It would be more accurate to blame my confusion on my beginner skills in code development....
In VS, go to Tools > Options > Text Editor > Fortran > Advanced. Change "Collect Calls/Caller Graph Information to True. (You may also want to set everything on this page except Disable Database to True.) Close and restart VS.
Open your project. Right click on the main program and select Call Browser > Show Call Graph in New Window. The call graph will appear at the first level - you can then expand as desired by clicking on the triangles next to names.
I've also enabled the other features in the Advanced Text Editor Options (except for the "Disable Database" as you mentioned). Just off the top of your head, what other similar/not so similar features to the Caller/Call Graph have I unlocked? It would be helpful to know how else I can facilitate navigating through the Fortran Code....
Find Declarations and Find References for one. See Using Source Editor Enhancements in Visual Studio. (Link is to 17.0 docs, will become invalid when a future major version is released, but you can find it under Getting Started > Using Microsoft Visual Studio.