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:

VC++Debug避免F11步进不想要的函数中的更多相关文章

  1. VC Debug和Release区别

    https://msdn.microsoft.com/en-us/library/xz7ttk5s.aspx   Optimizing Your Code Visual Studio 2015 The ...

  2. ES6 箭头函数中的 this?你可能想多了(翻译)

    箭头函数=>无疑是ES6中最受关注的一个新特性了,通过它可以简写 function 函数表达式,你也可以在各种提及箭头函数的地方看到这样的观点——“=> 就是一个新的 function”. ...

  3. 怎么查看CI,codeigniter的版本信息?想看某个项目中使用的CI具体是哪个版本,怎么查看?

    怎么查看CI的版本信息?想看某个项目中使用的CI具体是哪个版本,怎么查看?system\core\codeigniter.php中可以查看版本常量/** * CodeIgniter Version * ...

  4. python中,一个函数想使用另一个函数中的变量

    问题: 第一个函数中用到了变量a:第二个函数也想使用变量a. 解决方法: 在第一个函数中将变量a定义为全局变量,然后在第二个函数中,也写上global a即可. 示例: def func1(): gl ...

  5. 要想在for语句中直接定义一个变量

    要想在for语句中直接  定义一个变量  (如下的代码) 1 for(uint16_t i=0;i<10;i++); 2 if( GPIO_ReadInputDataBit(GPIOA, GPI ...

  6. VC++ Debug编译方式

    字节填充 VC++在Debug编译方式下,new的内存用0xcd(助记词为Cleared Data)填充,防止未初始化: delete后,内存用0xdd(Dead Data)填充,防止再次被使用. 这 ...

  7. windows下VC界面 DIY系列1----写给想要写界面的C++程序猿的话

    非常早就想写关于C++ UI开发的一系列博文,博客专栏刚审核通过,就立即開始刷博文,不能辜负自己的一番热血,我并非写界面的高手,仅仅想通过写博文提高我自己的技术积累,也顺便帮助大家解决界面开发的瓶颈. ...

  8. VC++ Debug产生异常时中断程序执行Break on Exception

    It is possible to instruct the debugger to break when an exception occurs, before a handler is invok ...

  9. VC++ Debug内存值

    Memory Values If you're using the debug heap, memory is initialized and cleared with special values. ...

随机推荐

  1. lshw-查看系统硬件信息

    lshw是系统日常使用会比较常用到的命令,一般是用它来查看新硬件的信息. 跟觉man,lshw会读取的文件有: /usr/local/share/pci.ids /usr/share/pci.ids ...

  2. 不吐不快之EJB演练——开篇概述

    EJB(Enterprise Java Bean)是J2EE规范的重要核心,它是一个用户分布式业务应用的标准服务端组件模型,它是一种能够高速开发大规模企业应用的组件体系结构.上面这样官方的解释可能对于 ...

  3. java异常处理Exception

    我看别人的面经中有一道题目就问到了Exception,即java的异常处理的,我曾经也学了java的异常处理,可是我查了下,看了别人的博客关于写的exception异常处理.我发现,自己学的不坚固,仅 ...

  4. Hibernate 多对一关联查询

     版权声明:本文为博主原创文章,如需转载请标注转载地址.  博客地址:http://www.cnblogs.com/caoyc/p/5598269.html  一.单向多对一和双向多对一的区别 如果只 ...

  5. Struts2入门示例

    1.导入struts2需要的9个包到lib文件夹中 2.配置web.xml文件 <?xml version="1.0" encoding="UTF-8"? ...

  6. iOS CoreData (一) 增删改查

    代码地址如下:http://www.demodashi.com/demo/11041.html Core Data是iOS5之后才出现的一个框架,本质上是对SQLite的一个封装,它提供了对象-关系映 ...

  7. android studio教学视频资源(点开即看)

    android studio教学视频资源(点开即看) 自从Google推出android studio之后.包含github在内的非常多第三方代码库项目很多其它的採用的android studio编译 ...

  8. 使用AsParallel 进行并行化处理数据

    using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using S ...

  9. List分组迭代器 C#--深入理解类型

    List分组迭代器   说明: 针对长度较大的List对象,可以分组批量进行处理, 如:长度为1000的List对象,可分为10组,每组100条,对数据进行业务逻辑处理... Source /**** ...

  10. c++ 返回对象的引用要小心

    除非能保证返回对象的生命周期足够长. 一定不要返回临时对象的引用.