解決GDB在iOS5下面的問題

  • 2748
  • 0

摘要:解决GDB在iOS5下面的问题

GDB在ios5下问题很多,直接安装GDB在Cydia中默认源的版本会导致程序在调试过程中会莫名其妙的崩溃。

后来发现网上之前有人提到过,通过添加源http://cydia.radare.org,使用其中的GDB则可以正常调试。但是缺点是,没有符号(so sad

因此还是使用Xcode中的GDB,具体使用方法如下:

执行以下命令:

cd /tmp
cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin .
lipo -thin armv7 gdb-arm-apple-darwin -output gdb
nano entitlements.xml

在终端中输入:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>com.apple.springboard.debugapplications</key>
        <true/>
        <key>get-task-allow</key>
        <true/>
        <key>task_for_pid-allow</key>
        <true/>
</dict>
</plist>

然后执行:

ldid -Sentitlements.xml gdb
scp gdb root@<iOS Device IP Address>:/usr/bin/

即可解决。

 

 

------------------------------

文章的授權使用CC BY-ND2.5協議。凡是標示“轉載”的文章,均來源於網絡並儘可能標註作者。如果有侵犯您的權益,請及時聯繫刪除或者署名、授權。


Gtalk/Email: cmd4shell  [at]  gmail.com