ContextInspectorView.st
changeset 12898 323452deefd5
parent 12779 4b9dd97e4033
child 12904 550f2f25a5b4
--- a/ContextInspectorView.st	Fri Jun 14 13:17:05 2013 +0200
+++ b/ContextInspectorView.st	Fri Jun 14 13:18:15 2013 +0200
@@ -57,11 +57,13 @@
     "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|
 
+    argsOnly := false.
+
     oldSelection := selectionIndex.
     oldSelection notNil ifTrue:[
         oldSelectedName := (self listEntryAt:oldSelection).
@@ -111,26 +113,10 @@
             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.
+Transcript showCR:'w'.
+                "/ in a wrapped context, locals are something different
+                argsOnly := true.
 
                 m := method originalMethod.
                 m notNil ifTrue:[
@@ -141,57 +127,52 @@
             ].
 
             method notNil ifTrue:[
-                "/ method source notNil ifTrue:[
-
-                    argsOnly ifTrue:[
-                        homeNames := method methodArgNames
-                    ] ifFalse:[
-                        homeNames := method methodArgAndVarNames.
+                argsOnly ifTrue:[
+                    homeNames := method methodArgNames
+                ] 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:[
+                        homeNames := method methodArgNames.
+                        argsOnly := true.
                     ].
+                ].
 
-                    "/ 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.
+self halt.
+                    numVarsInSource > 0 ifTrue:[
+                        numVarsInContext < numVarsInSource ifTrue:[
+Transcript showCR:'2'.
+                            "/ 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)
 
-                                "/ 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 +202,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 ...
@@ -553,7 +534,7 @@
 
     inspectedContext isNil ifTrue:[^ nil].
 
-    argsOnly := false.
+    "/ argsOnly := false.
     theContext := inspectedContext.
     methodHomeContext := theContext methodHome.
 
@@ -670,10 +651,10 @@
 !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.82 2013-06-14 11:18:15 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.82 2013-06-14 11:18:15 cg Exp $'
 ! !