Software Archive
Read-only legacy content
17060 Discussions

Does anyone else think this would be a useful feature

Intel_C_Intel
Employee
476 Views
I think this is the appropriate forum to discuss the following. I would dearly love to have the feature during debugging to dump out all the variables in a routine to an ascii file (with their names and values) at anytime during program execution. This would then allow me to do a differences using Windif between two files (generated from different versions of the code) and immediately pinpoint where an updated version of the code has introduced a bug that causes different results for a given variable from the older version of the code.

As it stands right now, I have to go through the program stopping at various locations and examine a bunch of variables that may or may not be different between the two versions. Once I find a difference, I commonly have to backtrack through the code until I find what is causing the initial difference as just about all the computations depend on previous computations. Needless to say, this is a laborious task that could save me days and weeks of debugging time if only I had the ability to do a differences among all variables at a given point in the code.

Since much of the development work nowadays consists of porting legacy code to F90/F95 and/or the Windows environment, it seems that others would find this useful too. One has the original code that supposedly gives the "correct" result and you have a new code that is being updated. Any differences between the two codes should be a result of a bug being introduced (unless one is adding new features). If this feature were available, there would be no need to spend hours/days/weeks finding out where the differences are in the code.

I alluded to this once before in one of my prior threads, but there wasn't much of a response. It seems like this would be an easy feature to implement in the debugger and, for me at least, would be well worth the investment to upgrade to a new version. Anyone else think this would be worthwhile?

Tom
0 Kudos
4 Replies
Steven_L_Intel1
Employee
476 Views
Actually, it's very difficult to implement in the debugger, as MS currently has it structured. We get called if you ask to examine a variable, but there's little opportunity to do a dump of everything.

Suggestion - define a NAMELIST group of all your variables, and insert NAMELIST write statements in your code at intervals. This will give you the names and values of every variable in the group.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
476 Views
Yet another suggestion is that select & copy (Ctrl+C) does work in 'Variables' debugger window and paste to a text file works fine... 90% automated :-). Unfortunately, this is limited to local variables only.
0 Kudos
Intel_C_Intel
Employee
476 Views
Select and copy also works with the watch windows. Although Ctrl+A doesn't work, it is possible to select all using Shift+[Up|Down]arrow. I like to paste into an Excel worksheet, since the results are separated into three columns.
0 Kudos
Intel_C_Intel
Employee
476 Views
Thanks for all the info. I've tried the copy in the variables window, but I have way too many arrays that each have to be expanded in the hydrodynamics portion of the code for this to be useful. The reason why I thought this would be easy to implement is precisely because all the local variables are available in the variables window during debugging. If the values are already available, I thought that it would be relatively simple to write them to a file. Oh well........

Tom
0 Kudos
Reply