如何在运行时列出一个函数的所有调用? [英] How to list all calls of a function at runtime?

查看:135
本文介绍了如何在运行时列出一个函数的所有调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以列表 (在VS中显示,写入文件) 所有调用者 (对象,函数) 的一个功能,而程序正在运行?可能使用调试器?



我需要记录 所有调用(包括调用者)从程序启动到终止。



源代码或二进制文件的简单扫描不做这项工作,因为程序可以作为接收请求来调用所需函数的服务器。



如果Visual Studio不提供此功能,还有其他的解决方案来解决这个问题吗?解决方案

抽样。





完成后,您可以选择Caller / Callee。





参考:


Is there any way to list (show in VS, write to file) all callers (objects, functions) of a function while the program is running? Possibly using the debugger?

I need to record all calls (including callers) of a function from the launch of the program to its termination.

A simple scan of the source code or the binary does not do the job because the program could operate as a server which receives requests to call the desired function.

If Visual Studio does not provide this feature, are there any other solutions to this problem?

解决方案

VS profiler tool also would be helpful for you, you could select the method "CPU sampling".

After it finished, you could select "Caller/Callee".

Reference:

https://docs.microsoft.com/en-us/visualstudio/profiling/caller-callee-view

Update: We can export the report:

这篇关于如何在运行时列出一个函数的所有调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆