<br><br><div class="gmail_quote">On Thu, Jul 16, 2009 at 6:26 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Didn&#39;t we talk about this earlier?</blockquote><div><br></div><div>Yes we had discussed it, but I needed the reminder...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Process&gt;&gt;currentProcess<br>
  &quot;Answer the currently active process.<br>
  If the receiver is simulating another process,<br>
  answer the other process. If not, answer self.&quot;<br>
  ^currentProcess ifNil:[self]<br>
<br>
Process&gt;&gt;currentProcess: aProcess<br>
  &quot;Set the currently active process.<br>
  Return the previous active process.&quot;<br>
  | prior |<br>
  prior := currentProcess.<br>
  currentProcess := aProcess.<br>
  ^prior<br>
<br>
ProcessorScheduler&gt;&gt;activeProcess<br>
  ^activeProcess currentProcess<br>
<br>
ProcessorScheduler&gt;&gt;currentProcess: aProcess<br>
  &quot;For debugging only.<br>
   Pretend that aProcess is the activeProcess&quot;<br>
  ^activeProcess currentProcess: aProcess<br>
<br>
and then:<br>
<br>
Debugger&gt;&gt;step<br>
  prior := Processor currentProcess: interruptedProcess.<br>
  [self doStep] ensure:[Processor currentProcess: prior].<br>
<br>
etc.</blockquote><div><br></div><div>Yes.  This is OK, but it means the system codes to suit the debugger and that&#39;s always felt like the tail wagging the dog to me. </div><div><br></div><div>How about creating an anonymous subclass of the process that implements activeProcess to raise an exception caught by the debugger that answers the right thing and class (to answer the proper class) and using adoptInstance: (the new guts of changeClassTo:)  for the duration of each step?</div>
<div><br></div><div>The VW debugger uses something similar to this to do step into.  All blocks in the current context get their class changed to one that raises an exception on receiving a value message which the debugger catches, converts the block back and pauses the computation after the activation of the block.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Eliot Miranda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Hi All,<br>
<br>
    does anyone have a neat hack to make Processor activeProcess answer what&#39;s expected in the context of the debugger?  i.e. anyone made the Squeak debugger answer the process being debugger when Processor activeProcess is stepped over or through, rather than the debugger process, or made the debugger run as the process being debugged rather than its own?<br>

<br>
TIA<br>
Eliot<br>
<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote></div><br>