author | Claus Gittinger <cg@exept.de> |
Thu, 20 Jun 2013 13:24:29 +0200 | |
changeset 12935 | 2149c6971ded |
parent 12932 | 63707ac51242 |
child 13173 | e9da2324940d |
child 13451 | 3ae3b9b9e45e |
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 |
" |
|
2717 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
34 | 14 |
InspectorView subclass:#ContextInspectorView |
1395 | 15 |
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
|
16 |
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
|
17 |
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
|
18 |
category:'Interface-Inspector' |
34 | 19 |
! |
20 |
||
785 | 21 |
!ContextInspectorView class methodsFor:'documentation'! |
34 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 26 |
All Rights Reserved |
34 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
471 | 39 |
a modified Inspector for Contexts (used in the Debugger) |
40 |
TODO: |
|
41 |
when expressions are evaluated in myself, the inst-var |
|
42 |
names are not known by the expression evaluator. |
|
43 |
This has to be fixed |
|
44 |
(actual work is to be done in the Parser to allow passing of a context ...) |
|
510 | 45 |
|
46 |
[author:] |
|
47 |
Claus Gittinger |
|
48 |
||
49 |
[see also:] |
|
50 |
Context DebugView |
|
34 | 51 |
" |
52 |
! ! |
|
53 |
||
54 |
!ContextInspectorView methodsFor:'accessing'! |
|
55 |
||
868 | 56 |
inspect:aContext |
34 | 57 |
"set the context to be inspected" |
58 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
59 |
|methodHomeContext method homeNames rec sel |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
60 |
m blockNode |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
61 |
numVarsInSource numVarsInContext isDoIt |
5803 | 62 |
numArgs numVars n tempNames realTempNames |
11549 | 63 |
oldSelection oldSelectedName hCon keepList newList| |
34 | 64 |
|
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
1769
diff
changeset
|
65 |
oldSelection := selectionIndex. |
11549 | 66 |
oldSelection notNil ifTrue:[ |
67 |
oldSelectedName := (self listEntryAt:oldSelection). |
|
68 |
oldSelectedName notNil ifTrue:[ |
|
69 |
oldSelectedName := oldSelectedName string |
|
70 |
] |
|
71 |
]. |
|
49 | 72 |
|
11549 | 73 |
keepList := ((aContext == inspectedContext) |
74 |
"/ care for contexts which change size |
|
75 |
"/ (after the locals & stack-setup) |
|
76 |
and:[ contextSize == inspectedContext size ]). |
|
77 |
||
78 |
keepList ifTrue:[ |
|
79 |
"/ assume that the list remains unchanged; |
|
80 |
"/ this is no longer true, if some inst-slot has changed (bullet colors) |
|
81 |
UserPreferences current showTypeIndicatorInInspector ifTrue:[ |
|
82 |
newList := self fieldList. |
|
83 |
newList ~= listView list ifTrue:[ |
|
84 |
listView list:newList. |
|
85 |
] |
|
86 |
]. |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
87 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
88 |
hasMore := argsOnly := false. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
89 |
inspectedObject := object := nil. |
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
90 |
inspectedContext := object := aContext. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
91 |
contextSize := inspectedContext size. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
92 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
93 |
aContext isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
94 |
names := nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
95 |
listView list:nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
96 |
^ self |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
97 |
]. |
34 | 98 |
|
11549 | 99 |
methodHomeContext := aContext methodHome. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
100 |
methodHomeContext isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
101 |
"its a cheap blocks context" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
102 |
rec := aContext receiver. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
103 |
sel := aContext selector. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
104 |
homeNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
105 |
isDoIt := false. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
106 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
107 |
rec := methodHomeContext receiver. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
108 |
sel := methodHomeContext selector. |
34 | 109 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
110 |
"/ #doIt needs special handling below |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
111 |
isDoIt := (sel == #doIt) or:[sel == #doIt:]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
112 |
method := methodHomeContext method. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
113 |
|
9588
dc38e81ec660
comment/format in: #inspect:
Claus Gittinger <cg@exept.de>
parents:
9426
diff
changeset
|
114 |
(method notNil and:[method isWrapped]) ifTrue:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
115 |
"/ in a wrapped context, locals are something different |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
116 |
argsOnly := true. |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
117 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
118 |
m := method originalMethod. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
119 |
m notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
120 |
method := m. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
121 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
122 |
argsOnly := true. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
123 |
]. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
124 |
]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
125 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
126 |
method notNil ifTrue:[ |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
127 |
argsOnly ifFalse:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
128 |
homeNames := method methodArgAndVarNames. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
129 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
130 |
"/ did it already allocate its locals ? |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
131 |
(homeNames size > (methodHomeContext numArgs + methodHomeContext numVars)) ifTrue:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
132 |
argsOnly := true. |
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
|
133 |
]. |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
134 |
]. |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
135 |
argsOnly ifTrue:[ |
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
136 |
homeNames := method methodArgNames |
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
137 |
]. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
138 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
139 |
"/ there is one case, where the above is by purpose: |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
140 |
"/ the #doIt - method, which has been given an invalid |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
141 |
"/ source. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
142 |
"/ care for this here. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
143 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
144 |
isDoIt ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
145 |
homeNames := #(). |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
146 |
] ifFalse:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
147 |
"/ check |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
148 |
numVarsInContext := methodHomeContext argsAndVars size. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
149 |
numVarsInSource := homeNames size. |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
150 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
151 |
numVarsInSource > 0 ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
152 |
numVarsInContext < numVarsInSource ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
153 |
"/ the methods source does not correctly reflect |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
154 |
"/ the number of args&vars in the context. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
155 |
"/ either outDated, or somehow strange. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
156 |
"/ (happens with wrapped methods, which are not |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
157 |
"/ what they look) |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
158 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
159 |
numVarsInSource > numVarsInContext ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
160 |
homeNames := homeNames copyTo:numVarsInContext. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
161 |
] ifFalse:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
162 |
numVarsInContext >= methodHomeContext numArgs ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
163 |
homeNames := homeNames copyTo:methodHomeContext numArgs |
977 | 164 |
] ifFalse:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
165 |
homeNames := nil |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
166 |
] |
977 | 167 |
] |
785 | 168 |
] |
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
|
169 |
] |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
170 |
] |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
171 |
]. |
73 | 172 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
173 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
174 |
create dummy names for method vars (if there is no source available) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
175 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
176 |
homeNames isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
177 |
homeNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
178 |
1 to:methodHomeContext numArgs do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
179 |
homeNames add:('mArg' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
180 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
181 |
argsOnly ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
182 |
1 to:methodHomeContext numVars do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
183 |
homeNames add:('mVar' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
184 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
185 |
"/ showingTemporaries ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
186 |
"/ 1 to:methodHomeContext numTemps do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
187 |
"/ homeNames add:('mTmp' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
188 |
"/ ] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
189 |
"/ ] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
190 |
] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
191 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
192 |
showingTemporaries ifTrue:[ |
8581 | 193 |
homeNames := homeNames asOrderedCollection. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
194 |
1 to:methodHomeContext numTemps do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
195 |
homeNames add:('mTmp' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
196 |
] |
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
|
197 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
198 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
199 |
n := homeNames size. |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
200 |
n < ((argsOnly ifTrue:[0] ifFalse:[ methodHomeContext numVars]) + methodHomeContext numArgs) ifTrue:[ |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
201 |
"/ its a context which includes locals from |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
202 |
"/ inlined sub-blocks. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
203 |
"/ First, generate synthetic varNames ... |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
204 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
205 |
homeNames := homeNames asOrderedCollection. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
206 |
tempNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
207 |
n to:(methodHomeContext numVars + methodHomeContext numArgs - 1) do:[:inlinedTempIdx | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
208 |
tempNames add:('*t' , (inlinedTempIdx - n + 1) 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
|
209 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
210 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
211 |
"/ now, see if we can find out more |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
212 |
"/ (failes, if source is not available) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
213 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
214 |
method notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
215 |
(isDoIt and:[tempNames size > 0]) ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
216 |
"/ special for #doIt |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
217 |
"/ my source is found in the method. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
218 |
blockNode := Compiler |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
219 |
blockAtLine:aContext lineNumber |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
220 |
in:nil |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
221 |
orSource:('[' , method source , '\]') withCRs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
222 |
numArgs:numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
223 |
numVars:numVars. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
224 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
225 |
blockNode := Compiler |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
226 |
blockAtLine:methodHomeContext lineNumber |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
227 |
in:method |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
228 |
orSource:nil |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
229 |
numArgs:numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
230 |
numVars:numVars. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
231 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
232 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
233 |
realTempNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
234 |
[blockNode notNil] whileTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
235 |
blockNode variables notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
236 |
realTempNames := (blockNode variables collect:[:aVar | aVar name]) , realTempNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
237 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
238 |
blockNode arguments notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
239 |
realTempNames := (blockNode arguments collect:[:aVar | aVar name]) , realTempNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
240 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
241 |
"/ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
242 |
"/ hidden temps used for loop. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
243 |
"/ |
9426 | 244 |
blockNode invocationSelector == #timesRepeat ifTrue:[ |
12779
4b9dd97e4033
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12456
diff
changeset
|
245 |
realTempNames := realTempNames asOrderedCollection. |
4b9dd97e4033
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12456
diff
changeset
|
246 |
realTempNames addFirst:'*loopStop*' |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
247 |
] ifFalse:[ |
9426 | 248 |
blockNode invocationSelector == #to:do: ifTrue:[ |
12779
4b9dd97e4033
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12456
diff
changeset
|
249 |
realTempNames := realTempNames asOrderedCollection. |
4b9dd97e4033
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12456
diff
changeset
|
250 |
realTempNames addFirst:'*loopStop*' |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
251 |
] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
252 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
253 |
blockNode := blockNode home. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
254 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
255 |
tempNames |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
256 |
replaceFrom:1 to:(tempNames size min:realTempNames size) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
257 |
with:realTempNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
258 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
259 |
homeNames addAll:tempNames. |
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
|
260 |
] |
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
|
261 |
]. |
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
262 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
263 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
264 |
stupid: should find the block via the contexts |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
265 |
method-home and put real names in here |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
266 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
267 |
aContext isBlockContext ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
268 |
names := self namesOfBlockContext:aContext. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
269 |
hCon := aContext home. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
270 |
[hCon == methodHomeContext] whileFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
271 |
names addAll:(self namesOfBlockContext:hCon). |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
272 |
hCon := hCon home. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
273 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
274 |
names addAll:homeNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
275 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
276 |
names := homeNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
277 |
]. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
278 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
279 |
listView list:(self fieldList). |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
280 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
281 |
workspace contents:nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
282 |
self setDoitActionIn:workspace for:aContext. |
34 | 283 |
]. |
51 | 284 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
285 |
oldSelectedName notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
286 |
|idx| |
73 | 287 |
|
11549 | 288 |
idx := listView list findFirst:[:entry | (entry ? '') string = oldSelectedName]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
289 |
idx ~~ 0 "(names includes:oldSelectedName)" ifTrue:[ |
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
290 |
listView selectElement:oldSelectedName. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
291 |
self showSelection:idx. |
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
292 |
] |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
293 |
]. |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
294 |
|
11549 | 295 |
"Modified: / 03-06-2012 / 11:56:59 / cg" |
34 | 296 |
! |
297 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
298 |
namesOfBlockContext:aContext |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
299 |
|numArgs numVars argAndVarNames argNames varNames tmpNames names| |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
300 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
301 |
numArgs := aContext numArgs. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
302 |
numVars := aContext numVars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
303 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
304 |
(numArgs > 0 or:[numVars > 0]) ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
305 |
argAndVarNames := aContext argAndVarNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
306 |
argAndVarNames notEmptyOrNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
307 |
argNames := argAndVarNames copyTo:numArgs. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
308 |
varNames := argAndVarNames copyFrom:numArgs+1. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
309 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
310 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
311 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
312 |
names := OrderedCollection new. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
313 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
314 |
argNames isNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
315 |
argNames := (1 to:numArgs) collect:[:i | 'arg' , i printString]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
316 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
317 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
318 |
names addAll:argNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
319 |
varNames isNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
320 |
varNames := (1 to:numVars) collect:[:i | 'var' , i printString]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
321 |
] ifFalse:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
322 |
varNames size ~~ numVars ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
323 |
varNames := varNames asOrderedCollection. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
324 |
varNames size+1 to:aContext numVars do:[:i | |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
325 |
varNames add:('var' , i printString) |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
326 |
] |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
327 |
] |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
328 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
329 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
330 |
names addAll:varNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
331 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
332 |
showingTemporaries ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
333 |
tmpNames := (1 to:(aContext numTemps)) collect:[:i | 'tmp' , i printString]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
334 |
names addAll:tmpNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
335 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
336 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
337 |
^ names |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
338 |
! |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
339 |
|
34 | 340 |
release |
341 |
"release inspected object" |
|
342 |
||
343 |
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
|
344 |
names := nil. |
34 | 345 |
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
|
346 |
|
297
3d34ce6e2b22
oops - leftover printMessage removed
Claus Gittinger <cg@exept.de>
parents:
296
diff
changeset
|
347 |
"Modified: 14.12.1995 / 21:49:43 / cg" |
34 | 348 |
! ! |
349 |
||
73 | 350 |
!ContextInspectorView methodsFor:'initialization'! |
51 | 351 |
|
6491 | 352 |
initialize |
353 |
super initialize. |
|
354 |
showingTemporaries := false. |
|
355 |
||
356 |
! ! |
|
357 |
||
358 |
!ContextInspectorView methodsFor:'menu'! |
|
359 |
||
73 | 360 |
fieldMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
361 |
"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
|
362 |
|
1361 | 363 |
<resource: #programMenu > |
364 |
||
6491 | 365 |
|items m sel| |
366 |
||
367 |
items := #( |
|
368 |
('Copy Name or Key' #doCopyKey) |
|
369 |
('-') |
|
370 |
('Inspect' #doInspect) |
|
371 |
('BasicInspect' #doBasicInspect) |
|
9351
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
372 |
). |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
373 |
NewInspector::NewInspectorView notNil ifTrue:[ |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
374 |
items := items , #( |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
375 |
('Inspect Hierarchical' #doNewInspect ) |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
376 |
). |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
377 |
]. |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
378 |
items := items , #( |
6491 | 379 |
('-') |
380 |
('Browse' #browse) |
|
381 |
). |
|
382 |
||
383 |
sel := self selection. |
|
12932
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
384 |
|
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
385 |
(sel isSymbol) ifTrue:[ |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
386 |
items := items , #( |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
387 |
('Browse Implementors' #browseImplementorsOfSymbolValue) |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
388 |
). |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
389 |
]. |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
390 |
|
6852 | 391 |
Error |
392 |
handle:[:ex| ] |
|
393 |
do:[ |
|
7438 | 394 |
(sel isBlock or:[sel isContext]) ifTrue:[ |
395 |
items := items , #( |
|
10437 | 396 |
('Browse Block''s Home' #browseHome) |
7438 | 397 |
). |
398 |
]. |
|
399 |
(sel isMethod) ifTrue:[ |
|
400 |
items := items , #( |
|
10437 | 401 |
('Browse Method''s Class' #browseMethodsClass) |
7438 | 402 |
). |
403 |
]. |
|
6852 | 404 |
]. |
405 |
||
7640 | 406 |
items := items , (self optionalStreamSelectionItems). |
407 |
items := items , (self optionalFilenameSelectionItems). |
|
408 |
||
6491 | 409 |
items := items , #( |
410 |
('-') |
|
411 |
). |
|
73 | 412 |
|
413 |
showingTemporaries ifFalse:[ |
|
6491 | 414 |
items := items , #( |
415 |
('Show Temporaries' #showTemporaries) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
416 |
) |
73 | 417 |
] ifTrue:[ |
6491 | 418 |
items := items , #( |
419 |
('Hide temporaries' #hideTemporaries) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
420 |
) |
73 | 421 |
]. |
422 |
||
7640 | 423 |
items := items , (self numberBaseItems). |
11630 | 424 |
items := items , (self sortOrderItems). |
7640 | 425 |
|
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
426 |
m := PopUpMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
427 |
itemList:items |
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
428 |
resources:resources. |
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
429 |
|
3425 | 430 |
selectionIndex isNil ifTrue:[ |
12935
2149c6971ded
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12932
diff
changeset
|
431 |
m disableAll:#(doInspect doBasicInspect browse browseHome browseImplementorsOfSymbolValue) |
3425 | 432 |
] ifFalse:[ |
6491 | 433 |
sel isBlock ifFalse:[ |
3425 | 434 |
m disable:#browseHome |
6491 | 435 |
]. |
436 |
sel class hasImmediateInstances ifTrue:[ |
|
437 |
m disableAll:#(showReferences doNewInspect) |
|
438 |
]. |
|
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
439 |
]. |
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
440 |
^ m |
1361 | 441 |
|
11630 | 442 |
"Modified: / 20-07-2012 / 10:51:12 / cg" |
73 | 443 |
! ! |
200 | 444 |
|
445 |
!ContextInspectorView methodsFor:'private'! |
|
446 |
||
647 | 447 |
defaultLabel |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3775
diff
changeset
|
448 |
^ 'Locals' |
647 | 449 |
|
450 |
" |
|
451 |
ContextInspectorView openOn:thisContext sender |
|
452 |
" |
|
453 |
||
454 |
"Modified: 28.6.1996 / 16:07:49 / cg" |
|
455 |
! |
|
456 |
||
3775 | 457 |
displayStringForValue:someValue |
458 |
"return the values displayString" |
|
459 |
||
460 |
|sel| |
|
461 |
||
11513 | 462 |
sel := self listEntryAt:selectionIndex. |
3775 | 463 |
(sel startsWith:'-all local vars') ifTrue:[ |
464 |
^ self stringWithAllLocalValues |
|
465 |
]. |
|
466 |
||
467 |
^ super displayStringForValue:someValue |
|
11513 | 468 |
|
469 |
"Modified: / 16-05-2012 / 17:55:33 / cg" |
|
3775 | 470 |
! |
471 |
||
200 | 472 |
fieldList |
3775 | 473 |
names size == 0 ifTrue:[^ names]. |
11515 | 474 |
^ (Array with:('-', 'all local vars' allItalic)) |
475 |
, (names keysAndValuesCollect:[:idx :nm | |
|
476 |
self listEntryForName:nm value:(self valueAtIndex:idx) ]) |
|
477 |
||
478 |
"Modified: / 16-05-2012 / 18:54:59 / cg" |
|
200 | 479 |
! |
480 |
||
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
|
481 |
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
|
482 |
^ 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
|
483 |
|
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 |
"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
|
485 |
! |
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 |
|
200 | 487 |
setDoitActionIn:aWorkspace for:aContext |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
488 |
aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
489 |
doItAction:[:theCode | |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
490 |
Compiler |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
491 |
evaluate:theCode |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
492 |
in:aContext |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
493 |
receiver:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
494 |
notifying:aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
495 |
logged:true |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
496 |
ifFail:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
497 |
] |
200 | 498 |
! |
499 |
||
3775 | 500 |
stringWithAllLocalValues |
501 |
|s maxLen varString| |
|
502 |
||
503 |
s := '' writeStream. |
|
504 |
maxLen := (names collect:[:eachName | eachName size]) max. |
|
505 |
names keysAndValuesDo:[:varIdx :eachLocalName | |
|
506 |
s nextPutAll:((eachLocalName , ' ') paddedTo:maxLen+1 with:$.). |
|
507 |
s nextPutAll:' : '. |
|
508 |
||
5922 | 509 |
[ |
8634
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
510 |
|s| |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
511 |
|
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
512 |
s := WriteStream on:(String new:10). |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
513 |
s writeLimit:100000. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
514 |
(self valueAtIndex:varIdx) displayOn:s. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
515 |
varString := s contents. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
516 |
"/ varString := (self valueAtIndex:varIdx) displayString. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
517 |
] on:Error do:[:ex | |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
518 |
varString := ('*** Error in displayString (%1)***' bindWith:ex description) |
5922 | 519 |
]. |
6404
f4c76a21ba34
care for local value with invalid class.
Claus Gittinger <cg@exept.de>
parents:
5922
diff
changeset
|
520 |
varString := varString ? ''. |
5922 | 521 |
|
3775 | 522 |
(varString includes:Character cr) ifTrue:[ |
523 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
524 |
varString := varString , '...'. |
|
525 |
]. |
|
526 |
s nextPutAll:varString. |
|
527 |
s cr. |
|
528 |
]. |
|
529 |
^ s contents |
|
530 |
! |
|
531 |
||
532 |
valueAtIndex:varIdx |
|
200 | 533 |
"helper - return the value of the selected entry" |
534 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
535 |
|methodHomeContext hCon 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
|
536 |
|
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
|
537 |
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
|
538 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
539 |
"/ argsOnly := false. |
868 | 540 |
theContext := inspectedContext. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
541 |
methodHomeContext := 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
|
542 |
|
868 | 543 |
theContext isBlockContext ifTrue:[ |
544 |
values := Array withAll:(theContext argsAndVars). |
|
545 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
|
546 |
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
|
547 |
]. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
548 |
hCon := theContext home. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
549 |
[hCon == methodHomeContext] whileFalse:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
550 |
values := values , hCon argsAndVars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
551 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
552 |
values := values , hCon temporaries |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
553 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
554 |
hCon := hCon home. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
555 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
556 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
557 |
methodHomeContext notNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
558 |
values := values , methodHomeContext args. |
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
|
559 |
argsOnly ifFalse:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
560 |
values := values , methodHomeContext vars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
561 |
(showingTemporaries and:[methodHomeContext numTemps ~~ 0])ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
562 |
values := values , methodHomeContext 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
|
563 |
] |
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
|
564 |
]. |
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
|
565 |
]. |
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
|
566 |
] 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
|
567 |
argsOnly ifTrue:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
568 |
values := methodHomeContext args |
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
|
569 |
] ifFalse:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
570 |
values := methodHomeContext argsAndVars |
1395 | 571 |
]. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
572 |
(showingTemporaries and:[methodHomeContext numTemps ~~ 0])ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
573 |
values := values , methodHomeContext 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
|
574 |
] |
1395 | 575 |
|
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
|
576 |
]. |
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
|
577 |
|
3775 | 578 |
^ values at:varIdx. |
200 | 579 |
|
1395 | 580 |
"Modified: / 13.1.1998 / 15:55:16 / cg" |
3775 | 581 |
! |
582 |
||
583 |
valueAtLine:lineNr |
|
584 |
"helper - return the value of the selected entry" |
|
585 |
||
586 |
|varIdx l| |
|
587 |
||
588 |
inspectedContext isNil ifTrue:[^ nil]. |
|
589 |
||
590 |
varIdx := lineNr. |
|
11513 | 591 |
l := self listEntryAt:lineNr. |
8437 | 592 |
l isNil ifTrue:[ ^nil]. |
593 |
||
594 |
(l startsWith:$-) ifTrue:[ |
|
3775 | 595 |
(l ~= '-') ifTrue:[ |
11513 | 596 |
^ self valueForSpecialLine:(self listEntryAt:lineNr) |
3775 | 597 |
]. |
598 |
]. |
|
599 |
^ self valueAtIndex:(varIdx - 1). "/ for the special var |
|
11513 | 600 |
|
601 |
"Modified: / 16-05-2012 / 17:55:57 / cg" |
|
3775 | 602 |
! |
603 |
||
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
604 |
valueAtLine:lineNr put:newValue |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
605 |
"helper - return the value of the selected entry" |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
606 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
607 |
|indexOfFirstNonSpecial contextIndex| |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
608 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
609 |
inspectedContext isNil ifTrue:[^ self]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
610 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
611 |
"/ count the special lines |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
612 |
indexOfFirstNonSpecial := self fieldList findFirst:[:l | (l string startsWith:'-') not]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
613 |
indexOfFirstNonSpecial == 0 ifTrue:[ |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
614 |
^ self |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
615 |
]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
616 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
617 |
contextIndex := lineNr - indexOfFirstNonSpecial + 1. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
618 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
619 |
"yes, you can do that with a context" |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
620 |
inspectedContext at:contextIndex put:newValue. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
621 |
! |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
622 |
|
3775 | 623 |
valueForSpecialLine:line |
624 |
(line startsWith:'-all local vars') ifTrue:[ |
|
625 |
^ inspectedObject |
|
626 |
]. |
|
627 |
||
628 |
self error:'unknown special line'. |
|
629 |
||
630 |
"Created: / 31.10.2001 / 09:17:45 / cg" |
|
200 | 631 |
! ! |
632 |
||
633 |
!ContextInspectorView methodsFor:'user actions'! |
|
634 |
||
635 |
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
|
636 |
"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
|
637 |
|
200 | 638 |
showingTemporaries := false. |
639 |
self inspect:inspectedContext |
|
640 |
||
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
|
641 |
"Modified: 14.12.1995 / 19:24:44 / cg" |
200 | 642 |
! |
643 |
||
644 |
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
|
645 |
"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
|
646 |
|
200 | 647 |
showingTemporaries := true. |
648 |
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
|
649 |
|
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
|
650 |
"Modified: 14.12.1995 / 19:24:49 / cg" |
200 | 651 |
! ! |
652 |
||
785 | 653 |
!ContextInspectorView class methodsFor:'documentation'! |
200 | 654 |
|
655 |
version |
|
12935
2149c6971ded
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12932
diff
changeset
|
656 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.85 2013-06-20 11:24:29 cg Exp $' |
9033
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
657 |
! |
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
658 |
|
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
659 |
version_CVS |
12935
2149c6971ded
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12932
diff
changeset
|
660 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.85 2013-06-20 11:24:29 cg Exp $' |
200 | 661 |
! ! |
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
662 |