tree_22.jpg
print自晰、p
:打印
po
:打印對象
- 讀取內(nèi)存
memory read/數(shù)量格式字節(jié)數(shù) 內(nèi)存地址
x/數(shù)量格式字節(jié)數(shù) 內(nèi)存地址
x/3xw 0x10010
- 修改內(nèi)存中的值
memory write 內(nèi)存地址 數(shù)值
memory write 0x0000010 10
格式
x是16進(jìn)制招驴,f是浮點(diǎn)勃黍,d是10進(jìn)制字節(jié)大小
b:byte 1字節(jié),h:half word 2字節(jié)
w:word 4字節(jié)阱飘,g:giant word 8字節(jié)
將Objective-C代碼轉(zhuǎn)換為C\C++代碼
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc OC源文件 -o 輸出的CPP文件
如果需要鏈接其他框架屏镊,使用-framework參數(shù)。比如-framework UIKit__weak問題解決
在使用clang轉(zhuǎn)換OC為C++代碼時(shí)贡定,可能會(huì)遇到以下問題
cannot create __weak reference in file using manual reference
解決方案:支持ARC、指定運(yùn)行時(shí)系統(tǒng)版本可都,比如
xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc -fobjc-arc -fobjc-runtime=ios-8.0.0 main.m