MiniInspector.st
author Claus Gittinger <cg@exept.de>
Tue, 12 Mar 2019 22:17:03 +0100
changeset 23880 f366fd5a51b5
parent 23651 20175dbb7642
child 23882 4ff5dd3eda16
permissions -rw-r--r--
#FEATURE by cg class: MiniInspector changed: #commandLoop
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
     1
"{ Encoding: utf8 }"
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
     2
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     3
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     4
 COPYRIGHT (c) 1989 by Claus Gittinger
308
f04744ef7b5d *** empty log message ***
claus
parents: 93
diff changeset
     5
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    13
"
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
    14
"{ Package: 'stx:libbasic' }"
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
    15
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
    16
"{ NameSpace: Smalltalk }"
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
    17
720
f31e0e5ab6e0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
    18
Object subclass:#MiniInspector
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    19
	instanceVariableNames:'inspectedObject commandArg inputStream'
1297
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 903
diff changeset
    20
	classVariableNames:''
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 903
diff changeset
    21
	poolDictionaries:''
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 903
diff changeset
    22
	category:'System-Debugging-Support'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    24
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    25
!MiniInspector class methodsFor:'documentation'!
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    26
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    27
copyright
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    28
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    29
 COPYRIGHT (c) 1989 by Claus Gittinger
308
f04744ef7b5d *** empty log message ***
claus
parents: 93
diff changeset
    30
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    32
 This software is furnished under a license and may be used
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    33
 only in accordance with the terms of that license and with the
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    35
 be provided or otherwise made available to, or used by, any
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    36
 other person.  No title to or ownership of the software is
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    37
 hereby transferred.
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    38
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    39
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    40
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    41
documentation
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    42
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    43
    a primitive (non graphical) inspector for use on systems without
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
    44
    graphics or when the real inspector dies (i.e. the UI is locked).
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
    45
    Sometimes useful as a last chance to fix a broken UI / event handling.
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
    46
    Needs a console.
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
    47
20847
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    48
        MiniInspector openOn: Display
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    49
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    50
    Attention:
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    51
        all printing is done via lowLevel _errorPrint messages,
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    52
        to ensure that output is to stderr, even if a logger is present, 
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    53
        or Stderr has been set to some other stream (Transcript).
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    54
        Also to avoid the logger's interfering and adding imestamp information.
1297
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 903
diff changeset
    55
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 903
diff changeset
    56
    [author:]
20847
da16b44cb640 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20842
diff changeset
    57
        Claus Gittinger
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    58
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    59
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    60
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
!MiniInspector class methodsFor:'instance creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    62
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
openOn:anObject
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    64
    ^ self openOn:anObject input:nil
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    65
!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    66
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    67
openOn:anObject input:inputStreamOrNil
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    68
    |anInspector|
14938
bb6698374550 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 10323
diff changeset
    69
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    70
    anInspector := (self new) initializeFor:anObject.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    71
    anInspector inputStream:inputStreamOrNil.
14938
bb6698374550 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 10323
diff changeset
    72
    anInspector enter.
bb6698374550 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 10323
diff changeset
    73
    ^ anInspector
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    74
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    75
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    76
!MiniInspector methodsFor:'accessing'!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    77
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    78
inputStream:something
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    79
    inputStream := something.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    80
! !
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    81
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    82
!MiniInspector methodsFor:'private'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    83
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
    84
callInspect:anotherObject message:msg
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
    85
    msg _errorPrintCR.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
    86
    
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
    87
    MiniInspector openOn:anotherObject input:inputStream.
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
    88
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
    89
    'Back in previous inspector on: ' _errorPrint.  
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
    90
    inspectedObject displayString _errorPrintCR.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
    91
!
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
    92
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    93
commandLoop
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
    94
    |cmd valid lastValue idx|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    95
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
    96
    'MiniInspector on ' _errorPrint.  
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
    97
    inspectedObject displayString _errorPrintCR.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
    98
    '' _errorPrintCR.
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
    99
    'Type "q" to quit, "?" for help ' _errorPrintCR.  
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   100
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   101
    [true] whileTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   102
        valid := false.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   103
        cmd := self getCommand:'inspector> '.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   104
        cmd isNil ifTrue:[   "/ EOF -> quit
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   105
            cmd := $q
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   106
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   107
        cmd isNumber ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   108
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   109
            self inspectInstvar:cmd of:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   110
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   111
        (cmd == $i) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   112
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   113
            self printInstVarsOf:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   114
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   115
        (cmd == $p) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   116
            valid := true.
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   117
            inspectedObject displayString _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   118
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   119
        (cmd == $c) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   120
            valid := true.
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   121
            inspectedObject class displayString _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   122
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   123
        (cmd == $C) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   124
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   125
            self callInspect:inspectedObject class message:'inspecting class...'.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   126
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   127
        (cmd == $d) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   128
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   129
            ObjectMemory dumpObject:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   130
        ].
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   131
        (cmd == $D) ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   132
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   133
            ObjectMemory dumpObject:inspectedObject class
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   134
        ].
23651
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   135
        ((cmd == $e) or:[ cmd == $E or:[ cmd == $? ]]) ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   136
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   137
            lastValue := Parser evaluate:commandArg receiver:inspectedObject.
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   138
            (cmd == $e) ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   139
                lastValue _errorPrintCR.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   140
            ].
23651
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   141
            (cmd == $?) ifTrue:[
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   142
                inspectedObject := lastValue.
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   143
                'inspecting ' _errorPrint.
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   144
                inspectedObject displayString _errorPrintCR. '' _errorPrintCR.
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   145
            ].
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   146
        ].
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   147
        (cmd == $$) ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   148
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   149
            self callInspect:lastValue message:'inspecting last value...'.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   150
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   151
        (cmd == $*) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   152
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   153
            inspectedObject becomeNil.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   154
            ^ cmd.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   155
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   156
        (cmd == $I) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   157
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   158
            self interpreterLoopWith:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   159
        ].
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   160
        (cmd == $N) ifTrue:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   161
            (commandArg withoutSeparators conform:#isDigit) ifTrue:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   162
                (idx := Integer readFrom:commandArg) > 0 ifTrue:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   163
                    (idx <= inspectedObject class instSize) ifFalse:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   164
                        'bad instvar index' _errorPrintCR
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   165
                    ] ifTrue:[  
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   166
                        inspectedObject instVarAt:idx put:nil.
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   167
                        valid := true.
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   168
                    ].    
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   169
                ].    
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   170
            ].
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   171
        ].    
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   172
        (cmd == $q) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   173
            ^ cmd.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   174
        ].
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   175
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   176
        valid ifFalse: [
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   177
            'valid commands:
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   178
 p ...... print inspected object
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   179
 i ...... print instvars
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   180
 d ...... VM-dump inspected object
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   181
 P ...... print inspected object''s class
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   182
 D ...... VM-dump inspected object''s class
5804
33282793d66d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5803
diff changeset
   183
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   184
 I ...... interpreter
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   185
 e expr   evaluate expression & print result ("E" to not print)
23651
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   186
 ? expr   evaluate expression & inspect result
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   187
 $        inspect the value of the last evaluated expression
5804
33282793d66d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5803
diff changeset
   188
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   189
 C ...... inspect class
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   190
 <N> .... inspect instvar <N> (N=1..)
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   191
 N <N> .. nil instvar <N> (N=1..) 
5803
a478ecef08c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5802
diff changeset
   192
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   193
 * ...... becomeNil and quit (dangerous)
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   194
 q ...... quit
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   195
'           _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   196
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   197
    ].
1426
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   198
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   199
    "Modified: / 03-02-2014 / 10:19:46 / cg"
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   200
    "Modified: / 12-03-2019 / 22:16:45 / Claus Gittinger"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   201
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   202
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   203
enter
15904
7b8100b48c7a AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 14938
diff changeset
   204
    AbortOperationRequest handle:[:ex |
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   205
        '** Abort Signal caught - back in previous debugLevel' _errorPrintCR.
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   206
        ex restart
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   207
    ] do:[
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   208
        Error handle:[:ex |
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   209
            |yesNo|
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   210
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   211
            'Error while executing command: ' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   212
            ex description _errorPrintCR.
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   213
            yesNo := self getCommand:'- (i)gnore / (p)roceed / (d)ebug ? '.
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   214
            yesNo == $d ifTrue:[
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   215
                ex reject
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   216
            ].
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   217
            yesNo == $p ifTrue:[
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   218
                ex proceed
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   219
            ].
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   220
            ex restart
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   221
        ] do:[
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   222
            self commandLoop.
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   223
        ].
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   224
    ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   225
    ^ nil
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   226
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   227
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   228
getCharacter
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   229
    inputStream isNil ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   230
        "/ globally blocking
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   231
        ^ Character fromUser
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   232
    ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   233
    ^ inputStream next
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   234
!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   235
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   236
getCommand:prompt
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   237
    |cmd c num arg|
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   238
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   239
    prompt _errorPrint.
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   240
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   241
    c := cmd := self getCharacter.
16250
c376e523d007 class: MiniInspector
Stefan Vogel <sv@exept.de>
parents: 15926
diff changeset
   242
    c isNil ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   243
        ^ nil.
16250
c376e523d007 class: MiniInspector
Stefan Vogel <sv@exept.de>
parents: 15926
diff changeset
   244
    ].
c376e523d007 class: MiniInspector
Stefan Vogel <sv@exept.de>
parents: 15926
diff changeset
   245
    c isDigit ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   246
        num := 0.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   247
        [
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   248
            num := (num * 10) + c digitValue.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   249
            c := self getCharacter.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   250
        ] doWhile:[c notNil and:[c isDigit]].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   251
        ^ num "/ numeric
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   252
    ].
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   253
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   254
    c := self getCharacter.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   255
    [c notNil and:[c isEndOfLineCharacter not and:[c isSeparator ]]] whileTrue:[ c := self getCharacter ].
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   256
    arg := ''.
4965
e4f22bc0d3c8 Fix input of nil character.
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
   257
    [c notNil and:[c isEndOfLineCharacter]] whileFalse:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   258
        arg := arg copyWith:c.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   259
        c := self getCharacter
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   260
    ].
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   261
    commandArg := arg.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   262
    ^ cmd
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   263
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   264
    "Modified: / 03-02-2014 / 10:16:49 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   265
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   266
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   267
initializeFor:anObject
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   268
    inspectedObject := anObject.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   269
    ^self
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   270
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   271
16635
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   272
inspect:anObject
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   273
    inspectedObject := anObject.
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   274
!
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   275
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   276
inspectInstvar:which of:anObject
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   277
    |numInsts idx|
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   278
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   279
    numInsts := anObject class instSize.
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   280
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   281
    which > numInsts ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   282
        idx := which - numInsts.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   283
        idx > anObject basicSize ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   284
            'invalid indexed instvar index: ' _errorPrint. idx _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   285
        ] ifFalse:[
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   286
            self callInspect:(anObject basicAt:idx) message:('Inspecting indexed instVar ',which printString,'...')
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   287
        ]
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   288
    ] ifFalse: [
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   289
        which < 0 ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   290
            'invalid instVar # (must be >= 1)' _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   291
        ] ifFalse:[
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   292
            self callInspect:(anObject instVarAt:which) message:('Inspecting instVar ',which printString,'...')
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   293
        ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   294
    ]
1426
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   295
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   296
    "Modified: 20.5.1996 / 10:27:40 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   297
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   298
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   299
interpreterLoopWith:anObject
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   300
    |line done rslt|
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   301
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   302
    'read-eval-print loop; exit with empty line' _errorPrintCR.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   303
    '' _errorPrintCR.
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   304
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   305
    done := false.
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   306
    [done] whileFalse:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   307
        '> ' _errorPrint.
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   308
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   309
        line := Processor activeProcess stdin nextLine.
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   310
        (line size == 0) ifTrue:[
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   311
            done := true
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   312
        ] ifFalse:[
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   313
            rslt := Compiler
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   314
                evaluate:line
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   315
                in:nil
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   316
                receiver:anObject
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   317
                notifying:nil
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   318
                ifFail:[].
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   319
            rslt _errorPrintCR.
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   320
        ]
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   321
    ]
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   322
!
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   323
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   324
printInstVarsOf:anObject
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   325
    |n "{ Class: SmallInteger }" names |
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   326
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   327
    n := anObject class instSize.
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   328
    names := anObject class allInstVarNames.
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   329
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   330
    'number of instvars: ' _errorPrint. n _errorPrintCR.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   331
    1 to:n do:[:i |
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   332
        (i printStringLeftPaddedTo:2) _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   333
        ' {' _errorPrint. (names at:i) _errorPrint. '}' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   334
        ': ' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   335
        ((anObject instVarAt:i) displayString contractAtEndTo:160) _errorPrintCR
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   336
    ].
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   337
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   338
    n := anObject basicSize.
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   339
    n > 0 ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   340
        'number of indexed instvars: ' _errorPrint. n _errorPrintCR.
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   341
        n > 10 ifTrue:[n := 10].
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   342
        1 to:n do:[:i |
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   343
            ' [' _errorPrint. i _errorPrint. ']: ' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   344
            ((anObject basicAt:i) displayString contractAtEndTo:160) _errorPrintCR
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   345
        ]
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   346
    ].
1426
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   347
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   348
    "Modified: 20.5.1996 / 10:27:45 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   349
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   350
658
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   351
!MiniInspector class methodsFor:'documentation'!
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   352
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   353
version
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   354
    ^ '$Header$'
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   355
!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   356
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   357
version_CVS
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   358
    ^ '$Header$'
658
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   359
! !
16635
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   360