<div dir="ltr">Hi Marcel,<div><br></div><div> can you give a specific example? Andreas and I came up with a solution for accessing Processor activeProcess correctly in the debugger. It works like this:</div><div><br></div><div>ProcessorScheduler>>activeProcess</div><div> ^activeProcess effectiveProcess</div><div><br></div><div><div>Process>>effectiveProcess</div><div><span class="" style="white-space:pre">        </span>"effectiveProcess is a mechanism to allow process-faithful debugging. The debugger executes code</div><div><span class="" style="white-space:pre">        </span> on behalf of processes, so unless some effort is made the identity of Processor activeProcess is not</div><div><span class="" style="white-space:pre">        </span> correctly maintained when debugging code. The debugger uses evaluate:onBehalfOf: to assign the</div><div><span class="" style="white-space:pre">        </span> debugged process as the effectiveProcess of the process executing the code, preserving process</div><div><span class="" style="white-space:pre">        </span> identity."</div><div><span class="" style="white-space:pre">        </span>^effectiveProcess ifNil: [self]</div></div><div><br></div><div>Process>>evaluate: aBlock onBehalfOf: aProcess</div><div><span class="" style="white-space:pre">        </span>"Evaluate aBlock setting effectiveProcess to aProcess. Used</div><div><span class="" style="white-space:pre">        </span> in the execution simulation machinery to ensure that</div><div><span class="" style="white-space:pre">        </span> Processor activeProcess evaluates correctly when debugging."</div><div><span class="" style="white-space:pre">        </span>| oldEffectiveProcess |</div><div><span class="" style="white-space:pre">        </span>oldEffectiveProcess := effectiveProcess.</div><div><span class="" style="white-space:pre">        </span>effectiveProcess := aProcess.</div><div><span class="" style="white-space:pre">        </span>^aBlock ensure: [effectiveProcess := oldEffectiveProcess]</div><div><br></div><div>and then in activateReturn:value: complete: popTo: popTo:value: return:value: step step: stepToCallee stepToSendOrReturn it is used as in</div><div><br></div><div><div>Process>>step</div><div><br></div><div><span class="" style="white-space:pre">        </span>^Processor activeProcess</div><div><span class="" style="white-space:pre">                </span>evaluate: [suspendedContext := suspendedContext step]</div><div><span class="" style="white-space:pre">                </span>onBehalfOf: self</div></div><div><br></div><div>Perhaps all that is needed is the access of process-specific variables to use effectiveProcess?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 12:50 AM, Marcel Taeumel <span dir="ltr"><<a href="mailto:marcel.taeumel@student.hpi.uni-potsdam.de" target="_blank">marcel.taeumel@student.hpi.uni-potsdam.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
There are process-specific variables. However, #doStep in Debugger does<br>
#completeStep: on the process object and Processor >> #activeProcess will be<br>
wrong during that execution.<br>
<br>
Is this a general problem of global state or could we fix that somehow?<br>
<br>
Best,<br>
Marcel<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.world.st/Process-specific-state-difficult-to-debug-tp4802422.html" target="_blank">http://forum.world.st/Process-specific-state-difficult-to-debug-tp4802422.html</a><br>
Sent from the Squeak - Dev mailing list archive at Nabble.com.<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div>