如何比较.NET中的执行路径?

发布于 2024-08-21 04:48:02 字数 318 浏览 4 评论 0原文

我正在调试 .NET Framework 源代码以查找 错误在我的应用程序中。我有两个类似的代码输入,其中一个显示错误,另一个则没有。然而,沿着代码路径进入 .NET 源代码是相当复杂的。

我想要的是一个可以对两个输入执行并比较结果以查看采用的代码路径、内部值有何不同等的工具...

这适用于 .NET 吗?

I'm debugging into the .NET Framework source code to look for a bug in my application. I have two similar inputs for the code where one exhibits the bug and the other doesn't. However to follow the code path into the .NET source is quite complex.

What I'd like is a tool that can be executed for both inputs and compare the results to see what code paths are taken, how the internal values differ, etc...

Is this available for .NET?

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

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

发布评论

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

评论(6

橘虞初梦 2024-08-28 04:48:02

您可以尝试nCover。它可以向您显示代码覆盖率信息,这可以帮助您确定发生错误时采用了哪些分支。

You could try nCover. It can show you code coverage information which might help you work out which branches are taken when the bug occurs.

始终不够 2024-08-28 04:48:02

您可以尝试 JetBrains DotTrace 并忽略计时。他们提供 30 天的免费试用下载。

You could try JetBrains DotTrace and just ignore the timings. They offer a free 30 day trial download.

梦中的蝴蝶 2024-08-28 04:48:02

正如 Mitch 建议的那样,查看一个分析器,也许是 ANTS。它会给你所有的方法调用,这样你就可以看到正在发生的一切。

As Mitch suggests, check out a profiler, perhaps ANTS. It will give you all the method calls so you can see everything that is going on.

隐诗 2024-08-28 04:48:02

SD C# 测试覆盖工具 将向您显示如果您运行则执行的代码单独的测试用例。

如果您要求它这样做,它还会计算每种情况所覆盖代码之间的差异。这种差异将是一个测试执行的代码,而另一个则不执行。可能这就是你的问题所在。

它不会帮助您获取 .NET 框架的源代码。

The SD C# Test Coverage Tool will show you what code is executed if you run your test cases separately.

It will also compute the difference between the covered code for each case if you ask it to do so. This difference will be the code that one tests executes, that the other does not. Likely that's where your problem is.

It won't help you obtain source for the .NET framework.

奶气 2024-08-28 04:48:02

尝试使用分析器:

如果您有 Visual Studio 2008 企业版(或其他版本)

Try using a profiler:

If you have the Enterprise version of Visual Studio 2008 (or other version)

马蹄踏│碎落叶 2024-08-28 04:48:02

尝试免费的 EQATEC Tracer - 它几乎可以满足您的需求。

它将“跟踪代码”注入到您的应用程序中,该代码将在运行时准确地告诉您执行了哪些方法以及参数是什么。有一些复杂的方法可以微调要跟踪的方法,因为“全部”通常太多了,但如果您确实愿意,只需单击一下即可打开对所有方法的跟踪。

查看此处的主要功能:http://www.eqatec.com/tools/tracer /features

- 并在此处获取它:http://www.eqatec.com/tools/跟踪器

编辑:抱歉,我错过了有关必须深入研究实际 .NET 框架代码的部分。追踪器无法以简单的方式做到这一点。

Try the free EQATEC Tracer - it does pretty much exactly what you're looking for.

It injects "tracing-code" into your application which will at runtime tell you exactly what methods are executed and what the parameters are. There are sophisticated ways of fine-tuning what methods to trace, since "all" is usually too much, but you can turn on tracing for all methods with just one single click if you really want to.

Take a look at the key features here: http://www.eqatec.com/tools/tracer/features

-and get it here: http://www.eqatec.com/tools/tracer

Edit: Sorry, I missed the part about having to dig into the actual .NET framework code. The tracer can't do that in an easy manner.

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