lldb常见命令

官方文档

运行进程

run

启动钱设置环境变量

env DEBUG=1
set rem target.env-vars DEBUG取消刚才的设置
process launch -v DEBUG=1设置环境变量然后重新launch

单点调试下一步

n Do a source levelsingle step over in the currently selected thread.
s Do a source level single step in the currently selected thread.
niDo aninstruction levelsingle step over in the currently selected thread.
siDo an instruction levelsingle step in the currently selected thread.
finishStep out of the currently selected frame.

断点命令

b main Set a breakpoint at all functions named main.
b -[NSString stringWithFormat:] Set a breakpoint at and object C function: -[NSString stringWithFormat:].
br s -S count Set a breakpoint at all Objective C methods whose selector is count.
br list List all breakpoints.
br del 1

查看变量

frame variable/ fr v查看当前区域的参数和所以变量
fr v -a查看当前区域的变量
p bar查看变量bar的值
target variable 查看所以全局、静态变量在当前文件里面

执行表达式

expression tf.backgroundColor = UIColor.red
expression value.a = 100
expr unsigned int $foo = 5

查看线程状态

thread list
thread select 1
t 1选择线程1作为后续命令的执行线程
bt 当前线程堆栈
bt all 所以线程堆栈
frame info当前区域信息
register read当前线程的通用寄存器

你可能感兴趣的:(lldb常见命令)