[squeak-dev] Re: process-faithful debugging?
bert at freudenbergs.de
Fri Jul 17 09:31:11 UTC 2009
On 17.07.2009, at 06:16, Eliot Miranda wrote:
> On Thu, Jul 16, 2009 at 6:26 PM, Andreas Raab <andreas.raab at gmx.de>
> Didn't we talk about this earlier?
> Yes we had discussed it, but I needed the reminder...
> "Answer the currently active process.
> If the receiver is simulating another process,
> answer the other process. If not, answer self."
> ^currentProcess ifNil:[self]
> Process>>currentProcess: aProcess
> "Set the currently active process.
> Return the previous active process."
> | prior |
> prior := currentProcess.
> currentProcess := aProcess.
> ^activeProcess currentProcess
> ProcessorScheduler>>currentProcess: aProcess
> "For debugging only.
> Pretend that aProcess is the activeProcess"
> ^activeProcess currentProcess: aProcess
> and then:
> prior := Processor currentProcess: interruptedProcess.
> [self doStep] ensure:[Processor currentProcess: prior].
> Yes. This is OK, but it means the system codes to suit the debugger
> and that's always felt like the tail wagging the dog to me.
> How about creating an anonymous subclass of the process that
> implements activeProcess
#activeProcess is implemented by ProcessorScheduler not Process. So
that won't work.
> 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?
Sounds like a trade-off between magic and simplicity.
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev