1. help
help breakpoint :查看指令的用法
2. breakpoint
設(shè)置斷點(diǎn)
breakpoint set -r 函數(shù)名字:模糊匹配方法名字(可能會(huì)打很多斷點(diǎn))
breakpoint set -s 動(dòng)態(tài)庫(kù) -n 函數(shù)名:給指定動(dòng)態(tài)庫(kù)的函數(shù)打斷點(diǎn)
breakpoint list :列出所有的斷點(diǎn)(每個(gè)斷點(diǎn)都有自己的編號(hào))
breakpoint disable 斷點(diǎn)編號(hào) :禁用編號(hào)
breakpoint enable 斷點(diǎn)編號(hào) :?jiǎn)⒂镁幪?hào)
breakpoint delete 斷點(diǎn)編號(hào) :刪除編號(hào)
breakpoint command add 斷點(diǎn)編號(hào):給斷點(diǎn)預(yù)先設(shè)置需要執(zhí)行的的命令,觸發(fā)斷點(diǎn),就會(huì)按順序執(zhí)行
breakpoint command list 斷點(diǎn)編號(hào):查看斷點(diǎn)設(shè)置的命令
breakpoint command delete 斷點(diǎn)編號(hào):刪除斷點(diǎn)設(shè)置的命令
breakpoint set --name 函數(shù)名字
breakpoint set -n 簡(jiǎn)寫(xiě)
breakpoint set -n touchesBegan:withEvent://會(huì)給所有touchesBegan打斷點(diǎn)
breakpoint set -n "-[ViewController touchesBegan:withEvent:]"http://給指定類(lèi)打斷點(diǎn)
3. expression
執(zhí)行一個(gè)表達(dá)式
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ù)直接返回某個(gè)值,不執(zhí)行斷點(diǎn)后面的代碼
6. frame variable
打印當(dāng)前斷點(diǎn)函數(shù)的參數(shù),變量
7. thread continue, continue, c
程序繼續(xù)運(yùn)行
8. thread step-over, next, n
單步運(yùn)行,遇到子函數(shù) 當(dāng)作整體一步執(zhí)行
9. thread step-in, step, s
單步運(yùn)行,遇到子函數(shù)會(huì)進(jìn)入子函數(shù)
10. thread step-out, finish
直接執(zhí)行完當(dāng)前函數(shù)的所有代碼,返回上一級(jí)函數(shù)

11. si,ni和s, n類(lèi)似
s,n 是代碼級(jí)別
si,ni 是匯編級(jí)別
help n //thread step-over
help s //thread step-in
help ni //thread step-inst-over
help si //thread step-inst
12 內(nèi)存斷點(diǎn)
watchpoint set variable self->_age :給self的age屬性打斷點(diǎn),有修時(shí),bt查看調(diào)研修改
watchpoint set variable 內(nèi)存地址
watchpoint set variable &self->_age
p &self->_age //打印self的age的內(nèi)存地址
watchpoint list
watchpoint disable 斷點(diǎn)編號(hào)
watchpoint enable 斷點(diǎn)編號(hào)
watchpoint delete 斷點(diǎn)編號(hào)
watchpoint command add 斷點(diǎn)編號(hào)
watchpoint command list 斷點(diǎn)編號(hào)
watchpoint command delete 斷點(diǎn)編號(hào)
13 image lookup
image lookup -t 類(lèi)型:查找類(lèi)型信息
image lookup -a 地址:根據(jù)內(nèi)存地址查找在模塊中的位置,崩潰查找
image lookup -n 符號(hào)或者函數(shù)名:查找符號(hào)或者函數(shù)的位置
image list 列出所加載模塊的信息


image list -o -f //打印模塊的便宜地址,全路徑
總結(jié)
1.敲enter鍵,默認(rèn)執(zhí)行上次的命令
2.絕大部分指令可以縮寫(xiě)