Hacker Pod2G has recently tweeted that he has written instructions on how to get GNU Debugger (GDB) working on the iOS 5 firmware generation. In case you do not know what GNU Debugger is, it essentially allows you to see what is going on ‘inside’ another program while it executes — or what another program was doing at the moment it crashed. This is obvious only useful to developers and is not for the public.
Although GNU Debugger is actually on Cydia, it has not been updated to support iOS devices running iOS 4.3 and above. Thus, if you are a developer and would like to get GNU Debugger on the iOS 5 firmware generation or any firmware past iOS 4.3, then you will be glad to know in this how to you will find the instructions necessary to do just this thanks to @Pod2G.
How To Get GNU Debugger On iOS 5
Step 1) – The first thing you will need to do is make sure you have a Jailbroken iOS device running a firmware that is >= to iOS 4.3. Next you will need to have OpenSSH installed on your iOS device and have access to a Mac computer with the iOS SDK installed.
Step 2) – Next you will need to remove the GDB Cydia package from Cydia.
Step 3) – With the GDB package removed from Cydia you can fire up the Mac OS X terminal and type in the following list of commands:
cd /tmp
cp /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin .
lipo -thin armv7 gdb-arm-apple-darwin -output gdb
nano entitlements.xml
Step 4) – Now you will now need to paste the following into the Mac OS X terminal:
<!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>
Step 5) – Save the file by doing CTRL + X, then ‘Y’, then ‘ENTER’.
Step 6) – Finally you will need to enter the commands shown below into the Mac OS X terminal.
ldid -Sentitlements.xml gdbscp gdb root@<iOS Device IP Address>:/usr/bin/
Congratulations! You have just installed GNU Debugger (GDB) on your iPhone, iPod Touch or iPad running the iOS 4.3 firmware and above. Let us know if you have any further questions in the comments section below…
Fdffd says
ldid command does not exist on mac, can only be downloaded to a device via Cydia.. Im stuck..
skyg says
lipo -thin armv7 gdb-arm-apple-darwin -output gdb
util/ldid.cpp(249): _assert(78:Swap(mach_header_->magic) == MH_MAGIC)
why?