Tool to visualise code flow (C/C++) [closed]
Do you have any sugestions of tools to ease the task of understanding C/C++ code? We just inherited a large piece of software written by others and we need to quickly get up to speed on it. Any advice on tools that might simplify this task?
SourceInsight and Understand for C++ are the best tools you can get for c/c++ code analysis including flow charts.
Profiling software gives you an idea of which functions have been called.
If you can use Linux, try KCachegrind
Doxygen is very good at generating diagrams from code without applying markup, if you turn on the EXTRACT_ALL option. You need GraphViz installed to get diagrams generated with the HAVE_DOT setting. I find having it installed and leaving the DOT_PATH blank works fine on Windows but on OS/X keep having to point directly to the dot tool location.
There's an excellent Code Spelunking article in ACM Queue which talks more about using doxygen and DTrace.
Personally, I use the debugger. Run through the code and see what its doing, and where its going is the only way.
However, you can run it through some documentation-generators which (sometimes) help. A good example is doxygen.
KScope, built upon the cscope utility, if you're on linux (KDE). The best thing I ever used (and use all the time) to deleve into some huge piece of unfamiliar code which I have to modify somehow or which API I'm to employ for my needs. Among its features are the cross-reference database, which can be searched in a plenty of ways: you can find all references of a symbol, its global definition, find callers/callees of a function and much more. It even has a built-in IDE and an ability to show a call-graph.