[squeak-dev] Re: process-faithful debugging?
Eliot Miranda
eliot.miranda at gmail.com
Fri Jul 17 17:17:30 UTC 2009
On Fri, Jul 17, 2009 at 2:31 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:
>
> 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> wrote:
>
>> Didn't we talk about this earlier?
>
>
> Yes we had discussed it, but I needed the reminder...
>
>
>> Process>>currentProcess
>> "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.
>> ^prior
>>
>> ProcessorScheduler>>activeProcess
>> ^activeProcess currentProcess
>>
>> ProcessorScheduler>>currentProcess: aProcess
>> "For debugging only.
>> Pretend that aProcess is the activeProcess"
>> ^activeProcess currentProcess: aProcess
>>
>> and then:
>>
>> Debugger>>step
>> prior := Processor currentProcess: interruptedProcess.
>> [self doStep] ensure:[Processor currentProcess: prior].
>>
>> etc.
>
>
> 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.
>
Doh! Thanks, Bert.
> 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...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090717/a0a0e2f8/attachment.htm
More information about the Squeak-dev
mailing list
|