[Python-Dev] Interactive Debugging of Python

Christian Tismer tismer at appliedbiometrics.com
Thu May 20 16:10:32 CEST 1999


Mark Hammond wrote:
> 
> All this talk about stack frames and manipulating them at runtime has
> reminded me of one of my biggest gripes about Python.  When I say "biggest
> gripe", I really mean "biggest surprise" or "biggest shame".
> 
> That is, Python is very interactive and dynamic.  However, when I am
> debugging Python, it seems to lose this.  There is no way for me to
> effectively change a running program.  Now with VC6, I can do this with C.
> Although it is slow and a little dumb, I can change the C side of my Python
> world while my program is running, but not the Python side of the world.
> 
> Im wondering how feasable it would be to change Python code _while_ running
> under the debugger.  Presumably this would require a way of recompiling the
> current block of code, patching this code back into the object, and somehow
> tricking the stack frame to use this new block of code; even if a first-cut
> had to restart the block or somesuch...
> 
> Any thoughts on this?

I'm writing a prototype of a stackless Python, which means that
you will be able to access the current state of the interpreter
completely.
The inner interpreter loop will be isolated from the frame
dispatcher. It will break whenever the ticker goes zero.
If you set the ticker to one, you will be able to single
step on every opcode, have the value stack, the frame chain,
everything.
I think, with this you can do very much.
But tell me if you want a callback hook somewhere.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-Dev mailing list