[wingide-users] Debugging Zope's FTP server with WingIDEAndreas Jung andreas at andreas-jung.com
Thu, 26 Sep 2002 18:44:29 +0200
This sounds promising. I will give it a try the next time when I have to fix bugs deep in Zope. Thanks, Andreas --On Donnerstag, 26. September 2002 11:20 -0400 "Stephan R.A. Deibel" <email@example.com> wrote: > On Thu, 26 Sep 2002, Andreas Jung wrote: >> Well, I have been a member of the Zope coreteam and I have been >> on the FTP server stuff of Zope a lot. So I am curious if WingIDE >> could have done my life more easier ;-) > > Yes, Wing can debug Zope itself. The approach is somewhat different than > debugging client code and there is the caveat that you need to set up Zope > to be single threaded during debugging to avoid unpredictable stopping on > breakpoints/exceptions (only one thread in the thread pool will be > debugged). > > Here are the basic steps: > > 1) Install Zope + Wing > > 2) Copy wingdbstub.py from the Wing installation into your Zope code > > 3) Edit your code to add 'import wingdbstub' somewhere before the code > you want to debug. > > 4) Zope needs to run with the -t 0 option, e.g. with a 'start' script > like this: > ># ! /bin/sh > reldir=`dirname $0` > ZOPEHOME=`cd $reldir; pwd` > export ZOPEHOME > exec $ZOPEHOME/bin/python $ZOPEHOME/z2.py -D "$@" -Z '' -t 0 > > 5) Run Wing and make sure that Enable Passive Listen was selected > from the Run / Network Mode menu area (or set preference > debug.passive-listen=true in your preferences file, which is > accessible from the Edit menu; then restart Wing IDE). Either > way the status area at the top of windows should read > "Debugger: Ready and Listening". > > 6) Launch Zope and execute the code that does the 'import wingdbstub'. > This should cause Wing to change to "Debugger: Program Running" > or may reach an exception or breakpoint if you've set one. > > 7) It's possible you will also need to make a modification to > ZServer/PubCore/ZRendezvous.py so that the handle() method > reads as follows: > > def handle(self, name, request, response): > import ZPublisher > try: > ZPublisher.publish_module(name, request = request, response = > response) finally: > response._finish() > > This was needed in the past but our recent threading-related > improvements may mean this is no longer required. > > The above assumes you're running Zope and Wing IDE as the same > user on the same machine. If you want to do remote debugging, > this is described in the Debugger chapter of the manual: > > http://wingide.com/psupport/wingide-1.1/ > > (see section 6.15.3) > > Please let us know if you run into any problems. > > Thanks, > > - Stephan > > _________________________________________________ > Wing IDE discussion list > http://wingide.com/support/forum
Run by Mailman v 2.0.8
Copyright (c) 2000-2002, Archaeopteryx Software, Inc.