The Trunk: Kernel-eem.894.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-eem.894.mcz

commits-2
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.894.mcz

==================== Summary ====================

Name: Kernel-eem.894
Author: eem
Time: 29 January 2015, 10:54:41.65 am
UUID: 4c8074eb-6db4-4d9b-bbfe-cd8f7197b999
Ancestors: Kernel-ul.893

Access a process's environment from effectiveProcess
to provide correct environment access when debugging.

=============== Diff against Kernel-ul.893 ===============

Item was added:
+ ----- Method: Process>>effectiveEnvironment (in category 'private') -----
+ effectiveEnvironment
+ "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.  By using the effectiveProcess's environment, access in the debugger is correct."
+ ^effectiveProcess
+ ifNil: [env]
+ ifNotNil:
+ [:theEffectiveProcess|
+ theEffectiveProcess effectiveEnvironment]!

Item was changed:
  ----- Method: Process>>effectiveProcess (in category 'accessing') -----
  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
- 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]!

Item was changed:
  ----- Method: Process>>environmentAt:ifAbsent: (in category 'process specific') -----
  environmentAt: key  ifAbsent: aBlock
 
+ ^(self effectiveEnvironment ifNil: [ ^aBlock value ]) at: key ifAbsent: aBlock.!
- ^(env ifNil: [ ^aBlock value ]) at: key ifAbsent: aBlock.!

Item was changed:
  ----- Method: Process>>environmentAt:ifAbsentPut: (in category 'process specific') -----
  environmentAt: key ifAbsentPut: aBlock
 
+ ^self setEffectiveEnvironment at: key ifAbsentPut: aBlock!
- ^(env ifNil: [ env := Dictionary new ]) at: key ifAbsentPut: aBlock.!

Item was changed:
  ----- Method: Process>>environmentAt:put: (in category 'process specific') -----
  environmentAt: key put: value
 
+ ^self setEffectiveEnvironment at: key put: value!
- ^(env ifNil: [ env := Dictionary new ]) at: key put: value.!

Item was changed:
  ----- Method: Process>>environmentRemoveKey:ifAbsent: (in category 'process specific') -----
  environmentRemoveKey: key ifAbsent: errorBlock
 
+ ^(self effectiveEnvironment ifNil: [^errorBlock value])
+ removeKey: key
+ ifAbsent: errorBlock!
- ^(env ifNil: [ ^errorBlock value ]) removeKey: key ifAbsent: errorBlock!

Item was added:
+ ----- Method: Process>>setEffectiveEnvironment (in category 'private') -----
+ setEffectiveEnvironment
+ "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.  By using the effectiveProcess's environment, access in the debugger is correct."
+ ^effectiveProcess
+ ifNil: [env ifNil: [env := Dictionary new]]
+ ifNotNil:
+ [:theEffectiveProcess|
+ theEffectiveProcess setEffectiveEnvironment]!