Search code examples
conditional-statementsbreakpointslldb

Set conditional breakpoint in lldb


ALL,

I need to set a breakpoint in lldb on OSX so that the program will be stopped the second time it hits.

So what should I add to the following:

break set -f myfile.mm -l 100

Trying to debug keyboard issue.

TIA!


Solution

  • Use the -i / --ignore-count flag. In your example, your command would be:

    break set -f myfile.mm -l 100 -i 1
    

    This would skip the breakpoint 1 time, and stop the second time (and every time after).

    For what it's worth, the docs (from help breakpoint set) say:

    -i <count> ( --ignore-count <count> )
        Set the number of times this breakpoint is skipped before stopping.