Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.12.mcz ==================== Summary ==================== Name: VMMakerUI-eem.12 Author: eem Time: 29 December 2019, 5:29:59.032533 pm UUID: a98c9ec5-e3e7-4cc6-aa4d-ed8d060de6a7 Ancestors: VMMakerUI-eem.11 Better printing of references unscavenged new space objects. =============== Diff against VMMakerUI-eem.11 =============== 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 | (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]]]]. - (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: StackInterpreter>>printForwarder:on: (in category '*VMMakerUI-debug printing') ----- + printForwarder: oop on: aStream + <doNotGenerate> + aStream nextPutAll: ' is a forwarded object to '. + self printHex: (objectMemory followForwarded: oop) on: aStream. + aStream nextPutAll: ' of slot size '; print: (objectMemory numSlotsOfAny: oop). + objectMemory printHeaderTypeOf: oop on: aStream. + aStream cr! Item was changed: ----- Method: StackInterpreter>>printOop:on:oopAttribute: (in category '*VMMakerUI-debug printing') ----- printOop: oop on: aStream oopAttribute: oopTextAttribute <doNotGenerate> | cls fmt lastIndex startIP bytecodesPerLine column | <inline: false> (objectMemory isImmediate: oop) ifTrue: [^self shortPrintOop: oop on: aStream]. self printHex: oop on: aStream. (objectMemory addressCouldBeObj: oop) ifFalse: + [(oop bitAnd: objectMemory allocationUnit - 1) ~= 0 ifTrue: [^aStream nextPutAll: ' is misaligned'; cr]. + ((objectMemory isInNewSpace: oop) + and: [objectMemory isForwarded: oop]) ifTrue: + [self printForwarder: oop on: aStream]. + ^aStream nextPutAll: (self whereIs: oop); cr]. - [^aStream nextPutAll: ((oop bitAnd: objectMemory allocationUnit - 1) ~= 0 - ifTrue: [' is misaligned'] - ifFalse: [self whereIs: oop]); cr]. (objectMemory isFreeObject: oop) ifTrue: [aStream nextPutAll: ' is a free chunk of size '; print: (objectMemory sizeOfFree: oop). objectMemory hasSpurMemoryManagerAPI ifTrue: [aStream nextPutAll: ' 0th: '. self printHex: (objectMemory fetchPointer: 0 ofFreeChunk: oop) on: aStream. objectMemory printHeaderTypeOf: oop on: aStream]. ^aStream cr]. (objectMemory isForwarded: oop) ifTrue: + [self printForwarder: oop on: aStream]. - [aStream - nextPutAll: ' is a forwarded object to '. self printHex: (objectMemory followForwarded: oop) on: aStream. - aStream nextPutAll: ' of slot size '; print: (objectMemory numSlotsOfAny: oop). - objectMemory printHeaderTypeOf: oop on: aStream. - ^aStream cr]. aStream nextPutAll: ': a(n) '. self printNameOfClass: (cls := objectMemory fetchClassOfNonImm: oop) count: 5 on: aStream. cls = (objectMemory splObj: ClassFloat) ifTrue: [^aStream cr; print: (objectMemory dbgFloatValueOf: oop); cr]. fmt := objectMemory formatOf: oop. fmt > objectMemory lastPointerFormat ifTrue: [aStream nextPutAll: ' nbytes '; print: (objectMemory numBytesOf: oop)]. aStream cr. (fmt between: objectMemory firstLongFormat and: objectMemory firstCompiledMethodFormat - 1) ifTrue: ["This will answer false if splObj: ClassAlien is nilObject" (self is: oop KindOfClass: (objectMemory splObj: ClassAlien)) ifTrue: [aStream nextPutAll: ' datasize '; print: (self sizeOfAlienData: oop). aStream nextPutAll: ((self isIndirectAlien: oop) ifTrue: [' indirect @ '] ifFalse: [(self isPointerAlien: oop) ifTrue: [' pointer @ '] ifFalse: [' direct @ ']]). self printHex: (self startOfAlienData: oop) on: aStream. ^aStream cr]. (objectMemory isWordsNonImm: oop) ifTrue: [lastIndex := 64 min: ((objectMemory numBytesOf: oop) / objectMemory wordSize). lastIndex > 0 ifTrue: [1 to: lastIndex do: [:index| self printHex: (objectMemory fetchLong32: index - 1 ofObject: oop) on: aStream. index \\ self elementsPerPrintOopLine = 0 ifTrue: [aStream cr]]. lastIndex \\ self elementsPerPrintOopLine = 0 ifFalse: [aStream cr]]. ^self]. self printStringOf: oop on: aStream. ^aStream cr]. "this is nonsense. apologies." startIP := (objectMemory safeLastPointerOf: oop) + objectMemory bytesPerOop - objectMemory baseHeaderSize / objectMemory bytesPerOop. lastIndex := 256 min: startIP. lastIndex > 0 ifTrue: [1 to: lastIndex do: [:index| aStream space; nextPutAll: (self hex: (objectMemory fetchPointer: index - 1 ofObject: oop) withAttribute: oopTextAttribute); space. aStream nextPutAll: (self shortPrint: (objectMemory fetchPointer: index - 1 ofObject: oop)). index \\ self elementsPerPrintOopLine = 0 ifTrue: [aStream cr]]. lastIndex \\ self elementsPerPrintOopLine = 0 ifFalse: [aStream cr]]. (objectMemory isCompiledMethod: oop) ifFalse: [startIP > 64 ifTrue: [aStream nextPutAll: '...'; cr]] ifTrue: [startIP := startIP * objectMemory wordSize + 1. lastIndex := objectMemory lengthOf: oop. lastIndex - startIP > 100 ifTrue: [lastIndex := startIP + 100]. bytecodesPerLine := 8. column := 1. startIP to: lastIndex do: [:index| | byte | column = 1 ifTrue: [aStream nextPutAll: (oop+objectMemory baseHeaderSize+index-1) hex; print: ': ']. byte := objectMemory fetchByte: index - 1 ofObject: oop. aStream space. byte printOn: aStream base: 16. aStream nextPut: $/. byte printOn: aStream. column := column + 1. column > bytecodesPerLine ifTrue: [column := 1. aStream cr]]. column = 1 ifFalse: [aStream cr]]! |
Free forum by Nabble | Edit this page |