Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Visual Studio to Step Into STL classes/functions

Lets assume we have this code snippet

    #include <vector>

    int main()
    {
        std::vector<int> a = { 1,2 };
        a.push_back(3);
        return 0;
    }

In VS 2019 I am attempting to Step Into (F11) the constructor and push_back function, but VS simply steps over it.

There are other solutions like Debugging C++ app in Visual Studio 2017 steps into not my code is there a way to turn this off? or Skip STL Code when debugging C++ Code in Visual Studio 2012?, which actually ask for the opposite (turn step into off). So I tried to reverse their solutions, e.g. adding
<Function><Name>std::.*</Name><Action>StepInto</Action></Function> in
C:\...\Visual Studio\2019\Professional\Common7\Packages\Debugger\Visualizers\default.natstepfilter but it doesn't work.

I am running Debug x64 with these options /JMC /permissive- /GS /W4 /Zc:wchar_t /ZI /Gm- /Od /sdl /Fd"x64\Debug\vc142.pdb" /Zc:inline /fp:precise /D "_CRT_SECURE_NO_WARNINGS" /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /std:c++17 /FC /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\EnvTest.pch" /diagnostics:column

What's the right setting to force VS to step into STL classes/functions?

like image 463
Phil-ZXX Avatar asked Sep 19 '25 04:09

Phil-ZXX


1 Answers

Turn off: Tools > Options > Debugging > General > [X] Enable Just My Code.

This is not a build/project setting but an IDE option. With this option on you will step over all the standard library code.

like image 122
Richard Critten Avatar answered Sep 20 '25 20:09

Richard Critten