Re: [Pyobjc-dev] Debugging PyObjC app
Brought to you by:
ronaldoussoren
From: Donovan P. <ds...@ma...> - 2004-03-31 04:18:21
|
On Mar 30, 2004, at 9:57 PM, James Mastro wrote: > What is the best way to go about debugging a PyObjC app? I have an app > I'm developing that is currently written in Objective C, but I'd > rather do it in Python with PyObjC. I remember reading somewhere when > I was first looking into this that source level debugging was going to > be a problem...but I can't find that link anymore. So, before I jump > into this, am I going to be stuck debugging with just print > statements? You can use pdb to debug your application if you use Bob's new main.m from PyMacApp, which embeds python instead of using execve to launch a python process. I have checked in this new main.m to the PyObjC cvs head, so you can use the template in the 'Xcode' directory to get started. You will need to start up your application with a hooked up stdin in order for this to work. You can either start the application from the terminal by executing YourApp.app/Contents/MacOS/YourApp or make sure the "Std In/Out" preference in the executable pane is set to "Pseudo terminal" in Xcode. You can break into pdb using the normal 'import pdb; pdb.set_trace()'. You can then set other breakpoints and continue. I am also working on a remote debugger for PyObjC which uses DO to communicate with the child process, and will provide more capable graphical debugging abilities. It is already working and all that remains is to finish off the ui. I will make an announcement when I have something slightly more featureful ready. dp |