7 ms·
C++11 has given us a new and wonderful world of this small function debugging horror, since we can now gin up lambda functors that have no name, that have a typ
by honkhonkpants 10y ago
C++11 has given us a new and wonderful world of this small function debugging horror, since we can now gin up lambda functors that have no name, that have a type with no known name, and don't play well with the debugger (good luck figuring out why your program is spending all of its time in "operator()").
- AstralStorm 10y agoEven relatively old generally and lldb show location information correctly for lambdas. Templates are usually more of a pain to debug.
- honkhonkpants 10y agoHow do you mean they show them correctly? Perhaps you are right but I often see them attributed to std::function::operator() in the header <functional>, because someone has assigned the lambda to a class member field or function argument of type std::function. When the function has more than one caller it can be a nuisance trying to figure out which caller's lambda is the one being called. The only way I know of to identify them is to examine the full template expansion which is often a kilobyte of metaprogram gibberish.
- robotresearcher 10y agoCan you not see the call stack for your lambda, as for any function?