This section of the archives stores flipcode's complete Developer Toolbox collection, featuring a variety of mini-articles and source code contributions from our readers.

 

  Easier Debugging
  Submitted by



When debugging C++ programs, "step into" is quite useful. What I find annoying, though, is that stepping into the creation of an object first steps into ::operator new and (if you're not careful) into _nh_malloc, even though you probably wanted to step into the object's constructor instead. Also, when passing a string literal to a function that expects a std::string, you step into the std::string constructor.

Visual Studio has an undocumented feature that allows you to prevent stepping into certain functions. Edit the file AUTOEXP.DAT (found under [Visual Studio Directory]\Common\MSDev98\Bin) and add the following lines:

[ExecutionControl]
std::*=NoStepInto
operator new=NoStepInto

This will prevent stepping into the new operator, skipping straight to the constructor. It also prevents stepping into any functions in the std namespace. You can specify the undocumented NoStepInto flag for anything you don't want to step into. For example:

CMyClass::MyMethod=NoStepInto
std::vector<*>=NoStepInto
SomeFunction=NoStepInto
CSomeClass::*=NoStepInto

You'll have to restart Visual Studio for it to notice the changes.

Regards,
Steven Don (aka Kippesoep)


The zip file viewer built into the Developer Toolbox made use of the zlib library, as well as the zlibdll source additions.

 

Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.