[squeak-dev] The Trunk: Kernel-eem.930.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jul 1 22:26:39 UTC 2015


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

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

Name: Kernel-eem.930
Author: eem
Time: 1 July 2015, 3:25:55.097 pm
UUID: f2ef6b5c-be8c-4bce-ab1b-dff14bb8ab0e
Ancestors: Kernel-eem.929

Fix the bug with the Debugger's through such that the Debugger would appear to freeze when encountering an MNU.  The example is Debug It on:

	Object flushDependents do: [ : e | ]

followed by Over, Through.  But in fact one can see the same issue doing Debug It and then Through on

	nil zork

What was happening is that Through was stepping through the uncaught and looping MNUs (of do: or zork in the above examples) since the Debugger did not catch unhandled errors during Through, and sicne doesNotUnderstand:'s default if uncaught is to resend.  The fix is merely to catch unhandled errors when doing Through to the same effect as runUntilErrorOrReturnFrom: caching errors for Over.

Also speed up Through.  The changes made in Kernel-eem.857 through Kernel-eem.896 to provide process-faithful debugging slowed down Process>>step a lot.  These changes restore the performance by using evaluate:onBehalfOf: once for each Through, rather than once for each step within Through.

=============== Diff against Kernel-eem.929 ===============

Item was added:
+ ----- Method: Exception>>canSearchForSignalerContext (in category 'debug support') -----
+ canSearchForSignalerContext
+ 	"This method is /only/ to support the debugger's catching of exceptions in stepIntoBlock."
+ 	^signalContext isContext!

Item was changed:
+ ----- Method: Exception>>signalerContext (in category 'handling') -----
- ----- Method: Exception>>signalerContext (in category 'printing') -----
  signalerContext
  	"Find the first sender of signal(:)"
  
  	^ signalContext findContextSuchThat: [:ctxt |
  		(ctxt receiver == self or: [ctxt receiver == self class]) not]!

Item was changed:
  ----- Method: Process>>stepToHome: (in category 'changing suspended state') -----
  stepToHome: aContext 
+ 	"Resume self until the home of top context is aContext.  Top context may be a block context.
+ 	 Catch any UnhandledErrors that are created while stepping, answering the relevant signalerContext
+ 	 if so. Note that this will cause weird effects if using through to step through UnhandledError
+ 	 code, but as the doctor ordered, don't do that; use over or into instead."
- 	"Resume self until the home of top context is aContext.  Top context may be a block context."
  
+ 	^Processor activeProcess
+ 		evaluate:
+ 			[| home anError |
+ 			home := aContext home.
+ 			[suspendedContext := suspendedContext step.
+ 			 home == suspendedContext home or: [home isDead]] whileFalse:
+ 				[(suspendedContext selector == #signalForException:
+ 				 and: [suspendedContext receiver == UnhandledError
+ 				 and: [anError := suspendedContext tempAt: 1.
+ 					   ((suspendedContext objectClass: anError) includesBehavior: Exception)
+ 				 and: [anError canSearchForSignalerContext]]]) ifTrue:
+ 					[anError signalerContext ifNotNil:
+ 						[:unhandledErrorSignalerContext|
+ 						[unhandledErrorSignalerContext == suspendedContext] whileFalse:
+ 							[self completeStep: suspendedContext].
+ 						^unhandledErrorSignalerContext]]].
+ 			suspendedContext]
+ 		onBehalfOf: self!
- 	| home ctxt |
- 	home := aContext home.
- 	[	ctxt := self step.
- 		home == ctxt home.
- 	] whileFalse: [
- 		home isDead ifTrue: [^ self suspendedContext].
- 	].
- 	^ self suspendedContext!



More information about the Squeak-dev mailing list