本文主要介紹介紹三種方式探索alloc源碼
1.下斷點(diǎn)
按住 control + step into
-
main中的LGPerson處 加一個(gè)斷點(diǎn),運(yùn)行程序,會(huì)斷在LGPerson位置
image -
按住
control鍵,選擇step into??鍵,進(jìn)去后,顯示為以下內(nèi)容
image
2.下符號(hào)斷點(diǎn)
-
通過(guò)符號(hào)斷點(diǎn),選擇
symbolic Breakpoint
image -
在符號(hào)斷點(diǎn)中輸入
alloc
image
image
3.通過(guò)匯編
- 查看匯編的流程:
Debug->Debug Workflow->Always Show Disassembly
image
image
image







