the breakpoint will always be skipped. Your breakpoint condition can be any code that evaluates true
or false
. For example, if you only want the breakpoint to stop when running on the main thread, you could use[NSThread isMainThread]
as your condition.
使用[NSThread isMainThread]可以判断是否运行在主进程。
可以不接触源码的情况下断点函数:
Symbolic Breakpoints
Symbolic breakpoints allow you to set breakpoints whenever specific selectors are sent messages. For example, here’s thesymbolicBreakpointAction:
method in the demo app:
观察变量什么时候被修改
(lldb) watch set variable _button1ClickCount Watchpoint created: Watchpoint 1: addr = 0x0b9a1ca4 size = 4 state = enabled type = w declare @ 'MyStuff/MyStuff/BNRDetailViewController.m:52' watchpoint spec = '_button1ClickCount' new value: 10