The Inbox: Kernel-ct.1384.mcz

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

The Inbox: Kernel-ct.1384.mcz

commits-2
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1384.mcz

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

Name: Kernel-ct.1384
Author: ct
Time: 20 March 2021, 7:38:48.824494 pm
UUID: fcf035d1-5257-5d49-ab69-048b2c308741
Ancestors: Kernel-mt.1381

Patches Process>>#stepToHome: so that stepping through a bottom context that is not a home context works as expected.

Example to reproduce:

        p := Process forContext: ([[] ensure: []] asContext) priority: 40.
        p debug.

Stepping through the "ensure:" should halt the debugger in the first block, but not inside the #ensure: method.



M Process>>stepToHome:

=============== Diff against Kernel-mt.1381 ===============

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.
- 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."
 
  ^Processor activeProcess
  evaluate:
  [| home anError |
  home := aContext home.
  [suspendedContext := suspendedContext step.
+ home == suspendedContext home or: [aContext isDead and: [home isDead]]] whileFalse:
- home == suspendedContext home or: [home isDead]] whileFalse:
  [(suspendedContext selector == #signalForException:
  and: [(suspendedContext receiver isBehavior and: [
  suspendedContext receiver includesBehavior: 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].
  "Give a debugger a chance to update its title to reflect the new exception"
  Notification new
  tag: {unhandledErrorSignalerContext. anError};
  signal.
  ^unhandledErrorSignalerContext]]].
  suspendedContext]
  onBehalfOf: self!