--- a/ContextInspectorView.st Thu Jun 13 12:23:07 2013 +0100
+++ b/ContextInspectorView.st Fri Jun 21 19:05:40 2013 +0100
@@ -57,7 +57,7 @@
"set the context to be inspected"
|methodHomeContext method homeNames rec sel
- m argsOnly blockNode
+ m blockNode
numVarsInSource numVarsInContext isDoIt
numArgs numVars n tempNames realTempNames
oldSelection oldSelectedName hCon keepList newList|
@@ -111,26 +111,9 @@
isDoIt := (sel == #doIt) or:[sel == #doIt:].
method := methodHomeContext method.
-"/ implementorClass := methodHomeContext methodClass.
-"/ implementorClass notNil ifTrue:[
-"/ method := implementorClass compiledMethodAt:sel.
-"/ ] ifFalse:[
-"/ "/ mhm - an unbound method;
-"/ "/ see if it was invoked by a direct call
-"/ "/ consider this a kludge
-"/
-"/ methodHomeContext sender notNil ifTrue:[
-"/ (methodHomeContext sender selector startsWith:'valueWithReceiver:') ifTrue:[
-"/ method := methodHomeContext sender receiver
-"/ ]
-"/ ]
-"/ ].
-
(method notNil and:[method isWrapped]) ifTrue:[
- "
- in a wrapped context, locals are something different
- "
-"/ argsOnly := true.
+ "/ in a wrapped context, locals are something different
+ argsOnly := true.
m := method originalMethod.
m notNil ifTrue:[
@@ -141,57 +124,50 @@
].
method notNil ifTrue:[
- "/ method source notNil ifTrue:[
-
- argsOnly ifTrue:[
- homeNames := method methodArgNames
- ] ifFalse:[
- homeNames := method methodArgAndVarNames.
+ argsOnly ifFalse:[
+ homeNames := method methodArgAndVarNames.
- "/ did it already allocate its locals ?
- homeNames size > (methodHomeContext numArgs + methodHomeContext numVars)
- ifTrue:[
- homeNames := method methodArgNames.
- argsOnly := true.
- ].
+ "/ did it already allocate its locals ?
+ (homeNames size > (methodHomeContext numArgs + methodHomeContext numVars)) ifTrue:[
+ argsOnly := true.
].
+ ].
+ argsOnly ifTrue:[
+ homeNames := method methodArgNames
+ ].
- "/ there is one case, where the above is by purpose:
- "/ the #doIt - method, which has been given an invalid
- "/ source.
- "/ care for this here.
-
- isDoIt ifTrue:[
- homeNames := #().
- ] ifFalse:[
+ "/ there is one case, where the above is by purpose:
+ "/ the #doIt - method, which has been given an invalid
+ "/ source.
+ "/ care for this here.
- "/ check
-
- numVarsInContext := methodHomeContext argsAndVars size.
- numVarsInSource := homeNames size.
-
- numVarsInSource > 0 ifTrue:[
- numVarsInContext < numVarsInSource ifTrue:[
+ isDoIt ifTrue:[
+ homeNames := #().
+ ] ifFalse:[
+ "/ check
+ numVarsInContext := methodHomeContext argsAndVars size.
+ numVarsInSource := homeNames size.
- "/ the methods source does not correctly reflect
- "/ the number of args&vars in the context.
- "/ either outDated, or somehow strange.
- "/ (happens with wrapped methods, which are not
- "/ what they look)
+ numVarsInSource > 0 ifTrue:[
+ numVarsInContext < numVarsInSource ifTrue:[
+ "/ the methods source does not correctly reflect
+ "/ the number of args&vars in the context.
+ "/ either outDated, or somehow strange.
+ "/ (happens with wrapped methods, which are not
+ "/ what they look)
- numVarsInSource > numVarsInContext ifTrue:[
- homeNames := homeNames copyTo:numVarsInContext.
+ numVarsInSource > numVarsInContext ifTrue:[
+ homeNames := homeNames copyTo:numVarsInContext.
+ ] ifFalse:[
+ numVarsInContext >= methodHomeContext numArgs ifTrue:[
+ homeNames := homeNames copyTo:methodHomeContext numArgs
] ifFalse:[
- numVarsInContext >= methodHomeContext numArgs ifTrue:[
- homeNames := homeNames copyTo:methodHomeContext numArgs
- ] ifFalse:[
- homeNames := nil
- ]
- ]
+ homeNames := nil
+ ]
]
]
]
- "/ ]
+ ]
].
"
@@ -221,7 +197,7 @@
].
n := homeNames size.
- n < (methodHomeContext numVars + methodHomeContext numArgs) ifTrue:[
+ n < ((argsOnly ifTrue:[0] ifFalse:[ methodHomeContext numVars]) + methodHomeContext numArgs) ifTrue:[
"/ its a context which includes locals from
"/ inlined sub-blocks.
"/ First, generate synthetic varNames ...
@@ -405,6 +381,13 @@
).
sel := self selection.
+
+ (sel isSymbol) ifTrue:[
+ items := items , #(
+ ('Browse Implementors' #browseImplementorsOfSymbolValue)
+ ).
+ ].
+
Error
handle:[:ex| ]
do:[
@@ -445,7 +428,7 @@
resources:resources.
selectionIndex isNil ifTrue:[
- m disableAll:#(doInspect doBasicInspect browse browseHome)
+ m disableAll:#(doInspect doBasicInspect browse browseHome browseImplementorsOfSymbolValue)
] ifFalse:[
sel isBlock ifFalse:[
m disable:#browseHome
@@ -553,7 +536,7 @@
inspectedContext isNil ifTrue:[^ nil].
- argsOnly := false.
+ "/ argsOnly := false.
theContext := inspectedContext.
methodHomeContext := theContext methodHome.
@@ -670,11 +653,11 @@
!ContextInspectorView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.81 2013-05-28 18:23:50 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.85 2013-06-20 11:24:29 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.81 2013-05-28 18:23:50 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.85 2013-06-20 11:24:29 cg Exp $'
!
version_HG