Search code examples
iosxcode7lldb

lldb 'step into' can't jump into function call on Xcode7?


I use Xcode7 to debug a App.

Seems step into behave like the step over, can't jump into the execution of a sub procedure? It's just jump to the next line in the source code each time.

And if I'm debug in the UIKit method(I don't have source code), it's jump to the next instruction.


Solution

  • As you have found, step-in avoids frames with no debug information. Most people like to just hit one step command, rather than switching between step & next depending on the line they are on, and in my experience, tend to choose step. This is made more pleasant if the debugger doesn't stop in printf & other code you have no debug info for.

    However, lldb's "step" command has an option to control this:

       -a <boolean> ( --step-in-avoids-no-debug <boolean> )
            A boolean value that sets whether stepping into functions will step over functions with no debug information.
    

    If you use this frequently, you can either reset the step alias to include this option, or make another alias that includes it. Use the command alias command to do this.

    And if you always want step-in to step into code with no debug information, just set the global setting:

    settings set target.process.thread.step-in-avoid-nodebug 0
    

    either at the start of a debug session or in your .lldbinit.

    Note, most of lldb's commands are documented in the help system. For instance, help step would have shown the above option for the step command, and apropos step would have shown the setting.