7

I am trying to make debugging std::function-heavy code less of a nightmare. What I want to happen is to be able to do is step directly into the lambda body in this example:

std::function<void(void)> lam_dostuff = []() {
    printf("stuff has been done\n");
};

lam_dostuff();

I did some research and found out that the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Packages\Debugger\Visualizers\default.natstepfilter file contains step-into overrides. I can add the rule <Function><Name>std::.*</Name><Action>NoStepInto</Action></Function>, and this does prevent me from stepping into any stl code, but it also prevents stepping into user code that is called as a result of the stl call. I tried adding the rule <Function><Name>std::_Invoker_functor::_Call.*</Name><Action>StepInto</Action></Function>, the signature for the final step of a std::function invocation, to no avail.

Is there anything I can do to get the result I want?

  • 2
    I found the same question here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/b7f46806-d407-4c3e-ab86-04303ae5e5e7/how-to-step-directly-into-my-stdfunction-in-debugger. It looks like this is not possible at the moment unfortunately. – Daan Posthuma Jun 07 '16 at 10:58

0 Answers0