ContextInspectorView.st
changeset 800 3abcfccedc0c
parent 785 16809b8d468c
child 840 ffc3caf94d23
--- a/ContextInspectorView.st	Wed Oct 23 02:20:50 1996 +0200
+++ b/ContextInspectorView.st	Wed Oct 23 17:34:01 1996 +0200
@@ -56,7 +56,7 @@
     "set the context to be inspected"
 
     |homeContext method homeNames rec sel implementorClass 
-     argNames varNames tmpNames m argsOnly|
+     argNames varNames tmpNames m argsOnly blockNode|
 
     (con == inspectedContext) ifTrue:[
         listView selection notNil ifTrue:[
@@ -113,7 +113,7 @@
                         homeNames := method methodArgAndVarNames.
 
                         "/ did it already allocate its locals ?
-                        homeNames size - method methodArgNames size == homeContext nvars
+                        homeNames size - method methodArgNames size == homeContext numVars
                         ifFalse:[
                             homeNames := method methodArgNames.
                             argsOnly := true
@@ -132,11 +132,11 @@
                 homeNames add:('mArg' , index printString)
             ].
             argsOnly ifFalse:[
-                1 to:homeContext nvars do:[:index |
+                1 to:homeContext numVars do:[:index |
                     homeNames add:('mVar' , index printString)
                 ].
                 showingTemporaries ifTrue:[
-                    1 to:homeContext ntemp do:[:index |
+                    1 to:homeContext numTemps do:[:index |
                         homeNames add:('mTmp' , index printString)
                     ]
                 ]
@@ -149,15 +149,47 @@
      method-home and put real names in here
     "
     con isBlockContext ifTrue:[
+        method notNil ifTrue:[
+            (con numArgs > 0
+             or:[con numVars > 0]) ifTrue:[
+                blockNode := Compiler 
+                                blockAtLine:(con lineNumber)
+                                in:method
+                                numArgs:con numArgs
+                                numVars:con numVars.
+                blockNode notNil ifTrue:[
+                    con numArgs > 0 ifTrue:[argNames := blockNode arguments collect:[:var | var name]].
+                    con numVars > 0 ifTrue:[
+                        blockNode variables size > 0 ifTrue:[
+                            varNames := blockNode variables collect:[:var | var name].
+                        ]
+                    ]
+                ]
+            ]
+        ].
+
         names := OrderedCollection new.
 
-        argNames := (1 to:(con numArgs)) collect:[:i | 'arg' , i printString].
+        argNames isNil ifTrue:[
+            argNames := (1 to:(con numArgs)) collect:[:i | 'arg' , i printString].
+        ].
+
         names addAll:argNames.
-        varNames := (1 to:(con nvars)) collect:[:i | 'var' , i printString].
+        varNames isNil ifTrue:[
+            varNames := (1 to:(con numVars)) collect:[:i | 'var' , i printString].
+        ] ifFalse:[
+            varNames size ~~ con numVars ifTrue:[
+                varNames := varNames asOrderedCollection.
+                varNames size+1 to:con numVars do:[:i |
+                    varNames add:('var' , i printString)
+                ]
+            ]
+        ].
+
         names addAll:varNames.
 
         showingTemporaries ifTrue:[
-            tmpNames := (1 to:(con ntemp)) collect:[:i | 'tmp' , i printString].
+            tmpNames := (1 to:(con numTemps)) collect:[:i | 'tmp' , i printString].
             names addAll:tmpNames.
         ].
 
@@ -171,7 +203,7 @@
     workspace contents:nil.
     self setDoitActionIn:workspace for:con.
 
-    "Modified: 21.10.1996 / 18:15:44 / cg"
+    "Modified: 23.10.1996 / 16:20:59 / cg"
 !
 
 release
@@ -274,14 +306,14 @@
 
     con isBlockContext ifTrue:[
         values := Array withAll:(con argsAndVars).
-        (showingTemporaries and:[con ntemp ~~ 0]) ifTrue:[
+        (showingTemporaries and:[con numTemps ~~ 0]) ifTrue:[
             values := values , con temporaries
         ].
         homeContext notNil ifTrue:[
             values := values , homeContext args.
             argsOnly ifFalse:[
                 values := values , homeContext vars.
-                (showingTemporaries and:[homeContext ntemp ~~ 0])ifTrue:[
+                (showingTemporaries and:[homeContext numTemps ~~ 0])ifTrue:[
                     values := values , homeContext temporaries
                 ]
             ].
@@ -296,7 +328,7 @@
 
     ^ values at:lineNr.
 
-    "Modified: 28.6.1996 / 15:23:15 / cg"
+    "Modified: 23.10.1996 / 16:21:05 / cg"
 ! !
 
 !ContextInspectorView methodsFor:'user actions'!
@@ -335,5 +367,5 @@
 !ContextInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.26 1996-10-21 17:15:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.27 1996-10-23 15:34:01 cg Exp $'
 ! !