Does anybody know where I can find a utility/application running on Windows that analyses C source and outputs a functional dependency tree?
What I'm looking for is something along these lines:
PrintString->PrintCharacter->PrintByte->Printf
Does anybody know where I can find a utility/application running on Windows that analyses C source and outputs a functional dependency tree?
What I'm looking for is something along these lines:
PrintString->PrintCharacter->PrintByte->Printf
It's almost certainly overkill, but you can do this for C, C++, PHP, Java, C#, and more with Doxygen (if you have Graphviz dot installed). Here's a page with a sample call tree generated by Doxygen/dot.
Doxygen runs on Windows fine, and can output HTML and a few other formats.
Many tools produce this kind of call-graph. Doxygen may well have the most presentation options for the results, being a "literate programming" tool at its core. The open source tool at http://frama-c.cea.fr/ produces call-graphs (also in the dot format) and tries to group the functions by "services" automatically: http://img23.yfrog.com/img23/8180/9il.png
CodeInsight is a commercial editor that has the functionality of CTAGS/CSCOPE rolled in. It can display call tree graphs (and almost any other relationship) as well.
Source Navigator seems to be in development again (latest release of SourceNav NG was in February of this year). Source Navigator can give you call trees, class dependencies, etc, etc. I have not tried the recent versions. Works on windows or X11.
Tools that read source but don't understand the programming language in a deep semantic sense can only give you an approximation of the call graph. (What if a call occurs in a macro? What if that call occurs inside a disabled preprocessor conditional? What if the call is indirect?) If this is good enough, and you really don't care to know about what indirect calls do, then tools like Doxygen and CScope will probably be helpful.
If you want an accurate call graph, you need a tool constructs one using full knowledge of the langauge. Frama-C (see other answer) AFAIK is one, although I don't know how it handles macros and indirect calls.
Not free, but the DMS Software Reengineering Toolkit and its C front end have full C macro/preprocessor processing capability, and constructs call graphs for a system of files. It specifically includes a points-to analysis in its call graph construction to give you a conservative approximation of where indirect function calls go. See example call graph with black arcs (direct calls) and blue arcs (conservatively analyzed) indirect calls.