1. help
help breakpoint :查看指令的用法
2. breakpoint
設置斷點
breakpoint set -r 函數(shù)名字:模糊匹配方法名字(可能會打很多斷點)
breakpoint set -s 動態(tài)庫 -n 函數(shù)名:給指定動態(tài)庫的函數(shù)打斷點
breakpoint list :列出所有的斷點(每個斷點都有自己的編號)
breakpoint disable 斷點編號 :禁用編號
breakpoint enable 斷點編號 :啟用編號
breakpoint delete 斷點編號 :刪除編號
breakpoint command add 斷點編號:給斷點預先設置需要執(zhí)行的的命令罪塔,觸發(fā)斷點夏伊,就會按順序執(zhí)行
breakpoint command list 斷點編號:查看斷點設置的命令
breakpoint command delete 斷點編號:刪除斷點設置的命令
breakpoint set --name 函數(shù)名字
breakpoint set -n 簡寫
breakpoint set -n touchesBegan:withEvent://會給所有touchesBegan打斷點
breakpoint set -n "-[ViewController touchesBegan:withEvent:]"http://給指定類打斷點
3. expression
執(zhí)行一個表達式
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
打印函數(shù)棧
和指令bt同效
5. thread return
叫函數(shù)直接返回某個值旷祸,不執(zhí)行斷點后面的代碼
6. frame variable
打印當前斷點函數(shù)的參數(shù)兔朦,變量
7. thread continue, continue, c
程序繼續(xù)運行
8. thread step-over, next, n
單步運行姻僧,遇到子函數(shù) 當作整體一步執(zhí)行
9. thread step-in, step, s
單步運行,遇到子函數(shù)會進入子函數(shù)
10. thread step-out, finish
直接執(zhí)行完當前函數(shù)的所有代碼矛绘,返回上一級函數(shù)
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 地址:根據(jù)內存地址查找在模塊中的位置,崩潰查找
image lookup -n 符號或者函數(shù)名:查找符號或者函數(shù)的位置
image list 列出所加載模塊的信息
image list -o -f //打印模塊的便宜地址啸蜜,全路徑
總結
1.敲enter鍵坑雅,默認執(zhí)行上次的命令
2.絕大部分指令可以縮寫