MiniInspector.st
changeset 903 234a9d6e4492
parent 720 f31e0e5ab6e0
child 1297 073d4d41ba0f
--- a/MiniInspector.st	Thu Jan 25 17:22:29 1996 +0100
+++ b/MiniInspector.st	Thu Jan 25 19:21:48 1996 +0100
@@ -59,21 +59,9 @@
     [done] whileFalse:[
 	valid := false.
 	cmd := self getCommand.
-	(cmd == $0) ifTrue:[
-	    valid := true.
-	    self inspectInstvar:0 of:inspectedObject
-	].
-	(cmd == $1) ifTrue:[
+	(cmd >= $0 and:[cmd <= $9]) ifTrue:[
 	    valid := true.
-	    self inspectInstvar:1 of:inspectedObject
-	].
-	(cmd == $2) ifTrue:[
-	    valid := true.
-	    self inspectInstvar:2 of:inspectedObject
-	].
-	(cmd == $3) ifTrue:[
-	    valid := true.
-	    self inspectInstvar:3 of:inspectedObject
+	    self inspectInstvar:(cmd asciiValue - $0 asciiValue) of:inspectedObject
 	].
 	(cmd == $i) ifTrue:[
 	    valid := true.
@@ -88,7 +76,7 @@
 	    'valid commands:
    (i)nstvars
    (p)rint
-   (1-9) inspect instvar
+   (0-9) inspect instvar
    (q)uit'       errorPrintNewline
 	]
     ].
@@ -118,24 +106,36 @@
 
 inspectInstvar:which of:anObject
     which > (anObject class instSize) ifTrue:[
-	'invalid instvar' printNewline
+	which > (anObject basicSize) ifTrue:[
+	    'invalid instvar' printNewline
+	] ifFalse:[
+	    (anObject basicAt:which) inspect
+	]
     ] ifFalse: [
 	(anObject instVarAt:which) inspect
     ]
 !
 
 printInstVarsOf:anObject
-    |n|
+    |n "{ Class: SmallInteger }" |
+
     n := anObject class instSize.
     'number of instvars: ' print. n printNewline.
     1 to:n do:[:i |
 	'  ' print. i print. ': ' print.
 	(anObject instVarAt:i) printNewline
-    ]
+    ].
+    n := anObject basicSize.
+    'number of indexed instvars: ' print. n printNewline.
+    n > 10 ifTrue:[n := 10].
+    1 to:n do:[:i |
+	' [' print. i print. ']: ' print.
+        (anObject basicAt:i) printNewline
+    ].
 ! !
 
 !MiniInspector class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/MiniInspector.st,v 1.15 1995-12-09 15:04:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/MiniInspector.st,v 1.16 1996-01-25 18:21:48 cg Exp $'
 ! !