http://asawicki.info/ Graphics programming, game programming, C++, games, Windows, Internet and more... |
|
22:49
Fri
10
Feb 2012
How to Make Visual Studio Debugger not Step Into STL
It is annoying when you debug your C++ code in Visual Studio, want to step into your function, but the debugger enters source code of some STL container or string. For example, in the following code you will first enter std::basic_string constructor, then std::vector operator[] and then body of MyFunction.
MyFunction(std::string("abc"), myVector[0]);
It turns out there is a way to disable stepping into certain code, using regular expressions. To do this:
Here is the full story:
In May 2007 I asked the question on forum.warsztat.gd and written this blog entry (in Polish). Now I've also found this article: How to Not Step Into Functions using the Visual C++ Debugger, Andy Pennell's Blog and this StackOverflow question: Is there a way to automatically avoiding stepping into certain functions in Visual Studio?
From that I've learned that Visual Studio 6.0 used autoexp.dat file, while new versions use Windows registry.
Rules entered in registry can be suffixed with case-insensitive "=NoStepInto" (which is the default) or "=StepInto".
Aside from regular expression syntax you can use additional special codes: \cid (identifier), \funct (function name), \scope (class or namespace, like myns::CClass::), \anything (any string) and \oper (C++ operator).
Double backslashes you can meet on some web pages come from the REG file format, where backslash must be additionally escaped, like "\\:". If you enter regular expression straight into regedit, it should be "\:".
Comments (1) | Tags: debugger visual studio c++
|
tell 2012-02-11 16:31:50 | Thanks. Very useful tip. I was wondering about it myself but never got around to actually checking it. |
| [Stat] [Admin] [STAT NO AD] [pub] [Mirror] | Copyright © 2004-2012 Adam Sawicki |