这种方便对一个流程进行断点,同时开启和禁用一组断点
(lldb) breakpoint set -n "[ViewController saceAction:]" -n "[ViewController stopAction:]" -n "[ViewController goonAction:]"
Breakpoint 3: 3 locations.
---
3: names = {'[ViewController saceAction:]', '[ViewController saceAction:]', '[ViewController saceAction:]', '[ViewController stopAction:]', '[ViewController stopAction:]', '[ViewController stopAction:]', '[ViewController goonAction:]', '[ViewController goonAction:]', '[ViewController goonAction:]'}, locations = 3, resolved = 3, hit count = 0
3.1: where = LLDB调试`-[ViewController saceAction:] + 60 at ViewController.m:32:5, address = 0x0000000100c99ecc, resolved, hit count = 0
3.2: where = LLDB调试`-[ViewController stopAction:] + 60 at ViewController.m:36:5, address = 0x0000000100c99f24, resolved, hit count = 0
3.3: where = LLDB调试`-[ViewController goonAction:] + 60 at ViewController.m:40:5, address = 0x0000000100c99f7c, resolved, hit count = 0
(lldb) target stop-hook add -o "frame variable"
Stop hook #1 added.
(lldb) n
2021-05-22 11:31:12.733658+0800 LLDB调试[5728:2271351] 1
(ViewController *) self = 0x000000012dd0f590
(SEL) _cmd = "touchesBegan:withEvent:"
(__NSSetM *) touches = 0x00000002816feae0 1 element
(UITouchesEvent *) event = 0x00000002823caf40
(lldb) n
2021-05-22 11:31:15.528090+0800 LLDB调试[5728:2271351] funcA
(ViewController *) self = 0x000000012dd0f590
(SEL) _cmd = "touchesBegan:withEvent:"
(__NSSetM *) touches = 0x00000002816feae0 1 element
(UITouchesEvent *) event = 0x00000002823caf40
6.2 target stop-hook list
(lldb) target stop-hook list
Hook: 1
State: enabled
Commands:
frame variable
(lldb)
6.3 target stop-hook delete
(lldb) target stop-hook list
Hook: 1
State: enabled
Commands:
frame variable
(lldb) target stop-hook delete 1
(lldb) target stop-hook list
No stop hooks.
(lldb) target stop-hook add -o "frame variable"
Stop hook #2 added.
(lldb) target stop-hook list
Hook: 2
State: enabled
Commands:
frame variable
(lldb) undisplay 2
(lldb) target stop-hook list
No stop hooks.
(lldb)