Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ code dependency / call-graph "viewer"? [closed]

is there such a thing as a (free) tool that would display a graph of all functions call in a given function? For instance, if I use it on a complex function fun() I'm trying to understand, it would show me all the functions called by fun() in order, then I would have the possibility to see the same thing for the function called by fun(), and so on. I'm looking for this for C++ code. Does such a thing even exist?

edit : I am using VS 2008 if that helps, but I was thinking that such a software would work on the source files anyway

like image 638
lezebulon Avatar asked Mar 09 '12 10:03

lezebulon


2 Answers

Doxygen can do this. See the CALL_GRAPH configuration option:

If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will generate a call dependency graph for every global function or class method. Note that enabling this option will significantly increase the time of a run. So in most cases it will be better to enable call graphs for selected functions only using the \callgraph command.

like image 109
Greg Hewgill Avatar answered Oct 19 '22 06:10

Greg Hewgill


Yes, Eclipse CDT Call Hierarchy view provides exactly this. Moreover, this view has 2 options:

  • Show Callers
  • Show Callees

You are asking about second one, but I am prefer the first one in code analysis.

like image 26
ks1322 Avatar answered Oct 19 '22 08:10

ks1322