The Trunk: System-mt.1093.mcz

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

The Trunk: System-mt.1093.mcz

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

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
  "Arrange for valuableObject to be evaluated at a time when the user interface
  is in a coherent state."
 
  self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
- "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-
- ^ aCompiledMethod
- valueWithReceiver: anObject
- arguments: (aContextOrNil
- ifNil: [#()]
- ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+ ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
  "Create a Notifier on the active scheduling process with the given label."
 
  ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
  "Create a Notifier on the active scheduling process with the given label."
 
  ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+ ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
  Preferences cmdDotEnabled ifTrue:
+ [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
- [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+ ^ToolSet handleSyntaxError: self!
- ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
- "Open a debugger on the given process and context."
- self default ifNil:[
- (self confirm: 'Debugger request -- proceed?')
- ifFalse:[Processor terminateActive].
- ^self].
- ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+ ^ self
+ debugProcess: Processor activeProcess
+ context: aContext
+ label: aString
+ contents: contents
+ fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
- "Open a debugger on the given context."
- self default ifNil:[
- (self confirm: 'Debugger request -- proceed?')
- ifFalse:[Processor terminateActive].
- ^self].
- ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
- "Handle an otherwise unhandled error"
- self default ifNil:[ | ctx |
- Smalltalk
- logSqueakError: anError description
- inContext: (ctx := anError signalerContext) .
- self inform: (anError description, String cr, ctx shortStack).
- ^anError return].
- ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+ "Open a debugger on the given process, which is already suspended."
+
+ ^ self default
+ ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+ ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+ ^ self default
+ ifNil: [
+ self inform: 'Cannot debug method. It will just be executed.'.
+ aCompiledMethod
+ valueWithReceiver: anObject
+ arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+ ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
- self default ifNil:[^ self inform: 'Cannot debug method.'].
- ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+ "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+ ^ self default
+ ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+ ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+ "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+
+ ^ self default
+ ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+ ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
- "Handle a syntax error"
- self default ifNil:[^self debugError: anError]. "handle as usual error"
- ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+ "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+
+ THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+ ^ self default
+ ifNil: [ | ctx |
+ Smalltalk
+ logSqueakError: anError description
+ inContext: (ctx := anError signalerContext) .
+ self inform: (anError description, String cr, ctx shortStack).
+ anError return]
+ ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+ "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+
+ THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+ ^ self default
+ ifNil: [self handleError: anError]
+ ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+ "The user wants to interrupt a process, which might be unresponsive, to debug it.
+
+ THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+ ^ self default
+ ifNil: [self inform: 'No handler for user interrupts found.']
+ ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+ "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+
+ THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+ ^ self default
+ ifNil: [
+ self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+ aWarning resume]
+ ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
- "Open a debugger on the given process and context."
- self default ifNil:[
- (self confirm: 'Debugger request -- proceed?')
- ifFalse:[aProcess terminate].
- ^self].
- ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
  "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+ ^ToolSet handleError: self exception!
- ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+ ^ ToolSet handleWarning: self exception!
- ^ ToolSet
- debugContext: self exception signalerContext
- label: 'Warning'
- contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
  | process |
  process := Process
  forContext: (Context
  sender: thisContext sender
  receiver: aReceiver
  method: method
  arguments: anArray)
  priority: Processor activeProcess priority.
  ToolSet
+ debugProcess: process
- debug: process
  context: process suspendedContext
  label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
  contents: nil
  fullView: true.
  Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
  thisContext swapSender: nil.
  Processor activeProcess terminate!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Hannes Hirzel
Great contribution!

On Tue, 17 Sep 2019 10:10:24 0000, [hidden email]
<[hidden email]> wrote:

> Marcel Taeumel uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-mt.1093.mcz
>
> ==================== Summary ====================
>
> Name: System-mt.1093
> Author: mt
> Time: 17 September 2019, 12:10:14.798406 pm
> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
> Ancestors: System-mt.1092
>
> Refactors process debugging in general, which makes MVC debugging work
> again:
>
> -  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to
> untangle debugging for those different GUI frameworks
> - removes the intermediate role of UIManager for debugging purposes -- focus
> on Project, (Standard)ToolSet, and Process
> - treat unhandled warnings the same as unhandled errors, which is through
> the current ToolSet
> - let SyntaxError tool use tool builder
> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
> - adds comments to ToolSet and StandardToolSet
>
> =============== Diff against System-mt.1092 ===============
>
> Item was changed:
> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling')
> -----
>   addDeferredUIMessage: valuableObject
>   "Arrange for valuableObject to be evaluated at a time when the user
> interface
>   is in a coherent state."
>
>   self subclassResponsibility!
>
> Item was removed:
> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category
> 'debugging') -----
> - debugMethod: aCompiledMethod forReceiver: anObject inContext:
> aContextOrNil
> - "Just execute the method and return the result. We cannot know how
> interactive debugging works for arbitrary projects."
> -
> - ^ aCompiledMethod
> - valueWithReceiver: anObject
> - arguments: (aContextOrNil
> - ifNil: [#()]
> - ifNotNil: [{aContextOrNil}])!
>
> Item was added:
> + ----- Method: Project>>debuggerClass (in category 'scheduling &
> debugging') -----
> + debuggerClass
> +
> + ^ self subclassResponsibility!
>
> Item was changed:
> + ----- Method: Project>>interruptName: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>interruptName: (in category 'debugging') -----
>   interruptName: labelString
>   "Create a Notifier on the active scheduling process with the given
> label."
>
>   ^ self subclassResponsibility
>   !
>
> Item was changed:
> + ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'debugging') -----
>   interruptName: labelString preemptedProcess: theInterruptedProcess
>   "Create a Notifier on the active scheduling process with the given
> label."
>
>   ^ self subclassResponsibility
>   !
>
> Item was added:
> + ----- Method: Project>>syntaxError: (in category 'scheduling & debugging')
> -----
> + syntaxError: aSyntaxErrorNotification
> +
> + ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>
> Item was changed:
>   ----- Method: SmalltalkImage>>handleUserInterrupt (in category
> 'miscellaneous') -----
>   handleUserInterrupt
>   Preferences cmdDotEnabled ifTrue:
> + [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
> - [[Project current interruptName: 'User Interrupt'] fork]
>   !
>
> Item was changed:
>   ----- Method: SyntaxErrorNotification>>defaultAction (in category
> '*System-exceptionDescription') -----
>   defaultAction
> + ^ToolSet handleSyntaxError: self!
> - ^ToolSet debugSyntaxError: self!
>
> Item was removed:
> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in
> category 'debugging') -----
> - debug: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> - "Open a debugger on the given process and context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[Processor terminateActive].
> - ^self].
> - ^self default debug: aProcess context: aContext label: aString contents:
> contents fullView: aBool!
>
> Item was added:
> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in
> category 'debugging - convenience') -----
> + debugActiveProcessContext: aContext label: aString contents: contents
> +
> + ^ self
> + debugProcess: Processor activeProcess
> + context: aContext
> + label: aString
> + contents: contents
> + fullView: false!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugContext:label:contents: (in category
> 'debugging') -----
> - debugContext: aContext label: aString contents: contents
> - "Open a debugger on the given context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[Processor terminateActive].
> - ^self].
> - ^self default debugContext: aContext label: aString contents: contents!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
> - debugError: anError
> - "Handle an otherwise unhandled error"
> - self default ifNil:[ | ctx |
> - Smalltalk
> - logSqueakError: anError description
> - inContext: (ctx := anError signalerContext) .
> - self inform: (anError description, String cr, ctx shortStack).
> - ^anError return].
> - ^self default debugError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category
> 'debugging') -----
> + debugInterruptedProcess: aSuspendedProcess label: aString
> + "Open a debugger on the given process, which is already suspended."
> +
> + ^ self default
> + ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse:[aSuspendedProcess terminate]]
> + ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label:
> aString]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in
> category 'debugging') -----
>   debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>
> + ^ self default
> + ifNil: [
> + self inform: 'Cannot debug method. It will just be executed.'.
> + aCompiledMethod
> + valueWithReceiver: anObject
> + arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
> + ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject
> inContext: aContext]!
> - self default ifNil:[^ self inform: 'Cannot debug method.'].
> - ^self default debugMethod: aCompiledMethod forReceiver: anObject
> inContext: aContext
> - !
>
> Item was added:
> + ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView:
> (in category 'debugging') -----
> + debugProcess: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> + "Open a debugger on the given process, which  might be active, suspended,
> or terminated."
> +
> + ^ self default
> + ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:
> [Processor terminateActive]]
> + ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label:
> aString contents: contents fullView: aBool]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging')
> -----
> + debugSyntaxError: aSyntaxErrorNotification
> + "Opens a tool to let the user correct the syntax error, which then
> resumes the compiler process."
> +
> + ^ self default
> + ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode
> label: 'Syntax Error (read only)']
> + ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
> - debugSyntaxError: anError
> - "Handle a syntax error"
> - self default ifNil:[^self debugError: anError]. "handle as usual error"
> - ^self default debugSyntaxError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>handleError: (in category 'debugging -
> handlers') -----
> + handleError: anError
> + "No exception handler caught the given error. Let the user handle that
> error through an interactive tool such as a debugger.
> +
> + THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
> +
> + ^ self default
> + ifNil: [ | ctx |
> + Smalltalk
> + logSqueakError: anError description
> + inContext: (ctx := anError signalerContext) .
> + self inform: (anError description, String cr, ctx shortStack).
> + anError return]
> + ifNotNil: [:ts | ts handleError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging -
> handlers') -----
> + handleSyntaxError: anError
> + "A syntax error (notification) occurred while parsing and compiling
> source code. Usually, the compiling process suspends until the syntax error
> gets corrected.
> +
> + THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
> +
> + ^ self default
> + ifNil: [self handleError: anError]
> + ifNotNil: [:ts | ts handleSyntaxError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category
> 'debugging - handlers') -----
> + handleUserInterruptRequest: aString
> + "The user wants to interrupt a process, which might be unresponsive, to
> debug it.
> +
> + THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the
> preempted one. See EventSensor >> #userInterruptWatcher."
> +
> + ^ self default
> + ifNil: [self inform: 'No handler for user interrupts found.']
> + ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging -
> handlers') -----
> + handleWarning: aWarning
> + "No exception handler caught the given warning. Let the user handle that
> warning through an interactive tool such as a debugger.
> +
> + THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
> +
> + ^ self default
> + ifNil: [
> + self inform: (aWarning messageText, String cr, aWarning signalerContext
> shortStack).
> + aWarning resume]
> + ifNotNil: [:ts | ts handleWarning: aWarning]!
>
> Item was removed:
> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging')
> -----
> - interrupt: aProcess label: aString
> - "Open a debugger on the given process and context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[aProcess terminate].
> - ^self].
> - ^self default interrupt: aProcess label: aString!
>
> Item was changed:
>   ----- Method: UnhandledError>>defaultAction (in category '*System-priv
> handling') -----
>   defaultAction
>   "The current computation is terminated. The cause of the error should be
> logged or reported to the user. If the program is operating in an
> interactive debugging environment the computation should be suspended and
> the debugger activated."
> + ^ToolSet handleError: self exception!
> - ^ToolSet debugError: self exception!
>
> Item was changed:
>   ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv
> handling') -----
>   defaultAction
>
> + ^ ToolSet handleWarning: self exception!
> - ^ ToolSet
> - debugContext: self exception signalerContext
> - label: 'Warning'
> - contents: self exception messageText , '\\Select Proceed to continue, or
> close this window to cancel the operation.' withCRs!
>
> Item was changed:
>   ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation')
> -----
>   run: aSelector with: anArray in: aReceiver
>   | process |
>   process := Process
>   forContext: (Context
>   sender: thisContext sender
>   receiver: aReceiver
>   method: method
>   arguments: anArray)
>   priority: Processor activeProcess priority.
>   ToolSet
> + debugProcess: process
> - debug: process
>   context: process suspendedContext
>   label:  'Breakpoint in ' , method methodClass name , '>>#' , method
> selector
>   contents: nil
>   fullView: true.
>   Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
>   thisContext swapSender: nil.
>   Processor activeProcess terminate!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Christoph Thiede
In reply to this post by commits-2

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.

Best,
Marcel

Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!





cmd-dot-dialog.1.cs (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Christoph Thiede

Did you first filein your changeset or install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:42:05
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.

Best,
Marcel

Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
I tried both and also rejecting/accepting the conflict in SmalltalkImage >> #handleUserInterrupt. Works fine.

Best,
Marcel

Am 20.09.2019 19:43:08 schrieb Thiede, Christoph <[hidden email]>:

Did you first filein your changeset or install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:42:05
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.

Best,
Marcel

Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Hannes Hirzel
I experience a strange BlockClosure>>newProcess message while
debugging the example
     3 factorial

Best
--Hannes

On 9/20/19, Marcel Taeumel <[hidden email]> wrote:

> I tried both and also rejecting/accepting the conflict in SmalltalkImage >>
> #handleUserInterrupt. Works fine.
>
> Best,
> Marcel
> Am 20.09.2019 19:43:08 schrieb Thiede, Christoph
> <[hidden email]>:
> Did you first filein your changeset or install this commit?
> Von: Squeak-dev <[hidden email]> im Auftrag
> von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:42:05
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
>
> Strange. If I file in the cmd-dot menu, it still works as expected in recent
> trunk.
>
> Best,
> Marcel
> Am 20.09.2019 19:20:52 schrieb Thiede, Christoph
> <[hidden email]>:
> FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up
> reproducibly.
> It would be great if you could create an updated version of the menu :)
> Otherwise, how can I safely unload the cmdDot menu to install this commit?
> Von: Squeak-dev <[hidden email]> im Auftrag
> von [hidden email] <[hidden email]>
> Gesendet: Dienstag, 17. September 2019 12:10:24
> An: [hidden email];
> [hidden email]
> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
>
> Marcel Taeumel uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-mt.1093.mcz
> [http://source.squeak.org/trunk/System-mt.1093.mcz]
>
> ==================== Summary ====================
>
> Name: System-mt.1093
> Author: mt
> Time: 17 September 2019, 12:10:14.798406 pm
> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
> Ancestors: System-mt.1092
>
> Refactors process debugging in general, which makes MVC debugging work
> again:
>
> -  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to
> untangle debugging for those different GUI frameworks
> - removes the intermediate role of UIManager for debugging purposes -- focus
> on Project, (Standard)ToolSet, and Process
> - treat unhandled warnings the same as unhandled errors, which is through
> the current ToolSet
> - let SyntaxError tool use tool builder
> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
> - adds comments to ToolSet and StandardToolSet
>
> =============== Diff against System-mt.1092 ===============
>
> Item was changed:
> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling')
> -----
>   addDeferredUIMessage: valuableObject
>          "Arrange for valuableObject to be evaluated at a time when the user
> interface
>          is in a coherent state."
>
>          self subclassResponsibility!
>
> Item was removed:
> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category
> 'debugging') -----
> - debugMethod: aCompiledMethod forReceiver: anObject inContext:
> aContextOrNil
> -        "Just execute the method and return the result. We cannot know how
> interactive debugging works for arbitrary projects."
> -
> -        ^ aCompiledMethod
> -                valueWithReceiver: anObject
> -                 arguments: (aContextOrNil
> -                                                        ifNil: [#()]
> -                                                        ifNotNil:
> [{aContextOrNil}])!
>
> Item was added:
> + ----- Method: Project>>debuggerClass (in category 'scheduling &
> debugging') -----
> + debuggerClass
> +
> +        ^ self subclassResponsibility!
>
> Item was changed:
> + ----- Method: Project>>interruptName: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>interruptName: (in category 'debugging') -----
>   interruptName: labelString
>          "Create a Notifier on the active scheduling process with the given
> label."
>
>          ^ self subclassResponsibility
>   !
>
> Item was changed:
> + ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'debugging') -----
>   interruptName: labelString preemptedProcess: theInterruptedProcess
>          "Create a Notifier on the active scheduling process with the given
> label."
>
>          ^ self subclassResponsibility
>   !
>
> Item was added:
> + ----- Method: Project>>syntaxError: (in category 'scheduling & debugging')
> -----
> + syntaxError: aSyntaxErrorNotification
> +
> +        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>
> Item was changed:
>   ----- Method: SmalltalkImage>>handleUserInterrupt (in category
> 'miscellaneous') -----
>   handleUserInterrupt
>          Preferences cmdDotEnabled ifTrue:
> +                [[ToolSet handleUserInterruptRequest: 'User Interrupt']
> fork]
> -                [[Project current interruptName: 'User Interrupt'] fork]
>   !
>
> Item was changed:
>   ----- Method: SyntaxErrorNotification>>defaultAction (in category
> '*System-exceptionDescription') -----
>   defaultAction
> +        ^ToolSet handleSyntaxError: self!
> -        ^ToolSet debugSyntaxError: self!
>
> Item was removed:
> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in
> category 'debugging') -----
> - debug: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> -        "Open a debugger on the given process and context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[Processor terminateActive].
> -                ^self].
> -        ^self default debug: aProcess context: aContext label: aString
> contents: contents fullView: aBool!
>
> Item was added:
> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in
> category 'debugging - convenience') -----
> + debugActiveProcessContext: aContext label: aString contents: contents
> +
> +        ^ self
> +                debugProcess: Processor activeProcess
> +                context: aContext
> +                label: aString
> +                contents: contents
> +                fullView: false!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugContext:label:contents: (in category
> 'debugging') -----
> - debugContext: aContext label: aString contents: contents
> -        "Open a debugger on the given context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[Processor terminateActive].
> -                ^self].
> -        ^self default debugContext: aContext label: aString contents:
> contents!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
> - debugError: anError
> -        "Handle an otherwise unhandled error"
> -        self default ifNil:[ | ctx |
> -                Smalltalk
> -                        logSqueakError: anError description
> -                        inContext: (ctx := anError signalerContext) .
> -                self inform: (anError description, String cr, ctx
> shortStack).
> -                ^anError return].
> -        ^self default debugError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category
> 'debugging') -----
> + debugInterruptedProcess: aSuspendedProcess label: aString
> +        "Open a debugger on the given process, which is already
> suspended."
> +
> +        ^ self default
> +                ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse:[aSuspendedProcess terminate]]
> +                ifNotNil: [:ts | ts debugInterruptedProcess:
> aSuspendedProcess label: aString]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in
> category 'debugging') -----
>   debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>
> +        ^ self default
> +                ifNil: [
> +                        self inform: 'Cannot debug method. It will just be
> executed.'.
> +                        aCompiledMethod
> +                                valueWithReceiver: anObject
> +                                arguments: (aContext ifNil: [#()] ifNotNil:
> [{aContext}])]
> +                ifNotNil: [:ts | ts debugMethod: aCompiledMethod
> forReceiver: anObject inContext: aContext]!
> -        self default ifNil:[^ self inform: 'Cannot debug method.'].
> -        ^self default debugMethod: aCompiledMethod forReceiver: anObject
> inContext: aContext
> - !
>
> Item was added:
> + ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView:
> (in category 'debugging') -----
> + debugProcess: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> +        "Open a debugger on the given process, which  might be active,
> suspended, or terminated."
> +
> +        ^ self default
> +                ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse: [Processor terminateActive]]
> +                ifNotNil: [:ts | ts debugProcess: aProcess context:
> aContext label: aString contents: contents fullView: aBool]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging')
> -----
> + debugSyntaxError: aSyntaxErrorNotification
> +        "Opens a tool to let the user correct the syntax error, which then
> resumes the compiler process."
> +
> +        ^ self default
> +                ifNil: [Project uiManager edit: aSyntaxErrorNotification
> errorCode label: 'Syntax Error (read only)']
> +                ifNotNil: [:ts | ts debugSyntaxError:
> aSyntaxErrorNotification]!
> - debugSyntaxError: anError
> -        "Handle a syntax error"
> -        self default ifNil:[^self debugError: anError]. "handle as usual
> error"
> -        ^self default debugSyntaxError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>handleError: (in category 'debugging -
> handlers') -----
> + handleError: anError
> +        "No exception handler caught the given error. Let the user handle
> that error through an interactive tool such as a debugger.
> +
> +        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
> +
> +        ^ self default
> +                ifNil: [ | ctx |
> +                        Smalltalk
> +                                logSqueakError: anError description
> +                                inContext: (ctx := anError signalerContext)
> .
> +                        self inform: (anError description, String cr, ctx
> shortStack).
> +                        anError return]
> +                ifNotNil: [:ts | ts handleError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging -
> handlers') -----
> + handleSyntaxError: anError
> +        "A syntax error (notification) occurred while parsing and compiling
> source code. Usually, the compiling process suspends until the syntax error
> gets corrected.
> +
> +        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
> +
> +        ^ self default
> +                ifNil: [self handleError: anError]
> +                ifNotNil: [:ts | ts handleSyntaxError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category
> 'debugging - handlers') -----
> + handleUserInterruptRequest: aString
> +        "The user wants to interrupt a process, which might be
> unresponsive, to debug it.
> +
> +        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher
> than the preempted one. See EventSensor >> #userInterruptWatcher."
> +
> +        ^ self default
> +                ifNil: [self inform: 'No handler for user interrupts
> found.']
> +                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging -
> handlers') -----
> + handleWarning: aWarning
> +        "No exception handler caught the given warning. Let the user handle
> that warning through an interactive tool such as a debugger.
> +
> +        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
> +
> +        ^ self default
> +                ifNil: [
> +                        self inform: (aWarning messageText, String cr,
> aWarning signalerContext shortStack).
> +                        aWarning resume]
> +                ifNotNil: [:ts | ts handleWarning: aWarning]!
>
> Item was removed:
> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging')
> -----
> - interrupt: aProcess label: aString
> -        "Open a debugger on the given process and context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[aProcess terminate].
> -                ^self].
> -        ^self default interrupt: aProcess label: aString!
>
> Item was changed:
>   ----- Method: UnhandledError>>defaultAction (in category '*System-priv
> handling') -----
>   defaultAction
>          "The current computation is terminated. The cause of the error
> should be logged or reported to the user. If the program is operating in an
> interactive debugging environment the computation should be suspended and
> the debugger activated."
> +        ^ToolSet handleError: self exception!
> -        ^ToolSet debugError: self exception!
>
> Item was changed:
>   ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv
> handling') -----
>   defaultAction
>
> +        ^ ToolSet handleWarning: self exception!
> -        ^ ToolSet
> -                debugContext: self exception signalerContext
> -                label: 'Warning'
> -                contents: self exception messageText , '\\Select Proceed to
> continue, or close this window to cancel the operation.' withCRs!
>
> Item was changed:
>   ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation')
> -----
>   run: aSelector with: anArray in: aReceiver
>          | process |
>          process := Process
>                  forContext: (Context
>                          sender: thisContext sender
>                          receiver: aReceiver
>                          method: method
>                          arguments: anArray)
>                  priority: Processor activeProcess priority.
>          ToolSet
> +                debugProcess: process
> -                debug: process
>                  context: process suspendedContext
>                  label:  'Breakpoint in ' , method methodClass name , '>>#'
> , method selector
>                  contents: nil
>                  fullView: true.
>          Project current spawnNewProcessIfThisIsUI: Processor
> activeProcess.
>          thisContext swapSender: nil.
>          Processor activeProcess terminate!
>
>
>



MVC_debugger_error_System-mt-1093_Screenshot_2019-09-21.png (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Christoph Thiede
In reply to this post by marcel.taeumel

I just did a complete Trunk update, accepted all conflict and then re-installed your changeset. When I press cmd+dot, I can see the dialog, but when I press an arbitrary key then, my image hangs up ...


There is no DebugLog. Any ideas?


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:55:41
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
I tried both and also rejecting/accepting the conflict in SmalltalkImage >> #handleUserInterrupt. Works fine.

Best,
Marcel

Am 20.09.2019 19:43:08 schrieb Thiede, Christoph <[hidden email]>:

Did you first filein your changeset or install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:42:05
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.

Best,
Marcel

Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Levente Uzonyi
If your platform supports signals, you can send SIGUSR1 to the VM's
process.

Levente

On Sat, 21 Sep 2019, Thiede, Christoph wrote:

>
> I just did a complete Trunk update, accepted all conflict and then re-installed your changeset. When I press cmd+dot, I can see the dialog, but when I press an arbitrary key then, my image hangs up ...
>
>
> There is no DebugLog. Any ideas?
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:55:41
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz  
> I tried both and also rejecting/accepting the conflict in SmalltalkImage >> #handleUserInterrupt. Works fine.
> Best,
> Marcel
>
>       Am 20.09.2019 19:43:08 schrieb Thiede, Christoph <[hidden email]>:
>
>       Did you first filein your changeset or install this commit?
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:42:05
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz  
> Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.
> Best,
> Marcel
>
>       Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:
>
>       FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.
>
>       It would be great if you could create an updated version of the menu :)
>
>       Otherwise, how can I safely unload the cmdDot menu to install this commit?
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
> Gesendet: Dienstag, 17. September 2019 12:10:24
> An: [hidden email]; [hidden email]
> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz  
> Marcel Taeumel uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-mt.1093.mcz
>
> ==================== Summary ====================
>
> Name: System-mt.1093
> Author: mt
> Time: 17 September 2019, 12:10:14.798406 pm
> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
> Ancestors: System-mt.1092
>
> Refactors process debugging in general, which makes MVC debugging work again:
>
> -  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
> - removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
> - treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
> - let SyntaxError tool use tool builder
> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
> - adds comments to ToolSet and StandardToolSet
>
> =============== Diff against System-mt.1092 ===============
>
> Item was changed:
> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
>   addDeferredUIMessage: valuableObject
>          "Arrange for valuableObject to be evaluated at a time when the user interface
>          is in a coherent state."
>  
>          self subclassResponsibility!
>
> Item was removed:
> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
> - debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
> -        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
> -       
> -        ^ aCompiledMethod
> -                valueWithReceiver: anObject
> -                 arguments: (aContextOrNil
> -                                                        ifNil: [#()]
> -                                                        ifNotNil: [{aContextOrNil}])!
>
> Item was added:
> + ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
> + debuggerClass
> +
> +        ^ self subclassResponsibility!
>
> Item was changed:
> + ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName: (in category 'debugging') -----
>   interruptName: labelString
>          "Create a Notifier on the active scheduling process with the given label."
>  
>          ^ self subclassResponsibility
>   !
>
> Item was changed:
> + ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
>   interruptName: labelString preemptedProcess: theInterruptedProcess
>          "Create a Notifier on the active scheduling process with the given label."
>  
>          ^ self subclassResponsibility
>   !
>
> Item was added:
> + ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
> + syntaxError: aSyntaxErrorNotification
> +
> +        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>
> Item was changed:
>   ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
>   handleUserInterrupt
>          Preferences cmdDotEnabled ifTrue:
> +                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
> -                [[Project current interruptName: 'User Interrupt'] fork]
>   !
>
> Item was changed:
>   ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
>   defaultAction
> +        ^ToolSet handleSyntaxError: self!
> -        ^ToolSet debugSyntaxError: self!
>
> Item was removed:
> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
> - debug: aProcess context: aContext label: aString contents: contents fullView: aBool
> -        "Open a debugger on the given process and context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[Processor terminateActive].
> -                ^self].
> -        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!
>
> Item was added:
> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
> + debugActiveProcessContext: aContext label: aString contents: contents
> +
> +        ^ self
> +                debugProcess: Processor activeProcess
> +                context: aContext
> +                label: aString
> +                contents: contents
> +                fullView: false!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
> - debugContext: aContext label: aString contents: contents
> -        "Open a debugger on the given context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[Processor terminateActive].
> -                ^self].
> -        ^self default debugContext: aContext label: aString contents: contents!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
> - debugError: anError
> -        "Handle an otherwise unhandled error"
> -        self default ifNil:[ | ctx |
> -                Smalltalk
> -                        logSqueakError: anError description
> -                        inContext: (ctx := anError signalerContext) .
> -                self inform: (anError description, String cr, ctx shortStack).
> -                ^anError return].
> -        ^self default debugError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
> + debugInterruptedProcess: aSuspendedProcess label: aString
> +        "Open a debugger on the given process, which is already suspended."
> +       
> +        ^ self default
> +                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
> +                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
>   debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>  
> +        ^ self default
> +                ifNil: [
> +                        self inform: 'Cannot debug method. It will just be executed.'.
> +                        aCompiledMethod
> +                                valueWithReceiver: anObject
> +                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
> +                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
> -        self default ifNil:[^ self inform: 'Cannot debug method.'].
> -        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
> - !
>
> Item was added:
> + ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
> + debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
> +        "Open a debugger on the given process, which  might be active, suspended, or terminated."
> +
> +        ^ self default
> +                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
> +                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
> + debugSyntaxError: aSyntaxErrorNotification
> +        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
> +       
> +        ^ self default
> +                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
> +                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
> - debugSyntaxError: anError
> -        "Handle a syntax error"
> -        self default ifNil:[^self debugError: anError]. "handle as usual error"
> -        ^self default debugSyntaxError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
> + handleError: anError
> +        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
> +       
> +        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
> +
> +        ^ self default
> +                ifNil: [ | ctx |
> +                        Smalltalk
> +                                logSqueakError: anError description
> +                                inContext: (ctx := anError signalerContext) .
> +                        self inform: (anError description, String cr, ctx shortStack).
> +                        anError return]
> +                ifNotNil: [:ts | ts handleError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
> + handleSyntaxError: anError
> +        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
> +       
> +        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
> +
> +        ^ self default
> +                ifNil: [self handleError: anError]
> +                ifNotNil: [:ts | ts handleSyntaxError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
> + handleUserInterruptRequest: aString
> +        "The user wants to interrupt a process, which might be unresponsive, to debug it.
> +       
> +        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
> +
> +        ^ self default
> +                ifNil: [self inform: 'No handler for user interrupts found.']
> +                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
> + handleWarning: aWarning
> +        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
> +       
> +        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
> +
> +        ^ self default
> +                ifNil: [
> +                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
> +                        aWarning resume]
> +                ifNotNil: [:ts | ts handleWarning: aWarning]!
>
> Item was removed:
> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
> - interrupt: aProcess label: aString
> -        "Open a debugger on the given process and context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[aProcess terminate].
> -                ^self].
> -        ^self default interrupt: aProcess label: aString!
>
> Item was changed:
>   ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
>   defaultAction
>          "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
> +        ^ToolSet handleError: self exception!
> -        ^ToolSet debugError: self exception!
>
> Item was changed:
>   ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
>   defaultAction
>  
> +        ^ ToolSet handleWarning: self exception!
> -        ^ ToolSet
> -                debugContext: self exception signalerContext
> -                label: 'Warning'
> -                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!
>
> Item was changed:
>   ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
>   run: aSelector with: anArray in: aReceiver
>          | process |
>          process := Process
>                  forContext: (Context
>                          sender: thisContext sender
>                          receiver: aReceiver
>                          method: method
>                          arguments: anArray)
>                  priority: Processor activeProcess priority.
>          ToolSet
> +                debugProcess: process
> -                debug: process
>                  context: process suspendedContext
>                  label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
>                  contents: nil
>                  fullView: true.
>          Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
>          thisContext swapSender: nil.
>          Processor activeProcess terminate!
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Christoph Thiede

Oh, that's (yet) totally Greek to me ... I'm on Windows, Google says it does not support SIGUSR1.


Von: Squeak-dev <[hidden email]> im Auftrag von Levente Uzonyi <[hidden email]>
Gesendet: Samstag, 21. September 2019 19:01:45
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
If your platform supports signals, you can send SIGUSR1 to the VM's
process.

Levente

On Sat, 21 Sep 2019, Thiede, Christoph wrote:

>
> I just did a complete Trunk update, accepted all conflict and then re-installed your changeset. When I press cmd+dot, I can see the dialog, but when I press an arbitrary key then, my image hangs up ...
>
>
> There is no DebugLog. Any ideas?
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:55:41
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz  
> I tried both and also rejecting/accepting the conflict in SmalltalkImage >> #handleUserInterrupt. Works fine.
> Best,
> Marcel
>
>       Am 20.09.2019 19:43:08 schrieb Thiede, Christoph <[hidden email]>:
>
>       Did you first filein your changeset or install this commit?
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:42:05
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz  
> Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.
> Best,
> Marcel
>
>       Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:
>
>       FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.
>
>       It would be great if you could create an updated version of the menu :)
>
>       Otherwise, how can I safely unload the cmdDot menu to install this commit?
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
> Gesendet: Dienstag, 17. September 2019 12:10:24
> An: [hidden email]; [hidden email]
> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz  
> Marcel Taeumel uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-mt.1093.mcz
>
> ==================== Summary ====================
>
> Name: System-mt.1093
> Author: mt
> Time: 17 September 2019, 12:10:14.798406 pm
> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
> Ancestors: System-mt.1092
>
> Refactors process debugging in general, which makes MVC debugging work again:
>
> -  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
> - removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
> - treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
> - let SyntaxError tool use tool builder
> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
> - adds comments to ToolSet and StandardToolSet
>
> =============== Diff against System-mt.1092 ===============
>
> Item was changed:
> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
>   addDeferredUIMessage: valuableObject
>          "Arrange for valuableObject to be evaluated at a time when the user interface
>          is in a coherent state."
>  
>          self subclassResponsibility!
>
> Item was removed:
> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
> - debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
> -        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
> -       
> -        ^ aCompiledMethod
> -                valueWithReceiver: anObject
> -                 arguments: (aContextOrNil
> -                                                        ifNil: [#()]
> -                                                        ifNotNil: [{aContextOrNil}])!
>
> Item was added:
> + ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
> + debuggerClass
> +
> +        ^ self subclassResponsibility!
>
> Item was changed:
> + ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName: (in category 'debugging') -----
>   interruptName: labelString
>          "Create a Notifier on the active scheduling process with the given label."
>  
>          ^ self subclassResponsibility
>   !
>
> Item was changed:
> + ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
>   interruptName: labelString preemptedProcess: theInterruptedProcess
>          "Create a Notifier on the active scheduling process with the given label."
>  
>          ^ self subclassResponsibility
>   !
>
> Item was added:
> + ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
> + syntaxError: aSyntaxErrorNotification
> +
> +        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>
> Item was changed:
>   ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
>   handleUserInterrupt
>          Preferences cmdDotEnabled ifTrue:
> +                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
> -                [[Project current interruptName: 'User Interrupt'] fork]
>   !
>
> Item was changed:
>   ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
>   defaultAction
> +        ^ToolSet handleSyntaxError: self!
> -        ^ToolSet debugSyntaxError: self!
>
> Item was removed:
> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
> - debug: aProcess context: aContext label: aString contents: contents fullView: aBool
> -        "Open a debugger on the given process and context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[Processor terminateActive].
> -                ^self].
> -        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!
>
> Item was added:
> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
> + debugActiveProcessContext: aContext label: aString contents: contents
> +
> +        ^ self
> +                debugProcess: Processor activeProcess
> +                context: aContext
> +                label: aString
> +                contents: contents
> +                fullView: false!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
> - debugContext: aContext label: aString contents: contents
> -        "Open a debugger on the given context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[Processor terminateActive].
> -                ^self].
> -        ^self default debugContext: aContext label: aString contents: contents!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
> - debugError: anError
> -        "Handle an otherwise unhandled error"
> -        self default ifNil:[ | ctx |
> -                Smalltalk
> -                        logSqueakError: anError description
> -                        inContext: (ctx := anError signalerContext) .
> -                self inform: (anError description, String cr, ctx shortStack).
> -                ^anError return].
> -        ^self default debugError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
> + debugInterruptedProcess: aSuspendedProcess label: aString
> +        "Open a debugger on the given process, which is already suspended."
> +       
> +        ^ self default
> +                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
> +                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
>   debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>  
> +        ^ self default
> +                ifNil: [
> +                        self inform: 'Cannot debug method. It will just be executed.'.
> +                        aCompiledMethod
> +                                valueWithReceiver: anObject
> +                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
> +                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
> -        self default ifNil:[^ self inform: 'Cannot debug method.'].
> -        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
> - !
>
> Item was added:
> + ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
> + debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
> +        "Open a debugger on the given process, which  might be active, suspended, or terminated."
> +
> +        ^ self default
> +                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
> +                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!
>
> Item was changed:
>   ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
> + debugSyntaxError: aSyntaxErrorNotification
> +        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
> +       
> +        ^ self default
> +                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
> +                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
> - debugSyntaxError: anError
> -        "Handle a syntax error"
> -        self default ifNil:[^self debugError: anError]. "handle as usual error"
> -        ^self default debugSyntaxError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
> + handleError: anError
> +        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
> +       
> +        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
> +
> +        ^ self default
> +                ifNil: [ | ctx |
> +                        Smalltalk
> +                                logSqueakError: anError description
> +                                inContext: (ctx := anError signalerContext) .
> +                        self inform: (anError description, String cr, ctx shortStack).
> +                        anError return]
> +                ifNotNil: [:ts | ts handleError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
> + handleSyntaxError: anError
> +        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
> +       
> +        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
> +
> +        ^ self default
> +                ifNil: [self handleError: anError]
> +                ifNotNil: [:ts | ts handleSyntaxError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
> + handleUserInterruptRequest: aString
> +        "The user wants to interrupt a process, which might be unresponsive, to debug it.
> +       
> +        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
> +
> +        ^ self default
> +                ifNil: [self inform: 'No handler for user interrupts found.']
> +                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
> + handleWarning: aWarning
> +        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
> +       
> +        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
> +
> +        ^ self default
> +                ifNil: [
> +                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
> +                        aWarning resume]
> +                ifNotNil: [:ts | ts handleWarning: aWarning]!
>
> Item was removed:
> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
> - interrupt: aProcess label: aString
> -        "Open a debugger on the given process and context."
> -        self default ifNil:[
> -                (self confirm: 'Debugger request -- proceed?')
> -                        ifFalse:[aProcess terminate].
> -                ^self].
> -        ^self default interrupt: aProcess label: aString!
>
> Item was changed:
>   ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
>   defaultAction
>          "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
> +        ^ToolSet handleError: self exception!
> -        ^ToolSet debugError: self exception!
>
> Item was changed:
>   ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
>   defaultAction
>  
> +        ^ ToolSet handleWarning: self exception!
> -        ^ ToolSet
> -                debugContext: self exception signalerContext
> -                label: 'Warning'
> -                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!
>
> Item was changed:
>   ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
>   run: aSelector with: anArray in: aReceiver
>          | process |
>          process := Process
>                  forContext: (Context
>                          sender: thisContext sender
>                          receiver: aReceiver
>                          method: method
>                          arguments: anArray)
>                  priority: Processor activeProcess priority.
>          ToolSet
> +                debugProcess: process
> -                debug: process
>                  context: process suspendedContext
>                  label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
>                  contents: nil
>                  fullView: true.
>          Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
>          thisContext swapSender: nil.
>          Processor activeProcess terminate!
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
In reply to this post by Hannes Hirzel
Hi Hannes,

that's a drawing glitch of the debugger. I will look into it.

Best,
Marcel

Am 21.09.2019 11:02:17 schrieb H. Hirzel <[hidden email]>:

I experience a strange BlockClosure>>newProcess message while
debugging the example
3 factorial

Best
--Hannes

On 9/20/19, Marcel Taeumel wrote:
> I tried both and also rejecting/accepting the conflict in SmalltalkImage >>
> #handleUserInterrupt. Works fine.
>
> Best,
> Marcel
> Am 20.09.2019 19:43:08 schrieb Thiede, Christoph
> :
> Did you first filein your changeset or install this commit?
> Von: Squeak-dev im Auftrag
> von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:42:05
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
>
> Strange. If I file in the cmd-dot menu, it still works as expected in recent
> trunk.
>
> Best,
> Marcel
> Am 20.09.2019 19:20:52 schrieb Thiede, Christoph
> :
> FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up
> reproducibly.
> It would be great if you could create an updated version of the menu :)
> Otherwise, how can I safely unload the cmdDot menu to install this commit?
> Von: Squeak-dev im Auftrag
> von [hidden email]
> Gesendet: Dienstag, 17. September 2019 12:10:24
> An: [hidden email];
> [hidden email]
> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
>
> Marcel Taeumel uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-mt.1093.mcz
> [http://source.squeak.org/trunk/System-mt.1093.mcz]
>
> ==================== Summary ====================
>
> Name: System-mt.1093
> Author: mt
> Time: 17 September 2019, 12:10:14.798406 pm
> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
> Ancestors: System-mt.1092
>
> Refactors process debugging in general, which makes MVC debugging work
> again:
>
> - adds MorphicDebugger and MVCDebugger as subclasses of Debugger to
> untangle debugging for those different GUI frameworks
> - removes the intermediate role of UIManager for debugging purposes -- focus
> on Project, (Standard)ToolSet, and Process
> - treat unhandled warnings the same as unhandled errors, which is through
> the current ToolSet
> - let SyntaxError tool use tool builder
> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
> - adds comments to ToolSet and StandardToolSet
>
> =============== Diff against System-mt.1092 ===============
>
> Item was changed:
> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling')
> -----
> addDeferredUIMessage: valuableObject
> "Arrange for valuableObject to be evaluated at a time when the user
> interface
> is in a coherent state."
>
> self subclassResponsibility!
>
> Item was removed:
> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category
> 'debugging') -----
> - debugMethod: aCompiledMethod forReceiver: anObject inContext:
> aContextOrNil
> - "Just execute the method and return the result. We cannot know how
> interactive debugging works for arbitrary projects."
> -
> - ^ aCompiledMethod
> - valueWithReceiver: anObject
> - arguments: (aContextOrNil
> - ifNil: [#()]
> - ifNotNil:
> [{aContextOrNil}])!
>
> Item was added:
> + ----- Method: Project>>debuggerClass (in category 'scheduling &
> debugging') -----
> + debuggerClass
> +
> + ^ self subclassResponsibility!
>
> Item was changed:
> + ----- Method: Project>>interruptName: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>interruptName: (in category 'debugging') -----
> interruptName: labelString
> "Create a Notifier on the active scheduling process with the given
> label."
>
> ^ self subclassResponsibility
> !
>
> Item was changed:
> + ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'debugging') -----
> interruptName: labelString preemptedProcess: theInterruptedProcess
> "Create a Notifier on the active scheduling process with the given
> label."
>
> ^ self subclassResponsibility
> !
>
> Item was added:
> + ----- Method: Project>>syntaxError: (in category 'scheduling & debugging')
> -----
> + syntaxError: aSyntaxErrorNotification
> +
> + ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>
> Item was changed:
> ----- Method: SmalltalkImage>>handleUserInterrupt (in category
> 'miscellaneous') -----
> handleUserInterrupt
> Preferences cmdDotEnabled ifTrue:
> + [[ToolSet handleUserInterruptRequest: 'User Interrupt']
> fork]
> - [[Project current interruptName: 'User Interrupt'] fork]
> !
>
> Item was changed:
> ----- Method: SyntaxErrorNotification>>defaultAction (in category
> '*System-exceptionDescription') -----
> defaultAction
> + ^ToolSet handleSyntaxError: self!
> - ^ToolSet debugSyntaxError: self!
>
> Item was removed:
> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in
> category 'debugging') -----
> - debug: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> - "Open a debugger on the given process and context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[Processor terminateActive].
> - ^self].
> - ^self default debug: aProcess context: aContext label: aString
> contents: contents fullView: aBool!
>
> Item was added:
> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in
> category 'debugging - convenience') -----
> + debugActiveProcessContext: aContext label: aString contents: contents
> +
> + ^ self
> + debugProcess: Processor activeProcess
> + context: aContext
> + label: aString
> + contents: contents
> + fullView: false!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugContext:label:contents: (in category
> 'debugging') -----
> - debugContext: aContext label: aString contents: contents
> - "Open a debugger on the given context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[Processor terminateActive].
> - ^self].
> - ^self default debugContext: aContext label: aString contents:
> contents!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
> - debugError: anError
> - "Handle an otherwise unhandled error"
> - self default ifNil:[ | ctx |
> - Smalltalk
> - logSqueakError: anError description
> - inContext: (ctx := anError signalerContext) .
> - self inform: (anError description, String cr, ctx
> shortStack).
> - ^anError return].
> - ^self default debugError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category
> 'debugging') -----
> + debugInterruptedProcess: aSuspendedProcess label: aString
> + "Open a debugger on the given process, which is already
> suspended."
> +
> + ^ self default
> + ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse:[aSuspendedProcess terminate]]
> + ifNotNil: [:ts | ts debugInterruptedProcess:
> aSuspendedProcess label: aString]!
>
> Item was changed:
> ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in
> category 'debugging') -----
> debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>
> + ^ self default
> + ifNil: [
> + self inform: 'Cannot debug method. It will just be
> executed.'.
> + aCompiledMethod
> + valueWithReceiver: anObject
> + arguments: (aContext ifNil: [#()] ifNotNil:
> [{aContext}])]
> + ifNotNil: [:ts | ts debugMethod: aCompiledMethod
> forReceiver: anObject inContext: aContext]!
> - self default ifNil:[^ self inform: 'Cannot debug method.'].
> - ^self default debugMethod: aCompiledMethod forReceiver: anObject
> inContext: aContext
> - !
>
> Item was added:
> + ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView:
> (in category 'debugging') -----
> + debugProcess: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> + "Open a debugger on the given process, which might be active,
> suspended, or terminated."
> +
> + ^ self default
> + ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse: [Processor terminateActive]]
> + ifNotNil: [:ts | ts debugProcess: aProcess context:
> aContext label: aString contents: contents fullView: aBool]!
>
> Item was changed:
> ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging')
> -----
> + debugSyntaxError: aSyntaxErrorNotification
> + "Opens a tool to let the user correct the syntax error, which then
> resumes the compiler process."
> +
> + ^ self default
> + ifNil: [Project uiManager edit: aSyntaxErrorNotification
> errorCode label: 'Syntax Error (read only)']
> + ifNotNil: [:ts | ts debugSyntaxError:
> aSyntaxErrorNotification]!
> - debugSyntaxError: anError
> - "Handle a syntax error"
> - self default ifNil:[^self debugError: anError]. "handle as usual
> error"
> - ^self default debugSyntaxError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>handleError: (in category 'debugging -
> handlers') -----
> + handleError: anError
> + "No exception handler caught the given error. Let the user handle
> that error through an interactive tool such as a debugger.
> +
> + THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
> +
> + ^ self default
> + ifNil: [ | ctx |
> + Smalltalk
> + logSqueakError: anError description
> + inContext: (ctx := anError signalerContext)
> .
> + self inform: (anError description, String cr, ctx
> shortStack).
> + anError return]
> + ifNotNil: [:ts | ts handleError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging -
> handlers') -----
> + handleSyntaxError: anError
> + "A syntax error (notification) occurred while parsing and compiling
> source code. Usually, the compiling process suspends until the syntax error
> gets corrected.
> +
> + THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
> +
> + ^ self default
> + ifNil: [self handleError: anError]
> + ifNotNil: [:ts | ts handleSyntaxError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category
> 'debugging - handlers') -----
> + handleUserInterruptRequest: aString
> + "The user wants to interrupt a process, which might be
> unresponsive, to debug it.
> +
> + THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher
> than the preempted one. See EventSensor >> #userInterruptWatcher."
> +
> + ^ self default
> + ifNil: [self inform: 'No handler for user interrupts
> found.']
> + ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging -
> handlers') -----
> + handleWarning: aWarning
> + "No exception handler caught the given warning. Let the user handle
> that warning through an interactive tool such as a debugger.
> +
> + THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
> +
> + ^ self default
> + ifNil: [
> + self inform: (aWarning messageText, String cr,
> aWarning signalerContext shortStack).
> + aWarning resume]
> + ifNotNil: [:ts | ts handleWarning: aWarning]!
>
> Item was removed:
> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging')
> -----
> - interrupt: aProcess label: aString
> - "Open a debugger on the given process and context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[aProcess terminate].
> - ^self].
> - ^self default interrupt: aProcess label: aString!
>
> Item was changed:
> ----- Method: UnhandledError>>defaultAction (in category '*System-priv
> handling') -----
> defaultAction
> "The current computation is terminated. The cause of the error
> should be logged or reported to the user. If the program is operating in an
> interactive debugging environment the computation should be suspended and
> the debugger activated."
> + ^ToolSet handleError: self exception!
> - ^ToolSet debugError: self exception!
>
> Item was changed:
> ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv
> handling') -----
> defaultAction
>
> + ^ ToolSet handleWarning: self exception!
> - ^ ToolSet
> - debugContext: self exception signalerContext
> - label: 'Warning'
> - contents: self exception messageText , '\\Select Proceed to
> continue, or close this window to cancel the operation.' withCRs!
>
> Item was changed:
> ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation')
> -----
> run: aSelector with: anArray in: aReceiver
> | process |
> process := Process
> forContext: (Context
> sender: thisContext sender
> receiver: aReceiver
> method: method
> arguments: anArray)
> priority: Processor activeProcess priority.
> ToolSet
> + debugProcess: process
> - debug: process
> context: process suspendedContext
> label: 'Breakpoint in ' , method methodClass name , '>>#'
> , method selector
> contents: nil
> fullView: true.
> Project current spawnNewProcessIfThisIsUI: Processor
> activeProcess.
> thisContext swapSender: nil.
> Processor activeProcess terminate!
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
Hi Hannes,

"debug it" should now work fine for expressions in MVC.

Best,
Marcel

Am 23.09.2019 17:36:34 schrieb Marcel Taeumel <[hidden email]>:

Hi Hannes,

that's a drawing glitch of the debugger. I will look into it.

Best,
Marcel

Am 21.09.2019 11:02:17 schrieb H. Hirzel <[hidden email]>:

I experience a strange BlockClosure>>newProcess message while
debugging the example
3 factorial

Best
--Hannes

On 9/20/19, Marcel Taeumel wrote:
> I tried both and also rejecting/accepting the conflict in SmalltalkImage >>
> #handleUserInterrupt. Works fine.
>
> Best,
> Marcel
> Am 20.09.2019 19:43:08 schrieb Thiede, Christoph
> :
> Did you first filein your changeset or install this commit?
> Von: Squeak-dev im Auftrag
> von Taeumel, Marcel
> Gesendet: Freitag, 20. September 2019 19:42:05
> An: Alan Grimes via Squeak-dev; [hidden email]
> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
>
> Strange. If I file in the cmd-dot menu, it still works as expected in recent
> trunk.
>
> Best,
> Marcel
> Am 20.09.2019 19:20:52 schrieb Thiede, Christoph
> :
> FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up
> reproducibly.
> It would be great if you could create an updated version of the menu :)
> Otherwise, how can I safely unload the cmdDot menu to install this commit?
> Von: Squeak-dev im Auftrag
> von [hidden email]
> Gesendet: Dienstag, 17. September 2019 12:10:24
> An: [hidden email];
> [hidden email]
> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
>
> Marcel Taeumel uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-mt.1093.mcz
> [http://source.squeak.org/trunk/System-mt.1093.mcz]
>
> ==================== Summary ====================
>
> Name: System-mt.1093
> Author: mt
> Time: 17 September 2019, 12:10:14.798406 pm
> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
> Ancestors: System-mt.1092
>
> Refactors process debugging in general, which makes MVC debugging work
> again:
>
> - adds MorphicDebugger and MVCDebugger as subclasses of Debugger to
> untangle debugging for those different GUI frameworks
> - removes the intermediate role of UIManager for debugging purposes -- focus
> on Project, (Standard)ToolSet, and Process
> - treat unhandled warnings the same as unhandled errors, which is through
> the current ToolSet
> - let SyntaxError tool use tool builder
> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
> - adds comments to ToolSet and StandardToolSet
>
> =============== Diff against System-mt.1092 ===============
>
> Item was changed:
> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling')
> -----
> addDeferredUIMessage: valuableObject
> "Arrange for valuableObject to be evaluated at a time when the user
> interface
> is in a coherent state."
>
> self subclassResponsibility!
>
> Item was removed:
> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category
> 'debugging') -----
> - debugMethod: aCompiledMethod forReceiver: anObject inContext:
> aContextOrNil
> - "Just execute the method and return the result. We cannot know how
> interactive debugging works for arbitrary projects."
> -
> - ^ aCompiledMethod
> - valueWithReceiver: anObject
> - arguments: (aContextOrNil
> - ifNil: [#()]
> - ifNotNil:
> [{aContextOrNil}])!
>
> Item was added:
> + ----- Method: Project>>debuggerClass (in category 'scheduling &
> debugging') -----
> + debuggerClass
> +
> + ^ self subclassResponsibility!
>
> Item was changed:
> + ----- Method: Project>>interruptName: (in category 'scheduling &
> debugging') -----
> - ----- Method: Project>>interruptName: (in category 'debugging') -----
> interruptName: labelString
> "Create a Notifier on the active scheduling process with the given
> label."
>
> ^ self subclassResponsibility
> !
>
> Item was changed:
> + ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'scheduling & debugging') -----
> - ----- Method: Project>>interruptName:preemptedProcess: (in category
> 'debugging') -----
> interruptName: labelString preemptedProcess: theInterruptedProcess
> "Create a Notifier on the active scheduling process with the given
> label."
>
> ^ self subclassResponsibility
> !
>
> Item was added:
> + ----- Method: Project>>syntaxError: (in category 'scheduling & debugging')
> -----
> + syntaxError: aSyntaxErrorNotification
> +
> + ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>
> Item was changed:
> ----- Method: SmalltalkImage>>handleUserInterrupt (in category
> 'miscellaneous') -----
> handleUserInterrupt
> Preferences cmdDotEnabled ifTrue:
> + [[ToolSet handleUserInterruptRequest: 'User Interrupt']
> fork]
> - [[Project current interruptName: 'User Interrupt'] fork]
> !
>
> Item was changed:
> ----- Method: SyntaxErrorNotification>>defaultAction (in category
> '*System-exceptionDescription') -----
> defaultAction
> + ^ToolSet handleSyntaxError: self!
> - ^ToolSet debugSyntaxError: self!
>
> Item was removed:
> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in
> category 'debugging') -----
> - debug: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> - "Open a debugger on the given process and context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[Processor terminateActive].
> - ^self].
> - ^self default debug: aProcess context: aContext label: aString
> contents: contents fullView: aBool!
>
> Item was added:
> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in
> category 'debugging - convenience') -----
> + debugActiveProcessContext: aContext label: aString contents: contents
> +
> + ^ self
> + debugProcess: Processor activeProcess
> + context: aContext
> + label: aString
> + contents: contents
> + fullView: false!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugContext:label:contents: (in category
> 'debugging') -----
> - debugContext: aContext label: aString contents: contents
> - "Open a debugger on the given context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[Processor terminateActive].
> - ^self].
> - ^self default debugContext: aContext label: aString contents:
> contents!
>
> Item was removed:
> - ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
> - debugError: anError
> - "Handle an otherwise unhandled error"
> - self default ifNil:[ | ctx |
> - Smalltalk
> - logSqueakError: anError description
> - inContext: (ctx := anError signalerContext) .
> - self inform: (anError description, String cr, ctx
> shortStack).
> - ^anError return].
> - ^self default debugError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category
> 'debugging') -----
> + debugInterruptedProcess: aSuspendedProcess label: aString
> + "Open a debugger on the given process, which is already
> suspended."
> +
> + ^ self default
> + ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse:[aSuspendedProcess terminate]]
> + ifNotNil: [:ts | ts debugInterruptedProcess:
> aSuspendedProcess label: aString]!
>
> Item was changed:
> ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in
> category 'debugging') -----
> debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>
> + ^ self default
> + ifNil: [
> + self inform: 'Cannot debug method. It will just be
> executed.'.
> + aCompiledMethod
> + valueWithReceiver: anObject
> + arguments: (aContext ifNil: [#()] ifNotNil:
> [{aContext}])]
> + ifNotNil: [:ts | ts debugMethod: aCompiledMethod
> forReceiver: anObject inContext: aContext]!
> - self default ifNil:[^ self inform: 'Cannot debug method.'].
> - ^self default debugMethod: aCompiledMethod forReceiver: anObject
> inContext: aContext
> - !
>
> Item was added:
> + ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView:
> (in category 'debugging') -----
> + debugProcess: aProcess context: aContext label: aString contents: contents
> fullView: aBool
> + "Open a debugger on the given process, which might be active,
> suspended, or terminated."
> +
> + ^ self default
> + ifNil: [(self confirm: 'Debugger request -- proceed?')
> ifFalse: [Processor terminateActive]]
> + ifNotNil: [:ts | ts debugProcess: aProcess context:
> aContext label: aString contents: contents fullView: aBool]!
>
> Item was changed:
> ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging')
> -----
> + debugSyntaxError: aSyntaxErrorNotification
> + "Opens a tool to let the user correct the syntax error, which then
> resumes the compiler process."
> +
> + ^ self default
> + ifNil: [Project uiManager edit: aSyntaxErrorNotification
> errorCode label: 'Syntax Error (read only)']
> + ifNotNil: [:ts | ts debugSyntaxError:
> aSyntaxErrorNotification]!
> - debugSyntaxError: anError
> - "Handle a syntax error"
> - self default ifNil:[^self debugError: anError]. "handle as usual
> error"
> - ^self default debugSyntaxError: anError!
>
> Item was added:
> + ----- Method: ToolSet class>>handleError: (in category 'debugging -
> handlers') -----
> + handleError: anError
> + "No exception handler caught the given error. Let the user handle
> that error through an interactive tool such as a debugger.
> +
> + THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
> +
> + ^ self default
> + ifNil: [ | ctx |
> + Smalltalk
> + logSqueakError: anError description
> + inContext: (ctx := anError signalerContext)
> .
> + self inform: (anError description, String cr, ctx
> shortStack).
> + anError return]
> + ifNotNil: [:ts | ts handleError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging -
> handlers') -----
> + handleSyntaxError: anError
> + "A syntax error (notification) occurred while parsing and compiling
> source code. Usually, the compiling process suspends until the syntax error
> gets corrected.
> +
> + THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
> +
> + ^ self default
> + ifNil: [self handleError: anError]
> + ifNotNil: [:ts | ts handleSyntaxError: anError]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category
> 'debugging - handlers') -----
> + handleUserInterruptRequest: aString
> + "The user wants to interrupt a process, which might be
> unresponsive, to debug it.
> +
> + THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher
> than the preempted one. See EventSensor >> #userInterruptWatcher."
> +
> + ^ self default
> + ifNil: [self inform: 'No handler for user interrupts
> found.']
> + ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>
> Item was added:
> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging -
> handlers') -----
> + handleWarning: aWarning
> + "No exception handler caught the given warning. Let the user handle
> that warning through an interactive tool such as a debugger.
> +
> + THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
> +
> + ^ self default
> + ifNil: [
> + self inform: (aWarning messageText, String cr,
> aWarning signalerContext shortStack).
> + aWarning resume]
> + ifNotNil: [:ts | ts handleWarning: aWarning]!
>
> Item was removed:
> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging')
> -----
> - interrupt: aProcess label: aString
> - "Open a debugger on the given process and context."
> - self default ifNil:[
> - (self confirm: 'Debugger request -- proceed?')
> - ifFalse:[aProcess terminate].
> - ^self].
> - ^self default interrupt: aProcess label: aString!
>
> Item was changed:
> ----- Method: UnhandledError>>defaultAction (in category '*System-priv
> handling') -----
> defaultAction
> "The current computation is terminated. The cause of the error
> should be logged or reported to the user. If the program is operating in an
> interactive debugging environment the computation should be suspended and
> the debugger activated."
> + ^ToolSet handleError: self exception!
> - ^ToolSet debugError: self exception!
>
> Item was changed:
> ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv
> handling') -----
> defaultAction
>
> + ^ ToolSet handleWarning: self exception!
> - ^ ToolSet
> - debugContext: self exception signalerContext
> - label: 'Warning'
> - contents: self exception messageText , '\\Select Proceed to
> continue, or close this window to cancel the operation.' withCRs!
>
> Item was changed:
> ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation')
> -----
> run: aSelector with: anArray in: aReceiver
> | process |
> process := Process
> forContext: (Context
> sender: thisContext sender
> receiver: aReceiver
> method: method
> arguments: anArray)
> priority: Processor activeProcess priority.
> ToolSet
> + debugProcess: process
> - debug: process
> context: process suspendedContext
> label: 'Breakpoint in ' , method methodClass name , '>>#'
> , method selector
> contents: nil
> fullView: true.
> Project current spawnNewProcessIfThisIsUI: Processor
> activeProcess.
> thisContext swapSender: nil.
> Processor activeProcess terminate!
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Hannes Hirzel
Hello Marcel

I can confirm that with your changes as of update 5.3-18978  'debug
it' in a workspace works fine.
First time for how many years? 5? 7?

Dave Lewis has put into the inbox
     ReleaseBuilder-dtl.198.mcz
where he proposess

"arrange for the home Morphic project to have a parent MVC project.
The MVC project supports emergency debugging in the event of
unrecoverable Morphic problems, and will fall back on the traditional
emergency evaluator if MVC debugging fails.
"

Could this also be commited to trunk. How would a test case look like?
Some change which breaks Morphic and then an MVC project is activated
which allows to fix the cause of breaking.

Regards
Hannes

On 9/24/19, Marcel Taeumel <[hidden email]> wrote:

> Hi Hannes,
>
> "debug it" should now work fine for expressions in MVC.
>
> Best,
> Marcel
> Am 23.09.2019 17:36:34 schrieb Marcel Taeumel <[hidden email]>:
> Hi Hannes,
>
> that's a drawing glitch of the debugger. I will look into it.
>
> Best,
> Marcel
> Am 21.09.2019 11:02:17 schrieb H. Hirzel <[hidden email]>:
> I experience a strange BlockClosure>>newProcess message while
> debugging the example
> 3 factorial
>
> Best
> --Hannes
>
> On 9/20/19, Marcel Taeumel wrote:
>> I tried both and also rejecting/accepting the conflict in SmalltalkImage
>> >>
>> #handleUserInterrupt. Works fine.
>>
>> Best,
>> Marcel
>> Am 20.09.2019 19:43:08 schrieb Thiede, Christoph
>> :
>> Did you first filein your changeset or install this commit?
>> Von: Squeak-dev im Auftrag
>> von Taeumel, Marcel
>> Gesendet: Freitag, 20. September 2019 19:42:05
>> An: Alan Grimes via Squeak-dev; [hidden email]
>> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
>>
>> Strange. If I file in the cmd-dot menu, it still works as expected in
>> recent
>> trunk.
>>
>> Best,
>> Marcel
>> Am 20.09.2019 19:20:52 schrieb Thiede, Christoph
>> :
>> FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up
>> reproducibly.
>> It would be great if you could create an updated version of the menu :)
>> Otherwise, how can I safely unload the cmdDot menu to install this
>> commit?
>> Von: Squeak-dev im Auftrag
>> von [hidden email]
>> Gesendet: Dienstag, 17. September 2019 12:10:24
>> An: [hidden email];
>> [hidden email]
>> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
>>
>> Marcel Taeumel uploaded a new version of System to project The Trunk:
>> http://source.squeak.org/trunk/System-mt.1093.mcz
>> [http://source.squeak.org/trunk/System-mt.1093.mcz]
>>
>> ==================== Summary ====================
>>
>> Name: System-mt.1093
>> Author: mt
>> Time: 17 September 2019, 12:10:14.798406 pm
>> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
>> Ancestors: System-mt.1092
>>
>> Refactors process debugging in general, which makes MVC debugging work
>> again:
>>
>> - adds MorphicDebugger and MVCDebugger as subclasses of Debugger to
>> untangle debugging for those different GUI frameworks
>> - removes the intermediate role of UIManager for debugging purposes --
>> focus
>> on Project, (Standard)ToolSet, and Process
>> - treat unhandled warnings the same as unhandled errors, which is through
>> the current ToolSet
>> - let SyntaxError tool use tool builder
>> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
>> - adds comments to ToolSet and StandardToolSet
>>
>> =============== Diff against System-mt.1092 ===============
>>
>> Item was changed:
>> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling &
>> debugging') -----
>> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling')
>> -----
>> addDeferredUIMessage: valuableObject
>> "Arrange for valuableObject to be evaluated at a time when the user
>> interface
>> is in a coherent state."
>>
>> self subclassResponsibility!
>>
>> Item was removed:
>> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category
>> 'debugging') -----
>> - debugMethod: aCompiledMethod forReceiver: anObject inContext:
>> aContextOrNil
>> - "Just execute the method and return the result. We cannot know how
>> interactive debugging works for arbitrary projects."
>> -
>> - ^ aCompiledMethod
>> - valueWithReceiver: anObject
>> - arguments: (aContextOrNil
>> - ifNil: [#()]
>> - ifNotNil:
>> [{aContextOrNil}])!
>>
>> Item was added:
>> + ----- Method: Project>>debuggerClass (in category 'scheduling &
>> debugging') -----
>> + debuggerClass
>> +
>> + ^ self subclassResponsibility!
>>
>> Item was changed:
>> + ----- Method: Project>>interruptName: (in category 'scheduling &
>> debugging') -----
>> - ----- Method: Project>>interruptName: (in category 'debugging') -----
>> interruptName: labelString
>> "Create a Notifier on the active scheduling process with the given
>> label."
>>
>> ^ self subclassResponsibility
>> !
>>
>> Item was changed:
>> + ----- Method: Project>>interruptName:preemptedProcess: (in category
>> 'scheduling & debugging') -----
>> - ----- Method: Project>>interruptName:preemptedProcess: (in category
>> 'debugging') -----
>> interruptName: labelString preemptedProcess: theInterruptedProcess
>> "Create a Notifier on the active scheduling process with the given
>> label."
>>
>> ^ self subclassResponsibility
>> !
>>
>> Item was added:
>> + ----- Method: Project>>syntaxError: (in category 'scheduling &
>> debugging')
>> -----
>> + syntaxError: aSyntaxErrorNotification
>> +
>> + ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>>
>> Item was changed:
>> ----- Method: SmalltalkImage>>handleUserInterrupt (in category
>> 'miscellaneous') -----
>> handleUserInterrupt
>> Preferences cmdDotEnabled ifTrue:
>> + [[ToolSet handleUserInterruptRequest: 'User Interrupt']
>> fork]
>> - [[Project current interruptName: 'User Interrupt'] fork]
>> !
>>
>> Item was changed:
>> ----- Method: SyntaxErrorNotification>>defaultAction (in category
>> '*System-exceptionDescription') -----
>> defaultAction
>> + ^ToolSet handleSyntaxError: self!
>> - ^ToolSet debugSyntaxError: self!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in
>> category 'debugging') -----
>> - debug: aProcess context: aContext label: aString contents: contents
>> fullView: aBool
>> - "Open a debugger on the given process and context."
>> - self default ifNil:[
>> - (self confirm: 'Debugger request -- proceed?')
>> - ifFalse:[Processor terminateActive].
>> - ^self].
>> - ^self default debug: aProcess context: aContext label: aString
>> contents: contents fullView: aBool!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents:
>> (in
>> category 'debugging - convenience') -----
>> + debugActiveProcessContext: aContext label: aString contents: contents
>> +
>> + ^ self
>> + debugProcess: Processor activeProcess
>> + context: aContext
>> + label: aString
>> + contents: contents
>> + fullView: false!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>debugContext:label:contents: (in category
>> 'debugging') -----
>> - debugContext: aContext label: aString contents: contents
>> - "Open a debugger on the given context."
>> - self default ifNil:[
>> - (self confirm: 'Debugger request -- proceed?')
>> - ifFalse:[Processor terminateActive].
>> - ^self].
>> - ^self default debugContext: aContext label: aString contents:
>> contents!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>debugError: (in category 'debugging')
>> -----
>> - debugError: anError
>> - "Handle an otherwise unhandled error"
>> - self default ifNil:[ | ctx |
>> - Smalltalk
>> - logSqueakError: anError description
>> - inContext: (ctx := anError signalerContext) .
>> - self inform: (anError description, String cr, ctx
>> shortStack).
>> - ^anError return].
>> - ^self default debugError: anError!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in
>> category
>> 'debugging') -----
>> + debugInterruptedProcess: aSuspendedProcess label: aString
>> + "Open a debugger on the given process, which is already
>> suspended."
>> +
>> + ^ self default
>> + ifNil: [(self confirm: 'Debugger request -- proceed?')
>> ifFalse:[aSuspendedProcess terminate]]
>> + ifNotNil: [:ts | ts debugInterruptedProcess:
>> aSuspendedProcess label: aString]!
>>
>> Item was changed:
>> ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in
>> category 'debugging') -----
>> debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>>
>> + ^ self default
>> + ifNil: [
>> + self inform: 'Cannot debug method. It will just be
>> executed.'.
>> + aCompiledMethod
>> + valueWithReceiver: anObject
>> + arguments: (aContext ifNil: [#()] ifNotNil:
>> [{aContext}])]
>> + ifNotNil: [:ts | ts debugMethod: aCompiledMethod
>> forReceiver: anObject inContext: aContext]!
>> - self default ifNil:[^ self inform: 'Cannot debug method.'].
>> - ^self default debugMethod: aCompiledMethod forReceiver: anObject
>> inContext: aContext
>> - !
>>
>> Item was added:
>> + ----- Method: ToolSet
>> class>>debugProcess:context:label:contents:fullView:
>> (in category 'debugging') -----
>> + debugProcess: aProcess context: aContext label: aString contents:
>> contents
>> fullView: aBool
>> + "Open a debugger on the given process, which might be active,
>> suspended, or terminated."
>> +
>> + ^ self default
>> + ifNil: [(self confirm: 'Debugger request -- proceed?')
>> ifFalse: [Processor terminateActive]]
>> + ifNotNil: [:ts | ts debugProcess: aProcess context:
>> aContext label: aString contents: contents fullView: aBool]!
>>
>> Item was changed:
>> ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging')
>> -----
>> + debugSyntaxError: aSyntaxErrorNotification
>> + "Opens a tool to let the user correct the syntax error, which then
>> resumes the compiler process."
>> +
>> + ^ self default
>> + ifNil: [Project uiManager edit: aSyntaxErrorNotification
>> errorCode label: 'Syntax Error (read only)']
>> + ifNotNil: [:ts | ts debugSyntaxError:
>> aSyntaxErrorNotification]!
>> - debugSyntaxError: anError
>> - "Handle a syntax error"
>> - self default ifNil:[^self debugError: anError]. "handle as usual
>> error"
>> - ^self default debugSyntaxError: anError!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleError: (in category 'debugging -
>> handlers') -----
>> + handleError: anError
>> + "No exception handler caught the given error. Let the user handle
>> that error through an interactive tool such as a debugger.
>> +
>> + THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
>> +
>> + ^ self default
>> + ifNil: [ | ctx |
>> + Smalltalk
>> + logSqueakError: anError description
>> + inContext: (ctx := anError signalerContext)
>> .
>> + self inform: (anError description, String cr, ctx
>> shortStack).
>> + anError return]
>> + ifNotNil: [:ts | ts handleError: anError]!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging
>> -
>> handlers') -----
>> + handleSyntaxError: anError
>> + "A syntax error (notification) occurred while parsing and compiling
>> source code. Usually, the compiling process suspends until the syntax
>> error
>> gets corrected.
>> +
>> + THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
>> +
>> + ^ self default
>> + ifNil: [self handleError: anError]
>> + ifNotNil: [:ts | ts handleSyntaxError: anError]!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category
>> 'debugging - handlers') -----
>> + handleUserInterruptRequest: aString
>> + "The user wants to interrupt a process, which might be
>> unresponsive, to debug it.
>> +
>> + THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher
>> than the preempted one. See EventSensor >> #userInterruptWatcher."
>> +
>> + ^ self default
>> + ifNil: [self inform: 'No handler for user interrupts
>> found.']
>> + ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging -
>> handlers') -----
>> + handleWarning: aWarning
>> + "No exception handler caught the given warning. Let the user handle
>> that warning through an interactive tool such as a debugger.
>> +
>> + THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
>> +
>> + ^ self default
>> + ifNil: [
>> + self inform: (aWarning messageText, String cr,
>> aWarning signalerContext shortStack).
>> + aWarning resume]
>> + ifNotNil: [:ts | ts handleWarning: aWarning]!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging')
>> -----
>> - interrupt: aProcess label: aString
>> - "Open a debugger on the given process and context."
>> - self default ifNil:[
>> - (self confirm: 'Debugger request -- proceed?')
>> - ifFalse:[aProcess terminate].
>> - ^self].
>> - ^self default interrupt: aProcess label: aString!
>>
>> Item was changed:
>> ----- Method: UnhandledError>>defaultAction (in category '*System-priv
>> handling') -----
>> defaultAction
>> "The current computation is terminated. The cause of the error
>> should be logged or reported to the user. If the program is operating in
>> an
>> interactive debugging environment the computation should be suspended and
>> the debugger activated."
>> + ^ToolSet handleError: self exception!
>> - ^ToolSet debugError: self exception!
>>
>> Item was changed:
>> ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv
>> handling') -----
>> defaultAction
>>
>> + ^ ToolSet handleWarning: self exception!
>> - ^ ToolSet
>> - debugContext: self exception signalerContext
>> - label: 'Warning'
>> - contents: self exception messageText , '\\Select Proceed to
>> continue, or close this window to cancel the operation.' withCRs!
>>
>> Item was changed:
>> ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation')
>> -----
>> run: aSelector with: anArray in: aReceiver
>> | process |
>> process := Process
>> forContext: (Context
>> sender: thisContext sender
>> receiver: aReceiver
>> method: method
>> arguments: anArray)
>> priority: Processor activeProcess priority.
>> ToolSet
>> + debugProcess: process
>> - debug: process
>> context: process suspendedContext
>> label: 'Breakpoint in ' , method methodClass name , '>>#'
>> , method selector
>> contents: nil
>> fullView: true.
>> Project current spawnNewProcessIfThisIsUI: Processor
>> activeProcess.
>> thisContext swapSender: nil.
>> Processor activeProcess terminate!
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
It's in the Trunk now.

However, we still need to tweak that fallback experience. Try messing up LazyListMorph >> #drawOn: to test the current experience. Fix that method with MVC tools. Try to go back to Morphic land.

Best,
Marcel

Am 24.09.2019 18:56:04 schrieb H. Hirzel <[hidden email]>:

Hello Marcel

I can confirm that with your changes as of update 5.3-18978 'debug
it' in a workspace works fine.
First time for how many years? 5? 7?

Dave Lewis has put into the inbox
ReleaseBuilder-dtl.198.mcz
where he proposess

"arrange for the home Morphic project to have a parent MVC project.
The MVC project supports emergency debugging in the event of
unrecoverable Morphic problems, and will fall back on the traditional
emergency evaluator if MVC debugging fails.
"

Could this also be commited to trunk. How would a test case look like?
Some change which breaks Morphic and then an MVC project is activated
which allows to fix the cause of breaking.

Regards
Hannes

On 9/24/19, Marcel Taeumel wrote:
> Hi Hannes,
>
> "debug it" should now work fine for expressions in MVC.
>
> Best,
> Marcel
> Am 23.09.2019 17:36:34 schrieb Marcel Taeumel :
> Hi Hannes,
>
> that's a drawing glitch of the debugger. I will look into it.
>
> Best,
> Marcel
> Am 21.09.2019 11:02:17 schrieb H. Hirzel :
> I experience a strange BlockClosure>>newProcess message while
> debugging the example
> 3 factorial
>
> Best
> --Hannes
>
> On 9/20/19, Marcel Taeumel wrote:
>> I tried both and also rejecting/accepting the conflict in SmalltalkImage
>> >>
>> #handleUserInterrupt. Works fine.
>>
>> Best,
>> Marcel
>> Am 20.09.2019 19:43:08 schrieb Thiede, Christoph
>> :
>> Did you first filein your changeset or install this commit?
>> Von: Squeak-dev im Auftrag
>> von Taeumel, Marcel
>> Gesendet: Freitag, 20. September 2019 19:42:05
>> An: Alan Grimes via Squeak-dev; [hidden email]
>> Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
>>
>> Strange. If I file in the cmd-dot menu, it still works as expected in
>> recent
>> trunk.
>>
>> Best,
>> Marcel
>> Am 20.09.2019 19:20:52 schrieb Thiede, Christoph
>> :
>> FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up
>> reproducibly.
>> It would be great if you could create an updated version of the menu :)
>> Otherwise, how can I safely unload the cmdDot menu to install this
>> commit?
>> Von: Squeak-dev im Auftrag
>> von [hidden email]
>> Gesendet: Dienstag, 17. September 2019 12:10:24
>> An: [hidden email];
>> [hidden email]
>> Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
>>
>> Marcel Taeumel uploaded a new version of System to project The Trunk:
>> http://source.squeak.org/trunk/System-mt.1093.mcz
>> [http://source.squeak.org/trunk/System-mt.1093.mcz]
>>
>> ==================== Summary ====================
>>
>> Name: System-mt.1093
>> Author: mt
>> Time: 17 September 2019, 12:10:14.798406 pm
>> UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
>> Ancestors: System-mt.1092
>>
>> Refactors process debugging in general, which makes MVC debugging work
>> again:
>>
>> - adds MorphicDebugger and MVCDebugger as subclasses of Debugger to
>> untangle debugging for those different GUI frameworks
>> - removes the intermediate role of UIManager for debugging purposes --
>> focus
>> on Project, (Standard)ToolSet, and Process
>> - treat unhandled warnings the same as unhandled errors, which is through
>> the current ToolSet
>> - let SyntaxError tool use tool builder
>> - clarify #handle* and #debug* methods in ToolSet's 'debugging' category
>> - adds comments to ToolSet and StandardToolSet
>>
>> =============== Diff against System-mt.1092 ===============
>>
>> Item was changed:
>> + ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling &
>> debugging') -----
>> - ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling')
>> -----
>> addDeferredUIMessage: valuableObject
>> "Arrange for valuableObject to be evaluated at a time when the user
>> interface
>> is in a coherent state."
>>
>> self subclassResponsibility!
>>
>> Item was removed:
>> - ----- Method: Project>>debugMethod:forReceiver:inContext: (in category
>> 'debugging') -----
>> - debugMethod: aCompiledMethod forReceiver: anObject inContext:
>> aContextOrNil
>> - "Just execute the method and return the result. We cannot know how
>> interactive debugging works for arbitrary projects."
>> -
>> - ^ aCompiledMethod
>> - valueWithReceiver: anObject
>> - arguments: (aContextOrNil
>> - ifNil: [#()]
>> - ifNotNil:
>> [{aContextOrNil}])!
>>
>> Item was added:
>> + ----- Method: Project>>debuggerClass (in category 'scheduling &
>> debugging') -----
>> + debuggerClass
>> +
>> + ^ self subclassResponsibility!
>>
>> Item was changed:
>> + ----- Method: Project>>interruptName: (in category 'scheduling &
>> debugging') -----
>> - ----- Method: Project>>interruptName: (in category 'debugging') -----
>> interruptName: labelString
>> "Create a Notifier on the active scheduling process with the given
>> label."
>>
>> ^ self subclassResponsibility
>> !
>>
>> Item was changed:
>> + ----- Method: Project>>interruptName:preemptedProcess: (in category
>> 'scheduling & debugging') -----
>> - ----- Method: Project>>interruptName:preemptedProcess: (in category
>> 'debugging') -----
>> interruptName: labelString preemptedProcess: theInterruptedProcess
>> "Create a Notifier on the active scheduling process with the given
>> label."
>>
>> ^ self subclassResponsibility
>> !
>>
>> Item was added:
>> + ----- Method: Project>>syntaxError: (in category 'scheduling &
>> debugging')
>> -----
>> + syntaxError: aSyntaxErrorNotification
>> +
>> + ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!
>>
>> Item was changed:
>> ----- Method: SmalltalkImage>>handleUserInterrupt (in category
>> 'miscellaneous') -----
>> handleUserInterrupt
>> Preferences cmdDotEnabled ifTrue:
>> + [[ToolSet handleUserInterruptRequest: 'User Interrupt']
>> fork]
>> - [[Project current interruptName: 'User Interrupt'] fork]
>> !
>>
>> Item was changed:
>> ----- Method: SyntaxErrorNotification>>defaultAction (in category
>> '*System-exceptionDescription') -----
>> defaultAction
>> + ^ToolSet handleSyntaxError: self!
>> - ^ToolSet debugSyntaxError: self!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in
>> category 'debugging') -----
>> - debug: aProcess context: aContext label: aString contents: contents
>> fullView: aBool
>> - "Open a debugger on the given process and context."
>> - self default ifNil:[
>> - (self confirm: 'Debugger request -- proceed?')
>> - ifFalse:[Processor terminateActive].
>> - ^self].
>> - ^self default debug: aProcess context: aContext label: aString
>> contents: contents fullView: aBool!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>debugActiveProcessContext:label:contents:
>> (in
>> category 'debugging - convenience') -----
>> + debugActiveProcessContext: aContext label: aString contents: contents
>> +
>> + ^ self
>> + debugProcess: Processor activeProcess
>> + context: aContext
>> + label: aString
>> + contents: contents
>> + fullView: false!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>debugContext:label:contents: (in category
>> 'debugging') -----
>> - debugContext: aContext label: aString contents: contents
>> - "Open a debugger on the given context."
>> - self default ifNil:[
>> - (self confirm: 'Debugger request -- proceed?')
>> - ifFalse:[Processor terminateActive].
>> - ^self].
>> - ^self default debugContext: aContext label: aString contents:
>> contents!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>debugError: (in category 'debugging')
>> -----
>> - debugError: anError
>> - "Handle an otherwise unhandled error"
>> - self default ifNil:[ | ctx |
>> - Smalltalk
>> - logSqueakError: anError description
>> - inContext: (ctx := anError signalerContext) .
>> - self inform: (anError description, String cr, ctx
>> shortStack).
>> - ^anError return].
>> - ^self default debugError: anError!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>debugInterruptedProcess:label: (in
>> category
>> 'debugging') -----
>> + debugInterruptedProcess: aSuspendedProcess label: aString
>> + "Open a debugger on the given process, which is already
>> suspended."
>> +
>> + ^ self default
>> + ifNil: [(self confirm: 'Debugger request -- proceed?')
>> ifFalse:[aSuspendedProcess terminate]]
>> + ifNotNil: [:ts | ts debugInterruptedProcess:
>> aSuspendedProcess label: aString]!
>>
>> Item was changed:
>> ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in
>> category 'debugging') -----
>> debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
>>
>> + ^ self default
>> + ifNil: [
>> + self inform: 'Cannot debug method. It will just be
>> executed.'.
>> + aCompiledMethod
>> + valueWithReceiver: anObject
>> + arguments: (aContext ifNil: [#()] ifNotNil:
>> [{aContext}])]
>> + ifNotNil: [:ts | ts debugMethod: aCompiledMethod
>> forReceiver: anObject inContext: aContext]!
>> - self default ifNil:[^ self inform: 'Cannot debug method.'].
>> - ^self default debugMethod: aCompiledMethod forReceiver: anObject
>> inContext: aContext
>> - !
>>
>> Item was added:
>> + ----- Method: ToolSet
>> class>>debugProcess:context:label:contents:fullView:
>> (in category 'debugging') -----
>> + debugProcess: aProcess context: aContext label: aString contents:
>> contents
>> fullView: aBool
>> + "Open a debugger on the given process, which might be active,
>> suspended, or terminated."
>> +
>> + ^ self default
>> + ifNil: [(self confirm: 'Debugger request -- proceed?')
>> ifFalse: [Processor terminateActive]]
>> + ifNotNil: [:ts | ts debugProcess: aProcess context:
>> aContext label: aString contents: contents fullView: aBool]!
>>
>> Item was changed:
>> ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging')
>> -----
>> + debugSyntaxError: aSyntaxErrorNotification
>> + "Opens a tool to let the user correct the syntax error, which then
>> resumes the compiler process."
>> +
>> + ^ self default
>> + ifNil: [Project uiManager edit: aSyntaxErrorNotification
>> errorCode label: 'Syntax Error (read only)']
>> + ifNotNil: [:ts | ts debugSyntaxError:
>> aSyntaxErrorNotification]!
>> - debugSyntaxError: anError
>> - "Handle a syntax error"
>> - self default ifNil:[^self debugError: anError]. "handle as usual
>> error"
>> - ^self default debugSyntaxError: anError!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleError: (in category 'debugging -
>> handlers') -----
>> + handleError: anError
>> + "No exception handler caught the given error. Let the user handle
>> that error through an interactive tool such as a debugger.
>> +
>> + THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
>> +
>> + ^ self default
>> + ifNil: [ | ctx |
>> + Smalltalk
>> + logSqueakError: anError description
>> + inContext: (ctx := anError signalerContext)
>> .
>> + self inform: (anError description, String cr, ctx
>> shortStack).
>> + anError return]
>> + ifNotNil: [:ts | ts handleError: anError]!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging
>> -
>> handlers') -----
>> + handleSyntaxError: anError
>> + "A syntax error (notification) occurred while parsing and compiling
>> source code. Usually, the compiling process suspends until the syntax
>> error
>> gets corrected.
>> +
>> + THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
>> +
>> + ^ self default
>> + ifNil: [self handleError: anError]
>> + ifNotNil: [:ts | ts handleSyntaxError: anError]!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleUserInterruptRequest: (in category
>> 'debugging - handlers') -----
>> + handleUserInterruptRequest: aString
>> + "The user wants to interrupt a process, which might be
>> unresponsive, to debug it.
>> +
>> + THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher
>> than the preempted one. See EventSensor >> #userInterruptWatcher."
>> +
>> + ^ self default
>> + ifNil: [self inform: 'No handler for user interrupts
>> found.']
>> + ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!
>>
>> Item was added:
>> + ----- Method: ToolSet class>>handleWarning: (in category 'debugging -
>> handlers') -----
>> + handleWarning: aWarning
>> + "No exception handler caught the given warning. Let the user handle
>> that warning through an interactive tool such as a debugger.
>> +
>> + THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
>> +
>> + ^ self default
>> + ifNil: [
>> + self inform: (aWarning messageText, String cr,
>> aWarning signalerContext shortStack).
>> + aWarning resume]
>> + ifNotNil: [:ts | ts handleWarning: aWarning]!
>>
>> Item was removed:
>> - ----- Method: ToolSet class>>interrupt:label: (in category 'debugging')
>> -----
>> - interrupt: aProcess label: aString
>> - "Open a debugger on the given process and context."
>> - self default ifNil:[
>> - (self confirm: 'Debugger request -- proceed?')
>> - ifFalse:[aProcess terminate].
>> - ^self].
>> - ^self default interrupt: aProcess label: aString!
>>
>> Item was changed:
>> ----- Method: UnhandledError>>defaultAction (in category '*System-priv
>> handling') -----
>> defaultAction
>> "The current computation is terminated. The cause of the error
>> should be logged or reported to the user. If the program is operating in
>> an
>> interactive debugging environment the computation should be suspended and
>> the debugger activated."
>> + ^ToolSet handleError: self exception!
>> - ^ToolSet debugError: self exception!
>>
>> Item was changed:
>> ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv
>> handling') -----
>> defaultAction
>>
>> + ^ ToolSet handleWarning: self exception!
>> - ^ ToolSet
>> - debugContext: self exception signalerContext
>> - label: 'Warning'
>> - contents: self exception messageText , '\\Select Proceed to
>> continue, or close this window to cancel the operation.' withCRs!
>>
>> Item was changed:
>> ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation')
>> -----
>> run: aSelector with: anArray in: aReceiver
>> | process |
>> process := Process
>> forContext: (Context
>> sender: thisContext sender
>> receiver: aReceiver
>> method: method
>> arguments: anArray)
>> priority: Processor activeProcess priority.
>> ToolSet
>> + debugProcess: process
>> - debug: process
>> context: process suspendedContext
>> label: 'Breakpoint in ' , method methodClass name , '>>#'
>> , method selector
>> contents: nil
>> fullView: true.
>> Project current spawnNewProcessIfThisIsUI: Processor
>> activeProcess.
>> thisContext swapSender: nil.
>> Processor activeProcess terminate!
>>
>>
>>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Christoph Thiede
In reply to this post by marcel.taeumel

I found my mistake.


Some days ago, I had pressed the "Reparent" button multiple times on Trunk commits but did not load them ... I suppose this made Metacello to load the updates incompletely. After reparenting many packages again and merging everything manually (*sigh*), everything seems to work.

Is there any way to check that I did not miss any package? :)


Best,

Christoph



Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:55 Uhr
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
I tried both and also rejecting/accepting the conflict in SmalltalkImage >> #handleUserInterrupt. Works fine.

Best,
Marcel

Am 20.09.2019 19:43:08 schrieb Thiede, Christoph <[hidden email]>:

Did you first filein your changeset or install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:42:05
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.

Best,
Marcel

Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!





ATT00001.txt (6 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
Is there any way to check that I did not miss any package? :)

No, I am afraid that there is no such way... especially if you have an image with lots of custom changes.

Best,
Marcel

Am 25.09.2019 23:10:43 schrieb Thiede, Christoph <[hidden email]>:

I found my mistake.


Some days ago, I had pressed the "Reparent" button multiple times on Trunk commits but did not load them ... I suppose this made Metacello to load the updates incompletely. After reparenting many packages again and merging everything manually (*sigh*), everything seems to work.

Is there any way to check that I did not miss any package? :)


Best,

Christoph



Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:55 Uhr
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
I tried both and also rejecting/accepting the conflict in SmalltalkImage >> #handleUserInterrupt. Works fine.

Best,
Marcel

Am 20.09.2019 19:43:08 schrieb Thiede, Christoph <[hidden email]>:

Did you first filein your changeset or install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Freitag, 20. September 2019 19:42:05
An: Alan Grimes via Squeak-dev; [hidden email]
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Strange. If I file in the cmd-dot menu, it still works as expected in recent trunk.

Best,
Marcel

Am 20.09.2019 19:20:52 schrieb Thiede, Christoph <[hidden email]>:

FYIO: For me, this commit breaks your new cmdDot menu, my image hangs up reproducibly.

It would be great if you could create an updated version of the menu :)

Otherwise, how can I safely unload the cmdDot menu to install this commit?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 17. September 2019 12:10:24
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1093.mcz

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

Name: System-mt.1093
Author: mt
Time: 17 September 2019, 12:10:14.798406 pm
UUID: 5eb2c78e-ce42-654d-b764-57fc1e4d0521
Ancestors: System-mt.1092

Refactors process debugging in general, which makes MVC debugging work again:

-  adds MorphicDebugger and MVCDebugger as subclasses of Debugger to untangle debugging for those different GUI frameworks
- removes the intermediate role of UIManager for debugging purposes -- focus on Project, (Standard)ToolSet, and Process
- treat unhandled warnings the same as unhandled errors, which is through the current ToolSet
- let SyntaxError tool use tool builder
- clarify #handle* and #debug* methods in ToolSet's 'debugging' category
- adds comments to ToolSet and StandardToolSet

=============== Diff against System-mt.1092 ===============

Item was changed:
+ ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling & debugging') -----
- ----- Method: Project>>addDeferredUIMessage: (in category 'scheduling') -----
  addDeferredUIMessage: valuableObject
         "Arrange for valuableObject to be evaluated at a time when the user interface
         is in a coherent state."
 
         self subclassResponsibility!

Item was removed:
- ----- Method: Project>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
- debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil
-        "Just execute the method and return the result. We cannot know how interactive debugging works for arbitrary projects."
-       
-        ^ aCompiledMethod
-                valueWithReceiver: anObject
-                 arguments: (aContextOrNil
-                                                        ifNil: [#()]
-                                                        ifNotNil: [{aContextOrNil}])!

Item was added:
+ ----- Method: Project>>debuggerClass (in category 'scheduling & debugging') -----
+ debuggerClass
+
+        ^ self subclassResponsibility!

Item was changed:
+ ----- Method: Project>>interruptName: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName: (in category 'debugging') -----
  interruptName: labelString
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was changed:
+ ----- Method: Project>>interruptName:preemptedProcess: (in category 'scheduling & debugging') -----
- ----- Method: Project>>interruptName:preemptedProcess: (in category 'debugging') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
         "Create a Notifier on the active scheduling process with the given label."
 
         ^ self subclassResponsibility
  !

Item was added:
+ ----- Method: Project>>syntaxError: (in category 'scheduling & debugging') -----
+ syntaxError: aSyntaxErrorNotification
+
+        ^ ToolSet debugSyntaxError: aSyntaxErrorNotification!

Item was changed:
  ----- Method: SmalltalkImage>>handleUserInterrupt (in category 'miscellaneous') -----
  handleUserInterrupt
         Preferences cmdDotEnabled ifTrue:
+                [[ToolSet handleUserInterruptRequest: 'User Interrupt'] fork]
-                [[Project current interruptName: 'User Interrupt'] fork]
  !

Item was changed:
  ----- Method: SyntaxErrorNotification>>defaultAction (in category '*System-exceptionDescription') -----
  defaultAction
+        ^ToolSet handleSyntaxError: self!
-        ^ToolSet debugSyntaxError: self!

Item was removed:
- ----- Method: ToolSet class>>debug:context:label:contents:fullView: (in category 'debugging') -----
- debug: aProcess context: aContext label: aString contents: contents fullView: aBool
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debug: aProcess context: aContext label: aString contents: contents fullView: aBool!

Item was added:
+ ----- Method: ToolSet class>>debugActiveProcessContext:label:contents: (in category 'debugging - convenience') -----
+ debugActiveProcessContext: aContext label: aString contents: contents
+
+        ^ self
+                debugProcess: Processor activeProcess
+                context: aContext
+                label: aString
+                contents: contents
+                fullView: false!

Item was removed:
- ----- Method: ToolSet class>>debugContext:label:contents: (in category 'debugging') -----
- debugContext: aContext label: aString contents: contents
-        "Open a debugger on the given context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[Processor terminateActive].
-                ^self].
-        ^self default debugContext: aContext label: aString contents: contents!

Item was removed:
- ----- Method: ToolSet class>>debugError: (in category 'debugging') -----
- debugError: anError
-        "Handle an otherwise unhandled error"
-        self default ifNil:[ | ctx |
-                Smalltalk
-                        logSqueakError: anError description
-                        inContext: (ctx := anError signalerContext) .
-                self inform: (anError description, String cr, ctx shortStack).
-                ^anError return].
-        ^self default debugError: anError!

Item was added:
+ ----- Method: ToolSet class>>debugInterruptedProcess:label: (in category 'debugging') -----
+ debugInterruptedProcess: aSuspendedProcess label: aString
+        "Open a debugger on the given process, which is already suspended."
+       
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse:[aSuspendedProcess terminate]]
+                ifNotNil: [:ts | ts debugInterruptedProcess: aSuspendedProcess label: aString]!

Item was changed:
  ----- Method: ToolSet class>>debugMethod:forReceiver:inContext: (in category 'debugging') -----
  debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
 
+        ^ self default
+                ifNil: [
+                        self inform: 'Cannot debug method. It will just be executed.'.
+                        aCompiledMethod
+                                valueWithReceiver: anObject
+                                arguments: (aContext ifNil: [#()] ifNotNil: [{aContext}])]
+                ifNotNil: [:ts | ts debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext]!
-        self default ifNil:[^ self inform: 'Cannot debug method.'].
-        ^self default debugMethod: aCompiledMethod forReceiver: anObject inContext: aContext
- !

Item was added:
+ ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
+ debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+        "Open a debugger on the given process, which  might be active, suspended, or terminated."
+
+        ^ self default
+                ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
+                ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: ToolSet class>>debugSyntaxError: (in category 'debugging') -----
+ debugSyntaxError: aSyntaxErrorNotification
+        "Opens a tool to let the user correct the syntax error, which then resumes the compiler process."
+       
+        ^ self default
+                ifNil: [Project uiManager edit: aSyntaxErrorNotification errorCode label: 'Syntax Error (read only)']
+                ifNotNil: [:ts | ts debugSyntaxError: aSyntaxErrorNotification]!
- debugSyntaxError: anError
-        "Handle a syntax error"
-        self default ifNil:[^self debugError: anError]. "handle as usual error"
-        ^self default debugSyntaxError: anError!

Item was added:
+ ----- Method: ToolSet class>>handleError: (in category 'debugging - handlers') -----
+ handleError: anError
+        "No exception handler caught the given error. Let the user handle that error through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE ERROR HAPPENED."
+
+        ^ self default
+                ifNil: [ | ctx |
+                        Smalltalk
+                                logSqueakError: anError description
+                                inContext: (ctx := anError signalerContext) .
+                        self inform: (anError description, String cr, ctx shortStack).
+                        anError return]
+                ifNotNil: [:ts | ts handleError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleSyntaxError: (in category 'debugging - handlers') -----
+ handleSyntaxError: anError
+        "A syntax error (notification) occurred while parsing and compiling source code. Usually, the compiling process suspends until the syntax error gets corrected.
+       
+        THE ACTIVE PROCESS *IS* THAT COMPILER PROCESS."
+
+        ^ self default
+                ifNil: [self handleError: anError]
+                ifNotNil: [:ts | ts handleSyntaxError: anError]!

Item was added:
+ ----- Method: ToolSet class>>handleUserInterruptRequest: (in category 'debugging - handlers') -----
+ handleUserInterruptRequest: aString
+        "The user wants to interrupt a process, which might be unresponsive, to debug it.
+       
+        THE ACTIVE PROCESS *IS* A HELPER PROCESS with a priority higher than the preempted one. See EventSensor >> #userInterruptWatcher."
+
+        ^ self default
+                ifNil: [self inform: 'No handler for user interrupts found.']
+                ifNotNil: [:ts | ts handleUserInterruptRequest: aString]!

Item was added:
+ ----- Method: ToolSet class>>handleWarning: (in category 'debugging - handlers') -----
+ handleWarning: aWarning
+        "No exception handler caught the given warning. Let the user handle that warning through an interactive tool such as a debugger.
+       
+        THE ACTIVE PROCESS *IS* WHERE THE WARNING HAPPENED."
+
+        ^ self default
+                ifNil: [
+                        self inform: (aWarning messageText, String cr, aWarning signalerContext shortStack).
+                        aWarning resume]
+                ifNotNil: [:ts | ts handleWarning: aWarning]!

Item was removed:
- ----- Method: ToolSet class>>interrupt:label: (in category 'debugging') -----
- interrupt: aProcess label: aString
-        "Open a debugger on the given process and context."
-        self default ifNil:[
-                (self confirm: 'Debugger request -- proceed?')
-                        ifFalse:[aProcess terminate].
-                ^self].
-        ^self default interrupt: aProcess label: aString!

Item was changed:
  ----- Method: UnhandledError>>defaultAction (in category '*System-priv handling') -----
  defaultAction
         "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated."
+        ^ToolSet handleError: self exception!
-        ^ToolSet debugError: self exception!

Item was changed:
  ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') -----
  defaultAction
 
+        ^ ToolSet handleWarning: self exception!
-        ^ ToolSet
-                debugContext: self exception signalerContext
-                label: 'Warning'
-                contents: self exception messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
         | process |
         process := Process
                 forContext: (Context
                         sender: thisContext sender
                         receiver: aReceiver
                         method: method
                         arguments: anArray)
                 priority: Processor activeProcess priority.
         ToolSet
+                debugProcess: process
-                debug: process
                 context: process suspendedContext
                 label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
                 contents: nil
                 fullView: true.
         Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
         thisContext swapSender: nil.
         Processor activeProcess terminate!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Hannes Hirzel
In reply to this post by marcel.taeumel
On 9/25/19, Marcel Taeumel <[hidden email]> wrote:
> It's in the Trunk now.
>
> However, we still need to tweak that fallback experience. Try messing up
> LazyListMorph >> #drawOn: to test the current experience. Fix that method
> with MVC tools. Try to go back to Morphic land.
>
> Best,
> Marcel

Hi Marcel

I did the following test

1. Download Image Squeak5.3alpha latest update: #19102
2. Put a 'self halt' into the LazyListMorph >> #drawOn:

Result: No MVC project shows up. Instead the image is blocked.

Regards
Hannes

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Balázs Kósi
Hi Hannes!

This morning I've just run into this exact same situation: putting a halt into a method, called by a morph's #drawOn:
makes the image unusable.

The problem stems from WorldState >> displayWorldSafely: being safe only for Errors and not for other kind of
Exceptions, and Halt being only an Exception not an Error.

For a quick fix add Halt to the handled exceptions in #displayWorldSafely:
[aWorld displayWorld. finished := true] on: Error, Halt do: [:ex |
Balázs


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

marcel.taeumel
Yeah, I wonder whether we should expand "Error" to "Error, Halt"?

Best,
Marcel

Am 15.10.2019 12:45:42 schrieb Balázs Kósi <[hidden email]>:

Hi Hannes!

This morning I've just run into this exact same situation: putting a halt into a method, called by a morph's #drawOn:
makes the image unusable.

The problem stems from WorldState >> displayWorldSafely: being safe only for Errors and not for other kind of
Exceptions, and Halt being only an Exception not an Error.

For a quick fix add Halt to the handled exceptions in #displayWorldSafely:
[aWorld displayWorld. finished := true] on: Error, Halt do: [:ex |
Balázs


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1093.mcz

Christoph Thiede

Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 15. Oktober 2019 13:18:26
An: gettimothy via Squeak-dev
Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
 
Yeah, I wonder whether we should expand "Error" to "Error, Halt"?

Best,
Marcel

Am 15.10.2019 12:45:42 schrieb Balázs Kósi <[hidden email]>:

Hi Hannes!

This morning I've just run into this exact same situation: putting a halt into a method, called by a morph's #drawOn:
makes the image unusable.

The problem stems from WorldState >> displayWorldSafely: being safe only for Errors and not for other kind of
Exceptions, and Halt being only an Exception not an Error.

For a quick fix add Halt to the handled exceptions in #displayWorldSafely:
[aWorld displayWorld. finished := true] on: Error, Halt do: [:ex |
Balázs


12