Re: [Pyobjc-dev] pdb in PyObjC apps?
Brought to you by:
ronaldoussoren
From: Zachery B. <zb...@ur...> - 2003-08-18 22:19:16
|
On Monday, August 18, 2003, at 05:56 PM, Bob Ippolito wrote: > On Monday, Aug 18, 2003, at 16:49 America/New_York, Zachery Bir wrote: > >> Anyone found a way to integrate the python debugger (pdb) with a >> PyObjC application? I made the mistake of trying it, and it clogged >> up my Console.app and I had to use Force Quit to stop my app. > > You can probably use it pretty much the same way you would normally > use pdb. There's probably a couple snags (NSApplicationMain will > probably kill the interpreter when the runloop stops, > AppHelper.runEventLoop will probably try and catch all your > exceptions, etc.), but you didn't really give enough information about > your problem. You should be more concise about exactly what you did, > especially how it was executed (WindowServer is picky about these > things). You should also include some sample code (preferably > stripped down to just enough to show the problem), and define what > "clogged up my Console.app" means. Sorry, something along the lines of: class MyAppDelegate(NibClassBuilder.AutoBaseClass): def init(self): import pdb;pdb.set_trace() self.foo = do_something() So that I can track the creation of my application's main object and see where this disconnect that I'm experiencing is coming from. When I tried that before and ran the built application by double-clicking on it, Console.app was filled with: (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) (Pdb) ... ad nauseum when that line was hit. There was no terminal I could attach to to take charge of the pdb session. Perhaps I need to run the application differently? (trying that) AHA! Running: $ ~/Developer/ZopeEditManager/build/ZopeEditManager.app/Contents/MacOS/ ZopeEditManager with the import pdb;pdb.set_trace() in my app's init() method brings me to a pdb prompt :) Note to self: Don't use pdb and try to catch it through double-clicking the app :) >> Should we be using the Project Builder's debugger? Will that work? > > Not unless you're debugging Python itself, or an extension written in > C, C++, Objective C :) Project Builder's debugger is just a gdb > frontend. Good to know, thanks. Zac |