學科:IOS/調試器

來自維基學院

Xcode目前有兩個調試器:LLDB和GDB(The GNU Project Debugger)

LLDB官方網站:lldb.llvm.org

GDB官方網站:www.gnu.org/software/gdb

實用LLDB命令[編輯 | 編輯原始碼]

命令名 用法 說明
expr expr 表達式 可以在調試時動態執行指定表達式,並將結果打印出來,很有用的命令。
po po 表達式 與expr類似,打印對象,會調用對象description方法。是print-object的簡寫
print print (type) 表達式 也是打印命令,需要指定類型。
bt bt [all] 打印調用堆棧,是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

參考[編輯 | 編輯原始碼]