Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1114.mcz ==================== Summary ==================== Name: System-mt.1114 Author: mt Time: 9 October 2019, 3:31:40.772803 pm UUID: 8d7cf94a-6d5a-6d4c-aef8-e48a1bd36ea8 Ancestors: System-eem.1113 For exception handling and debugging, untangle some dependencies between System and Kernel. =============== Diff against System-eem.1113 =============== Item was changed: + ----- Method: Process>>clearErrorRecursionFlag (in category '*System-debugging support') ----- - ----- Method: Process>>clearErrorRecursionFlag (in category '*System-debugging') ----- clearErrorRecursionFlag self environmentAt: #errorRecursionFlag put: false.! Item was added: + ----- Method: Process>>debug (in category '*System-debugging') ----- + debug + + ^ self debugWithTitle: 'Debug'! Item was added: + ----- Method: Process>>debug: (in category '*System-debugging') ----- + debug: context + + ^ self debug: context title: 'Debug'! Item was added: + ----- Method: Process>>debug:title: (in category '*System-debugging') ----- + debug: context title: title + "Open debugger on self with context shown on top" + + ^ self debug: context title: title full: false + ! Item was added: + ----- Method: Process>>debug:title:full: (in category '*System-debugging') ----- + debug: context title: title full: bool + + ^ self + debug: context + title: title + full: bool + contents: nil! Item was added: + ----- Method: Process>>debug:title:full:contents: (in category '*System-debugging') ----- + debug: context title: title full: bool contents: contents + "Open debugger on self with context shown on top" + + | topCtxt | + topCtxt := self isActiveProcess ifTrue: [thisContext] ifFalse: [self suspendedContext]. + (topCtxt hasContext: context) ifFalse: [^ self error: 'context not in process']. + ^ ToolSet debugProcess: self context: context label: title contents: contents fullView: bool! Item was added: + ----- Method: Process>>debugWithTitle: (in category '*System-debugging') ----- + debugWithTitle: title + + ^ self debugWithTitle: title full: true! Item was added: + ----- Method: Process>>debugWithTitle:full: (in category '*System-debugging') ----- + debugWithTitle: title full: aBoolean + + ^ self debugWithTitle: title full: aBoolean contents: nil! Item was added: + ----- Method: Process>>debugWithTitle:full:contents: (in category '*System-debugging') ----- + debugWithTitle: title full: bool contents: contents + "Automatically choose the top context." + + ^ self + debug: (self isActiveProcess ifTrue: [thisContext] ifFalse: [self suspendedContext]) + title: title + full: bool + contents: contents! Item was changed: + ----- Method: Process>>hasRecursiveError (in category '*System-debugging support') ----- - ----- Method: Process>>hasRecursiveError (in category '*System-debugging') ----- hasRecursiveError ^ self environmentAt: #errorRecursionFlag ifAbsent: [false]! Item was changed: + ----- Method: Process>>runUntil: (in category '*System-debugging support') ----- - ----- Method: Process>>runUntil: (in category '*System-debugging') ----- runUntil: aConditionBlock "Simulate code execution until the provided condition is fulfilled." [(aConditionBlock isNil or: [self isTerminated]) or: [aConditionBlock value: self suspendedContext] ] whileFalse: [self step]. "If we are already at a send, this next call should do nothing." self stepToSendOrReturn.! Item was changed: + ----- Method: Process>>setErrorRecursionFlag (in category '*System-debugging support') ----- - ----- Method: Process>>setErrorRecursionFlag (in category '*System-debugging') ----- setErrorRecursionFlag self environmentAt: #errorRecursionFlag put: true.! Item was changed: + ----- Method: Process>>shouldResumeFromDebugger (in category '*System-debugging support') ----- - ----- Method: Process>>shouldResumeFromDebugger (in category '*System-debugging') ----- shouldResumeFromDebugger "Tools can construct processes that might interfere with existing ones. For example, one process can be copied for inspecting the state through that copy later on. Resuming both - original and copy - at some point might result in unexpected interference. To prevent or help In such situations, the copy can be flagged to not be resumable from the debugger. Note that you can always resume a process with #resume even if a tool tells you otherwise." ^ self environmentAt: #shouldResumeFromDebugger ifAbsent: [true]! Item was changed: + ----- Method: Process>>shouldResumeFromDebugger: (in category '*System-debugging support') ----- - ----- Method: Process>>shouldResumeFromDebugger: (in category '*System-debugging') ----- shouldResumeFromDebugger: aBoolean self environmentAt: #shouldResumeFromDebugger put: aBoolean.! Item was changed: ----- 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 "Maybe better teminate process?"] - anError return] ifNotNil: [:ts | ts handleError: anError]! Item was removed: - ----- 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! Item was removed: - ----- Method: UnhandledWarning>>defaultAction (in category '*System-priv handling') ----- - defaultAction - - ^ ToolSet handleWarning: self exception! Item was removed: - ----- Method: Warning>>defaultAction (in category '*System-exceptionDescription') ----- - defaultAction - "Inform the user of a Warning, giving them the choice of ignoring the warning (proceeding), debugging, or terminating the computation." - UnhandledWarning signalForException: self! |
Free forum by Nabble | Edit this page |