[gs-devel] debugging ghostscript in xcode
Ralph Giles
ralph.giles at artifex.com
Wed Apr 4 22:42:58 PDT 2007
Tim,
Last week you asked about debugging gs from xcode. I got it to work
again, sort of. Here's a somewhat minimal recipe.
1. Start xcode and open a new project
2. Choose the "Empty Project" template
3. Enter a Project Name like "gs"
4. Set the Project Directory to the top level of your gs source tree
5. Select Project:New Target...
6. Choose the "External Target" template
7. Set Target Name to something like "gs"
8. Double-click on the "gs" target to open its info panel
9. HACK: add 'debug' to the end of the arguments string.
8. Click on the Build button.
The status bar should now say "Running external build tool..."
and the warning count will slowly build.
9. Select Project:New Custom Executable...
10. Set Executable Name to "gs-debug"
11. Set Executable Path to "debugobj/gs"
12. In the executable's info panel, Set the working directory to
Project directory
13. Open the debugger and click on the "Debug" or "Build and Debug"
button. It should launch. If you hit "Pause" once the program is
running it should break and let you debug. It seems smart enough
to find the source without explicitly adding the files to the
project.
Issues:
* I haven't figured out how to get at the command line interface, but
you can pass arguments in the Executable's info panel, which is enough
to debug a file.
* Fix-and-continue, etc. don't work with external targets.
* We should be passing the 'debug' make target through $(ACTION) instead
of hacking it onto the external target's arguments list, so the Clean
button, and the Build button under the Release config work properly.
* Docs suggest you can add a Debugger() call to trigger a breakpoint
at a specific execution point, but I didn't try that. Might require
adding a library to the link line.
Hope that's of some help,
-r
More information about the gs-devel
mailing list