1.lldb
expr expr 表達(dá)式 可以在調(diào)試時動態(tài)執(zhí)行指定表達(dá)式,并將結(jié)果打印出來,很有用的命令。
po po 表達(dá)式 與expr類似,打印對象,會調(diào)用對象description方法。是print-object的簡寫
print print (type) 表達(dá)式 也是打印命令,需要指定類型。
bt bt [all] 打印調(diào)用堆棧,是thread backtrace的簡寫,加all可打印所有thread的堆棧。
br l br l 是breakpoint list的簡寫
process continue l process continue 簡寫:c
thread step-in l thread step-in l 簡寫:s
thread step-inst l thread step-inst l 簡寫:si
thread step-over l thread step-over l 簡寫:n
thread step-over-inst l thread step-over-inst l 簡寫:ni
thread step-out l thread step-out l 簡寫:f
thread list thread list 簡寫:th l
2.zombie
內(nèi)存管理的問題,一般是訪問了已經(jīng)釋放的對象導(dǎo)致的
開啟該選項后,程序在運行時,如果訪問了已經(jīng)釋放的對象,則會給出較準(zhǔn)確的定位信息,可以幫助確定問題所在。
該功能的原理是,在對象釋放(retainCount為0)時,使用一個內(nèi)置的Zombie對象,替代原來被釋放的對象。無論向該對象發(fā)送什么消息(函數(shù)調(diào)用),都會觸發(fā)異常,拋出調(diào)試信息。
記得在問題被修復(fù)后,關(guān)閉該功能
to be continued