Andreas Raab uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ar.142.mcz ==================== Summary ==================== Name: Tools-ar.142 Author: ar Time: 12 November 2009, 1:21:18 am UUID: f5f2f9cd-99e6-f84b-b7c5-30abb82533a2 Ancestors: Tools-nice.141 Remove support for isolation layers. =============== Diff against Tools-nice.141 =============== Item was changed: ----- Method: Debugger>>process:controller:context: (in category 'private') ----- process: aProcess controller: aController context: aContext + super initialize. + Smalltalk at: #MessageTally ifPresentAndInMemory: [:c | c new close]. + contents := nil. + interruptedProcess := aProcess. + interruptedController := aController. + contextStackTop := aContext. + self newStack: (contextStackTop stackOfSize: 1). + contextStackIndex := 1. + externalInterrupt := false. + selectingPC := true. + Smalltalk isMorphic ifTrue: + [errorWasInUIProcess := false]! - ^ self process: aProcess controller: aController context: aContext isolationHead: nil! Item was changed: ----- Method: Debugger>>openNotifierContents:label: (in category 'initialize') ----- openNotifierContents: msgString label: label "Create and schedule a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired." "NOTE: When this method returns, a new process has been scheduled to run the windows, and thus this notifier, but the previous active porcess has not been suspended. The sender will do this." | msg builder spec | Sensor flushKeyboard. savedCursor := Sensor currentCursor. Sensor currentCursor: Cursor normal. (label beginsWith: 'Space is low') ifTrue: [msg := self lowSpaceChoices, (msgString ifNil: [''])] ifFalse: [msg := msgString]. - isolationHead ifNotNil: - ["We have already revoked the isolation layer -- now jump to the parent project." - msg := self isolationRecoveryAdvice, msgString. - failedProject := Project current. - isolationHead parent enterForEmergencyRecovery]. - builder := ToolBuilder default. spec := self buildNotifierWith: builder label: label message: msg. self expandStack. builder open: spec. errorWasInUIProcess := Project spawnNewProcessIfThisIsUI: interruptedProcess. ! Item was changed: ----- Method: Debugger class>>context: (in category 'instance creation') ----- + context: aContext - context: aContext "Answer an instance of me for debugging the active process starting with the given context." + ^ self new + process: Processor activeProcess + controller: + ((Smalltalk isMorphic not and: [ScheduledControllers inActiveControllerProcess]) + ifTrue: [ScheduledControllers activeController] + ifFalse: [nil]) + context: aContext! - ^ self context: aContext isolationHead: nil! Item was changed: CodeHolder subclass: #Debugger + instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackTop contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC debuggerMap savedCursor errorWasInUIProcess labelString message' - instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackTop contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC debuggerMap savedCursor isolationHead failedProject errorWasInUIProcess labelString message' classVariableNames: 'ContextStackKeystrokes ErrorRecursion' poolDictionaries: '' category: 'Tools-Debugger'! !Debugger commentStamp: '<historical>' prior: 0! I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context. Special note on recursive errors: Some errors affect Squeak's ability to present a debugger. This is normally an unrecoverable situation. However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger. Here is the chain of events in such a recovery. * A recursive error is detected. * The current project is queried for an isolationHead * Changes in the isolationHead are revoked * The parent project of isolated project is returned to * The debugger is opened there and execution resumes. If the user closes that debugger, execution continues in the outer project and layer. If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. ! Item was changed: ----- Method: ParagraphEditor>>debug:receiver:in: (in category '*Tools') ----- debug: aCompiledMethod receiver: anObject in: evalContext | selector guineaPig debugger context | selector := evalContext isNil ifTrue: [#DoIt] ifFalse: [#DoItIn:]. anObject class addSelectorSilently: selector withMethod: aCompiledMethod. guineaPig := evalContext isNil ifTrue: [[anObject DoIt] newProcess] ifFalse: [[anObject DoItIn: evalContext] newProcess]. context := guineaPig suspendedContext. debugger := Debugger new process: guineaPig controller: ((Smalltalk isMorphic not and: [ScheduledControllers inActiveControllerProcess]) ifTrue: [ScheduledControllers activeController] ifFalse: [nil]) + context: context. - context: context - isolationHead: nil. debugger openFullNoSuspendLabel: 'Debug it'. [debugger interruptedContext method == aCompiledMethod] whileFalse: [debugger send]. anObject class basicRemoveSelector: selector! Item was changed: ----- Method: Debugger>>resumeProcess: (in category 'private') ----- resumeProcess: aTopView Smalltalk isMorphic ifFalse: [aTopView erase]. savedCursor ifNotNil: [Sensor currentCursor: savedCursor]. - isolationHead - ifNotNil: [failedProject enterForEmergencyRecovery. - isolationHead invoke. - isolationHead := nil]. interruptedProcess isTerminated ifFalse: [ Smalltalk isMorphic ifTrue: [errorWasInUIProcess ifTrue: [Project resumeProcess: interruptedProcess] ifFalse: [interruptedProcess resume]] ifFalse: [ScheduledControllers activeControllerNoTerminate: interruptedController andProcess: interruptedProcess]]. "if old process was terminated, just terminate current one" interruptedProcess := nil. "Before delete, so release doesn't terminate it" Smalltalk isMorphic ifTrue: [aTopView delete. World displayWorld] ifFalse: [aTopView controller closeAndUnscheduleNoErase]. Smalltalk installLowSpaceWatcher. "restart low space handler" errorWasInUIProcess == false ifFalse: [Processor terminateActive]! Item was changed: ----- Method: Debugger class>>openContext:label:contents: (in category 'class initialization') ----- openContext: aContext label: aString contents: contentsStringOrNil - | isolationHead | "Open a notifier in response to an error, halt, or notify. A notifier view just shows a short view of the sender stack and provides a menu that lets the user open a full debugger." <primitive: 19> "Simulation guard" ErrorRecursion not & Preferences logDebuggerStackToFile ifTrue: [Smalltalk logError: aString inContext: aContext to: 'SqueakDebug.log']. + ErrorRecursion ifTrue:[ + ErrorRecursion := false. + self primitiveError: aString]. - ErrorRecursion ifTrue: - [ErrorRecursion := false. - (isolationHead := Project current isolationHead) - ifNil: [self primitiveError: aString] - ifNotNil: [isolationHead revoke]]. ErrorRecursion := true. self informExistingDebugger: aContext label: aString. + (Debugger context: aContext) - (Debugger context: aContext isolationHead: isolationHead) openNotifierContents: contentsStringOrNil label: aString. ErrorRecursion := false. Processor activeProcess suspend. ! Item was removed: - ----- Method: Debugger>>isolationRecoveryAdvice (in category 'private') ----- - isolationRecoveryAdvice - "Return a notifier message string to be presented in case of recovery from recursive error by revoking the changes in an isolation layer. This surely ranks as one of Squeak's longer help messages." - - ^ 'Warning!! You have encountered a recursive error situation. - - Don''t panic, but do read the following advice. If you were just fooling around, the simplest thing to do is to quit and NOT save, and restart Squeak. If you care about recovery, then read on... - - In the process of diagnosing one error, further errors occurred, making it impossible to give you a debugger to work with. Squeak has jumped to an outer project where many of the objects and code changes that might have caused this problem are not involved in normal operation. If you are looking at this window, chances are that this first level of recovery was successful. If there are changes you care a lot about, try to save them now. Then, hopefully, from the state in this debugger, you can determine what the problem was and fix it. Do not save this image until you are confident of its recovery. - - You are no longer in the world that is damaged. The two most likely causes of recursive errors are malformed objects (for instance a corrupt value encountered in any display of the desktop) and recurring code errors (such as a change that causes errors in any attempt to display the desktop). - - In the case of malformed objects, you can attempt to repair them by altering various bindings in the corrupted environment. Open this debugger and examine the state of the objects closest to the error. - - In the case of code errors, note that you are no longer in a world where the erroneous code is in effect. The only simple option available is for you to browse to the changeSet for the project in distress, and remove one or more of the changes (later it will be possible to edit the code remotely from here). - - If you feel you have repaired the problem, then you may proceed from this debugger. This will put you back in the project that failed with the changes that failed for another try. Note that the debugger from which you are proceeding is the second one that occurred; you will likely find the first one waiting for you when you reenter the failed project!! Also note that if your error occurred while displaying a morph, it may now be flagged as undisplayable (red with yellow cross); if so, use the morph debug menu to choose ''start drawing again''. - - If you have not repaired the problem, you should close this debugger and delete the failed project after retrieving whatever may be of value in it. - - Good luck. - - - The Squeak Fairy Godmother - - PS: If you feel you need the help of a quantum mechanic, do NOT close this window. Instead, the best thing to do (after saving anything that seems safe to save) would be to use the ''save as...'' command in the world menu, and give it a new image name, such as OOPS. There is a good chance that someone who knows their way around Squeak can help you out. - '! Item was removed: - ----- Method: Debugger>>process:controller:context:isolationHead: (in category 'private') ----- - process: aProcess controller: aController context: aContext isolationHead: projectOrNil - - super initialize. - Smalltalk at: #MessageTally ifPresentAndInMemory: [:c | c new close]. - contents := nil. - interruptedProcess := aProcess. - interruptedController := aController. - contextStackTop := aContext. - self newStack: (contextStackTop stackOfSize: 1). - contextStackIndex := 1. - externalInterrupt := false. - selectingPC := true. - isolationHead := projectOrNil. - Smalltalk isMorphic ifTrue: - [errorWasInUIProcess := false]! Item was removed: - ----- Method: Debugger class>>context:isolationHead: (in category 'instance creation') ----- - context: aContext isolationHead: isolationHead - "Answer an instance of me for debugging the active process starting with the given context." - - ^ self new - process: Processor activeProcess - controller: - ((Smalltalk isMorphic not and: [ScheduledControllers inActiveControllerProcess]) - ifTrue: [ScheduledControllers activeController] - ifFalse: [nil]) - context: aContext - isolationHead: isolationHead - ! |
Free forum by Nabble | Edit this page |