Debugging breaks scopeEnvironmentWhile:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Debugging breaks scopeEnvironmentWhile:

Adrian Kuhn-3
I am having trouble with scopeEnvironmentWhile: when debugging, maybe  
someone knows a workaround. The actual application is more complex,  
but here a small example to reproduce the bug on the Workspace

First do the below code and click 'terminate' when the DNU dialog  
shows up

        Processor activeProcess scopeEnvironmentWhile: [ :env |
                env at: #foo put: 'while'.
                3 zork ].

Then do

        Processor activeProcess environmentAt: #foo.

which returns 'while' instead of the correct nil. Also what I found  
out is that if Processor activeProcess is saved into a var before and  
compared using == afterwards, it is not the same anymore! The active  
process is afterwards a new process with an environment that has the  
old process' environment as parent, but the wrong one - the scoped  
one from within the block not the default one from outside.

If no exception is thrown inside the while block or if the exception  
is handled programmatically, everything works fine. It seems the  
debugger is doing same process foo foo behind the scenes.

Is there a fix or workaround for this? As it is now, this makes  
debugging our application nearly impossible.

cheers,
-- Adrian