C++函数调用路由解析器
我正在寻找一种工具,可以告诉/解析每个函数的所有调用路径(称为“路由”)。
例如:
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);
}
看到了吗? 我需要一个工具来告诉我所有通往 Deep() 的路径,如果可能的话,还需要更多。
通过说“更多”,我的意思是它会告诉我指针是否与提供给调用函数的指针相同。
这将大大节省我的时间。 谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为 cppDepend 具有该功能(以及其他代码分析功能)
I think cppDepend has that functionality (along with other code analysis features)
Doxygen 将为您做到这一点。它会为您绘制漂亮的继承树,并向您显示正在调用(以及被调用)您的函数的每个人。
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.
您可以查看 clang 分析器。
我没有尝试过,但看看代码审查的屏幕截图,它可能很有用
you can look at the clang analyzer.
I didn't tried it but looking at the screenshots of code review, it might be usefull