简体   繁体   English

VS2012调试,不要进入某些自定义例程

[英]VS2012 Debugging, dont step into certain custom routines

i have routines that are used often that I dont want to step into in debugger. 我有常用的例程,我不想在调试器中插入。 Ideally treated much the same way as unmanaged code is. 理想的处理方式与非托管代码的处理方式大致相同。

getting the F10/F11 combinations right is distracting and annoying and is followed by Shift F11. 使F10 / F11组合正确是令人分心和烦人的,然后是Shift F11。 And 1 Shift F11 too many and you are ready to plant your fist through the screen. 1换档F11太多,你准备好通过屏幕播种拳头。 So after yet another round of expletives, Im looking for a solution or tip on how to avoid this issue. 因此,在又一轮咒骂之后,我正在寻找解决方案或提示如何避免这个问题。

Is there a class or method annotation? 是否有类或方法注释? Something I can do so that F11 steps over and not into certain classes or Methods ? 我可以做的事情,以便F11步骤而不是某些类或方法?

DebuggerStepThroughAttribute如何告诉调试器跳过代码。

There's nothing special about unmanaged code debugging in this respect. 在这方面,非托管代码调试没有什么特别之处。 Other than the higher likelihood that you won't have PDB file (or a stripped one) for code that you are not interested in. That works the same in C#. 除了你不会对你不感兴趣的代码有PDB文件(或剥离文件)的可能性更高。在C#中也是如此。 Project + Properties, Build tab, Advanced button, Debug Info setting. 项目+属性,构建选项卡,高级按钮,调试信息设置。

Additional options when debugging C# is the "Just My Code" and "Step over properties and operators" options in Tools + Options, Debugging section and the [DebuggerStepThrough] attribute. 调试C#时的其他选项是Tools + Options,Debugging部分和[DebuggerStepThrough]属性中的“Just My Code”和“Step over properties and operators”选项。 The "Just My Code" option was added to C++ for VS2013. “Just My Code”选项已添加到C ++ for VS2013中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM