Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1115.mcz ==================== Summary ==================== Name: Morphic-mt.1115 Author: mt Time: 17 April 2016, 7:53:29.399544 pm UUID: c54f2046-be47-6c41-8280-6760e845852d Ancestors: Morphic-mt.1114 Use tool set to "debug it". =============== Diff against Morphic-mt.1114 =============== Item was added: + ----- Method: MorphicProject>>debugMethod:forReceiver:inContext: (in category 'debugging') ----- + debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil + + | guineaPig debugger debuggerWindow context | + guineaPig := + [aCompiledMethod + valueWithReceiver: anObject + arguments: (aContextOrNil ifNil: [ #() ] ifNotNil: [ { aContextOrNil } ]). + guineaPig := nil "spot the return from aCompiledMethod"] newProcess. + context := guineaPig suspendedContext. + debugger := Debugger new + process: guineaPig + controller: nil + context: context. + debuggerWindow := debugger openFullNoSuspendLabel: 'Debug it'. + "Now step into the expression. But if it is quick (is implemented as a primtiive, e.g. `0') + it will return immediately back to the block that is sent newProcess above. Guard + against that with the check for home being thisContext." + [debugger interruptedContext method == aCompiledMethod] + whileFalse: + [(guineaPig isNil + and: [debugger interruptedContext home == thisContext]) ifTrue: + [debuggerWindow delete. + UIManager default inform: 'Nothing to debug; expression is optimized'. + ^self]. + debugger send]! Item was removed: - ----- Method: TextEditor>>debug:receiver:in: (in category 'do-its') ----- - debug: aCompiledMethod receiver: anObject in: evalContext - - | guineaPig debugger debuggerWindow context | - guineaPig := - [aCompiledMethod - valueWithReceiver: anObject - arguments: (evalContext ifNil: [ #() ] ifNotNil: [ { evalContext } ]). - guineaPig := nil "spot the return from aCompiledMethod"] newProcess. - context := guineaPig suspendedContext. - debugger := Debugger new - process: guineaPig - controller: nil - context: context. - debuggerWindow := debugger openFullNoSuspendLabel: 'Debug it'. - "Now step into the expression. But if it is quick (is implemented as a primtiive, e.g. `0') - it will return immediately back to the block that is sent newProcess above. Guard - against that with the check for home being thisContext." - [debugger interruptedContext method == aCompiledMethod] - whileFalse: - [(guineaPig isNil - and: [debugger interruptedContext home == thisContext]) ifTrue: - [debuggerWindow delete. - UIManager default inform: 'Nothing to debug; expression is optimized'. - ^self]. - debugger send]! Item was changed: ----- Method: TextEditor>>debugIt (in category 'do-its') ----- debugIt | receiver context | self lineSelectAndEmptyCheck: [^self]. (model respondsTo: #debugExpression:) ifTrue: [^ model perform: #debugExpression: with: self selection]. receiver := (model respondsTo: #doItReceiver) ifTrue: [model doItReceiver] ifFalse: [nil]. context := (model respondsTo: #doItContext) ifTrue: [model doItContext] ifFalse: [nil]. (self compileSelectionFor: receiver in: context) ifNotNil: [:method | + ToolSet debugMethod: method forReceiver: receiver inContext: context].! - self debug: method receiver: receiver in: context].! |
Free forum by Nabble | Edit this page |