Hi Marcel,
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:
ProcessorScheduler>>activeProcess
^activeProcess effectiveProcess
Process>>effectiveProcess
"effectiveProcess is a mechanism to allow process-faithful debugging. The debugger executes code
on behalf of processes, so unless some effort is made the identity of Processor activeProcess is not
correctly maintained when debugging code. The debugger uses evaluate:onBehalfOf: to assign the
debugged process as the effectiveProcess of the process executing the code, preserving process
identity."
^effectiveProcess ifNil: [self]
Process>>evaluate: aBlock onBehalfOf: aProcess
"Evaluate aBlock setting effectiveProcess to aProcess. Used
in the execution simulation machinery to ensure that
Processor activeProcess evaluates correctly when debugging."
| oldEffectiveProcess |
oldEffectiveProcess := effectiveProcess.
effectiveProcess := aProcess.
^aBlock ensure: [effectiveProcess := oldEffectiveProcess]
and then in activateReturn:value: complete: popTo: popTo:value: return:value: step step: stepToCallee stepToSendOrReturn it is used as in
Process>>step
^Processor activeProcess
evaluate: [suspendedContext := suspendedContext step]
onBehalfOf: self
Perhaps all that is needed is the access of process-specific variables to use effectiveProcess?