博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
VC++Debug避免F11步进不想要的函数中
阅读量:5319 次
发布时间:2019-06-14

本文共 2434 字,大约阅读时间需要 8 分钟。

  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 ):

  • 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:

 

转载于:https://www.cnblogs.com/MakeView660/p/8442831.html

你可能感兴趣的文章
xml.exist() 实例演示
查看>>
判断是否为空然后赋值
查看>>
zabbix监控日志文件
查看>>
正则表达式
查看>>
pip install torch on windows, and the 'from torch._C import * ImportError: DLL load failed:' s...
查看>>
java基础(一):我对java的三个环境变量的简单理解和配置
查看>>
arcgis api 4.x for js 结合 Echarts4 实现散点图效果(附源码下载)
查看>>
YTU 2625: B 构造函数和析构函数
查看>>
apache自带压力测试工具ab的使用及解析
查看>>
C#使用Xamarin开发可移植移动应用(2.Xamarin.Forms布局,本篇很长,注意)附源码
查看>>
jenkins搭建
查看>>
C#中使用Split分隔字符串的技巧
查看>>
加固linux
查看>>
IPSP问题
查看>>
10.17动手动脑
查看>>
WPF中Image显示本地图片
查看>>
Windows Phone 7你不知道的8件事
查看>>
实用拜占庭容错算法PBFT
查看>>
java的二叉树树一层层输出,Java构造二叉树、树形结构先序遍历、中序遍历、后序遍历...
查看>>
php仿阿里巴巴,php实现的仿阿里巴巴实现同类产品翻页
查看>>