Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip STL Code when debugging C++ Code in Visual Studio 2012?

Tags:

Is it possible to skip STL Code when using the C++ debugger (native, x64) in Visual Studio 2012? Quite often when debugging C++ code I step into STL code. I expect that the STL code provided by Microsoft is correct - I am not interested in debugging it - I am only interested in debugging my own (self-written) code.

For instacne when setting a break point at this function:

foo(std::make_shared<int>(6)); 

where foo is defined as:

void foo(std::shared_ptr<int> x) {     // do something } 

I do not want to dive into the details of std::make_shared - what I want is to step directly into the function foo. But this seems not to be possible. If the breakpoint at foo(std::make_shared<int>(6)); is reached and I press the 'Step Into' button (or F11) it first steps into the 'memory' header file (STL):

enter image description here

So again I have to press the 'Step Out' button than again the 'Step Into' button to get into the foo function. What I want is to skip the STL related parameter initialization or a possibility to jump directly into the function.

like image 622
Vertexwahn Avatar asked Dec 03 '13 13:12

Vertexwahn


People also ask

How do I skip the code while debugging in Visual Studio?

You can also click on the line you want to skip to and hit Ctrl+F10 (Run to Cursor).

How do you Debug C code in Visual code?

message, choose the Install more tools and features link. Then, in the Visual Studio Installer, choose the Desktop development with C++ workload. In the Configure your new project window, type or enter get-started-debugging in the Project name box. Then, choose Create.

How do I change Debug configuration in VS code?

Once you have your launch configuration set, start your debug session with F5. Alternatively, you can run your configuration through the Command Palette (Ctrl+Shift+P) by filtering on Debug: Select and Start Debugging or typing 'debug ' and selecting the configuration you want to debug.


1 Answers

There's Step Into Specific available on the right-click menu:

Step Into Specific

Though for a single argument, I'll more often do Step Into + Step Out + Step Into from the keyboard instead of navigating the menus for Step Into Specific.

An unofficial registry key for always stepping over certain code is described in an MSDN blog post, How to Not Step Into Functions using the Visual C++ Debugger.

like image 50
xan Avatar answered Nov 09 '22 07:11

xan