The Trunk: Morphic-mt.1113.mcz

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

The Trunk: Morphic-mt.1113.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1113.mcz

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

Name: Morphic-mt.1113
Author: mt
Time: 17 April 2016, 5:44:23.036117 pm
UUID: 1b36a4fb-13d9-f04f-8552-4048b9ac0439
Ancestors: Morphic-mt.1112

Improves robustness when facing erroneous drawing code that affects the debugger GUI. In that case, show primitive REPL instead of freezing the image.

Note that there will soon be more code to recover from such serious errors.

=============== Diff against Morphic-mt.1112 ===============

Item was changed:
  ----- Method: Debugger class>>morphicOpenOn:context:label:contents:fullView: (in category '*Morphic-opening') -----
+ morphicOpenOn: process context: context label: title contents: contentsStringOrNil fullView: full
- morphicOpenOn: process context: context label: title contents: contentsStringOrNil fullView: bool
  "Open a notifier in response to an error, halt, or notify. A notifier view just shows a short view of the sender stack and provides a menu that lets the user open a full debugger."
 
  | errorWasInUIProcess debugger |
+ ErrorRecursion ifTrue: [
+ "self assert: process == Project current uiProcess -- DOCUMENTATION ONLY"
+ ErrorRecursion := false.
+ ^ Project current handleFatalDrawingError: title].
+
+ [ErrorRecursion not & Preferences logDebuggerStackToFile
- errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: process.
- [Preferences logDebuggerStackToFile
  ifTrue: [Smalltalk logSqueakError: title inContext: context]] on: Error do: [:ex | ex return: nil].
+
+ ErrorRecursion := true.
+
+ errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: process.
+
+ "Schedule debugging in deferred UI message because
+ 1) If process is the current UI process, it is already broken.
+ 2) If process is some other process, it must not execute UI code"
+ Project current addDeferredUIMessage: [
+ debugger := self new process: process controller: nil context: context.
+ full
+ ifTrue: [debugger openFullNoSuspendLabel: title]
+ ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
+ debugger errorWasInUIProcess: errorWasInUIProcess.
+
+ "Try drawing the debugger tool at least once to avoid freeze."
+ ActiveWorld displayWorldSafely.
+
+ ErrorRecursion := false.
- WorldState addDeferredUIMessage: [
- "schedule debugger in deferred UI message to address redraw
- problems after opening a debugger e.g. from the testrunner."
- [
- debugger := self new process: process controller: nil context: context.
- bool
- ifTrue: [debugger openFullNoSuspendLabel: title]
- ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
- debugger errorWasInUIProcess: errorWasInUIProcess.
- ] on: Error do: [:ex |
- self primitiveError:
- 'Original error: ',
- title asString, '.
- Debugger error: ',
- ([ex description] on: Error do: ['a ', ex class printString]), ':'
- ]
  ].
  process suspend.
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-mt.1113.mcz

Chris Muller-3
Hi Marcel, it goes to Emergency Evaluator even when it doesn't lock up
too, but I think this is worth it if it saves the lock up cases; EE is
certainly better.  How should this interplay with the big red X
approach that Morphic uses?

On Sun, Apr 17, 2016 at 10:44 AM,  <[hidden email]> wrote:

> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-mt.1113.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-mt.1113
> Author: mt
> Time: 17 April 2016, 5:44:23.036117 pm
> UUID: 1b36a4fb-13d9-f04f-8552-4048b9ac0439
> Ancestors: Morphic-mt.1112
>
> Improves robustness when facing erroneous drawing code that affects the debugger GUI. In that case, show primitive REPL instead of freezing the image.
>
> Note that there will soon be more code to recover from such serious errors.
>
> =============== Diff against Morphic-mt.1112 ===============
>
> Item was changed:
>   ----- Method: Debugger class>>morphicOpenOn:context:label:contents:fullView: (in category '*Morphic-opening') -----
> + morphicOpenOn: process context: context label: title contents: contentsStringOrNil fullView: full
> - morphicOpenOn: process context: context label: title contents: contentsStringOrNil fullView: bool
>         "Open a notifier in response to an error, halt, or notify. A notifier view just shows a short view of the sender stack and provides a menu that lets the user open a full debugger."
>
>         | errorWasInUIProcess debugger |
> +       ErrorRecursion ifTrue: [
> +               "self assert: process == Project current uiProcess -- DOCUMENTATION ONLY"
> +               ErrorRecursion := false.
> +               ^ Project current handleFatalDrawingError: title].
> +
> +       [ErrorRecursion not & Preferences logDebuggerStackToFile
> -       errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: process.
> -       [Preferences logDebuggerStackToFile
>                 ifTrue: [Smalltalk logSqueakError: title inContext: context]] on: Error do: [:ex | ex return: nil].
> +
> +       ErrorRecursion := true.
> +
> +       errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: process.
> +
> +       "Schedule debugging in deferred UI message because
> +               1) If process is the current UI process, it is already broken.
> +               2) If process is some other process, it must not execute UI code"
> +       Project current addDeferredUIMessage: [
> +               debugger := self new process: process controller: nil context: context.
> +               full
> +                       ifTrue: [debugger openFullNoSuspendLabel: title]
> +                       ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
> +               debugger errorWasInUIProcess: errorWasInUIProcess.
> +
> +               "Try drawing the debugger tool at least once to avoid freeze."
> +               ActiveWorld displayWorldSafely.
> +
> +               ErrorRecursion := false.
> -       WorldState addDeferredUIMessage: [
> -               "schedule debugger in deferred UI message to address redraw
> -               problems after opening a debugger e.g. from the testrunner."
> -               [
> -                       debugger := self new process: process controller: nil context: context.
> -                       bool
> -                               ifTrue: [debugger openFullNoSuspendLabel: title]
> -                               ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
> -                       debugger errorWasInUIProcess: errorWasInUIProcess.
> -               ] on: Error do: [:ex |
> -                               self primitiveError:
> -                                       'Original error: ',
> -                                       title asString, '.
> -       Debugger error: ',
> -                               ([ex description] on: Error do: ['a ', ex class printString]), ':'
> -                       ]
>         ].
>         process suspend.
>   !
>
>