Q: How do you debug an application with Xcode from a project other than the one that built it? A: It is possible to debug an application using Xcode, even if you don't have the project that was used to build that application. This allows you to take advantage of Xcode's graphical debugging capabilities. And a similar approach works in Project Builder. Here's how:
- In Xcode, choose "New Project..." from the File menu, select "Empty Project" to create a new empty project, and click "Next".
- In the assistant dialog that appears, choose a project name and project directory where the project should be stored on disk. Then click "Finish".
- From the Project menu, choose "New Custom Executable".
- In the assistant dialog that appears, enter a name for the application you plan to debug, choose the path to the application by pressing the "Choose..." button, and then click "Finish".
- You are now ready to debug the application. Although the debug button will always be dimmed out in the toolbar, you can choose the "Debug Executable" menu item from the Debug menu to debug your application.
Note:
If you have the source code to the application available in a folder other than the location where it originally resided when building the application, you may want to make that available to the debugger so you can trace breakpoints into your code. There are two ways to do this.
In the Groups and Files list of the project window, select "Executables" (or go to the Targets tab in Project Builder) and double-click on your executable in the "Executables" list. This brings up the Executables editor for that executable. Add the path to the source code under "Source Directories". This will make your source code visible while debugging, but won't give you quick access to the source before the debugging session starts, to set breakpoints.
OR
You can add your source code to the project by dragging it into the project Groups and Files list, or by selecting the "Add Files..." menu item in the Project menu.
|
[Sep 15, 2003]
|