Archaeopteryx Software, Inc.
Take Flight!Search

Home
Wing IDE
News
Support
About Us
Python
Open Source
Store

 Search:
 
 Advanced Search




[wingide-users] Problems with wingdbstub.SuspendDebug

Wing IDE Support support at wingide.com
Thu, 3 Apr 2003 15:19:00 -0500 (EST)


Hi,

The API will only work if you're launching the debug process from outside
of Wing.  If you debug from within Wing, the debugger is already going by
the time you reach the import of wingdbstub, so the module does nothing
and doesn't set up the debugger API.  When you ran from the command shell
it also didn't work because there's a bug in SuspendDebug that needs 
fixing (oops, thanks for pointing it out!).

However, you probably don't need to use the API anyway.  At this point
this is really only there for very unusual debugging scenarios.

Try removing your calls to the API and placing the import of wingdbstub
where you currently have the ResumeDebug call.  This will delay starting
debug until that line is reached.

If you want to launch the process from the IDE, use the Execute items
in the Run menu instead.  This runs things outside of the debugger and
lets wingdbstub do its work when it is imported.

If you do need .wingdebugpw, it's in ~/.wingide on Linux/Unix, and inside
profiles/[username] in your Wing installation on Win32.  However, if both 
processes run as the same user then the debugger looks up the file 
automatically.

Hope that helps... if not, please let us know.

Thanks,

Stephan Deibel

--
Wing IDE for Python
Archaeopteryx Software, Inc
Take Flight!

www.wingide.com

On Thu, 3 Apr 2003 Peter.Frey@haufe.de wrote:

> Hi,
> 
> I am using WingIDE 1.1.9-1 with Python 2.2.2 (with largefile support
> compiled in) and Zope 2.6.1 for debugging on a Suse Linux 8.1 desktop
> system.
> My problem is with startup performance when debugging my scripts that
> interface to the Zope runtime.
> It looks like it is caused by over 600 modules loaded at startup time of my
> script. The script runs as a batch process, i.e. not inside a Zope http
> request.
> 
> To speed up this process I tried to implement the tip found in the Wing IDE
> manual (HTML)
> in section 6.15.7 "Full Control via Debug API" as follows:
> 
> 
> global DEBUG
> DEBUG = 1
> 
> if DEBUG:
>     import wingdbstub
>     wingdbstub.debugger.SuspendDebug()
>     # suspend debugger to speed up startup time for Zope environment
> 
> import sys, traceback
> import os, os.path
> import re
> import time
> import getopt, glob
> import Zope
> try:
>     print "% starting up Zope environment ..."
>     Zope.startup() # added for Zope 2.6
> except:
>     etype, value, tb = sys.exc_info()
>     print "*** failed to do Zope 2.6 style initialisation"
>     print "Exception %s: %s" % (etype, value)
>     traceback.print_tb(tb)
>     sys.exit(1)
> 
> import Acquisition
> ...
> 
> if DEBUG:
>     wingdbstub.debugger.ResumeDebug()
> 
> 
> The problem now is, when started from inside WingIDE 1.1.9-1, I get the
> following exception when starting the script from inside the IDE:
> 
> Attribute not found: 'module' object has no attribute 'debugger'
> 
> Traceback (innermost last):
> File "<string>", line 1, in ?
> File "/home/freyp/EPcvs/HRS/Prod/HaufeCMSScripts/QueryTest.py", line 11, in
> ?
>       wingdbstub.debugger.SuspendDebug()
> 
> when stepping through wingdbstub.py (that I just copied from
> /usr/lib/wingide/wingdbstub.py
> over to the directory where my python script is, I am unable to step over
> the line 136:
> 
> if not kWingDebugDisabled and not os.environ.has_key('WINGDB_DISABLED') and
> \
>    not os.environ.has_key('WINGDB_ACTIVE'):
> 
> (looks like an exception that is not caught/handled by the Wing IDE
> debugger)
> 
> and in the interactive debug probe, I also see no member debugger with the
> wingdbstub module:
> 
> >>> dir (wingdbstub)
> ['WINGHOME', '__builtins__', '__doc__', '__file__', '__name__', 'imp',
> 'kAttachPort', 'kEmbedded', 'kExitOnFailure', 'kLogFile', 'kPWFileName',
> 'kPWFilePath', 'kSilent', 'kWingDebugDisabled', 'kWingHostPort', 'os',
> 'string', 'sys']
> >>>
> 
> (so probably it is kind of python magic?)
> 
> 
> 
> Next try was to run the script from a bash shell:
> 
> 
> freyp@linux-frpkoend:~/EPcvs/HRS/Prod/HaufeCMSScripts> sh start_query.sh
> Traceback (most recent call last):
>   File "QueryTest.py", line 11, in ?
>     wingdbstub.debugger.SuspendDebug()
>   File "2.2.0/src/debug/server/netserver.pyc", line 758, in SuspendDebug
> TypeError: tracer_stop_trace() takes exactly 0 arguments (1 given)
> 
> 
> the script used was was:
> 
> freyp@linux-frpkoend:~/EPcvs/HRS/Prod/HaufeCMSScripts> more start_query.sh
> #!/bin/sh
> export PYTHONPATH=/home/freyp/Zope/Server/lib/python/
> export INSTANCE_HOME=/windows/Work/Zope/HaufeCMSTest
> exec /usr/local/bin/python QueryTest.py /HaufeCMSTest/ImportTest
> /windows/Work/Zope/daten/import /windows/Work/Zope/test/export
> 
> 
> 
> Does this mean I am no longer possible to use SuspendDebug/ResumeDebug from
> WingIDE 1.1.9? 
> 
> debug.passive-listen is set to true (as I need this for other Zope debugging
> sessions, too)
> but I could not find the .wingdebugpwd file. Probably I do not need it as I
> run both the ZEO Server and my script 
> from within the same user account.
> 
> Any help? Or, is there an other - better - way to speed up load time?
> 
> regards
> Peter
> _________________________________________________
> Wing IDE discussion list
> http://wingide.com/support/forum
> 





Run by Mailman v 2.0.8


Copyright (c) 2000-2002, Archaeopteryx Software, Inc.
Legal Statements