zoukankan      html  css  js  c++  java
  • VC++Debug避免F11步进不想要的函数中

      It's often useful to avoid stepping into some common code like constructors or overloaded operators.

      Many times when you debug the code you probably step into functions you would like to step over, whether it's constructors, assignment operators or others. One of those that used to bother me the most was the CStringconstructor. Here is an example when stepping into take_a_string() function first steps into CString's constructor.

      

      Luckily it is possible to tell the debugger to step over some methods, classes or entire namespaces. The way this was implemented has changed. Back in the days of VS 6 this used to be specified through the autoexp.dat file.

      autoexp.dat provides this capability. Add a section called "[ExecutionControl]". Add keys where the key is the function name and the value is "NoStepInto". You can specify an asterisk (*) as a wildcard as the first set of colons for a namespace or class.

      autoexp.dat is only read on Visual Studio's start up.

      To ignore the function myfunctionname, and all calls to the class CFoo:

      [ExecutionControl]

      myfunctionname=NoStepInto

      CFoo::*=NoStepInto

      To ignore construction and assignment of MFC CStrings: (Notice the extra = in CString::operator=.)

      [ExecutionControl]

      CString::CString=NoStepInto

      CString::operator==NoStepInto

      To ignore all ATL calls:

      [ExecutionControl]

      ATL::*=NoStepInto

            -------------------------------------------------------------------------分割线-----------------------------------------------------------------------------------------

      Since Visual Studio 2002 this was changed to Registry settings. To enable stepping over functions you need to add some values in Registry (you can find all the details here):

    • The actual location depends on the version of Visual Studio you have and the platform of the OS (x86 or x64, because the Registry has to views for 64-bit Windows)
    • The value name is a number and represents the priority of the rule; the higher the number the more precedence the rules has over others.
    • The value data is a REG_SZ value representing a regular expression that specifies what to filter and what action to perform.

      To skip stepping into any CString method I have added the following rule:

      

      Having this enabled, even when you press to step into take_a_string() in the above example the debugger skips the CString's constructor.

      Additional readings:

  • 相关阅读:
    关于CSS自文档的思考_css声明式语言式代码注释
    html5中contenteditable属性如果过滤标签,过滤富文本样式
    web前端工程化/构建自动化
    Python连载19-装饰器
    Java连载1-概述&常用的dos命令
    HTML连载18-id选择器与class区别&class选择器使用思路&后代选择器
    Python连载18-closure闭包解释及其注意点
    HTML连载17-id选择器&类选择器
    Python连载17-排序函数&返回函数的函数
    HTML连载16-颜色控制属性2&标签选择器
  • 原文地址:https://www.cnblogs.com/MakeView660/p/8442831.html
Copyright © 2011-2022 走看看