author | Claus Gittinger <cg@exept.de> |
Mon, 11 Mar 2013 17:58:00 +0100 | |
changeset 12456 | 87fdcd23e545 |
parent 11630 | 767544a6b3f7 |
child 12459 | 7899fe07efd7 |
child 12779 | 4b9dd97e4033 |
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 |
5803 | 60 |
m argsOnly 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 |
|
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
114 |
"/ implementorClass := methodHomeContext methodClass. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
115 |
"/ implementorClass notNil ifTrue:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
116 |
"/ method := implementorClass compiledMethodAt:sel. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
117 |
"/ ] ifFalse:[ |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
118 |
"/ "/ mhm - an unbound method; |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
119 |
"/ "/ see if it was invoked by a direct call |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
120 |
"/ "/ consider this a kludge |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
121 |
"/ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
122 |
"/ methodHomeContext sender notNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
123 |
"/ (methodHomeContext sender selector startsWith:'valueWithReceiver:') ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
124 |
"/ method := methodHomeContext sender receiver |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
125 |
"/ ] |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
126 |
"/ ] |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
127 |
"/ ]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
128 |
|
9588
dc38e81ec660
comment/format in: #inspect:
Claus Gittinger <cg@exept.de>
parents:
9426
diff
changeset
|
129 |
(method notNil and:[method isWrapped]) ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
130 |
" |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
131 |
in a wrapped context, locals are something different |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
132 |
" |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
133 |
"/ argsOnly := true. |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
134 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
135 |
m := method originalMethod. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
136 |
m notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
137 |
method := m. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
138 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
139 |
argsOnly := true. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
140 |
]. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
141 |
]. |
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
142 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
143 |
method notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
144 |
"/ method source notNil ifTrue:[ |
1026
b863f3784b3c
oops - methods with inlined blockVars did not show its vars
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
145 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
146 |
argsOnly ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
147 |
homeNames := method methodArgNames |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
148 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
149 |
homeNames := method methodArgAndVarNames. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
150 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
151 |
"/ did it already allocate its locals ? |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
152 |
homeNames size > (methodHomeContext numArgs + methodHomeContext numVars) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
153 |
ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
154 |
homeNames := method methodArgNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
155 |
argsOnly := true. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
156 |
]. |
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
|
157 |
]. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
158 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
159 |
"/ there is one case, where the above is by purpose: |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
160 |
"/ the #doIt - method, which has been given an invalid |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
161 |
"/ source. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
162 |
"/ care for this here. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
163 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
164 |
isDoIt ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
165 |
homeNames := #(). |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
166 |
] ifFalse:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
167 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
168 |
"/ check |
785 | 169 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
170 |
numVarsInContext := methodHomeContext argsAndVars size. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
171 |
numVarsInSource := homeNames size. |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
172 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
173 |
numVarsInSource > 0 ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
174 |
numVarsInContext < numVarsInSource ifTrue:[ |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
175 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
176 |
"/ the methods source does not correctly reflect |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
177 |
"/ the number of args&vars in the context. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
178 |
"/ either outDated, or somehow strange. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
179 |
"/ (happens with wrapped methods, which are not |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
180 |
"/ what they look) |
947
b9625d9b0881
better block-var name detection
Claus Gittinger <cg@exept.de>
parents:
868
diff
changeset
|
181 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
182 |
numVarsInSource > numVarsInContext ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
183 |
homeNames := homeNames copyTo:numVarsInContext. |
977 | 184 |
] ifFalse:[ |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
185 |
numVarsInContext >= methodHomeContext numArgs ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
186 |
homeNames := homeNames copyTo:methodHomeContext numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
187 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
188 |
homeNames := nil |
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 |
] |
977 | 191 |
] |
785 | 192 |
] |
296
b480a51cfb5f
dont buffer values / keep context / update value (now try single stepping with a variable selected)
Claus Gittinger <cg@exept.de>
parents:
200
diff
changeset
|
193 |
] |
8516
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 |
]. |
73 | 196 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
197 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
198 |
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
|
199 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
200 |
homeNames isNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
201 |
homeNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
202 |
1 to:methodHomeContext numArgs do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
203 |
homeNames add:('mArg' , index printString) |
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 |
argsOnly ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
206 |
1 to:methodHomeContext numVars do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
207 |
homeNames add:('mVar' , index printString) |
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 |
"/ showingTemporaries ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
210 |
"/ 1 to:methodHomeContext numTemps do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
211 |
"/ homeNames add:('mTmp' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
212 |
"/ ] |
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 |
] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
215 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
216 |
showingTemporaries ifTrue:[ |
8581 | 217 |
homeNames := homeNames asOrderedCollection. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
218 |
1 to:methodHomeContext numTemps do:[:index | |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
219 |
homeNames add:('mTmp' , index printString) |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
220 |
] |
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
|
221 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
222 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
223 |
n := homeNames size. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
224 |
n < (methodHomeContext numVars + methodHomeContext numArgs) ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
225 |
"/ 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
|
226 |
"/ inlined sub-blocks. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
227 |
"/ First, generate synthetic varNames ... |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
228 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
229 |
homeNames := homeNames asOrderedCollection. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
230 |
tempNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
231 |
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
|
232 |
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
|
233 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
234 |
|
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
235 |
"/ 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
|
236 |
"/ (failes, if source is not available) |
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 |
method notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
239 |
(isDoIt and:[tempNames size > 0]) ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
240 |
"/ special for #doIt |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
241 |
"/ 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
|
242 |
blockNode := Compiler |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
243 |
blockAtLine:aContext lineNumber |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
244 |
in:nil |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
245 |
orSource:('[' , method source , '\]') withCRs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
246 |
numArgs:numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
247 |
numVars:numVars. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
248 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
249 |
blockNode := Compiler |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
250 |
blockAtLine:methodHomeContext lineNumber |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
251 |
in:method |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
252 |
orSource:nil |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
253 |
numArgs:numArgs |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
254 |
numVars:numVars. |
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 |
realTempNames := OrderedCollection new. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
258 |
[blockNode notNil] whileTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
259 |
blockNode variables notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
260 |
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
|
261 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
262 |
blockNode arguments notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
263 |
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
|
264 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
265 |
"/ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
266 |
"/ hidden temps used for loop. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
267 |
"/ |
9426 | 268 |
blockNode invocationSelector == #timesRepeat ifTrue:[ |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
269 |
realTempNames asOrderedCollection addFirst:'*loopStop*' |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
270 |
] ifFalse:[ |
9426 | 271 |
blockNode invocationSelector == #to:do: ifTrue:[ |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
272 |
realTempNames asOrderedCollection addFirst:'*loopStop*' |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
273 |
] |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
274 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
275 |
blockNode := blockNode home. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
276 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
277 |
tempNames |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
278 |
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
|
279 |
with:realTempNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
280 |
]. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
281 |
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
|
282 |
] |
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
|
283 |
]. |
1204
e2f7a2409f7d
inlined vars/args are shown as *t<i>
Claus Gittinger <cg@exept.de>
parents:
1026
diff
changeset
|
284 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
285 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
286 |
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
|
287 |
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
|
288 |
" |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
289 |
aContext isBlockContext ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
290 |
names := self namesOfBlockContext:aContext. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
291 |
hCon := aContext home. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
292 |
[hCon == methodHomeContext] whileFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
293 |
names addAll:(self namesOfBlockContext:hCon). |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
294 |
hCon := hCon home. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
295 |
]. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
296 |
names addAll:homeNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
297 |
] ifFalse:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
298 |
names := homeNames. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
299 |
]. |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
300 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
301 |
listView list:(self fieldList). |
1370
d322faba88b9
better extract of block-var-names
Claus Gittinger <cg@exept.de>
parents:
1361
diff
changeset
|
302 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
303 |
workspace contents:nil. |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
304 |
self setDoitActionIn:workspace for:aContext. |
34 | 305 |
]. |
51 | 306 |
|
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
307 |
oldSelectedName notNil ifTrue:[ |
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
308 |
|idx| |
73 | 309 |
|
11549 | 310 |
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
|
311 |
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
|
312 |
listView selectElement:oldSelectedName. |
8516
e83b1f8fe73f
reselection - keep shown entry (all locals in debugger)
Claus Gittinger <cg@exept.de>
parents:
8437
diff
changeset
|
313 |
self showSelection:idx. |
1769
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
314 |
] |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
315 |
]. |
6b904f69858f
try to reselect the same name-entry, if inspected context
Claus Gittinger <cg@exept.de>
parents:
1664
diff
changeset
|
316 |
|
11549 | 317 |
"Modified: / 03-06-2012 / 11:56:59 / cg" |
34 | 318 |
! |
319 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
320 |
namesOfBlockContext:aContext |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
321 |
|numArgs numVars argAndVarNames argNames varNames tmpNames names| |
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 |
numArgs := aContext numArgs. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
324 |
numVars := aContext numVars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
325 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
326 |
(numArgs > 0 or:[numVars > 0]) ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
327 |
argAndVarNames := aContext argAndVarNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
328 |
argAndVarNames notEmptyOrNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
329 |
argNames := argAndVarNames copyTo:numArgs. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
330 |
varNames := argAndVarNames copyFrom:numArgs+1. |
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 |
names := OrderedCollection new. |
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 |
argNames isNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
337 |
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
|
338 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
339 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
340 |
names addAll:argNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
341 |
varNames isNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
342 |
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
|
343 |
] ifFalse:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
344 |
varNames size ~~ numVars ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
345 |
varNames := varNames asOrderedCollection. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
346 |
varNames size+1 to:aContext numVars do:[:i | |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
347 |
varNames add:('var' , i printString) |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
348 |
] |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
349 |
] |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
350 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
351 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
352 |
names addAll:varNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
353 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
354 |
showingTemporaries ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
355 |
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
|
356 |
names addAll:tmpNames. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
357 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
358 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
359 |
^ names |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
360 |
! |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
361 |
|
34 | 362 |
release |
363 |
"release inspected object" |
|
364 |
||
365 |
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
|
366 |
names := nil. |
34 | 367 |
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
|
368 |
|
297
3d34ce6e2b22
oops - leftover printMessage removed
Claus Gittinger <cg@exept.de>
parents:
296
diff
changeset
|
369 |
"Modified: 14.12.1995 / 21:49:43 / cg" |
34 | 370 |
! ! |
371 |
||
73 | 372 |
!ContextInspectorView methodsFor:'initialization'! |
51 | 373 |
|
6491 | 374 |
initialize |
375 |
super initialize. |
|
376 |
showingTemporaries := false. |
|
377 |
||
378 |
! ! |
|
379 |
||
380 |
!ContextInspectorView methodsFor:'menu'! |
|
381 |
||
73 | 382 |
fieldMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
383 |
"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
|
384 |
|
1361 | 385 |
<resource: #programMenu > |
386 |
||
6491 | 387 |
|items m sel| |
388 |
||
389 |
items := #( |
|
390 |
('Copy Name or Key' #doCopyKey) |
|
391 |
('-') |
|
392 |
('Inspect' #doInspect) |
|
393 |
('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
|
394 |
). |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
395 |
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
|
396 |
items := items , #( |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
397 |
('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
|
398 |
). |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
399 |
]. |
99bd94741d5d
do not show new-inspector in menu, if there is none loaded
Claus Gittinger <cg@exept.de>
parents:
9033
diff
changeset
|
400 |
items := items , #( |
6491 | 401 |
('-') |
402 |
('Browse' #browse) |
|
403 |
). |
|
404 |
||
405 |
sel := self selection. |
|
6852 | 406 |
Error |
407 |
handle:[:ex| ] |
|
408 |
do:[ |
|
7438 | 409 |
(sel isBlock or:[sel isContext]) ifTrue:[ |
410 |
items := items , #( |
|
10437 | 411 |
('Browse Block''s Home' #browseHome) |
7438 | 412 |
). |
413 |
]. |
|
414 |
(sel isMethod) ifTrue:[ |
|
415 |
items := items , #( |
|
10437 | 416 |
('Browse Method''s Class' #browseMethodsClass) |
7438 | 417 |
). |
418 |
]. |
|
6852 | 419 |
]. |
420 |
||
7640 | 421 |
items := items , (self optionalStreamSelectionItems). |
422 |
items := items , (self optionalFilenameSelectionItems). |
|
423 |
||
6491 | 424 |
items := items , #( |
425 |
('-') |
|
426 |
). |
|
73 | 427 |
|
428 |
showingTemporaries ifFalse:[ |
|
6491 | 429 |
items := items , #( |
430 |
('Show Temporaries' #showTemporaries) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
431 |
) |
73 | 432 |
] ifTrue:[ |
6491 | 433 |
items := items , #( |
434 |
('Hide temporaries' #hideTemporaries) |
|
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
435 |
) |
73 | 436 |
]. |
437 |
||
7640 | 438 |
items := items , (self numberBaseItems). |
11630 | 439 |
items := items , (self sortOrderItems). |
7640 | 440 |
|
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
441 |
m := PopUpMenu |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
442 |
itemList:items |
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
443 |
resources:resources. |
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
444 |
|
3425 | 445 |
selectionIndex isNil ifTrue:[ |
446 |
m disableAll:#(doInspect doBasicInspect browse browseHome) |
|
447 |
] ifFalse:[ |
|
6491 | 448 |
sel isBlock ifFalse:[ |
3425 | 449 |
m disable:#browseHome |
6491 | 450 |
]. |
451 |
sel class hasImmediateInstances ifTrue:[ |
|
452 |
m disableAll:#(showReferences doNewInspect) |
|
453 |
]. |
|
3105
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
454 |
]. |
9d80b49560ca
added browse blocks home menu item
Claus Gittinger <cg@exept.de>
parents:
2957
diff
changeset
|
455 |
^ m |
1361 | 456 |
|
11630 | 457 |
"Modified: / 20-07-2012 / 10:51:12 / cg" |
73 | 458 |
! ! |
200 | 459 |
|
460 |
!ContextInspectorView methodsFor:'private'! |
|
461 |
||
647 | 462 |
defaultLabel |
4095
5bd36b14723d
labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents:
3775
diff
changeset
|
463 |
^ 'Locals' |
647 | 464 |
|
465 |
" |
|
466 |
ContextInspectorView openOn:thisContext sender |
|
467 |
" |
|
468 |
||
469 |
"Modified: 28.6.1996 / 16:07:49 / cg" |
|
470 |
! |
|
471 |
||
3775 | 472 |
displayStringForValue:someValue |
473 |
"return the values displayString" |
|
474 |
||
475 |
|sel| |
|
476 |
||
11513 | 477 |
sel := self listEntryAt:selectionIndex. |
3775 | 478 |
(sel startsWith:'-all local vars') ifTrue:[ |
479 |
^ self stringWithAllLocalValues |
|
480 |
]. |
|
481 |
||
482 |
^ super displayStringForValue:someValue |
|
11513 | 483 |
|
484 |
"Modified: / 16-05-2012 / 17:55:33 / cg" |
|
3775 | 485 |
! |
486 |
||
200 | 487 |
fieldList |
3775 | 488 |
names size == 0 ifTrue:[^ names]. |
11515 | 489 |
^ (Array with:('-', 'all local vars' allItalic)) |
490 |
, (names keysAndValuesCollect:[:idx :nm | |
|
491 |
self listEntryForName:nm value:(self valueAtIndex:idx) ]) |
|
492 |
||
493 |
"Modified: / 16-05-2012 / 18:54:59 / cg" |
|
200 | 494 |
! |
495 |
||
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
|
496 |
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
|
497 |
^ 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
|
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 |
"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
|
500 |
! |
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
|
501 |
|
200 | 502 |
setDoitActionIn:aWorkspace for:aContext |
1596
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
503 |
aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
504 |
doItAction:[:theCode | |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
505 |
Compiler |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
506 |
evaluate:theCode |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
507 |
in:aContext |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
508 |
receiver:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
509 |
notifying:aWorkspace |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
510 |
logged:true |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
511 |
ifFail:nil |
1c937a1d2d37
use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
512 |
] |
200 | 513 |
! |
514 |
||
3775 | 515 |
stringWithAllLocalValues |
516 |
|s maxLen varString| |
|
517 |
||
518 |
s := '' writeStream. |
|
519 |
maxLen := (names collect:[:eachName | eachName size]) max. |
|
520 |
names keysAndValuesDo:[:varIdx :eachLocalName | |
|
521 |
s nextPutAll:((eachLocalName , ' ') paddedTo:maxLen+1 with:$.). |
|
522 |
s nextPutAll:' : '. |
|
523 |
||
5922 | 524 |
[ |
8634
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
525 |
|s| |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
526 |
|
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
527 |
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
|
528 |
s writeLimit:100000. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
529 |
(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
|
530 |
varString := s contents. |
a37194c645be
limit printStrings (in case an instvar is ByteArray of size 80Mb)
Claus Gittinger <cg@exept.de>
parents:
8581
diff
changeset
|
531 |
"/ 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
|
532 |
] 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
|
533 |
varString := ('*** Error in displayString (%1)***' bindWith:ex description) |
5922 | 534 |
]. |
6404
f4c76a21ba34
care for local value with invalid class.
Claus Gittinger <cg@exept.de>
parents:
5922
diff
changeset
|
535 |
varString := varString ? ''. |
5922 | 536 |
|
3775 | 537 |
(varString includes:Character cr) ifTrue:[ |
538 |
varString := varString copyTo:(varString indexOf:Character cr)-1. |
|
539 |
varString := varString , '...'. |
|
540 |
]. |
|
541 |
s nextPutAll:varString. |
|
542 |
s cr. |
|
543 |
]. |
|
544 |
^ s contents |
|
545 |
! |
|
546 |
||
547 |
valueAtIndex:varIdx |
|
200 | 548 |
"helper - return the value of the selected entry" |
549 |
||
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
550 |
|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
|
551 |
|
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
|
552 |
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
|
553 |
|
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
|
554 |
argsOnly := false. |
868 | 555 |
theContext := inspectedContext. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
556 |
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
|
557 |
|
868 | 558 |
theContext isBlockContext ifTrue:[ |
559 |
values := Array withAll:(theContext argsAndVars). |
|
560 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
|
561 |
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
|
562 |
]. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
563 |
hCon := theContext home. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
564 |
[hCon == methodHomeContext] whileFalse:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
565 |
values := values , hCon argsAndVars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
566 |
(showingTemporaries and:[theContext numTemps ~~ 0]) ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
567 |
values := values , hCon temporaries |
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 |
hCon := hCon home. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
570 |
]. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
571 |
|
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
572 |
methodHomeContext notNil ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
573 |
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
|
574 |
argsOnly ifFalse:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
575 |
values := values , methodHomeContext vars. |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
576 |
(showingTemporaries and:[methodHomeContext numTemps ~~ 0])ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
577 |
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
|
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 |
]. |
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 |
]. |
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
|
581 |
] 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
|
582 |
argsOnly ifTrue:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
583 |
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
|
584 |
] ifFalse:[ |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
585 |
values := methodHomeContext argsAndVars |
1395 | 586 |
]. |
5339
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
587 |
(showingTemporaries and:[methodHomeContext numTemps ~~ 0])ifTrue:[ |
a740e2325527
also show argAndVarNames of outer blocks.
Claus Gittinger <cg@exept.de>
parents:
5148
diff
changeset
|
588 |
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
|
589 |
] |
1395 | 590 |
|
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
|
591 |
]. |
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
|
592 |
|
3775 | 593 |
^ values at:varIdx. |
200 | 594 |
|
1395 | 595 |
"Modified: / 13.1.1998 / 15:55:16 / cg" |
3775 | 596 |
! |
597 |
||
598 |
valueAtLine:lineNr |
|
599 |
"helper - return the value of the selected entry" |
|
600 |
||
601 |
|varIdx l| |
|
602 |
||
603 |
inspectedContext isNil ifTrue:[^ nil]. |
|
604 |
||
605 |
varIdx := lineNr. |
|
11513 | 606 |
l := self listEntryAt:lineNr. |
8437 | 607 |
l isNil ifTrue:[ ^nil]. |
608 |
||
609 |
(l startsWith:$-) ifTrue:[ |
|
3775 | 610 |
(l ~= '-') ifTrue:[ |
11513 | 611 |
^ self valueForSpecialLine:(self listEntryAt:lineNr) |
3775 | 612 |
]. |
613 |
]. |
|
614 |
^ self valueAtIndex:(varIdx - 1). "/ for the special var |
|
11513 | 615 |
|
616 |
"Modified: / 16-05-2012 / 17:55:57 / cg" |
|
3775 | 617 |
! |
618 |
||
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
619 |
valueAtLine:lineNr put:newValue |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
620 |
"helper - return the value of the selected entry" |
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 |
|indexOfFirstNonSpecial contextIndex| |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
623 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
624 |
inspectedContext isNil ifTrue:[^ self]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
625 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
626 |
"/ count the special lines |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
627 |
indexOfFirstNonSpecial := self fieldList findFirst:[:l | (l string startsWith:'-') not]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
628 |
indexOfFirstNonSpecial == 0 ifTrue:[ |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
629 |
^ self |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
630 |
]. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
631 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
632 |
contextIndex := lineNr - indexOfFirstNonSpecial + 1. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
633 |
|
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
634 |
"yes, you can do that with a context" |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
635 |
inspectedContext at:contextIndex put:newValue. |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
636 |
! |
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
637 |
|
3775 | 638 |
valueForSpecialLine:line |
639 |
(line startsWith:'-all local vars') ifTrue:[ |
|
640 |
^ inspectedObject |
|
641 |
]. |
|
642 |
||
643 |
self error:'unknown special line'. |
|
644 |
||
645 |
"Created: / 31.10.2001 / 09:17:45 / cg" |
|
200 | 646 |
! ! |
647 |
||
648 |
!ContextInspectorView methodsFor:'user actions'! |
|
649 |
||
650 |
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
|
651 |
"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
|
652 |
|
200 | 653 |
showingTemporaries := false. |
654 |
self inspect:inspectedContext |
|
655 |
||
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 |
"Modified: 14.12.1995 / 19:24:44 / cg" |
200 | 657 |
! |
658 |
||
659 |
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
|
660 |
"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
|
661 |
|
200 | 662 |
showingTemporaries := true. |
663 |
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
|
664 |
|
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
|
665 |
"Modified: 14.12.1995 / 19:24:49 / cg" |
200 | 666 |
! ! |
667 |
||
785 | 668 |
!ContextInspectorView class methodsFor:'documentation'! |
200 | 669 |
|
670 |
version |
|
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
671 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.80 2013-03-11 16:58:00 cg Exp $' |
9033
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
672 |
! |
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
673 |
|
abeca4d8f0f0
no need for #asText to emphasize a string
Claus Gittinger <cg@exept.de>
parents:
8690
diff
changeset
|
674 |
version_CVS |
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
675 |
^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.80 2013-03-11 16:58:00 cg Exp $' |
200 | 676 |
! ! |
12456
87fdcd23e545
class: ContextInspectorView
Claus Gittinger <cg@exept.de>
parents:
11630
diff
changeset
|
677 |