Search code examples
c++cdebugginglldb

How to step-into outermost function call in the line with LLDB?


Let's say I'm debugging code like this

   outer(fn1(), fn2());

If I use the s command, LLDB will first step into fn1, then I type fin to step-out, s again steps into fn2, fin... and only now I'm able to step-into outer which is what I wanted since the beginning.

Is there a way to tell LLDB on which function call to step-in?


Solution

  • lldb comes with an alias for exactly this: sif. In the given example, you can run:

    (lldb) sif outer
    

    You can remember it as step into function

    It works with partial matches, it doesn't have to be called with the full function name. In this case, you could also run sif out for example.