Best way to attach GDB to process ID and list its ARM registers on the iPhone?
Just won开发者_C百科dering, what is the most reliable/best way to attach GDB to process ID and list its ARM registers on the iPhone (through a cocoa app)? I've been trying NSTask for quite awhile, it is able to list the x86 registers of a specific process (through the iOS Simulator). But when deployed on an iPhone, it doesn't work. I have yet to see anyone perform successful asynchronous operations such as what I am seeking on the iPhone. I was thinking of using Applescript to run a bash script with the gdb commands inside, anyone care to comment on the feasability of such a task?
Any help is very much appreciated!
My attempt at using NSTask for this objective can be found here :
Strange GDB behaviour once application is deployed to a jailbroken iPhone
If you are asking how to do this from within an app: you can't do this meaningfully on iOS. Your process has limited to no access to other processes and certainly can't spawn GDB to affect them in any way.
If you're asking how to do this from within Xcode: Select the Product
menu, and then select Attach to Process
. (This assumes Xcode 4. I don't remember the Xcode 3 menu item offhand, but if you use the search bar in the Help
menu, you can find it easily.)
精彩评论