lldb

记录常用的lldb命令


基本命令

命令 说明 举例
查询某个命令如何使用 help <command> help breakpoint
help breakpoint delete
修改某个变量的值 expression
e
expression self.groupImgView = nil
设置断点 breakpoint
br
/


流程控制命令

命令 说明 举例
continue按钮 process continue
continue
c
/
执行整个函数 thread step-over
next
n
/
跳进函数 thread step-in
step
s
/
执行当前函数剩余代码后返回 thread step-out
finish
/
不执行当前函数代码直接返回 thread return
thread return NO(伪造返回值)


查找UIButton点击事件的响应函数

1、抓屏获取UIButton的内存地址,此处记为0x162609170

2、将UIButton内存地址强转赋值给lldb内存变量:(貌似变量需要以符号开头) e UIButton*myButton = (UIButton *)0x162609170

3、打印UIButton allTargets,此处记第一个target内存地址为0x286cc6540
po [$myButton allTargets]

4、获取响应函数selector,下面的64代表 UIControlEventTouchUpInside
po [$myButton actionsForTarget:(id)0x286cc6540 forControlEvent:64]

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容