Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.23.mcz ==================== Summary ==================== Name: VMMakerUI-eem.23 Author: eem Time: 24 February 2020, 10:18:34.007099 pm UUID: 4c054213-2bde-422f-b669-589935878c54 Ancestors: VMMakerUI-eem.22 Extend CogFrameInspector to allow changing the stack pointer, and to force text generation when frame is old and out-of-bounds. =============== Diff against VMMakerUI-eem.22 =============== Item was changed: CogVMObjectInspector subclass: #CogAbstractFrameInspector + instanceVariableNames: 'force' - instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'VMMakerUI-SqueakInspectors'! !CogAbstractFrameInspector commentStamp: 'eem 12/24/2019 12:32' prior: 0! A CogAbstractFrameInspector is an inspector for the state of a Smalltalk stack frame in Cog.! Item was added: + ----- Method: CogAbstractFrameInspector>>coInterpreter: (in category 'initialization') ----- + coInterpreter: aCoInterpreter + super coInterpreter: aCoInterpreter. + force := false! Item was changed: ----- Method: CogAbstractFrameInspector>>textForFramePointer:stackPointer: (in category 'accessing - ui') ----- textForFramePointer: framePointer stackPointer: stackPointer "Print and emphasize the frame text as efficiently as possible, deferring as much interpretation until evaluation time." | frameString frameText | + (force or: [coInterpreter stackPages apparentlyValidFramePointer: framePointer stackPointer: stackPointer]) ifFalse: - (coInterpreter stackPages apparentlyValidFramePointer: framePointer stackPointer: stackPointer) ifFalse: [^('Invalid Frame fp: ', (framePointer isInteger ifTrue: [framePointer hex allButFirst: 3] ifFalse: [framePointer printString]), ' sp: ', (framePointer isInteger ifTrue: [framePointer hex allButFirst: 3] ifFalse: [framePointer printString])) asText allBold]. frameText := (String streamContents: [:fs| coInterpreter printFrame: framePointer WithSP: stackPointer on: fs]) allButFirst asText. (frameString := frameText string) findTokens: {Character cr} indicesDo: [:start :stop| | firstColonIndex fieldNameIndex fieldNameEndIndex valueIndex | start = 1 ifTrue: [self windowTitle: (self windowTitleFrom: (frameString copyFrom: 1 to: stop)). frameText addAttribute: (PluggableTextAttribute evalBlock: [(CogFrameInspector on: coInterpreter) framePointer: framePointer; open]) from: 1 to: (frameString indexOf: Character space startingAt: 4) - 1] ifFalse: [fieldNameIndex := (firstColonIndex := frameString indexOf: $: startingAt: start + 1) + 1. [(frameString at: fieldNameIndex) = Character space] whileTrue: [fieldNameIndex := fieldNameIndex + 1]. fieldNameEndIndex := (frameString indexOf: $: startingAt: fieldNameIndex + 1) - 1. valueIndex := fieldNameEndIndex + 2. [(frameString at: valueIndex) = Character space] whileTrue: [valueIndex := valueIndex + 1]. valueIndex < stop ifTrue: "greater for 'INVALID RECEIVER'" [(self evalAttributeForFieldName: (frameString copyFrom: fieldNameIndex to: fieldNameEndIndex) framePointer: framePointer value: (frameString copyFrom: valueIndex to: stop) addressString: (frameString copyFrom: start to: firstColonIndex - 1)) ifNotNil: [:attribute| frameText addAttribute: attribute from: fieldNameIndex to: fieldNameEndIndex]]]]. ^frameText! Item was added: + ----- Method: CogFrameInspector>>textMenu: (in category 'accessing - ui') ----- + textMenu: aMenuMorph + aMenuMorph + add: 'decrement sp' action: [self stackPointer: self stackPointer - objectMemory wordSize]; + add: 'increment sp' action: [self stackPointer: self stackPointer + objectMemory wordSize]; + addLine; + add: 'force output' action: [force := true]. + ^aMenuMorph! |
Free forum by Nabble | Edit this page |