I often find myself in a situation when I want to know where a function returns. There’s no need to know the return value, as this may be the same for multiple code paths (e.g.,
nullptr if something went wrong). It is embarrassing, but I sometimes have put
fprintf(stderr, "T1"); in my code just to follow which path the execution took. Needless to say, this behavior requires manual editing and recompilation and should be avoided if possible.
Here’s a way to elegantly debug where a function returns using
lldb from the command line.
Continue reading “How to debug where a function returns using LLDB from the command line”