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

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

问题描述

有没有办法跳过代码,而不必设置断点?我正在使用调试来浏览具有很多次的GUI绘画事件的代码。我希望看到事件完成后触发的是什么,而不必单击下一次。

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]

此属性与DebuggerHiddenAttribute相同,除了可以在使用DebuggerStepThroughAttribute进行装饰的代码中设置断点之外,调试器将在断点处停止。

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]

此属性将一段代码标记为不是用户代码,然后可以使用Tools-> Options-> Debugging-> General-> Enable Just My Code(选项)来告知调试器不要进入装饰的代码。

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天全站免登陆