How to avoid unwanted stepping in debugging with visual studio

It is always annoying when you are debugging with visual studio, you press F11 on a standard MFC or STL object and the control goes to the constructor or assignment operator of that standard class.

Eg:

string myStr = “This is my string”;

If you press F11 on the above line, it will go to the assignment operator implementation of std::string class.

To avoid such unwanted stepping into the assignment operator implementation, edit AUTOEXP.DAT , found in the Bin folder of MsDev directory and add the following line.

[ExecutionControl]

std::string::operator==NoStepInto

To avoid stepping into the constructor of string, you can add a line as follows.

[ExecutionControl]

std::string::string=NoStepInto

If you want to disable stepping into all the functions of the class CMyClass,

[ExecutionControl]

CMyClass::*=NoStepInto

If you want to disable stepping into all the functions of classes in the namespace MyNameSpace,

[ExecutionControl]

MyNameSpace::*=NoStepInto

Advertisements

One Response to How to avoid unwanted stepping in debugging with visual studio

  1. […] that to achieve that you used the [ExecutionControl] section in autoexp.dat, and seems it is widely believed to still hold. However, since 2003(!) the home of these setting is the registry. Since VS2005, its […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: