define to
b objc_msgSend
c
set $__i = 0
while ($__i < $arg0)
printf "%d: [%s %s]\n", $__i, (char*)object_getClassName($r0), (char*)$r1
set $__i++
c
end
end
之后 跑到 你想要看流程的时候, 断下来直接敲:
to 100
就可以 trace 100 条调用过程:
0x3165f004 in mach_msg_trap ()
Breakpoint 1 at 0x351b7f72
Breakpoint 1, 0x351b7f72 in objc_msgSend ()
0: [__NSCFTimer retain]
Breakpoint 1, 0x351b7f72 in objc_msgSend ()
1: [HomeViewController retain]
Breakpoint 1, 0x351b7f72 in objc_msgSend ()
2: [HomeViewController timerHandler:]
Breakpoint 1, 0x351b7f72 in objc_msgSend ()
3: [__NSArrayM count]
Breakpoint 1, 0x351b7f72 in objc_msgSend ()
4: [__NSArrayM count]
Breakpoint 1, 0x351b7f72 in objc_msgSend ()
5: [HomeViewController changePage:]
d