C++ function call routes resolver
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!
I think cppDepend has that functionality (along with other code analysis features)
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.
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
精彩评论