阿尔及利亚网站后缀,网站开发例子,中国工信部官网查询网站备案,怎么创建一个论坛文章目录 结构常用命令#xff1a;1、流程控制#xff1a;2、常用命令3、进程信息#xff1a;4、寄存器#xff1a;register5、镜像#xff1a;image6、内存#xff1a;memory7、符号断点#xff1a;breakpoint8、内存断点#xff1a;watchpoint9、Tips#xff1a; 结… 文章目录 结构常用命令1、流程控制2、常用命令3、进程信息4、寄存器register5、镜像image6、内存memory7、符号断点breakpoint8、内存断点watchpoint9、Tips 结构
命令结构
// 命令结构
command [subcommand [subcommand...]] action [-options [optionvalue]] [argument [argument...]]
命令 子命令 命令操作 命令选项 命令参数常用命令
expression表达式
thread backtrace堆栈
thread线程
frame栈帧
breakpoint符号断点
watchpoint内存断点
image镜像
register寄存器
memory内存continue继续
next下一步
step跳进
finish跳出call执行方法查看帮助help command [subcommand]
查看命令具体帮助apropos command 流程控制
1、流程控制
源码级别 source level
// 单步运行
thread step-in / step / s // 会进入函数内部
thread step-over / next / n // 不会进入函数内部指令级别 instruction level
需要设置Debug → Debug workflow → Always Show Disassembly
// 在汇编页面
thread step-inst / stepi / si // 会进入函数内部
thread step-inst-over / ni // 不会进入函数内部继续、退出
// 从一个函数跳出若没有执行s/si, 会跳到汇编指令bl的下一条位置)
thread step-out / finish / f
// 要从嵌套的 step-out 中退出可执行 c 跳转到下一个断点
process continue / continue / c2、常用命令
// 执行表达式
expression / expr / p// 打印1print p
p person
(Person *) $0 0x000000010053b7f0// 打印2expression -o / expr -o / po
po person
Person: 0x10053b7f0
// 若接受到的对象是一个指针会调用它的 description 方法打印
// 若接受到的对象是 CoreFoundation 对象会调用它的 CFShow 方法打印
// 其他情况同 p// 修改背景色
expr tableView.backgroundColor UIColor.red// 查看变量类型结构
fr v -R a
(Swift.Int) a {_value 10
}3、进程信息
thread list # 线程列表
// 堆栈
thread backtrace all # 所有线程堆栈
thread backtrace # 当前线程堆栈
thread backtrace 2 # 线程2堆栈// 跳出当前执行的方法(后面的不执行)
thread return
thread return 20// 栈帧
frame info // 栈帧信息
frame variable // 帧变量列表
frame select 0 // 选择帧
// 移动帧up序号1 down序号-14、寄存器register
register read
register write rax 1235、镜像image
// 依赖库列表
image list
// 查找模块
image lookup -type class // 查看class所有属性和成员变量
image lookup -name 方法名 // 查找方法来源
image lookup -address 地址 // 查找崩溃位置6、内存memory
memory read/数量格式字节数 内存地址
// 格式x为16进制f位浮点数d为10进制
// 字节数b为1个字节h为2个字节w为4个字节g为8个字节// 例
x/4xg 0x00006000001600b0
memory read 0x00006000001600b0
memory read/3xg 0x00006000001600b0
memory read/8xg 0x00006000001600b0
memory read/8xw 0x00006000001600b0
memory read/3dw 0x00006000001600b0
memory read/3fw 0x00006000001600b0// 写内存
memory write 内存地址 述职7、符号断点breakpoint
// 列出所有断点
breakpoint list
// 设置断点
breakpoint set -address 0x000000 // 函数地址
breakpoint set -name viewDidLoad // 函数名breakpoint disable 断点编号 // 禁用断点
breakpoint enable 断点编号 // 启用断点
breakpoint delete 断点编号 // 删除断点8、内存断点watchpoint
watchpoint set variable 变量
watchpoint set expression 地址
watchpoint list
watchpoint diable 断点编号
watchpoint enable 断点编号
watchpoint delete 断点编号
watchpoint command add 断点编号
watchpoint command list 断点编号
watchpoint command delete 断点编号9、Tips
反引号a会用表达式解析器运行该值的文本将值替换为该文本
memory read -c len 0x12345
当参数以-开头前面需要用- -隔开
process launch --stop-at-entry -- -program_arg value 参考
官网https://lldb.llvm.org/ 官方教程https://lldb.llvm.org/use/tutorial.html
lldb常用命令与调试技巧
iOS开发之LLDB常用命令