Take this code:
#include <iostream>
#include <memory>
#include <functional>
std::function<int()> getint = []
{
return 5;
};
void foo(int i)
{
std::cout<<i<<std::endl;
}
int main()
{
foo(getint());
}
I'm stopped at a breakpoint at line 17. I want to step into the getint
function. Using gdb's step
by default takes me through a bunch of std::function
's internal crap that I'm not interested in. If I continue stepping, I will eventually get through to the lambda, but having to do this for every std::function
call is extremely annoying.
I tried using the skip
command:
skip -rfu ^std::.*
but this causes step
to jump straight into foo
, completely skipping the lambda inside std::function
.
Is it possible to configure gdb in a way, where step
at line 17 would take me straight to the lambda at line 7?