author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 08 Oct 2013 14:11:22 +0100 | |
branch | jv |
changeset 13622 | 8052e86d86b1 |
parent 13491 | b3afe831ff0a |
child 13658 | 065376680d85 |
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) |
|
13622
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
76 |
and:[ contextSize == inspectedContext size |
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
77 |
"/ care for JavaContexts whose set of visible variables |
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
78 |
"/ may change during method execution ( nested block locals... ) |
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
79 |
and:[ aContext isJavaContext not |
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
80 |
]]). |
11549 | 81 |
|
82 |
keepList ifTrue:[ |
|
83 |
"/ assume that the list remains unchanged; |
|
84 |
"/ this is no longer true, if some inst-slot has changed (bullet colors) |
|
85 |
UserPreferences current showTypeIndicatorInInspector ifTrue:[ |
|
86 |
newList := self fieldList. |
|
87 |
newList ~= listView list ifTrue:[ |
|
88 |
listView list:newList. |
|
89 |
] |
|
90 |
]. |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
91 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
92 |
hasMore := argsOnly := false. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
93 |
inspectedObject := object := nil. |
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
94 |
inspectedContext := object := aContext. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
95 |
contextSize := inspectedContext size. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
96 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
97 |
aContext isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
98 |
names := nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
99 |
listView list:nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
100 |
^ self |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
101 |
]. |
34 | 102 |
|
11549 | 103 |
methodHomeContext := aContext methodHome. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
104 |
methodHomeContext isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
105 |
"its a cheap blocks context" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
106 |
rec := aContext receiver. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
107 |
sel := aContext selector. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
108 |
homeNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
109 |
isDoIt := false. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
110 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
111 |
rec := methodHomeContext receiver. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
112 |
sel := methodHomeContext selector. |
34 | 113 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
114 |
"/ #doIt needs special handling below |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
115 |
isDoIt := (sel == #doIt) or:[sel == #doIt:]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
116 |
method := methodHomeContext method. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
117 |
|
9588
dc38e81ec660
comment/format in: #inspect:
Claus Gittinger <cg@exept.de>
parents:
9426
diff
changeset
|
118 |
(method notNil and:[method isWrapped]) ifTrue:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
119 |
"/ in a wrapped context, locals are something different |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
120 |
argsOnly := true. |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
121 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
122 |
m := method originalMethod. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
123 |
m notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
124 |
method := m. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
125 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
126 |
argsOnly := true. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
127 |
]. |
947
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 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
130 |
method notNil ifTrue:[ |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
131 |
argsOnly ifFalse:[ |
13622
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
132 |
homeNames := method methodArgAndVarNamesInContext: methodHomeContext. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
133 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
134 |
"/ did it already allocate its locals ? |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
135 |
(homeNames size > (methodHomeContext numArgs + methodHomeContext numVars)) ifTrue:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
136 |
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
|
137 |
]. |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
138 |
]. |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
139 |
argsOnly ifTrue:[ |
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
140 |
homeNames := method methodArgNames |
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
141 |
]. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
142 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
143 |
"/ there is one case, where the above is by purpose: |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
144 |
"/ the #doIt - method, which has been given an invalid |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
145 |
"/ source. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
146 |
"/ care for this here. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
147 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
148 |
isDoIt ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
149 |
homeNames := #(). |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
150 |
] ifFalse:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
151 |
"/ check |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
152 |
numVarsInContext := methodHomeContext argsAndVars size. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
153 |
numVarsInSource := homeNames size. |
12904
550f2f25a5b4
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12898
diff
changeset
|
154 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
155 |
numVarsInSource > 0 ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
156 |
numVarsInContext < numVarsInSource ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
157 |
"/ the methods source does not correctly reflect |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
158 |
"/ the number of args&vars in the context. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
159 |
"/ either outDated, or somehow strange. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
160 |
"/ (happens with wrapped methods, which are not |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
161 |
"/ what they look) |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
162 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
163 |
numVarsInSource > numVarsInContext ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
164 |
homeNames := homeNames copyTo:numVarsInContext. |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
165 |
] ifFalse:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
166 |
numVarsInContext >= methodHomeContext numArgs ifTrue:[ |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
167 |
homeNames := homeNames copyTo:methodHomeContext numArgs |
977 | 168 |
] ifFalse:[ |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
169 |
homeNames := nil |
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
170 |
] |
977 | 171 |
] |
785 | 172 |
] |
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
|
173 |
] |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
174 |
] |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
175 |
]. |
73 | 176 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
177 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
178 |
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
|
179 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
180 |
homeNames isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
181 |
homeNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
182 |
1 to:methodHomeContext numArgs do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
183 |
homeNames add:('mArg' , 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 |
argsOnly ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
186 |
1 to:methodHomeContext numVars do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
187 |
homeNames add:('mVar' , 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 |
"/ showingTemporaries ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
190 |
"/ 1 to:methodHomeContext numTemps do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
191 |
"/ homeNames add:('mTmp' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
192 |
"/ ] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
193 |
"/ ] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
194 |
] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
195 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
196 |
showingTemporaries ifTrue:[ |
8581 | 197 |
homeNames := homeNames asOrderedCollection. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
198 |
1 to:methodHomeContext numTemps do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
199 |
homeNames add:('mTmp' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
200 |
] |
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
|
201 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
202 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
203 |
n := homeNames size. |
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
204 |
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
|
205 |
"/ 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
|
206 |
"/ inlined sub-blocks. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
207 |
"/ First, generate synthetic varNames ... |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
208 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
209 |
homeNames := homeNames asOrderedCollection. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
210 |
tempNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
211 |
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
|
212 |
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
|
213 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
214 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
215 |
"/ 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
|
216 |
"/ (failes, if source is not available) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
217 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
218 |
method notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
219 |
(isDoIt and:[tempNames size > 0]) ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
220 |
"/ special for #doIt |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
221 |
"/ 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
|
222 |
blockNode := Compiler |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
223 |
blockAtLine:aContext lineNumber |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
224 |
in:nil |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
225 |
orSource:('[' , method source , '\]') withCRs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
226 |
numArgs:numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
227 |
numVars:numVars. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
228 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
229 |
blockNode := Compiler |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
230 |
blockAtLine:methodHomeContext lineNumber |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
231 |
in:method |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
232 |
orSource:nil |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
233 |
numArgs:numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
234 |
numVars:numVars. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
235 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
236 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
237 |
realTempNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
238 |
[blockNode notNil] whileTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
239 |
blockNode variables notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
240 |
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
|
241 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
242 |
blockNode arguments notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
243 |
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
|
244 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
245 |
"/ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
246 |
"/ hidden temps used for loop. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
247 |
"/ |
9426 | 248 |
blockNode invocationSelector == #timesRepeat 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 |
] ifFalse:[ |
9426 | 252 |
blockNode invocationSelector == #to:do: ifTrue:[ |
12779
4b9dd97e4033
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12456
diff
changeset
|
253 |
realTempNames := realTempNames asOrderedCollection. |
4b9dd97e4033
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12456
diff
changeset
|
254 |
realTempNames addFirst:'*loopStop*' |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
255 |
] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
256 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
257 |
blockNode := blockNode home. |
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 |
tempNames |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
260 |
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
|
261 |
with:realTempNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
262 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
263 |
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
|
264 |
] |
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
|
265 |
]. |
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
266 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
267 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
268 |
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
|
269 |
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
|
270 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
271 |
aContext isBlockContext ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
272 |
names := self namesOfBlockContext:aContext. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
273 |
hCon := aContext home. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
274 |
[hCon == methodHomeContext] whileFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
275 |
names addAll:(self namesOfBlockContext:hCon). |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
276 |
hCon := hCon home. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
277 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
278 |
names addAll:homeNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
279 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
280 |
names := homeNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
281 |
]. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
282 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
283 |
listView list:(self fieldList). |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
284 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
285 |
workspace contents:nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
286 |
self setDoitActionIn:workspace for:aContext. |
34 | 287 |
]. |
51 | 288 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
289 |
oldSelectedName notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
290 |
|idx| |
73 | 291 |
|
11549 | 292 |
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
|
293 |
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
|
294 |
listView selectElement:oldSelectedName. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
295 |
self showSelection:idx. |
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
296 |
] |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
297 |
]. |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
298 |
|
11549 | 299 |
"Modified: / 03-06-2012 / 11:56:59 / cg" |
13622
8052e86d86b1
Fix in ContextInspectorView: always call Method>>methodArgAndVarNamesInContext:...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13491
diff
changeset
|
300 |
"Modified: / 08-10-2013 / 12:00:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 301 |
! |
302 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
303 |
namesOfBlockContext:aContext |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
304 |
|numArgs numVars argAndVarNames argNames varNames tmpNames names| |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
305 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
306 |
numArgs := aContext numArgs. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
307 |
numVars := aContext numVars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
308 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
309 |
(numArgs > 0 or:[numVars > 0]) ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
310 |
argAndVarNames := aContext argAndVarNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
311 |
argAndVarNames notEmptyOrNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
312 |
argNames := argAndVarNames copyTo:numArgs. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
313 |
varNames := argAndVarNames copyFrom:numArgs+1. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
314 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
315 |
]. |
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 |
names := OrderedCollection new. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
318 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
319 |
argNames isNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
320 |
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
|
321 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
322 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
323 |
names addAll:argNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
324 |
varNames isNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
325 |
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
|
326 |
] ifFalse:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
327 |
varNames size ~~ numVars ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
328 |
varNames := varNames asOrderedCollection. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
329 |
varNames size+1 to:aContext numVars do:[:i | |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
330 |
varNames add:('var' , i printString) |
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 |
] |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
333 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
334 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
335 |
names addAll:varNames. |
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 |
showingTemporaries ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
338 |
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
|
339 |
names addAll:tmpNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
340 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
341 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
342 |
^ names |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
343 |
! |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
344 |
|
34 | 345 |
release |
346 |
"release inspected object" |
|
347 |
||
348 |
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
|
349 |
names := nil. |
34 | 350 |
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
|
351 |
|
297
3d34ce6e2b22
oops - leftover printMessage removed
Claus Gittinger <cg@exept.de>
parents:
296
diff
changeset
|
352 |
"Modified: 14.12.1995 / 21:49:43 / cg" |
34 | 353 |
! ! |
354 |
||
73 | 355 |
!ContextInspectorView methodsFor:'initialization'! |
51 | 356 |
|
6491 | 357 |
initialize |
358 |
super initialize. |
|
359 |
showingTemporaries := false. |
|
360 |
||
361 |
! ! |
|
362 |
||
363 |
!ContextInspectorView methodsFor:'menu'! |
|
364 |
||
73 | 365 |
fieldMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
366 |
"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
|
367 |
|
1361 | 368 |
<resource: #programMenu > |
369 |
||
6491 | 370 |
|items m sel| |
371 |
||
372 |
items := #( |
|
373 |
('Copy Name or Key' #doCopyKey) |
|
374 |
('-') |
|
375 |
('Inspect' #doInspect) |
|
376 |
('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
|
377 |
). |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
378 |
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
|
379 |
items := items , #( |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
380 |
('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
|
381 |
). |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
382 |
]. |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
383 |
items := items , #( |
6491 | 384 |
('-') |
385 |
('Browse' #browse) |
|
386 |
). |
|
387 |
||
388 |
sel := self selection. |
|
12932
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 |
(sel isSymbol) ifTrue:[ |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
391 |
items := items , #( |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
392 |
('Browse Implementors' #browseImplementorsOfSymbolValue) |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
393 |
). |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
394 |
]. |
63707ac51242
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12904
diff
changeset
|
395 |
|
6852 | 396 |
Error |
397 |
handle:[:ex| ] |
|
398 |
do:[ |
|
7438 | 399 |
(sel isBlock or:[sel isContext]) ifTrue:[ |
400 |
items := items , #( |
|
10437 | 401 |
('Browse Block''s Home' #browseHome) |
7438 | 402 |
). |
403 |
]. |
|
404 |
(sel isMethod) ifTrue:[ |
|
405 |
items := items , #( |
|
10437 | 406 |
('Browse Method''s Class' #browseMethodsClass) |
7438 | 407 |
). |
408 |
]. |
|
6852 | 409 |
]. |
410 |
||
7640 | 411 |
items := items , (self optionalStreamSelectionItems). |
412 |
items := items , (self optionalFilenameSelectionItems). |
|
413 |
||
6491 | 414 |
items := items , #( |
415 |
('-') |
|
416 |
). |
|
73 | 417 |
|
418 |
showingTemporaries ifFalse:[ |
|
6491 | 419 |
items := items , #( |
420 |
('Show Temporaries' #showTemporaries) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
421 |
) |
73 | 422 |
] ifTrue:[ |
6491 | 423 |
items := items , #( |
424 |
('Hide temporaries' #hideTemporaries) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
425 |
) |
73 | 426 |
]. |
427 |
||
7640 | 428 |
items := items , (self numberBaseItems). |
11630 | 429 |
items := items , (self sortOrderItems). |
7640 | 430 |
|
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
431 |
m := PopUpMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
432 |
itemList:items |
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
433 |
resources:resources. |
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
434 |
|
3425 | 435 |
selectionIndex isNil ifTrue:[ |
12935
2149c6971ded
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12932
diff
changeset
|
436 |
m disableAll:#(doInspect doBasicInspect browse browseHome browseImplementorsOfSymbolValue) |
3425 | 437 |
] ifFalse:[ |
6491 | 438 |
sel isBlock ifFalse:[ |
3425 | 439 |
m disable:#browseHome |
6491 | 440 |
]. |
441 |
sel class hasImmediateInstances ifTrue:[ |
|
442 |
m disableAll:#(showReferences doNewInspect) |
|
443 |
]. |
|
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
444 |
]. |
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
445 |
^ m |
1361 | 446 |
|
11630 | 447 |
"Modified: / 20-07-2012 / 10:51:12 / cg" |
73 | 448 |
! ! |
200 | 449 |
|
450 |
!ContextInspectorView methodsFor:'private'! |
|
451 |
||
647 | 452 |
defaultLabel |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3775
diff
changeset
|
453 |
^ 'Locals' |
647 | 454 |
|
455 |
" |
|
456 |
ContextInspectorView openOn:thisContext sender |
|
457 |
" |
|
458 |
||
459 |
"Modified: 28.6.1996 / 16:07:49 / cg" |
|
460 |
! |
|
461 |
||
3775 | 462 |
displayStringForValue:someValue |
463 |
"return the values displayString" |
|
464 |
||
465 |
|sel| |
|
466 |
||
11513 | 467 |
sel := self listEntryAt:selectionIndex. |
3775 | 468 |
(sel startsWith:'-all local vars') ifTrue:[ |
469 |
^ self stringWithAllLocalValues |
|
470 |
]. |
|
471 |
||
472 |
^ super displayStringForValue:someValue |
|
11513 | 473 |
|
474 |
"Modified: / 16-05-2012 / 17:55:33 / cg" |
|
3775 | 475 |
! |
476 |
||
200 | 477 |
fieldList |
13454
feba94447645
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13453
diff
changeset
|
478 |
"generate a list of names (& pseudo names) to be shown on the left side" |
feba94447645
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13453
diff
changeset
|
479 |
|
13451
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
480 |
names size == 0 ifTrue:[ |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
481 |
inspectedContext home isNil ifTrue:[ |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
482 |
"/ hack to guide beginners |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
483 |
^ { '>> no home in cheap block <<' colorizeAllWith:Color grey } |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
484 |
]. |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
485 |
^ names |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
486 |
]. |
11515 | 487 |
^ (Array with:('-', 'all local vars' allItalic)) |
488 |
, (names keysAndValuesCollect:[:idx :nm | |
|
489 |
self listEntryForName:nm value:(self valueAtIndex:idx) ]) |
|
490 |
||
491 |
"Modified: / 16-05-2012 / 18:54:59 / cg" |
|
200 | 492 |
! |
493 |
||
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
|
494 |
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
|
495 |
^ 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
|
496 |
|
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 |
"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
|
498 |
! |
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
|
499 |
|
200 | 500 |
setDoitActionIn:aWorkspace for:aContext |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
501 |
aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
502 |
doItAction:[:theCode | |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
503 |
Compiler |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
504 |
evaluate:theCode |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
505 |
in:aContext |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
506 |
receiver:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
507 |
notifying:aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
508 |
logged:true |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
509 |
ifFail:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
510 |
] |
200 | 511 |
! |
512 |
||
3775 | 513 |
stringWithAllLocalValues |
514 |
|s maxLen varString| |
|
515 |
||
516 |
s := '' writeStream. |
|
517 |
maxLen := (names collect:[:eachName | eachName size]) max. |
|
518 |
names keysAndValuesDo:[:varIdx :eachLocalName | |
|
519 |
s nextPutAll:((eachLocalName , ' ') paddedTo:maxLen+1 with:$.). |
|
520 |
s nextPutAll:' : '. |
|
521 |
||
5922 | 522 |
[ |
8634
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
523 |
|s| |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
524 |
|
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
525 |
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
|
526 |
s writeLimit:100000. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
527 |
(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
|
528 |
varString := s contents. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
529 |
"/ 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
|
530 |
] 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
|
531 |
varString := ('*** Error in displayString (%1)***' bindWith:ex description) |
5922 | 532 |
]. |
6404
f4c76a21ba34
care for local value with invalid class.
Claus Gittinger <cg@exept.de>
parents:
5922
diff
changeset
|
533 |
varString := varString ? ''. |
5922 | 534 |
|
3775 | 535 |
(varString includes:Character cr) ifTrue:[ |
536 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
537 |
varString := varString , '...'. |
|
538 |
]. |
|
539 |
s nextPutAll:varString. |
|
540 |
s cr. |
|
541 |
]. |
|
542 |
^ s contents |
|
543 |
! |
|
544 |
||
545 |
valueAtIndex:varIdx |
|
200 | 546 |
"helper - return the value of the selected entry" |
547 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
548 |
|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
|
549 |
|
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
|
550 |
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
|
551 |
|
12898
323452deefd5
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12779
diff
changeset
|
552 |
"/ argsOnly := false. |
868 | 553 |
theContext := inspectedContext. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
554 |
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
|
555 |
|
868 | 556 |
theContext isBlockContext ifTrue:[ |
557 |
values := Array withAll:(theContext argsAndVars). |
|
558 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
|
559 |
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
|
560 |
]. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
561 |
hCon := theContext home. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
562 |
[hCon == methodHomeContext] whileFalse:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
563 |
values := values , hCon argsAndVars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
564 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
565 |
values := values , hCon temporaries |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
566 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
567 |
hCon := hCon home. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
568 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
569 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
570 |
methodHomeContext notNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
571 |
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
|
572 |
argsOnly ifFalse:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
573 |
values := values , methodHomeContext vars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
574 |
(showingTemporaries and:[methodHomeContext numTemps ~~ 0])ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
575 |
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
|
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 |
]. |
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
|
578 |
]. |
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
|
579 |
] 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
|
580 |
argsOnly ifTrue:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
581 |
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
|
582 |
] ifFalse:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
583 |
values := methodHomeContext argsAndVars |
1395 | 584 |
]. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
585 |
(showingTemporaries and:[methodHomeContext numTemps ~~ 0])ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
586 |
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
|
587 |
] |
1395 | 588 |
|
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
|
589 |
]. |
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
|
590 |
|
3775 | 591 |
^ values at:varIdx. |
200 | 592 |
|
1395 | 593 |
"Modified: / 13.1.1998 / 15:55:16 / cg" |
3775 | 594 |
! |
595 |
||
596 |
valueAtLine:lineNr |
|
597 |
"helper - return the value of the selected entry" |
|
598 |
||
599 |
|varIdx l| |
|
600 |
||
601 |
inspectedContext isNil ifTrue:[^ nil]. |
|
602 |
||
603 |
varIdx := lineNr. |
|
11513 | 604 |
l := self listEntryAt:lineNr. |
8437 | 605 |
l isNil ifTrue:[ ^nil]. |
606 |
||
13451
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
607 |
(l startsWith:'>>') ifTrue:[ |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
608 |
"/ a comment (hack) |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
609 |
^ self valueForCommentLine:(self listEntryAt:lineNr) |
3ae3b9b9e45e
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
12935
diff
changeset
|
610 |
]. |
8437 | 611 |
(l startsWith:$-) ifTrue:[ |
3775 | 612 |
(l ~= '-') ifTrue:[ |
11513 | 613 |
^ self valueForSpecialLine:(self listEntryAt:lineNr) |
3775 | 614 |
]. |
615 |
]. |
|
616 |
^ self valueAtIndex:(varIdx - 1). "/ for the special var |
|
11513 | 617 |
|
618 |
"Modified: / 16-05-2012 / 17:55:57 / cg" |
|
3775 | 619 |
! |
620 |
||
13453
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
621 |
valueForCommentLine:line |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
622 |
"/ a hack to guide beginners |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
623 |
(line startsWith:'>> no home') ifTrue:[ |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
624 |
^ 'Cheapblocks do not refer to any variable in |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
625 |
their defining outer context |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
626 |
(i.e. they only refer to self and arguments). |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
627 |
Therefore, they do not keep a reference to the outer context. |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
628 |
This is a compiler optimization, leading to a slight inconvenience here.' |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
629 |
]. |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
630 |
|
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
631 |
^ nil |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
632 |
! |
ddc48bfab4c7
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13452
diff
changeset
|
633 |
|
3775 | 634 |
valueForSpecialLine:line |
635 |
(line startsWith:'-all local vars') ifTrue:[ |
|
636 |
^ inspectedObject |
|
637 |
]. |
|
638 |
||
639 |
self error:'unknown special line'. |
|
640 |
||
641 |
"Created: / 31.10.2001 / 09:17:45 / cg" |
|
200 | 642 |
! ! |
643 |
||
644 |
!ContextInspectorView methodsFor:'user actions'! |
|
645 |
||
646 |
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
|
647 |
"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
|
648 |
|
200 | 649 |
showingTemporaries := false. |
650 |
self inspect:inspectedContext |
|
651 |
||
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
|
652 |
"Modified: 14.12.1995 / 19:24:44 / cg" |
200 | 653 |
! |
654 |
||
655 |
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
|
656 |
"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
|
657 |
|
200 | 658 |
showingTemporaries := true. |
659 |
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
|
660 |
|
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
|
661 |
"Modified: 14.12.1995 / 19:24:49 / cg" |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3775
diff
changeset
|
662 |
! |
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3775
diff
changeset
|
663 |
|
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
664 |
valueAtLine:lineNr put:newValue |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
665 |
"helper - return the value of the selected entry" |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
666 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
667 |
|indexOfFirstNonSpecial contextIndex| |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
668 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
669 |
inspectedContext isNil ifTrue:[^ self]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
670 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
671 |
"/ count the special lines |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
672 |
indexOfFirstNonSpecial := self fieldList findFirst:[:l | (l string startsWith:'-') not]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
673 |
indexOfFirstNonSpecial == 0 ifTrue:[ |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
674 |
^ self |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
675 |
]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
676 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
677 |
contextIndex := lineNr - indexOfFirstNonSpecial + 1. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
678 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
679 |
"yes, you can do that with a context" |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
680 |
inspectedContext at:contextIndex put:newValue. |
200 | 681 |
! ! |
682 |
||
785 | 683 |
!ContextInspectorView class methodsFor:'documentation'! |
200 | 684 |
|
685 |
version |
|
13454
feba94447645
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13453
diff
changeset
|
686 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.89 2013-09-01 09:00:46 cg Exp $' |
9033
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
687 |
! |
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
688 |
|
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
689 |
version_CVS |
13454
feba94447645
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
13453
diff
changeset
|
690 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.89 2013-09-01 09:00:46 cg Exp $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
691 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
692 |
|
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
693 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
694 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
695 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
696 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
697 |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
698 |
version_SVN |
12265 | 699 |
^ '$Id: ContextInspectorView.st 8022 2012-07-25 09:51:30Z vranyj1 $' |
200 | 700 |
! ! |
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
701 |