Reverting blocks in the debugger

Michael Roberts mike at mjr104.co.uk
Sun Oct 23 21:12:45 UTC 2005


I have been tracking down something that I thought was a bug when using 
the debugger in Seaside.  It occurs when you try to rewrite the code 
from within a DNU inside a callback:

html anchorWithAction: [self zork] text: 'click me'

I was doing this intentionally to show that you could rewrite the code 
in the debugger.  The problem is that when you change the block to 
something sensible, and reset the context, you get an error saying 
"Error: aContext is not in process chain"

I now think I understand why this is true and it isn't really a bug in 
Seaside.

Avi has a nice minimal example:

Undeclared at: #x put: [1+1. self halt]. "do-it on this line first"
(Undeclared at: #x) value

When you change the code in the block and accept it you get the same error.

The issue is that the block is saved somewhere and isn't on the stack - 
or strictly the block's home's sender is nil.  This means the revert and 
recompile put you in the wrong 1-line stack and the original process 
can't be resumed.

Now checking back through versions of Squeak, and in VW, it appears that 
this doesn't work.

So does anyone think it might be possible for this to work or has it 
never worked for a reason?  It could be that blocks are not normally 
saved and then recompiled in midst execution.  I hope this isn't a 
stupid question - it's just that I seem to provoke this when programming 
in Seaside.

Thanks,

Mike



More information about the Squeak-dev mailing list