ObjectC的函数名怪怪的,又空格,又+/-:号,又括号。下断点很麻烦。
可以试试 -r选项 , 可以正则表达式来模糊下断点,还是比较方便了。
如:
(lldb) br set -r IPXReconnectManager initWithAsset:hostWindow:finishedBlock\]
Breakpoint 18: 20 locations.
(lldb) breakpoint list
Current breakpoints:
18: regex = 'IPXReconnectManager', locations = 20, resolved = 20, hit count = 0
18.1: where = Photos`-[IPXReconnectManager .cxx_destruct], address = 0x000000010e22d203, resolved, hit count = 0
18.2: where = Photos`-[IPXReconnectManager initWithAsset:hostWindow:finishedBlock:], address = 0x000000010e403f4c, resolved, hit count = 0
18.3: where = Photos`-[IPXReconnectManager initWithAssets:hostWindow:finishedBlock:], address = 0x000000010e404066, resolved, hit count = 0
18.4: where = Photos`-[IPXReconnectManager setProgress:], address = 0x000000010e404137, resolved, hit count = 0
18.5: where = Photos`-[IPXReconnectManager observeValueForKeyPath:ofObject:change:context:], address = 0x000000010e4041f5, resolved, hit count = 0
18.6: where = Photos`-[IPXReconnectManager checkAssetsForMissingMaster], address = 0x000000010e40432c, resolved, hit count = 0
18.7: where = Photos`-[IPXReconnectManager _findFolderForAsset:originalURL:outCancel:outSkip:outApplyToAll:], address = 0x000000010e4044b7, resolved, hit count = 0
18.8: where = Photos`-[IPXReconnectManager _findFolderForOriginalURL:], address = 0x000000010e404874, resolved, hit count = 0
18.9: where = Photos`-[IPXReconnectManager reconnectProgress], address = 0x000000010e404d9d, resolved, hit count = 0
18.10: where = Photos`-[IPXReconnectManager setReconnectProgress:], address = 0x000000010e404db1, resolved, hit count = 0
18.11: where = Photos`-[IPXReconnectManager commonRootResults], address = 0x000000010e404dc0, resolved, hit count = 0
18.12: where = Photos`-[IPXReconnectManager setCommonRootResults:], address = 0x000000010e404dd4, resolved, hit count = 0
18.13: where = Photos`__87-[IPXReconnectManager _findFolderForAsset:originalURL:outCancel:outSkip:outApplyToAll:]_block_invoke, address = 0x000000010e404de3, resolved, hit count = 0
18.14: where = Photos`__50-[IPXReconnectManager checkAssetsForMissingMaster]_block_invoke, address = 0x000000010e404e02, resolved, hit count = 0
18.15: where = Photos`__50-[IPXReconnectManager checkAssetsForMissingMaster]_block_invoke.79, address = 0x000000010e404fca, resolved, hit count = 0
18.16: where = Photos`__50-[IPXReconnectManager checkAssetsForMissingMaster]_block_invoke.71, address = 0x000000010e4052fd, resolved, hit count = 0
18.17: where = Photos`+[IPXReconnectManager reconnectManagerForAsset:hostWindow:finishedBlock:], address = 0x000000010e405353, resolved, hit count = 0
18.18: where = Photos`+[IPXReconnectManager reconnectManagerForAssets:hostWindow:finishedBlock:], address = 0x000000010e405520, resolved, hit count = 0
18.19: where = Photos`+[IPXReconnectManager oneReconnectSerialQueue], address = 0x000000010e4055b5, resolved, hit count = 0
18.20: where = Photos`__46+[IPXReconnectManager oneReconnectSerialQueue]_block_invoke, address = 0x000000010e405618, resolved, hit count = 0
Objc的程序,可是确定一个地址或寄存器是一个对象的话,
直接po $rax, 或者 po 0x23234abc就好了,不需要知道类的具体名字,还是比较方便。
要是想知道,可以先来一个p (NSObject *) $rax之类的,出来的时候会提示你这个类的名字。