做这样的c++工具存在吗? [我不知道该叫什么]

发布于 2024-09-04 04:32:32 字数 1539 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

桃扇骨 2024-09-11 04:32:32

我认为调用图可能对您有帮助。大多数分析器可以在分析后生成调用图。分析还可以帮助您确定最常使用的代码。

另一种可能性是使用工具生成序列图。这不会具体向您显示运行时期间发生的情况,但它会清楚地说明代码在做什么。

问候
短剑

I think a call graph may help you. Most profilers can generate a call graph after profiling. Profiling can also help you identified what code is being used most often.

Another possibility is using a tool to generate sequence diagrams. This won't show you specifically what happened during runtime, but it will give a clear idea what the code is doing.

Regards
Dirk

魄砕の薆 2024-09-11 04:32:32

探查器或代码覆盖工具会告诉您这一点。

A profiler or code coverage tool will tell you this.

千柳 2024-09-11 04:32:32

您正在寻找一个分析器。这个 StackOverflow 线程将为您提供帮助找到一个。

You are searching for a profiler. This StackOverflow thread will help you to find one.

眼藏柔 2024-09-11 04:32:32

在linux中,我建议 ltrace ,它的作用正是如此你描述。我在 google 上搜索“ltrace for windows”,发现了 dumbug。这有望成为“ltrace for windows”。

In linux, I would suggest ltrace which does exactly what you describe. I googled "ltrace for windows" and found dumbug. This promises to be "ltrace for windows".

¢蛋碎的人ぎ生 2024-09-11 04:32:32

您正在寻找的是一个分析器。在 Linux 系统上,我会说“gprof”,但我无法真正说出 MSVC 选择的工具的名称。

What you are looking for is a profiler. On a Linux system I would say 'gprof', but I can't really name the tool of choice for MSVC.

鱼忆七猫命九 2024-09-11 04:32:32

WinAPIOverride32工具,它可能对您的需要有用。

WinAPIOverride32 tool, it may be useful for your need.

凡间太子 2024-09-11 04:32:32

我最终使用的解决方案是 John Panzer 的 Call Moniter 类。这段代码与我的程序一起运行,并输出函数及其全名(包括类)、调用时以及完成时,使用缩进显示该函数嵌入其他函数的深度。需要进行一些修改才能消除多余的数据,但效果很好。我可能会将其修改为输出到 Excel,而不是按照调用输出到控制台。

感谢大家的回答。纵观所有结果,没有一个能完全完成工作,但这有助于让我了解发生了什么。

一些建议的答案可能有效,但它们都在我的脑海中,或者我无法让它们运行,或者我找不到我正在寻找的功能。

编辑: Call Monitor 类最终成为另一个错误线索。它按照调用顺序显示了被调用的函数名称,并嵌套它们以显示哪些函数调用了哪些函数,这非常棒。我必须过滤掉一些噪音,这很好。但最后,当我查看结果时,这个类错过了整整一半的调用函数!哦,我不知道它是否可以正确地与线程一起工作,因为调用线程的函数是其中一些被跳过的函数。

据我了解,我想要的是一个调用图。

The solution I ended up using is John Panzer's Call Moniter class. This code runs with my program and outputs the functions with their full names(including class), when there are called, and when they are finished, using indentation to show how deep the function is embedded in other functions. It took a little modification to get rid of excess data, but it works beautifully. I will probably modify it to output to excel instead of outputting to the console as called.

Thanks all for your answers. Looking at all the results, none of them quite did the job, but it helped give me an idea of what was going on.

Some of the suggested answers might have worked, but they were all over my head or I could not get them operational or I could not find the functionality I was looking for.

EDIT: The Call Moniter class ended up being another false trail. It showed functions names as they were called, in the order they were called, and nested them to show which functions called which, and that was great. I had to filter out some noise, which was fine. But at the end, when I looked at the results, this class missed a full half of all the functions that were called! Oh, and I dont know if it would work with threads properly, as the functions that called threads were some of those that were skipped over.

From what I understand, what I wanted was a call graph.

甜点 2024-09-11 04:32:32

您可以查看这个用于理解大型代码库的工具问题和< a href="http://www.scitools.com/" rel="nofollow noreferrer">Scientific Toolwork 的理解工具

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文