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!
Great contribution!
On Tue, 17 Sep 2019 10:10:24 0000, commits@source.squeak.org commits@source.squeak.org 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
context: process suspendedContext label: 'Breakpoint in ' , method methodClass name , '>>#' , methoddebug: process
selector contents: nil fullView: true. Project current spawnNewProcessIfThisIsUI: Processor activeProcess. thisContext swapSender: nil. Processor activeProcess terminate!
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 christoph.thiede@student.hpi.uni-potsdam.de: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
Did you first filein your changeset or install this commit?
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de:
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 christoph.thiede@student.hpi.uni-potsdam.de: Did you first filein your changeset or install this commit? Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
I experience a strange BlockClosure>>newProcess message while debugging the example 3 factorial
Best --Hannes
On 9/20/19, Marcel Taeumel marcel.taeumel@hpi.de 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 christoph.thiede@student.hpi.uni-potsdam.de: Did you first filein your changeset or install this commit? Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 hannes.hirzel@gmail.com: 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; packages@lists.squeakfoundation.org 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 commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
Hi Hannes,
"debug it" should now work fine for expressions in MVC.
Best, Marcel Am 23.09.2019 17:36:34 schrieb Marcel Taeumel marcel.taeumel@hpi.de: 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 hannes.hirzel@gmail.com: 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; packages@lists.squeakfoundation.org 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 commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 marcel.taeumel@hpi.de 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 marcel.taeumel@hpi.de: 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 hannes.hirzel@gmail.com: 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; packages@lists.squeakfoundation.org 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 commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 hannes.hirzel@gmail.com: 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; packages@lists.squeakfoundation.org 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 commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
On 9/25/19, Marcel Taeumel marcel.taeumel@hpi.de 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
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
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 rebmekop@gmail.com: 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
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org 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 rebmekop@gmail.com:
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
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel Am 22.10.2019 18:50:59 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ... Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org 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 rebmekop@gmail.com: 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
I see, but isn't it just their existence what we want to test for to prevent from loads of Debuggers appearing?
Or should we go the other way around and signal a "DebuggerRaisedNotification" each time before opening a debugger?
However, currently, a #deprecated call in a drawing method makes the image unusable ...
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Mittwoch, 23. Oktober 2019 15:48:15 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel
Am 22.10.2019 18:50:59 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de:
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org 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 rebmekop@gmail.com:
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
Hi Christoph.
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Yes, there is a lot of room for improvement in Squeak's strategy to keep the image alive and in a recoverable state. Annoying things include errors in event handlers (such as #mouseOver:) and the thing about Warnings you mentioned for #displayWorldSafely.
Since the exception mechanism can be used to implement dynamic scope (see CurrentReadOnlySourceFiles), we should never catch Exception in general to install such handlers.
Warning might be a nice addition to #displayWorldSafely.
[Error] bench '219,000,000 per second. 4.57 nanoseconds per run.' [Error, Halt] bench '11,900,000 per second. 84.4 nanoseconds per run.' [Error, Halt, Warning] bench '9,910,000 per second. 101 nanoseconds per run.'
Since this is called only once to fourteen times per frame (see DamageRecorder) -- but usually only once -- we are good with 100 nanoseconds, given that 60 frames-per-second translate to 16 666 667 nanoseconds per frame.
Best, Marcel Am 25.10.2019 20:46:52 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: I see, but isn't it just their existence what we want to test for to prevent from loads of Debuggers appearing? Or should we go the other way around and signal a "DebuggerRaisedNotification" each time before opening a debugger?
However, currently, a #deprecated call in a drawing method makes the image unusable ... Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Mittwoch, 23. Oktober 2019 15:48:15 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel Am 22.10.2019 18:50:59 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ... Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org 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 rebmekop@gmail.com: 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
Since this is called only once to fourteen times per frame (see DamageRecorder) ...
Sorry for that slip. The role of DamageRecorder comes into play only *after* the error handler. So this is only called once per frame.
Best, Marcel Am 29.10.2019 15:07:42 schrieb Marcel Taeumel marcel.taeumel@hpi.de: Hi Christoph.
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Yes, there is a lot of room for improvement in Squeak's strategy to keep the image alive and in a recoverable state. Annoying things include errors in event handlers (such as #mouseOver:) and the thing about Warnings you mentioned for #displayWorldSafely.
Since the exception mechanism can be used to implement dynamic scope (see CurrentReadOnlySourceFiles), we should never catch Exception in general to install such handlers.
Warning might be a nice addition to #displayWorldSafely.
[Error] bench '219,000,000 per second. 4.57 nanoseconds per run.' [Error, Halt] bench '11,900,000 per second. 84.4 nanoseconds per run.' [Error, Halt, Warning] bench '9,910,000 per second. 101 nanoseconds per run.'
Since this is called only once to fourteen times per frame (see DamageRecorder) -- but usually only once -- we are good with 100 nanoseconds, given that 60 frames-per-second translate to 16 666 667 nanoseconds per frame.
Best, Marcel Am 25.10.2019 20:46:52 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: I see, but isn't it just their existence what we want to test for to prevent from loads of Debuggers appearing? Or should we go the other way around and signal a "DebuggerRaisedNotification" each time before opening a debugger?
However, currently, a #deprecated call in a drawing method makes the image unusable ... Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Mittwoch, 23. Oktober 2019 15:48:15 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel Am 22.10.2019 18:50:59 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ... Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org 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 rebmekop@gmail.com: 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
On Tue, 29 Oct 2019, Marcel Taeumel wrote:
Hi Christoph.
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Yes, there is a lot of room for improvement in Squeak's strategy to keep the image alive and in a recoverable state. Annoying things include errors in event handlers (such as #mouseOver:) and the thing about Warnings you mentioned for #displayWorldSafely.
Since the exception mechanism can be used to implement dynamic scope (see CurrentReadOnlySourceFiles), we should never catch Exception in general to install such handlers.
Warning might be a nice addition to #displayWorldSafely.
[Error] bench '219,000,000 per second. 4.57 nanoseconds per run.' [Error, Halt] bench '11,900,000 per second. 84.4 nanoseconds per run.' [Error, Halt, Warning] bench '9,910,000 per second. 101 nanoseconds per run.'
#bench is not suitable to measure things that are fairly quick, because [] bench doesn't give 0 ns. It's not too far off, but definitely not accurate, especially if you compare ratios.
#bench doesn't measure the effects of allocation/gc well. The last two code puts pressure on the garbage collector.
Since this is called only once to fourteen times per frame (see DamageRecorder) -- but usually only once -- we are good with 100 nanoseconds, given that 60 frames-per-second translate to 16 666 667 nanoseconds per frame.
Not all machines (physical and virtual) running Squeak are as fast as yours. What's 100ns on your machine, may take up to 3 magnitudes longer on others. In that case, you only have 16 666 microseconds to render, and you spend 100 microseconds on something that could be almost 0.
If there were a class variable holding the exception set, it could be reused with no additional cost. It would also let users to add their own exceptions to the set without modifying Trunk code.
Levente
Best, Marcel
Am 25.10.2019 20:46:52 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>: I see, but isn't it just their existence what we want to test for to prevent from loads of Debuggers appearing? Or should we go the other way around and signal a "DebuggerRaisedNotification" each time before opening a debugger? However, currently, a #deprecated call in a drawing method makes the image unusable ...
Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Mittwoch, 23. Oktober 2019 15:48:15 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel
Am 22.10.2019 18:50:59 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>: Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org 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 <rebmekop@gmail.com>: 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
Hi Levente,
that's correct. Thanks that reminder. So we need a benchmark on a slower machine to justify that class variable. Until then, your speculation is as good as my fast machine. :-D
I do like the point of the extensibility through a class variable though...
Best, Marcel Am 29.10.2019 16:20:33 schrieb Levente Uzonyi leves@caesar.elte.hu: On Tue, 29 Oct 2019, Marcel Taeumel wrote:
Hi Christoph.
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Yes, there is a lot of room for improvement in Squeak's strategy to keep the image alive and in a recoverable state. Annoying things include errors in event handlers (such as #mouseOver:) and the thing about Warnings you mentioned for #displayWorldSafely.
Since the exception mechanism can be used to implement dynamic scope (see CurrentReadOnlySourceFiles), we should never catch Exception in general to install such handlers.
Warning might be a nice addition to #displayWorldSafely.
[Error] bench '219,000,000 per second. 4.57 nanoseconds per run.' [Error, Halt] bench '11,900,000 per second. 84.4 nanoseconds per run.' [Error, Halt, Warning] bench '9,910,000 per second. 101 nanoseconds per run.'
#bench is not suitable to measure things that are fairly quick, because [] bench doesn't give 0 ns. It's not too far off, but definitely not accurate, especially if you compare ratios.
#bench doesn't measure the effects of allocation/gc well. The last two code puts pressure on the garbage collector.
Since this is called only once to fourteen times per frame (see DamageRecorder) -- but usually only once -- we are good with 100 nanoseconds, given that 60 frames-per-second translate to 16 666 667 nanoseconds per frame.
Not all machines (physical and virtual) running Squeak are as fast as yours. What's 100ns on your machine, may take up to 3 magnitudes longer on others. In that case, you only have 16 666 microseconds to render, and you spend 100 microseconds on something that could be almost 0.
If there were a class variable holding the exception set, it could be reused with no additional cost. It would also let users to add their own exceptions to the set without modifying Trunk code.
Levente
Best, Marcel
Am 25.10.2019 20:46:52 schrieb Thiede, Christoph :
I see, but isn't it just their existence what we want to test for to prevent from loads of Debuggers appearing?
Or should we go the other way around and signal a "DebuggerRaisedNotification" each time before opening a debugger?
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Von: Squeak-dev im Auftrag von Taeumel, Marcel Gesendet: Mittwoch, 23. Oktober 2019 15:48:15 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel
Am 22.10.2019 18:50:59 schrieb Thiede, Christoph :
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
Von: Squeak-dev 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 :
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
Raspberry Pi 3 Model B+ (2017)
62 nanoseconds 1.11 microseconds 1.37 microseconds
SqueakJS (Squeak 5.0) on my machine
2 microseconds 24 microseconds 28 microseconds
**
What are better ways to benchmark "Error, Halt, Warning" than via #bench?
Best, Marcel Am 30.10.2019 09:25:10 schrieb Marcel Taeumel marcel.taeumel@hpi.de: Hi Levente,
that's correct. Thanks that reminder. So we need a benchmark on a slower machine to justify that class variable. Until then, your speculation is as good as my fast machine. :-D
I do like the point of the extensibility through a class variable though...
Best, Marcel Am 29.10.2019 16:20:33 schrieb Levente Uzonyi leves@caesar.elte.hu: On Tue, 29 Oct 2019, Marcel Taeumel wrote:
Hi Christoph.
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Yes, there is a lot of room for improvement in Squeak's strategy to keep the image alive and in a recoverable state. Annoying things include errors in event handlers (such as #mouseOver:) and the thing about Warnings you mentioned for #displayWorldSafely.
Since the exception mechanism can be used to implement dynamic scope (see CurrentReadOnlySourceFiles), we should never catch Exception in general to install such handlers.
Warning might be a nice addition to #displayWorldSafely.
[Error] bench '219,000,000 per second. 4.57 nanoseconds per run.' [Error, Halt] bench '11,900,000 per second. 84.4 nanoseconds per run.' [Error, Halt, Warning] bench '9,910,000 per second. 101 nanoseconds per run.'
#bench is not suitable to measure things that are fairly quick, because [] bench doesn't give 0 ns. It's not too far off, but definitely not accurate, especially if you compare ratios.
#bench doesn't measure the effects of allocation/gc well. The last two code puts pressure on the garbage collector.
Since this is called only once to fourteen times per frame (see DamageRecorder) -- but usually only once -- we are good with 100 nanoseconds, given that 60 frames-per-second translate to 16 666 667 nanoseconds per frame.
Not all machines (physical and virtual) running Squeak are as fast as yours. What's 100ns on your machine, may take up to 3 magnitudes longer on others. In that case, you only have 16 666 microseconds to render, and you spend 100 microseconds on something that could be almost 0.
If there were a class variable holding the exception set, it could be reused with no additional cost. It would also let users to add their own exceptions to the set without modifying Trunk code.
Levente
Best, Marcel
Am 25.10.2019 20:46:52 schrieb Thiede, Christoph :
I see, but isn't it just their existence what we want to test for to prevent from loads of Debuggers appearing?
Or should we go the other way around and signal a "DebuggerRaisedNotification" each time before opening a debugger?
However, currently, a #deprecated call in a drawing method makes the image unusable ...
Von: Squeak-dev im Auftrag von Taeumel, Marcel Gesendet: Mittwoch, 23. Oktober 2019 15:48:15 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: System-mt.1093.mcz
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
UnhandledError and UnhandledWarning are (private) implementation details of Squeak's exception handling mechanism. They should never be exposed to (or used by) applications/frameworks.
Best, Marcel
Am 22.10.2019 18:50:59 schrieb Thiede, Christoph :
Why isn't it sufficient to test for UnhandledError instead? Otherwise, we would also need to test for Warning etc. ...
Von: Squeak-dev 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 :
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
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:55:41 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de:
Did you first filein your changeset or install this commit?
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de:
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:55:41 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 <christoph.thiede@student.hpi.uni-potsdam.de>: Did you first filein your changeset or install this commit?
Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 <christoph.thiede@student.hpi.uni-potsdam.de>: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
Oh, that's (yet) totally Greek to me ... I'm on Windows, Google says it does not support SIGUSR1.
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Levente Uzonyi leves@caesar.elte.hu 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:55:41 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 <christoph.thiede@student.hpi.uni-potsdam.de>: Did you first filein your changeset or install this commit?
Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 <christoph.thiede@student.hpi.uni-potsdam.de>: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:55 Uhr An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de:
Did you first filein your changeset or install this commit?
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de:
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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
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 christoph.thiede@student.hpi.uni-potsdam.de: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:55 Uhr An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de: Did you first filein your changeset or install this commit? Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Freitag, 20. September 2019 19:42:05 An: Alan Grimes via Squeak-dev; packages@lists.squeakfoundation.org 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 christoph.thiede@student.hpi.uni-potsdam.de: 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 squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Dienstag, 17. September 2019 12:10:24 An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org 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!
squeak-dev@lists.squeakfoundation.org