MiniInspector.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 23884 1e08361b4c05
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
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
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    19
	instanceVariableNames:'inspectedObject commandArg inputStream level'
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
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    64
    ^ self openOn:anObject input:nil level:1
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    65
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    66
    "Modified: / 12-03-2019 / 22:43:53 / Claus Gittinger"
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    67
!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    68
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    69
openOn:anObject input:inputStreamOrNil
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    70
    ^ self openOn:anObject input:inputStreamOrNil level:1
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    71
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    72
    "Modified: / 12-03-2019 / 22:44:15 / Claus Gittinger"
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    73
!
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    74
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    75
openOn:anObject input:inputStreamOrNil level:level
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    76
    |anInspector|
14938
bb6698374550 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 10323
diff changeset
    77
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    78
    anInspector := (self new) initializeFor:anObject.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    79
    anInspector inputStream:inputStreamOrNil.
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    80
    anInspector level:level.
14938
bb6698374550 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 10323
diff changeset
    81
    anInspector enter.
bb6698374550 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 10323
diff changeset
    82
    ^ anInspector
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    83
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    84
    "Created: / 12-03-2019 / 22:43:39 / Claus Gittinger"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    85
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    86
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    87
!MiniInspector methodsFor:'accessing'!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    88
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    89
inputStream:something
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    90
    inputStream := something.
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    91
!
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    92
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    93
level:anInteger
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    94
    level := anInteger.
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    95
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
    96
    "Created: / 12-03-2019 / 22:44:26 / Claus Gittinger"
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    97
! !
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
    98
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    99
!MiniInspector methodsFor:'private'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   100
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   101
callInspect:anotherObject message:msg
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   102
    msg _errorPrintCR.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   103
    
23884
1e08361b4c05 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23883
diff changeset
   104
    MiniInspector openOn:anotherObject input:inputStream level:(level?1)+1.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   105
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   106
    'Back in previous inspector on: ' _errorPrint.  
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   107
    inspectedObject displayString _errorPrintCR.
23884
1e08361b4c05 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23883
diff changeset
   108
1e08361b4c05 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23883
diff changeset
   109
    "Modified: / 12-03-2019 / 22:45:50 / Claus Gittinger"
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   110
!
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   111
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   112
commandLoop
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   113
    |cmd valid lastValue idx|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   114
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   115
    'MiniInspector on ' _errorPrint.  
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   116
    inspectedObject displayString _errorPrintCR.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   117
    '' _errorPrintCR.
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   118
    '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
   119
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   120
    [true] whileTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   121
        valid := false.
23884
1e08361b4c05 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23883
diff changeset
   122
        cmd := self getCommand:'inspector',(level ? 1) printString,'> '.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   123
        cmd isNil ifTrue:[   "/ EOF -> quit
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   124
            cmd := $q
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   125
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   126
        cmd isNumber ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   127
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   128
            self inspectInstvar:cmd of:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   129
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   130
        (cmd == $i) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   131
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   132
            self printInstVarsOf:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   133
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   134
        (cmd == $p) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   135
            valid := true.
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   136
            inspectedObject displayString _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   137
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   138
        (cmd == $c) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   139
            valid := true.
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   140
            inspectedObject class displayString _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   141
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   142
        (cmd == $C) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   143
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   144
            self callInspect:inspectedObject class message:'inspecting class...'.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   145
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   146
        (cmd == $d) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   147
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   148
            ObjectMemory dumpObject:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   149
        ].
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   150
        (cmd == $D) ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   151
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   152
            ObjectMemory dumpObject:inspectedObject class
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   153
        ].
23882
4ff5dd3eda16 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23880
diff changeset
   154
        ((cmd == $e) or:[ cmd == $E or:[ cmd == $Q ]]) ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   155
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   156
            lastValue := Parser evaluate:commandArg receiver:inspectedObject.
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   157
            (cmd == $e) ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   158
                lastValue _errorPrintCR.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   159
            ].
23882
4ff5dd3eda16 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23880
diff changeset
   160
            (cmd == $Q) ifTrue:[
23651
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   161
                inspectedObject := lastValue.
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   162
                'inspecting ' _errorPrint.
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   163
                inspectedObject displayString _errorPrintCR. '' _errorPrintCR.
20175dbb7642 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 20847
diff changeset
   164
            ].
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   165
        ].
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   166
        (cmd == $$) ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   167
            valid := true.
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   168
            self callInspect:lastValue message:'inspecting last value...'.
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   169
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   170
        (cmd == $*) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   171
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   172
            inspectedObject becomeNil.
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
        ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   175
        (cmd == $I) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   176
            valid := true.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   177
            self interpreterLoopWith:inspectedObject
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   178
        ].
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   179
        (cmd == $N) ifTrue:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   180
            (commandArg withoutSeparators conform:#isDigit) ifTrue:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   181
                (idx := Integer readFrom:commandArg) > 0 ifTrue:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   182
                    (idx <= inspectedObject class instSize) ifFalse:[
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   183
                        'bad instvar index' _errorPrintCR
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   184
                    ] ifTrue:[  
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   185
                        inspectedObject instVarAt:idx put:nil.
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   186
                        valid := true.
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   187
                    ].    
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   188
                ].    
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   189
            ].
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   190
        ].    
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   191
        (cmd == $q) ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   192
            ^ cmd.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   193
        ].
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   194
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   195
        valid ifFalse: [
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   196
            'valid commands:
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   197
 p ...... print inspected object
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   198
 i ...... print instvars
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   199
 d ...... VM-dump inspected object
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   200
 P ...... print inspected object''s class
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   201
 D ...... VM-dump inspected object''s class
5804
33282793d66d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5803
diff changeset
   202
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   203
 I ...... interpreter
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   204
 e expr   evaluate expression & print result ("E" to not print)
23882
4ff5dd3eda16 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23880
diff changeset
   205
 Q expr   evaluate expression & inspect result
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   206
 $        inspect the value of the last evaluated expression
5804
33282793d66d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5803
diff changeset
   207
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   208
 C ...... inspect class
23880
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   209
 <N> .... inspect instvar <N> (N=1..)
f366fd5a51b5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23651
diff changeset
   210
 N <N> .. nil instvar <N> (N=1..) 
5803
a478ecef08c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5802
diff changeset
   211
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   212
 * ...... becomeNil and quit (dangerous)
23883
df08efe904d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23882
diff changeset
   213
 q ...... quit (or back to previous level)
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   214
'           _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   215
        ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   216
    ].
1426
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   217
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   218
    "Modified: / 03-02-2014 / 10:19:46 / cg"
23884
1e08361b4c05 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23883
diff changeset
   219
    "Modified: / 12-03-2019 / 22:46:01 / Claus Gittinger"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   220
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   221
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   222
enter
15904
7b8100b48c7a AbortSignal -> AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents: 14938
diff changeset
   223
    AbortOperationRequest handle:[:ex |
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   224
        '** Abort Signal caught - back in previous debugLevel' _errorPrintCR.
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   225
        ex restart
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   226
    ] do:[
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   227
        Error handle:[:ex |
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   228
            |yesNo|
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   229
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   230
            'Error while executing command: ' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   231
            ex description _errorPrintCR.
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   232
            yesNo := self getCommand:'- (i)gnore / (p)roceed / (d)ebug ? '.
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   233
            yesNo == $d ifTrue:[
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   234
                ex reject
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   235
            ].
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   236
            yesNo == $p ifTrue:[
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   237
                ex proceed
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   238
            ].
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   239
            ex restart
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   240
        ] do:[
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   241
            self commandLoop.
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   242
        ].
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   243
    ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   244
    ^ nil
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   245
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   246
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   247
getCharacter
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   248
    inputStream isNil ifTrue:[
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   249
        "/ globally blocking
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   250
        ^ Character fromUser
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   251
    ].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   252
    ^ inputStream next
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   253
!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   254
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   255
getCommand:prompt
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   256
    |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
   257
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   258
    prompt _errorPrint.
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   259
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   260
    c := cmd := self getCharacter.
16250
c376e523d007 class: MiniInspector
Stefan Vogel <sv@exept.de>
parents: 15926
diff changeset
   261
    c isNil ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   262
        ^ nil.
16250
c376e523d007 class: MiniInspector
Stefan Vogel <sv@exept.de>
parents: 15926
diff changeset
   263
    ].
c376e523d007 class: MiniInspector
Stefan Vogel <sv@exept.de>
parents: 15926
diff changeset
   264
    c isDigit ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   265
        num := 0.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   266
        [
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   267
            num := (num * 10) + c digitValue.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   268
            c := self getCharacter.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   269
        ] doWhile:[c notNil and:[c isDigit]].
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   270
        ^ num "/ numeric
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   271
    ].
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   272
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   273
    c := self getCharacter.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   274
    [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
   275
    arg := ''.
4965
e4f22bc0d3c8 Fix input of nil character.
Stefan Vogel <sv@exept.de>
parents: 2775
diff changeset
   276
    [c notNil and:[c isEndOfLineCharacter]] whileFalse:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   277
        arg := arg copyWith:c.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   278
        c := self getCharacter
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   279
    ].
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   280
    commandArg := arg.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   281
    ^ cmd
15926
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   282
2a89ee50988c class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 15904
diff changeset
   283
    "Modified: / 03-02-2014 / 10:16:49 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   284
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   285
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   286
initializeFor:anObject
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   287
    inspectedObject := anObject.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   288
    ^self
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   289
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   290
16635
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   291
inspect:anObject
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   292
    inspectedObject := anObject.
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   293
!
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   294
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   295
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
   296
    |numInsts idx|
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   297
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   298
    numInsts := anObject class instSize.
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   299
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 4965
diff changeset
   300
    which > numInsts ifTrue:[
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   301
        idx := which - numInsts.
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   302
        idx > anObject basicSize ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   303
            'invalid indexed instvar index: ' _errorPrint. idx _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   304
        ] ifFalse:[
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   305
            self callInspect:(anObject basicAt:idx) message:('Inspecting indexed instVar ',which printString,'...')
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   306
        ]
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   307
    ] ifFalse: [
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   308
        which < 0 ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   309
            'invalid instVar # (must be >= 1)' _errorPrintCR
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   310
        ] ifFalse:[
20735
6dc31fd16564 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20721
diff changeset
   311
            self callInspect:(anObject instVarAt:which) message:('Inspecting instVar ',which printString,'...')
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   312
        ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   313
    ]
1426
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   314
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   315
    "Modified: 20.5.1996 / 10:27:40 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   316
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   317
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   318
interpreterLoopWith:anObject
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   319
    |line done rslt|
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   320
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   321
    'read-eval-print loop; exit with empty line' _errorPrintCR.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   322
    '' _errorPrintCR.
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   323
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   324
    done := false.
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   325
    [done] whileFalse:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   326
        '> ' _errorPrint.
16558
Claus Gittinger <cg@exept.de>
parents: 16250
diff changeset
   327
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   328
        line := Processor activeProcess stdin nextLine.
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   329
        (line size == 0) ifTrue:[
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   330
            done := true
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   331
        ] ifFalse:[
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   332
            rslt := Compiler
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   333
                evaluate:line
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   334
                in:nil
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   335
                receiver:anObject
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   336
                notifying:nil
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   337
                ifFail:[].
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   338
            rslt _errorPrintCR.
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   339
        ]
7092
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   340
    ]
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   341
!
630807cd320f Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 5805
diff changeset
   342
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   343
printInstVarsOf:anObject
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   344
    |n "{ Class: SmallInteger }" names |
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   345
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   346
    n := anObject class instSize.
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   347
    names := anObject class allInstVarNames.
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   348
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   349
    'number of instvars: ' _errorPrint. n _errorPrintCR.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   350
    1 to:n do:[:i |
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   351
        (i printStringLeftPaddedTo:2) _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   352
        ' {' _errorPrint. (names at:i) _errorPrint. '}' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   353
        ': ' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   354
        ((anObject instVarAt:i) displayString contractAtEndTo:160) _errorPrintCR
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   355
    ].
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   356
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   357
    n := anObject basicSize.
5805
007549d68d4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5804
diff changeset
   358
    n > 0 ifTrue:[
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   359
        'number of indexed instvars: ' _errorPrint. n _errorPrintCR.
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   360
        n > 10 ifTrue:[n := 10].
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   361
        1 to:n do:[:i |
20842
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   362
            ' [' _errorPrint. i _errorPrint. ']: ' _errorPrint.
57ae16d01413 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20750
diff changeset
   363
            ((anObject basicAt:i) displayString contractAtEndTo:160) _errorPrintCR
20721
79c02fb533fb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19390
diff changeset
   364
        ]
903
234a9d6e4492 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   365
    ].
1426
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   366
3b565d5d0791 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   367
    "Modified: 20.5.1996 / 10:27:45 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   368
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   369
658
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   370
!MiniInspector class methodsFor:'documentation'!
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   371
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   372
version
19381
ff17cf92e2c3 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 16635
diff changeset
   373
    ^ '$Header$'
19390
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   374
!
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   375
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   376
version_CVS
c9149f3022e1 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19381
diff changeset
   377
    ^ '$Header$'
658
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
   378
! !
16635
ee5ebbb9e049 class: MiniInspector
Claus Gittinger <cg@exept.de>
parents: 16558
diff changeset
   379