'From Squeak3.1alpha of 16 September 2001 [latest update: #4332] on 19 September 2001 at 11:38:52 pm'! "Change Set: ChasePointersMenu Date: 19 September 2001 Author: Doug Way Adds the useful 'chase pointers' menu item to the Inspector (in addition to the ProcessBrowser), which uses the PointerFinder to track down a global which points to the inspected object. Great for figuring out why an object hasn't been garbage collected."! !Inspector methodsFor: 'menu commands' stamp: 'dew 2/13/2001 01:31'! chasePointers | saved | self selectionIndex == 0 ifTrue: [^ self changed: #flash]. saved _ self object. [self object: nil. (Smalltalk includesKey: #PointerFinder) ifTrue: [PointerFinder on: saved] ifFalse: [self inspectPointers]] ensure: [self object: saved]! ! !Inspector methodsFor: 'menu commands' stamp: 'dew 9/19/2001 01:42'! fieldListMenu: aMenu "Arm the supplied menu with items for the field-list of the receiver" Smalltalk isMorphic ifTrue: [aMenu addStayUpItemSpecial]. aMenu addList: #( ('inspect (i)' inspectSelection) ('explore (I)' exploreSelection)). self addCollectionItemsTo: aMenu. aMenu addList: #( - ('method refs to this inst var' referencesToSelection) ('methods storing into this inst var' defsOfSelection) ('objects pointing to this value' objectReferencesToSelection) ('chase pointers' chasePointers) - ('browse full (b)' browseMethodFull) ('browse class' browseClass) ('browse hierarchy' classHierarchy) ('browse protocol (p)' browseFullProtocol) - ('inst var refs...' browseInstVarRefs) ('inst var defs...' browseInstVarDefs) ('class var refs...' classVarRefs) ('class variables' browseClassVariables) ('class refs (N)' browseClassRefs) - ('copy name (c)' copyName) ('basic inspect' inspectBasic)). Smalltalk isMorphic ifTrue: [aMenu addList: #( - ('tile for this value (t)' tearOffTile) ('viewer for this value (v)' viewerForValue))]. ^ aMenu " - ('alias for this value' aliasForValue) ('watcher for this slot' watcherForSlot)" ! ! !Inspector methodsFor: 'menu commands' stamp: 'dew 2/13/2001 01:43'! fieldListMenuForCollection: aMenu ^ aMenu labels: 'inspect (i) inspect element... explore (I) method refs to this inst var methods storing into this inst var objects pointing to this value chase pointers copy name browse full (b) browse class browse hierarchy inst var refs... inst var defs... class var refs... class variables class refs basic inspect' lines: #(3 7 8 11 13 16) selections: #(inspectSelection inspectElement exploreSelection referencesToSelection defsOfSelection objectReferencesToSelection chasePointers copyName browseMethodFull browseClass classHierarchy browseInstVarRefs browseInstVarDefs classVarRefs browseClassVariables browseClassRefs inspectBasic). ! ! !OrderedCollectionInspector methodsFor: 'as yet unclassified' stamp: 'dew 9/19/2001 03:27'! fieldList object ifNil: [ ^ OrderedCollection new]. ^ self baseFieldList , (object size <= (self i1 + self i2) ifTrue: [(1 to: object size) collect: [:i | i printString]] ifFalse: [(1 to: self i1) , (object size-(self i2-1) to: object size) collect: [:i | i printString]]) " OrderedCollection new inspect (OrderedCollection newFrom: #(3 5 7 123)) inspect (OrderedCollection newFrom: (1 to: 1000)) inspect "! !