If you ask how to do this from the application, you cannot do it meaningfully on iOS. Your process is limited by the lack of access to other processes and, of course, cannot generate GDB in order to influence them in any way.
If you ask how to do this from within Xcode: select the Product menu, and then select Attach to Process . (This assumes Xcode 4. I do not remember the Xcode 3 menu item, but if you use the search bar in the Help menu, you can easily find it.)
source share