views:

104

answers:

3

Hi!

I'm looking for a tool that will tell/resolve for every function all the call paths (call it "routes") to it.

For example:

void deeper(int *pNumber)
{
 *pNumber++;
}
void gateA(int *pNumber)
{
 deeper(pNumber);
}
void gateB(int *pNumber)
{
 gateA(pNumber);
}

void main()
{
 int x = 123;
 gateA(&x);
 gateB(&x);
}

See? I need a tool that will tell me all the routes to deeper(), and more if possible.

By saying "more" I mean that it will tell me if the pointer is the same as been provided to the calling function.

This will greatly save me time. Thanks!

+5  A: 

Doxygen will do that for you. It'll draw you nice inheritance trees and show you everyone who is calling (and called by) your functions.

Kristo
Was going to suggest that myself.
Ben Voigt
+2  A: 

I think cppDepend has that functionality (along with other code analysis features)

Dror Helper
+1  A: 

you can look at the clang analyzer.

The Clang Static Analyzer is source code analysis tool that find bugs in C/C++ and Objective-C programs.

I didn't tried it but looking at the screenshots of code review, it might be usefull

mathroc