如何设置一个断点在VS2010中的每个方法 [英] How to set a breakpoint in every method in VS2010

查看:139
本文介绍了如何设置一个断点在VS2010中的每个方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个更大的(C#)与WPF 应用程序正班 M-方法。我想在每一个方法断点的地方,所以每次我在我的应用程序按下按钮或任何方法被调用,我想在VS2010应用程序打的断点。我想了解应用程序的流量/进度。

I have a bigger (c#) WPF application with n-classes and m-methods. I would like to place in every single method a breakpoint, so everytime i press a button in my application or any method gets called, i would like the application in VS2010 to hit that breakpoint. I want to understand the flow/progress of the application.

,因为我有很多方法,我宁可不要手动放置在每一个和他们每个人一个断点。

And since i have many methods i would rather not place manually in every and each of them a breakpoint.

是否有任何命令或工具到处放置在我的VS2010解决了断点?

Is there any command or tool to place everywhere in my VS2010 solution a breakpoint?

修改:可能像下面的插件:的 http://weblogs.asp.net/uruit/archive/2011/08/04/visual-studio-2010-addin-setting-a-class-breakpoint.aspx

edit: maybe something like the following addin: http://weblogs.asp.net/uruit/archive/2011/08/04/visual-studio-2010-addin-setting-a-class-breakpoint.aspx

EDIT2 :有一些答案,但没有人好像向前伸直简单的解决方案。还有别的吗?

edit2: there are some answers but none of them seems like the straight forward easy solution. Anything else?

推荐答案

这个答案建议一个宏为你问,会做,但我个人的建议是使用一个分析器,而不是 - 一个让你暂停,并在飞行(几乎所有的商业剖析的那样)继续分析,然后打在开始分析按钮,你做你的按钮点击之前。在事件探查器查看调用树往往是洞悉了什么应用程序在做什么,比在调试器中逐句通过更多的非常方便的方法。

This answer suggests a macro that will do as you ask, but my personal recommendation would be to use a profiler instead - one that lets you pause and resume profiling on the fly (nearly all of the commercial profilers do), and then hit the "Start Profiling" button just before you do your button click. Viewing the call tree in the profiler is often a very convenient way of gaining insight into what an application is doing, much more than stepping through in the debugger.

更新:此功能在我工作的所谓 OzCode 一个Visual Studio扩展的存在。随着OzCode,当你点击图标旁边的类定义,你会看到QuickAction:

UPDATE: This feature exists in a Visual Studio extension that I'm working on called OzCode. With OzCode, when you click on the icon next to the class definition, you'll see the QuickAction:

这篇关于如何设置一个断点在VS2010中的每个方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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