[Zope] Debugging and Zope: Strangeness with continue
Lennart Regebro
lennart@regebro.nu
Sun, 27 Jan 2002 18:55:17 +0100
The need for shutting down Zope, going into python manually and then making
a manual request means that debugging for me usually is to complicated to be
worth it, and the result is that I instead debug by making tons of 'print
"DEBUG":, whatvereiwant toknow' statements. Thats not always very efficient,
and its almost impossible to debug code where the whats happening is not
just the request of a simple URL, so I have been looking for better ways.
I discovered this, almost good way:
Where I want the code to break so I can examine it, I write:
import pdb
pdb.set_trace()
And hey presto, the code I want to debug pops up in the debugger, I still
interact with Zope through the web, and I actually can spend time debugging
the problem I have, instead of trying to figure out how to recreate the
problem with the debugger command line.
But there is a huge problem:
After I have stepped through the function I want to debug, I can't stop
debugging.
'continue' is supposed to run until the next breakpoint, but it doesn't.
Instead after several continues, Zope starts waiting for the next request,
and as soon as it gets it, it stops, waiting for a debugger command.
This is very annoying, to say the least. Can somebody tell me why or tell me
how to fix this?
I have found an ugly workaround. When Zope during the next request stops and
waits in the debugger, I to an 'ignore' command. This prints out an error,
and throws that request into the great binary void, but at least I can then
again work with Zope without having to write 'c<enter>' 20 times for each
request....