lldb命令
进入断点的几种方式
- 如红色部分 2.jpg
- 异常中断
断点设置
- break set -n moonTest:
- break list //获取断点列表
- break delete 4 //1 breakpoints deleted; 0 breakpoint locations disabled.
- break set -f ViewController.m -n moonTest3://针对某一个文件设置断点
- breakpoint set -l //某一行设置断点
- break set -r moon //模糊匹配所有带moon的方法
- breakpoint set --selector alignLeftEdges:
- break delete //删除所有断点
p和po的官方解释
-
'po' is an abbreviation for 'expression -O --'
-
'p' is an abbreviation for 'expression --'
-
p self.view.backgroundColor = [UIColor blueColor];
-
call [self.view setBackgroundColor:[UIColor redColor]]
修改并打印某一个值
- p (Person*)self.personArray.lastObject //(Person *) $1 = 0x000060000003fa60
- p $1.name = @"qqqq" //(NSTaggedPointerString *) $2 = 0xa000000717171714 @"qqqq"
- p (Person*)self.personArray.lastObject //(Person *) $3 = 0x000060000003fa60
调用栈
- bt指令 显示调用栈
- up、down 栈的前进后退
- frame select 3 选择第3条
- frame variable -- Show variables for the current stack frame. Defaults to all
(ViewController *) self = 0x00007fd525707f20
(SEL) _cmd = "moonTest3:"
(__NSCFConstantString *) str = 0x00000001046a3198 @"13"
流程控制
- n 单步 s跳进去 c继续
- 汇编 ni si
watchpoint
- watch set variable per1->_name
- watch modify -c ‘global == 5’//条件断点
- break command add 3
- breakpoint command list
- breakpoint command delete 3
break command add 3
Enter your debugger command(s). Type 'DONE' to end.
> bt
> DONE
stop hook
- 每次停车时都要追踪和拆卸。target stop-hook add -o “frame variable”
- image lookup --address 0x0000000100004af8
.lidbinit
- 这个文件不太会玩,先不写了。
网友评论