lldb调试objc程序使用正则表达式下断点

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之类的,出来的时候会提示你这个类的名字。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值