1. help
help breakpoint :查看指令的用法
2. breakpoint
设置断点
breakpoint set -r 函数名字:模糊匹配方法名字(可能会打很多断点)
breakpoint set -s 动态库 -n 函数名:给指定动态库的函数打断点
breakpoint list :列出所有的断点(每个断点都有自己的编号)
breakpoint disable 断点编号 :禁用编号
breakpoint enable 断点编号 :启用编号
breakpoint delete 断点编号 :删除编号
breakpoint command add 断点编号:给断点预先设置需要执行的的命令,触发断点,就会按顺序执行
breakpoint command list 断点编号:查看断点设置的命令
breakpoint command delete 断点编号:删除断点设置的命令
breakpoint set --name 函数名字
breakpoint set -n 简写
breakpoint set -n touchesBegan:withEvent://会给所有touchesBegan打断点
breakpoint set -n "-[ViewController touchesBegan:withEvent:]"//给指定类打断点
3. expression
执行一个表达式
expression, expression --和 print ,p,call一样
eexpression -O -- 和 po一样
expression UILabel *l = [[UILabel alloc]init];l.frame = CGRectMake(100, 100, 100, 100);[self.view addSubview:l];l.text = @"123131";
4. thread backtrace
打印函数栈
和指令bt同效
5. thread return
叫函数直接返回某个值,不执行断点后面的代码
6. frame variable
打印当前断点函数的参数,变量
7. thread continue, continue, c
程序继续运行
8. thread step-over, next, n
单步运行,遇到子函数 当作整体一步执行
9. thread step-in, step, s
单步运行,遇到子函数会进入子函数
10. thread step-out, finish
直接执行完当前函数的所有代码,返回上一级函数
11. si,ni和s, n类似
s,n 是代码级别
si,ni 是汇编级别
help n //thread step-over
help s //thread step-in
help ni //thread step-inst-over
help si //thread step-inst
12 内存断点
watchpoint set variable self->_age :给self的age属性打断点,有修时,bt查看调研修改
watchpoint set variable 内存地址
watchpoint set variable &self->_age
p &self->_age //打印self的age的内存地址
watchpoint list
watchpoint disable 断点编号
watchpoint enable 断点编号
watchpoint delete 断点编号
watchpoint command add 断点编号
watchpoint command list 断点编号
watchpoint command delete 断点编号
13 image lookup
image lookup -t 类型:查找类型信息
image lookup -a 地址:根据内存地址查找在模块中的位置,崩溃查找
image lookup -n 符号或者函数名:查找符号或者函数的位置
image list 列出所加载模块的信息
image list -o -f //打印模块的便宜地址,全路径
总结
1.敲enter键,默认执行上次的命令
2.绝大部分指令可以缩写