Visual Studio 2008中调试 - 跳过代码 [英] Visual Studio 2008 Debugging - Skipping code

查看:123
本文介绍了Visual Studio 2008中调试 - 跳过代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法跳过代码,而无需后设置一个断点?我使用的调试与运行很多次GUI写生活动探索的代码。我希望看到完成活动后无需点击旁边一堆次触发什么来。


解决方案

  [DebuggerHidden] 

当这个属性附加到一个构造函数/方法/属性或索引则该代码是从调试器隐藏,它不会是可能为你踏入代码,调试器将只跳过代码。即使您设置内部装饰与此属性的代码片断中的一个断点,调试器会忽略它。

  [DebuggerStepThrough] 

这属性是一样的DebuggerHiddenAttribute,除了事实,你可以设置一个断点已被饰以DebuggerStepThroughAttribute里面的代码,调试器将在断点处停止。

  [DebuggerNonUserCode] 

该属性标记代码不被用户代码段,你可以再与工具 - 使用此>选项 - > Debugging->常规 - >启用仅我的代码,选项告诉调试器不要踏入装饰代码。


Is there a way to skip code without having to set a breakpoint after it? I am using the debugging to explore code with a GUI painting event that runs lots of times. I wish to see what comes after the event is done triggering without having to click next a bunch of times.

解决方案

[DebuggerHidden]

When this attribute is attached to a constructor/method/property or indexer then that code is hidden from the debugger, it will not be possible for you to step into the code, the debugger will just skip over the code. Even if you set a breakpoint inside one of the pieces of code decorated with this attribute, the debugger will ignore it.

[DebuggerStepThrough]

This attribute is the same as the DebuggerHiddenAttribute, apart from the fact that you can set a breakpoint inside the code which has been decorated with the DebuggerStepThroughAttribute, and the debugger will stop at the breakpoint.

[DebuggerNonUserCode]

This attributes marks a section of code as not being user code, you can then use this with the Tools->Options->Debugging->General->Enable Just My Code, option to tell the debugger not to step into the decorated code.

这篇关于Visual Studio 2008中调试 - 跳过代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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