Monitoring flow of program in Visual C++

Hello CppGurus,
I am wondering if there is any program out there that could map out the flow of program in Visual C++ 6.0.

I do modify MRI sequence code written by Siemens and only Visual C++ 6.0 is supported. So, I am forced to use this older version. Also, their codes lack proper documentations.

Typically, a sequence code has usually 5-10 files (headers and sources). There are four main functions: initialization, preparation, check, run. So, flow among these codes is obvious. However, these function calls several other functions (say few hundereds) from within the project and libraries and it’s extremely tough to figure out the flow by using pen and paper.

As a MRI physicist, I just have to change various parts of code to accomplish my task. However, the lack of proper documentation makes it a guess work. Also, given that my C++ experience is at intermediate level, it takes me lots of hard work to figure out where I should make the change.

I am looking some free/ not-so-expensive tools that are compatible with Visual C++ 6.0 and later versions. Though I would prefer free tools, I am okay with buying provided it should not cost me more than a couple of hundred euros (~200-300).

What am I trying to do:
1) Find out the flow of program.
2) I should be able to monitor how the value of a particular variable changes during runtime. For instance, my sequence development would be a lot faster if I could have information like:
The value of variable A was changed at “line no 1000 of code-X”, “line 502 of code-Y” and “line no 10 of code-Z”.

Thanks in advance,
Dushyant
Last edited on
You can use the debugger of Visual Studio for doing this -- such a code project would certainly be extremely difficult to manage without using a debugger.

Here's an article that describes the debugger in quite some detail, although it's written for Visual Studio 2010 : http://www.codeproject.com/Articles/79508/Mastering-Debugging-in-Visual-Studio-2010-A-Beginn

I don't know to what extent the Visual C++ 6.0 debugger interface will be identical to this (the article mentions certain features that were added for VS 2010 and later versions, even though it says that many things are common in older versions), although the main structure and notions involved should be pretty much unchanged.


If you experience problems in debugging with VC++ 6.0, -- e.g. I read here ( http://en.wikipedia.org/wiki/Visual_C%2B%2B ) that:
There are, however, issues with this version under Windows XP, especially under the debugging mode (for example, the values of static variables do not display).
, this second link mentions further down that a "Visual C++ 6.0 Processor Pack" can be used to solve those issues under Windows 98, Windows NT 4.0 and Windows 2000.

If you experience debugging problems you could also download the current "Express" version of Visual Studio (which is free), and use it to open your VC++ 6.0 project, use the debugger as described in the first link I gave, and then once you determine the changes that need to be made to your headers and source files, and make those changes, compile your corrected headers and sources using your original VC++ 6.0 project and Visual Studio version (as the headers and sources will now have your changes applied to them).

Hope this helps you in some way,

Ogoyant
Last edited on
Thanks Ogoyant.

I really appreciate your help.

Regards,
DK

You're welcome DK, glad it helped you.

Ogoyant
Last edited on
Topic archived. No new replies allowed.