[Zope] Zope Debugger lets WingDbg fail to connect toclient

Chris Withers chris at simplistix.co.uk
Wed Oct 19 05:10:29 EDT 2005


Stephan Deibel wrote:
> You can turn on and off debugging from the WingDBG control panel 
> which installs/removes the tracer hook and also the monkey 
> patches.  When off, it's the same as if no debugger were running 
> (except that WingDBG lets you turn it on again dynamically).

Is the WingDBG control panel in Zope or in WingIDE?
Where's the code which does this "turning off and turning on"?

>>>Also, someone mentioned changing the monkey patch to call inherited.
>>
>>Not sure what you mean by that...
> 
> I meant trying to call the inherited/replaced method to do the
> work or more of the work rather than completely replacing it.  
> This *might* make things less brittle (but I doubt it, actually
> ;-).

Well, it's more than you may want to call the method you're replacing 
when you're monkey patched method is done doing what it's doing. zdb 
does this with prettymuch all its monkeypatches...

> The old/existing impl adds a ##'ed comment block to scripts and 
> ends up stripping the block before compiling the script so that
> line numbers in the code object don't match up with the copy of 
> the script that has the ##'s (which is what anyone reading from 
> the file system will see).  The patch changes this to compile
> the script w/ the ##'ed comment in place.

Yes, but this stuff isn't necessary ;-)
(and has nothing to do with the code that patches co_filename, right?)

> Re: patching Zope + CMF:  It should be possible to patch CMF so
> that it can run w/ either patched or unpatched Zope.  The author
> of CMFFormController accepted our patch when it was originally
> submitted and did that.

Odd. You earlier suggested you wanted to get "Zope" changed to 
co_filename was meaningful. That change also needs to be made in 
FSPythonScript. That one small change is the only thing I'm talking 
about ;-)

> Hmm, so perhaps reworking the patch for CMF to work like that
> might help get it accepted... then the question is whether the
> Zope patch can be made to work w/ unpatched CMF (if that is an
> issue; or is it OK for Zope to change under CMF?).

The two should have nothing to do with each other...

> As far as a standard for co_filename it should be the full path
> file name for FS scripts (O/W most debuggers won't work out of
> the box), 

Well, you see, that doesn't work for me ;-)
(Since I tried both FSPythonScripts and PythonScripts in the same way, 
and that uses their full ZODB path)

> We'll try to do actual work on this (rather than sending emailed 
> drivel ;-) after Wing 2.0.4 is out.  Unfortunately, we've got 
> various things going on that has left us w/ very little extra 
> time for the next month or so.

You might start by actually getting to know how zdb works, there's very 
little code in it and it tackles the problem in a different way which 
avoids all the trouble you're getting into above...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list