是否有 Visual Studio 宏可以在类中每个方法的开头设置断点?

发布于 2024-10-07 06:08:23 字数 97 浏览 1 评论 0原文

是否有 Visual Studio 宏(版本 2008 或 2010)可以在类中每个方法的开头设置断点?

我已经看到了参考文献的提示,但我无法挖掘出真正的参考文献。

Is there a Visual Studio macro (either for version 2008 or 2010) to set a breakpoint on the start of every method in a class?

I've seen hints of references, but I've not been able to dig an actual one out.

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

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

发布评论

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

评论(3

鱼忆七猫命九 2024-10-14 06:08:23

名为 OzCode 的 Visual Studio 扩展确实具有在类的所有成员上设置/取消设置断点的功能。我经常使用这个扩展,因为它有一些非常好的调试增强功能。

诚然,我没有太多使用设置/取消设置断点功能,但它是您的一个选择。

A Visual Studio extension named OzCode does have a feature to set/unset breakpoints on all members of a class. I use this extension a lot, as it has some very nice debugging enhancements.

Admittedly though, I haven't used the set/unset breakpoint feature much, but it's an option for you.

好多鱼好多余 2024-10-14 06:08:23

单步执行源代码不是更好吗?

我无法想象为什么在每个方法开始处设置断点会比单步执行更好。无论如何,您最终都会破坏所有地方,而单步执行提供了额外的优势,可以向您显示代码路径的逻辑流程。

可能肯定想学习键盘快捷键,但它们可能取决于您如何设置 VS 环境。在“调试”菜单中查找“单步执行”和“单步执行”项。 (通常,步过是F10,单步进入是F11。)唯一的区别是,如果当前突出显示的行包含函数调用,则单步进入将允许您单步执行被调用函数中的代码(这可能最像您想要做的事情),而单步执行将简单地调用该函数并停止在当前函数中的下一行。

Wouldn't you be better off just single-stepping through your source code?

I can't imagine why a breakpoint at the start of every method would be any better than single-stepping. You're going to end up breaking everywhere anyway, and single-stepping provides the additional advantage of showing you the logical flow of your code paths.

You'll probably definitely want to learn the keyboard shortcut keys, but they can depend on how you have your VS environment set up. Look in your "Debug" menu for the "Step Over" and "Step Into" items. (Normally, Step Over is F10 and Step Into is F11.) The only difference is that, if the currently highlighted line contains a function call, Step Into will allow you to single-step through the code in the called function (this is probably most like what you want to do), while Step Over will simply call the function and stop on the next line in the current function.

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