author | Claus Gittinger <cg@exept.de> |
Fri, 26 Jan 2001 13:56:29 +0100 | |
changeset 2957 | 1bf7796f502b |
parent 2717 | dc997032a34e |
child 3105 | 9d80b49560ca |
permissions | -rw-r--r-- |
34 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 3 |
All Rights Reserved |
34 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2717 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
34 | 15 |
InspectorView subclass:#ContextInspectorView |
1395 | 16 |
instanceVariableNames:'inspectedContext names showingTemporaries argsOnly contextSize' |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
17 |
classVariableNames:'' |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
18 |
poolDictionaries:'' |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
19 |
category:'Interface-Inspector' |
34 | 20 |
! |
21 |
||
785 | 22 |
!ContextInspectorView class methodsFor:'documentation'! |
34 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 27 |
All Rights Reserved |
34 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
471 | 40 |
a modified Inspector for Contexts (used in the Debugger) |
41 |
TODO: |
|
42 |
when expressions are evaluated in myself, the inst-var |
|
43 |
names are not known by the expression evaluator. |
|
44 |
This has to be fixed |
|
45 |
(actual work is to be done in the Parser to allow passing of a context ...) |
|
510 | 46 |
|
47 |
[author:] |
|
48 |
Claus Gittinger |
|
49 |
||
50 |
[see also:] |
|
51 |
Context DebugView |
|
34 | 52 |
" |
53 |
! ! |
|
54 |
||
55 |
!ContextInspectorView methodsFor:'accessing'! |
|
56 |
||
868 | 57 |
inspect:aContext |
34 | 58 |
"set the context to be inspected" |
59 |
||
107 | 60 |
|homeContext method homeNames rec sel implementorClass |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
61 |
argNames varNames tmpNames m argsOnly blockNode vars |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
62 |
numVarsInSource numVarsInContext isDoIt |
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
63 |
numArgs numVars n tempNames realTempNames src |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
64 |
oldSelection oldSelectedName| |
34 | 65 |
|
868 | 66 |
(aContext == inspectedContext) ifTrue:[ |
1395 | 67 |
"/ care for contexts which change size |
68 |
"/ (after the locals & stack-setup) |
|
69 |
contextSize == inspectedContext size ifTrue:[ |
|
70 |
listView selection notNil ifTrue:[ |
|
71 |
self showSelection:(listView selection). |
|
72 |
]. |
|
73 |
^ self |
|
74 |
] |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
75 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
76 |
|
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
77 |
hasMore := argsOnly := false. |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
1769
diff
changeset
|
78 |
inspectedObject := object := nil. |
868 | 79 |
inspectedContext := aContext. |
1395 | 80 |
contextSize := inspectedContext size. |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
1769
diff
changeset
|
81 |
oldSelection := selectionIndex. |
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
82 |
oldSelection notNil ifTrue:[oldSelectedName := listView at:oldSelection]. |
49 | 83 |
|
868 | 84 |
aContext isNil ifTrue:[ |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
85 |
names := nil. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
86 |
listView list:nil. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
87 |
^ self |
34 | 88 |
]. |
89 |
||
56 | 90 |
"/ realized ifFalse:[^ self]. |
91 |
||
868 | 92 |
homeContext := aContext methodHome. |
51 | 93 |
|
94 |
homeContext isNil ifTrue:[ |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
95 |
"its a cheap blocks context" |
868 | 96 |
rec := aContext receiver. |
97 |
sel := aContext selector. |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
98 |
homeNames := OrderedCollection new. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
99 |
isDoIt := false. |
51 | 100 |
] ifFalse:[ |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
101 |
rec := homeContext receiver. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
102 |
sel := homeContext selector. |
34 | 103 |
|
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
104 |
"/ #doIt needs special handling below |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
105 |
isDoIt := (sel == #doIt) or:[sel == #doIt:]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
106 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
107 |
method := homeContext method. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
108 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
109 |
"/ implementorClass := homeContext methodClass. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
110 |
"/ implementorClass notNil ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
111 |
"/ method := implementorClass compiledMethodAt:sel. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
112 |
"/ ] ifFalse:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
113 |
"/ "/ mhm - an unbound method; |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
114 |
"/ "/ see if it was invoked by a direct call |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
115 |
"/ "/ consider this a kludge |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
116 |
"/ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
117 |
"/ homeContext sender notNil ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
118 |
"/ (homeContext sender selector startsWith:'valueWithReceiver:') ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
119 |
"/ method := homeContext sender receiver |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
120 |
"/ ] |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
121 |
"/ ] |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
122 |
"/ ]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
123 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
124 |
(method notNil |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
125 |
and:[method isWrapped]) ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
126 |
" |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
127 |
in a wrapped context, locals are something different |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
128 |
" |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
129 |
"/ argsOnly := true. |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
130 |
|
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
131 |
m := method originalMethod. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
132 |
m notNil ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
133 |
method := m. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
134 |
] ifFalse:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
135 |
argsOnly := true. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
136 |
]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
137 |
]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
138 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
139 |
method notNil ifTrue:[ |
1395 | 140 |
"/ method source notNil ifTrue:[ |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
141 |
|
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
142 |
argsOnly ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
143 |
homeNames := method methodArgNames |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
144 |
] ifFalse:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
145 |
homeNames := method methodArgAndVarNames. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
146 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
147 |
"/ did it already allocate its locals ? |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
148 |
homeNames size > (homeContext numArgs + homeContext numVars) |
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
149 |
ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
150 |
homeNames := method methodArgNames. |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
151 |
argsOnly := true. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
152 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
153 |
]. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
154 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
155 |
"/ there is one case, where the above is by purpose: |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
156 |
"/ the #doIt - method, which has been given an invalid |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
157 |
"/ source. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
158 |
"/ care for this here. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
159 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
160 |
isDoIt ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
161 |
homeNames := #(). |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
162 |
] ifFalse:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
163 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
164 |
"/ check |
785 | 165 |
|
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
166 |
numVarsInContext := homeContext argsAndVars size. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
167 |
numVarsInSource := homeNames size. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
168 |
|
977 | 169 |
numVarsInSource > 0 ifTrue:[ |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
170 |
numVarsInContext < numVarsInSource ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
171 |
|
977 | 172 |
"/ the methods source does not correctly reflect |
173 |
"/ the number of args&vars in the context. |
|
174 |
"/ either outDated, or somehow strange. |
|
175 |
"/ (happens with wrapped methods, which are not |
|
176 |
"/ what they look) |
|
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
177 |
|
977 | 178 |
numVarsInSource > numVarsInContext ifTrue:[ |
179 |
homeNames := homeNames copyTo:numVarsInContext. |
|
976
95a817dc94a2
fixed arg-name display of wrapped methods
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
180 |
] ifFalse:[ |
977 | 181 |
numVarsInContext >= homeContext numArgs ifTrue:[ |
182 |
homeNames := homeNames copyTo:homeContext numArgs |
|
183 |
] ifFalse:[ |
|
184 |
homeNames := nil |
|
185 |
] |
|
186 |
] |
|
785 | 187 |
] |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
188 |
] |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
189 |
] |
1395 | 190 |
"/ ] |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
191 |
]. |
73 | 192 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
193 |
" |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
194 |
create dummy names for method vars (if there is no source available) |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
195 |
" |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
196 |
homeNames isNil ifTrue:[ |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
197 |
homeNames := OrderedCollection new. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
198 |
1 to:homeContext numArgs do:[:index | |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
199 |
homeNames add:('mArg' , index printString) |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
200 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
201 |
argsOnly ifFalse:[ |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
202 |
1 to:homeContext numVars do:[:index | |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
203 |
homeNames add:('mVar' , index printString) |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
204 |
]. |
1395 | 205 |
"/ showingTemporaries ifTrue:[ |
206 |
"/ 1 to:homeContext numTemps do:[:index | |
|
207 |
"/ homeNames add:('mTmp' , index printString) |
|
208 |
"/ ] |
|
209 |
"/ ] |
|
210 |
] |
|
211 |
]. |
|
212 |
showingTemporaries ifTrue:[ |
|
213 |
1 to:homeContext numTemps do:[:index | |
|
214 |
homeNames add:('mTmp' , index printString) |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
215 |
] |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
216 |
]. |
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
217 |
|
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
218 |
n := homeNames size. |
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
219 |
n < (homeContext numVars + homeContext numArgs) ifTrue:[ |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
220 |
"/ its a context which includes locals from |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
221 |
"/ inlined sub-blocks. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
222 |
"/ First, generate synthetic varNames ... |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
223 |
|
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
224 |
homeNames := homeNames asOrderedCollection. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
225 |
tempNames := OrderedCollection new. |
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
226 |
n to:(homeContext numVars + homeContext numArgs - 1) do:[:inlinedTempIdx | |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
227 |
tempNames add:('*t' , (inlinedTempIdx - n + 1) printString) |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
228 |
]. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
229 |
|
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
230 |
"/ now, see if we can find out more |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
231 |
"/ (failes, if source is not available) |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
232 |
|
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
233 |
method notNil ifTrue:[ |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
234 |
(isDoIt and:[tempNames size > 0]) ifTrue:[ |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
235 |
"/ special for #doIt |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
236 |
"/ my source is found in the method. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
237 |
blockNode := Compiler |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
238 |
blockAtLine:(aContext lineNumber) |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
239 |
in:nil |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
240 |
orSource:('[' , method source , '\]') withCRs |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
241 |
numArgs:numArgs |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
242 |
numVars:numVars. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
243 |
] ifFalse:[ |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
244 |
blockNode := Compiler |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
245 |
blockAtLine:(homeContext lineNumber) |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
246 |
in:method |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
247 |
orSource:nil |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
248 |
numArgs:numArgs |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
249 |
numVars:numVars. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
250 |
]. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
251 |
|
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
252 |
realTempNames := OrderedCollection new. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
253 |
[blockNode notNil] whileTrue:[ |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
254 |
blockNode variables notNil ifTrue:[ |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
255 |
realTempNames := (blockNode variables collect:[:aVar | aVar name]) , realTempNames. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
256 |
]. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
257 |
blockNode arguments notNil ifTrue:[ |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
258 |
realTempNames := (blockNode arguments collect:[:aVar | aVar name]) , realTempNames. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
259 |
]. |
1523
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
260 |
"/ |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
261 |
"/ hidden temps used for loop. |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
262 |
"/ |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
263 |
blockNode invokationSelector == #timesRepeat ifTrue:[ |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
264 |
realTempNames addFirst:'*loopStop*' |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
265 |
] ifFalse:[ |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
266 |
blockNode invokationSelector == #to:do: ifTrue:[ |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
267 |
realTempNames addFirst:'*loopStop*' |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
268 |
] |
fb99bad7e005
care for hidden tempVars in inlined loops
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
269 |
]. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
270 |
blockNode := blockNode home. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
271 |
]. |
1377 | 272 |
tempNames |
273 |
replaceFrom:1 to:(tempNames size min:realTempNames size) |
|
274 |
with:realTempNames. |
|
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
275 |
]. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
276 |
|
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
277 |
homeNames := homeNames asOrderedCollection. |
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
278 |
homeNames addAll:tempNames. |
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
279 |
] |
34 | 280 |
]. |
51 | 281 |
|
34 | 282 |
" |
283 |
stupid: should find the block via the contexts |
|
284 |
method-home and put real names in here |
|
285 |
" |
|
868 | 286 |
aContext isBlockContext ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
287 |
numArgs := aContext numArgs. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
288 |
numVars := aContext numVars. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
289 |
|
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
290 |
(numArgs > 0 or:[numVars > 0]) ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
291 |
|
948 | 292 |
method notNil ifTrue:[ |
293 |
isDoIt ifTrue:[ |
|
294 |
"/ special for #doIt |
|
295 |
"/ my source is found in the method. |
|
1401 | 296 |
m := nil. |
297 |
src := ('[' , method source , '\]') withCRs |
|
948 | 298 |
] ifFalse:[ |
1401 | 299 |
m := method. |
300 |
src := nil. |
|
301 |
]. |
|
302 |
blockNode := Compiler |
|
303 |
blockAtLine:(aContext lineNumber) |
|
304 |
in:m |
|
305 |
orSource:src |
|
306 |
numArgs:numArgs |
|
307 |
numVars:numVars. |
|
308 |
blockNode notNil ifTrue:[ |
|
309 |
numArgs > 0 ifTrue:[ |
|
310 |
vars := blockNode arguments. |
|
311 |
vars size > 0 ifTrue:[ |
|
312 |
argNames := vars collect:[:var | var name] |
|
313 |
] |
|
314 |
]. |
|
315 |
numVars > 0 ifTrue:[ |
|
316 |
vars := blockNode variables. |
|
317 |
vars size > 0 ifTrue:[ |
|
318 |
varNames := vars collect:[:var | var name]. |
|
319 |
] |
|
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
320 |
] |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
321 |
]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
322 |
]. |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
323 |
]. |
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
324 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
325 |
names := OrderedCollection new. |
51 | 326 |
|
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
327 |
argNames isNil ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
328 |
argNames := (1 to:numArgs) collect:[:i | 'arg' , i printString]. |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
329 |
]. |
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
330 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
331 |
names addAll:argNames. |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
332 |
varNames isNil ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
333 |
varNames := (1 to:numVars) collect:[:i | 'var' , i printString]. |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
334 |
] ifFalse:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
335 |
varNames size ~~ numVars ifTrue:[ |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
336 |
varNames := varNames asOrderedCollection. |
868 | 337 |
varNames size+1 to:aContext numVars do:[:i | |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
338 |
varNames add:('var' , i printString) |
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
339 |
] |
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
340 |
] |
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
341 |
]. |
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
342 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
343 |
names addAll:varNames. |
51 | 344 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
345 |
showingTemporaries ifTrue:[ |
868 | 346 |
tmpNames := (1 to:(aContext numTemps)) collect:[:i | 'tmp' , i printString]. |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
347 |
names addAll:tmpNames. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
348 |
]. |
51 | 349 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
350 |
names addAll:homeNames. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
351 |
|
34 | 352 |
] ifFalse:[ |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
353 |
names := homeNames. |
34 | 354 |
]. |
73 | 355 |
|
356 |
listView list:names. |
|
34 | 357 |
|
358 |
workspace contents:nil. |
|
868 | 359 |
self setDoitActionIn:workspace for:aContext. |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
360 |
|
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
361 |
oldSelectedName notNil ifTrue:[ |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
362 |
(names includes:oldSelectedName) ifTrue:[ |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
363 |
listView selectElement:oldSelectedName. |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
364 |
self showSelection:(listView list indexOf:oldSelectedName). |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
365 |
] |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
366 |
]. |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
367 |
|
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
368 |
"Modified: / 30.7.1998 / 12:51:44 / cg" |
34 | 369 |
! |
370 |
||
371 |
release |
|
372 |
"release inspected object" |
|
373 |
||
374 |
inspectedContext := nil. |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
375 |
names := nil. |
34 | 376 |
super release |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
377 |
|
297
3d34ce6e2b22
oops - leftover printMessage removed
Claus Gittinger <cg@exept.de>
parents:
296
diff
changeset
|
378 |
"Modified: 14.12.1995 / 21:49:43 / cg" |
34 | 379 |
! ! |
380 |
||
73 | 381 |
!ContextInspectorView methodsFor:'initialization'! |
51 | 382 |
|
73 | 383 |
fieldMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
384 |
"return a popUpMenu for the left (fields) pane" |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
385 |
|
1361 | 386 |
<resource: #programMenu > |
387 |
||
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
388 |
|items| |
73 | 389 |
|
390 |
showingTemporaries ifFalse:[ |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
391 |
items := #( |
1664 | 392 |
('inspect' #doInspect) |
393 |
('basicInspect' #doBasicInspect) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
394 |
('-') |
2957 | 395 |
('browse' #browse) |
396 |
('-') |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
397 |
('show temporaries' #showTemporaries) |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
398 |
) |
73 | 399 |
] ifTrue:[ |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
400 |
items := #( |
1664 | 401 |
('inspect' #doInspect) |
402 |
('basicInspect' #doBasicInspect) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
403 |
('-') |
2957 | 404 |
('browse' #browse) |
405 |
('-') |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
406 |
('hide temporaries' #hideTemporaries) |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
407 |
) |
73 | 408 |
]. |
409 |
||
1634
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
410 |
showHex ifTrue:[ |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
411 |
items := items , #( |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
412 |
('-') |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
413 |
('decimal integers' #toggleHex ) |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
414 |
) |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
415 |
] ifFalse:[ |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
416 |
items := items , #( |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
417 |
('-') |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
418 |
('hex integers' #toggleHex ) |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
419 |
) |
216a4254e634
added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents:
1596
diff
changeset
|
420 |
]. |
73 | 421 |
^ PopUpMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
422 |
itemList:items |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
423 |
resources:resources |
1361 | 424 |
|
1664 | 425 |
"Modified: / 21.5.1998 / 13:20:18 / cg" |
200 | 426 |
! |
427 |
||
428 |
initialize |
|
429 |
super initialize. |
|
430 |
showingTemporaries := false. |
|
431 |
||
73 | 432 |
! ! |
200 | 433 |
|
434 |
!ContextInspectorView methodsFor:'private'! |
|
435 |
||
647 | 436 |
defaultLabel |
437 |
^ 'locals' |
|
438 |
||
439 |
" |
|
440 |
ContextInspectorView openOn:thisContext sender |
|
441 |
" |
|
442 |
||
443 |
"Modified: 28.6.1996 / 16:07:49 / cg" |
|
444 |
! |
|
445 |
||
200 | 446 |
fieldList |
447 |
^ names |
|
448 |
! |
|
449 |
||
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
450 |
hasSelfEntry |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
451 |
^ false |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
452 |
|
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
453 |
"Created: 14.12.1995 / 19:29:47 / cg" |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
454 |
! |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
455 |
|
200 | 456 |
setDoitActionIn:aWorkspace for:aContext |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
457 |
aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
458 |
doItAction:[:theCode | |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
459 |
Compiler |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
460 |
evaluate:theCode |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
461 |
in:aContext |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
462 |
receiver:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
463 |
notifying:aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
464 |
logged:true |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
465 |
ifFail:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
466 |
] |
200 | 467 |
! |
468 |
||
469 |
valueAtLine:lineNr |
|
470 |
"helper - return the value of the selected entry" |
|
471 |
||
868 | 472 |
|homeContext theContext values| |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
473 |
|
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
474 |
inspectedContext isNil ifTrue:[^ nil]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
475 |
|
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
476 |
argsOnly := false. |
868 | 477 |
theContext := inspectedContext. |
478 |
homeContext := theContext methodHome. |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
479 |
|
868 | 480 |
theContext isBlockContext ifTrue:[ |
481 |
values := Array withAll:(theContext argsAndVars). |
|
482 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
|
483 |
values := values , theContext temporaries |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
484 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
485 |
homeContext notNil ifTrue:[ |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
486 |
values := values , homeContext args. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
487 |
argsOnly ifFalse:[ |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
488 |
values := values , homeContext vars. |
800
3abcfccedc0c
finally: show block-arg and var-names.
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
489 |
(showingTemporaries and:[homeContext numTemps ~~ 0])ifTrue:[ |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
490 |
values := values , homeContext temporaries |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
491 |
] |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
492 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
493 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
494 |
] ifFalse:[ |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
495 |
argsOnly ifTrue:[ |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
496 |
values := homeContext args |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
497 |
] ifFalse:[ |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
498 |
values := homeContext argsAndVars |
1395 | 499 |
]. |
500 |
(showingTemporaries and:[homeContext numTemps ~~ 0])ifTrue:[ |
|
501 |
values := values , homeContext temporaries |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
502 |
] |
1395 | 503 |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
504 |
]. |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
505 |
|
200 | 506 |
^ values at:lineNr. |
507 |
||
1395 | 508 |
"Modified: / 13.1.1998 / 15:55:16 / cg" |
200 | 509 |
! ! |
510 |
||
511 |
!ContextInspectorView methodsFor:'user actions'! |
|
512 |
||
513 |
doAccept:theText |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
514 |
"text in the right pane was accepted - evaluate the contents and |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
515 |
assign to the selected field" |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
516 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
517 |
|newValue| |
200 | 518 |
|
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
1769
diff
changeset
|
519 |
selectionIndex notNil ifTrue:[ |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
520 |
newValue := inspectedObject class evaluatorClass |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
521 |
evaluate:theText |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
522 |
receiver:inspectedObject |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
523 |
notifying:workspace. |
200 | 524 |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
525 |
"yes, you can do that with a context" |
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
526 |
inspectedContext at:selectionIndex put:newValue. |
200 | 527 |
]. |
528 |
! |
|
529 |
||
530 |
hideTemporaries |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
531 |
"do not show contexts temporaries" |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
532 |
|
200 | 533 |
showingTemporaries := false. |
534 |
self inspect:inspectedContext |
|
535 |
||
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
536 |
"Modified: 14.12.1995 / 19:24:44 / cg" |
200 | 537 |
! |
538 |
||
539 |
showTemporaries |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
540 |
"show contexts temporaries" |
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
541 |
|
200 | 542 |
showingTemporaries := true. |
543 |
self inspect:inspectedContext |
|
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
544 |
|
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
545 |
"Modified: 14.12.1995 / 19:24:49 / cg" |
200 | 546 |
! ! |
547 |
||
785 | 548 |
!ContextInspectorView class methodsFor:'documentation'! |
200 | 549 |
|
550 |
version |
|
2957 | 551 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.49 2001-01-26 12:56:29 cg Exp $' |
200 | 552 |
! ! |