author | Claus Gittinger <cg@exept.de> |
Fri, 22 Dec 1995 23:17:17 +0100 | |
changeset 316 | 7d529dfe8a99 |
parent 303 | 1d94813f1977 |
child 317 | c6772be0b62f |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
45 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
StandardSystemView subclass:#DebugView |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
14 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
15 |
receiverInspector contextInspector contextArray selectedContext |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
16 |
catchBlock grabber traceView tracing bigStep skipLineNr |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
17 |
steppedContextAddress canAbort abortButton terminateButton |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
18 |
continueButton stepButton nextButton sendButton returnButton |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
19 |
restartButton exclusive inspecting nChainShown inspectedProcess |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
20 |
updateProcess stopButton updateButton monitorToggle stepping |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
21 |
steppedContextLineno stepForReturn actualContext inWrap' |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
22 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail' |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
23 |
poolDictionaries:'' |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
24 |
category:'Interface-Debugger' |
0 | 25 |
! |
26 |
||
29 | 27 |
!DebugView class methodsFor:'documentation'! |
28 |
||
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
45 | 32 |
All Rights Reserved |
29 | 33 |
|
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
0 | 42 |
|
29 | 43 |
documentation |
44 |
" |
|
45 |
this class implements a graphical debugger interface. |
|
46 |
The debugger usually sits on top of the faulting process, |
|
47 |
taking over its event processing. Thus only the 'stopped' process is affected; |
|
48 |
other processes continue to respond to events. |
|
49 |
||
50 |
The one exception is when an error occurs within the dispatcher process |
|
51 |
or in one of the eventhandler processes - in this case, the debugger |
|
52 |
will sit on an exclusive display connection. |
|
53 |
||
54 |
The whole debugging will be changed, once the required process primitives |
|
55 |
are available, which allow control of another processes execution |
|
56 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
57 |
to have the debugger control the debuggee (i.e. two processes) |
|
35 | 58 |
|
59 |
See additional information in 'doc/misc/debugger.doc'. |
|
53 | 60 |
|
61 |
Notice: the DebugView class caches the last used debugger in a class |
|
62 |
variable. It may happen, that a malfunctioning debugger (for example, |
|
63 |
a halfway destoyed one) is kept there. You will notice this, if a |
|
64 |
debugger comes up without showing any contents. In this case, close |
|
65 |
(or destroy) the broken debugView, and execute |
|
66 |
Debugger newDebugger |
|
67 |
which removes the cached debugger and forces creation of a new one the |
|
68 |
next time. This is a temporary workaround - the debugger will be fixed to |
|
69 |
avoid this problem. |
|
29 | 70 |
" |
71 |
! ! |
|
0 | 72 |
|
243 | 73 |
!DebugView class methodsFor:'initialization'! |
74 |
||
75 |
reinitialize |
|
76 |
self newDebugger |
|
77 |
! ! |
|
78 |
||
0 | 79 |
!DebugView class methodsFor:'instance creation'! |
80 |
||
266 | 81 |
enter |
82 |
"another way of entering the debugger" |
|
73 | 83 |
|
266 | 84 |
^ self enter:(thisContext sender) withMessage:'Debugger' |
73 | 85 |
|
266 | 86 |
"Debugger enter" |
73 | 87 |
! |
88 |
||
266 | 89 |
enter:aContext |
90 |
"enter the debugger on aContext" |
|
29 | 91 |
|
266 | 92 |
^ self enter:aContext withMessage:'Debugger' |
0 | 93 |
! |
94 |
||
29 | 95 |
enter:aContext withMessage:aString |
53 | 96 |
"enter a debugger; if this is a recursive invocation, enter |
97 |
a MiniDebugger instead. |
|
98 |
This is the standard way of entering the debugger; |
|
99 |
sent from error- and halt messages." |
|
0 | 100 |
|
93 | 101 |
|active| |
102 |
||
57 | 103 |
StepInterruptPending := nil. |
104 |
||
62 | 105 |
thisContext isRecursive ifTrue:[ |
93 | 106 |
^ MiniDebugger enterWithMessage:'recursive error in debugger'. |
62 | 107 |
]. |
108 |
||
57 | 109 |
" |
110 |
well, it could be a stepping or sending debugger up there; |
|
111 |
in this case, return to it. This happens, when a stepping process |
|
112 |
runs into an error (for example, a halt). In this case, we want the |
|
113 |
stepping debugger to come up again instead of a new one. |
|
114 |
" |
|
115 |
OpenDebuggers notNil ifTrue:[ |
|
93 | 116 |
active := Processor activeProcess. |
57 | 117 |
OpenDebuggers do:[:aDebugger | |
118 |
aDebugger notNil ifTrue:[ |
|
93 | 119 |
(aDebugger inspectedProcess == active) ifTrue:[ |
57 | 120 |
"/ 'entering stepping debugger again' printNL. |
121 |
aDebugger unstep. |
|
93 | 122 |
aDebugger setLabelFor:aString in:active. |
57 | 123 |
^ aDebugger enter:aContext. |
124 |
] |
|
125 |
] |
|
126 |
] |
|
127 |
]. |
|
128 |
||
53 | 129 |
^ self enterUnconditional:aContext withMessage:aString |
130 |
! |
|
131 |
||
266 | 132 |
enterUnconditional:aContext withMessage:aString |
133 |
"enter a debugger - do not check for recursive invocation" |
|
134 |
||
135 |
|aDebugger| |
|
136 |
||
137 |
StepInterruptPending := nil. |
|
138 |
aDebugger := self new. |
|
139 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
|
140 |
aDebugger enter:aContext. |
|
141 |
^ nil |
|
142 |
||
143 |
"nil halt" |
|
144 |
! |
|
145 |
||
146 |
enterWithMessage:aString |
|
147 |
"the standard way of entering the debugger - sent from Objects |
|
148 |
error- and halt messages" |
|
149 |
||
150 |
^ self enter:(thisContext sender) withMessage:aString |
|
151 |
||
152 |
"Debugger enterWithMessage:'hi there'" |
|
153 |
! |
|
154 |
||
155 |
lowSpaceCleanup |
|
156 |
"in low memory situations, give up cached debuggers" |
|
157 |
||
158 |
self newDebugger |
|
159 |
! |
|
160 |
||
161 |
new |
|
162 |
"return a new DebugView - return a cached debugger if it already |
|
163 |
exists" |
|
53 | 164 |
|
73 | 165 |
|debugger| |
14 | 166 |
|
266 | 167 |
" |
168 |
need a blocking debugger if no processes or |
|
169 |
or if its a timing/interrupt process |
|
170 |
(because otherwise we would not get any events here ... |
|
171 |
" |
|
172 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
173 |
CachedExclusive isNil ifTrue:[ |
|
174 |
debugger := self newExclusive |
|
175 |
] ifFalse:[ |
|
176 |
debugger := CachedExclusive. |
|
177 |
CachedExclusive := nil. |
|
178 |
]. |
|
179 |
] ifFalse:[ |
|
180 |
CachedDebugger isNil ifTrue:[ |
|
181 |
debugger := super new. |
|
182 |
debugger label:'Debugger'. |
|
183 |
debugger icon:(Form fromFile:'Debugger.xbm' resolution:100). |
|
184 |
] ifFalse:[ |
|
185 |
debugger := CachedDebugger. |
|
186 |
CachedDebugger := nil. |
|
187 |
] |
|
188 |
]. |
|
73 | 189 |
^ debugger |
190 |
! |
|
0 | 191 |
|
73 | 192 |
newDebugger |
193 |
"force creation of a new debugger" |
|
194 |
||
195 |
CachedDebugger := nil. |
|
196 |
CachedExclusive := nil. |
|
197 |
OpenDebuggers := nil. |
|
198 |
||
199 |
" |
|
200 |
DebugView newDebugger |
|
201 |
" |
|
0 | 202 |
! |
203 |
||
266 | 204 |
newExclusive |
205 |
"return a debugger for exclusive display access" |
|
206 |
||
207 |
|debugger| |
|
105 | 208 |
|
266 | 209 |
debugger := super new. |
210 |
debugger label:'Debugger'. |
|
211 |
debugger icon:(Form fromFile:'Debugger.xbm' resolution:100). |
|
212 |
debugger exclusive:true. |
|
213 |
^ debugger |
|
105 | 214 |
! |
215 |
||
29 | 216 |
openOn:aProcess |
217 |
"start a debugger on aProcess |
|
218 |
(actually not more than a good-looking inspector)" |
|
15 | 219 |
|
52 | 220 |
|aDebugger label nm| |
15 | 221 |
|
222 |
aDebugger := super new. |
|
223 |
aDebugger icon:(Form fromFile:'Debugger.xbm' resolution:100). |
|
29 | 224 |
aProcess notNil ifTrue:[ |
52 | 225 |
nm := aProcess name. |
226 |
nm notNil ifTrue:[ |
|
61 | 227 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
52 | 228 |
] ifFalse:[ |
229 |
nm := aProcess id printString |
|
230 |
]. |
|
231 |
label := 'Debugger [' , nm , ']'. |
|
29 | 232 |
] ifFalse:[ |
45 | 233 |
label := 'no process' |
29 | 234 |
]. |
235 |
aDebugger label:label. |
|
15 | 236 |
aDebugger iconLabel:'Debugger'. |
237 |
aDebugger openOn:aProcess. |
|
238 |
^ nil |
|
126 | 239 |
! ! |
240 |
||
73 | 241 |
!DebugView methodsFor:'basic'! |
242 |
||
266 | 243 |
enter |
244 |
"enter the debugger - on the sending context" |
|
245 |
||
246 |
|where| |
|
247 |
||
248 |
busy := true. |
|
249 |
||
250 |
where := thisContext. "enter" |
|
251 |
where := where sender. "the calling context" |
|
252 |
where notNil ifTrue:[ |
|
253 |
(where receiver == DebugView) ifTrue:[ |
|
254 |
where := where sender |
|
255 |
] |
|
256 |
"where is now interrupted methods context" |
|
257 |
]. |
|
258 |
^ self enter:where |
|
259 |
! |
|
260 |
||
73 | 261 |
enter:aContext |
262 |
"enter the debugger - get and display the context, then start an |
|
263 |
exclusive event loop on top of eveything else" |
|
264 |
||
265 |
|con selection m idx retval s| |
|
266 |
||
267 |
busy := true. |
|
268 |
inspecting := false. |
|
269 |
inspectedProcess := Processor activeProcess. |
|
270 |
stepping := false. |
|
271 |
bigStep := false. |
|
272 |
nChainShown := 50. |
|
273 |
||
274 |
"if debugger is entered while a box has grabbed the |
|
275 |
pointer, we must ungrab - otherwise X wont talk to |
|
276 |
us here |
|
277 |
" |
|
278 |
(grabber := device activePointerGrab) notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
279 |
device ungrabPointer |
73 | 280 |
]. |
281 |
||
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
282 |
(inspectedProcess suspendedContext isNil |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
283 |
or:[Processor isSystemProcess:inspectedProcess]) ifTrue:[ |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
284 |
terminateButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
285 |
abortButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
286 |
] ifFalse:[ |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
287 |
terminateButton enable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
288 |
abortButton enable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
289 |
]. |
73 | 290 |
|
291 |
drawableId notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
292 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
293 |
not the first time - disable buttons & menus |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
294 |
from previous life |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
295 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
296 |
terminateButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
297 |
continueButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
298 |
returnButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
299 |
restartButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
300 |
abortButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
301 |
nextButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
302 |
stepButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
303 |
sendButton turnOffWithoutRedraw. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
304 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
305 |
m := contextView middleButtonMenu. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
306 |
m notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
307 |
m disableAll:#(showMore skip skipForoReturn inspectContext). |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
308 |
] |
73 | 309 |
] ifFalse:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
310 |
self iconLabel:'Debugger'. |
132 | 311 |
]. |
312 |
||
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
313 |
windowGroup isNil ifTrue:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
314 |
windowGroup := WindowGroup new. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
315 |
windowGroup addTopView:self. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
316 |
]. |
132 | 317 |
exclusive ifFalse:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
318 |
"/ create a (modal) windowGroup for myself |
132 | 319 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
320 |
windowGroup setModal:true. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
321 |
] ifTrue:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
322 |
"/ create a windowGroup with a synchronous sensor for me |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
323 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
324 |
windowGroup sensor:(SynchronousWindowSensor new device:device). |
73 | 325 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
326 |
windowGroup setProcess:Processor activeProcess. |
73 | 327 |
|
328 |
" |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
329 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 330 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
331 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
73 | 332 |
|
333 |
" |
|
334 |
and find the one context to show initially |
|
335 |
- if we came here by a send (single step), its the top context; |
|
336 |
- if we came here by a step (i.e. bigStep), its the top context |
|
337 |
(for ifs and whiles) or the sender (for regular sends). |
|
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
338 |
- otherwise, we came here by some signal raise, and we are interested |
73 | 339 |
in the context where the raise actually occured. |
340 |
" |
|
341 |
exitAction == #step ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
342 |
selection := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
343 |
steppedContextAddress notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
344 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
345 |
if we came here by a big-step, show the method where we are |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
346 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
347 |
(ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
348 |
selection := 1 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
349 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
350 |
(ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
351 |
selection := 2 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
352 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
353 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
354 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
355 |
for bigStep, we could also be in a block below the actual method ... |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
356 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
357 |
(aContext home notNil and:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
358 |
(ObjectMemory addressOf:aContext home) == steppedContextAddress]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
359 |
selection := 1 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
360 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
361 |
(aContext sender home notNil and:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
362 |
(ObjectMemory addressOf:aContext sender home) == steppedContextAddress]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
363 |
selection := 2 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
364 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
365 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
366 |
] |
73 | 367 |
] ifFalse:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
368 |
steppedContextAddress isNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
369 |
" |
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
370 |
preselect a more interesting context, (where halt/raise was ...) |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
371 |
" |
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
372 |
selection := self interestingContextFrom:aContext. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
373 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
374 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
375 |
if we came here by a big-step, show the method where we are |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
376 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
377 |
(ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
378 |
selection := 1 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
379 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
380 |
(ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
381 |
selection := 2 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
382 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
383 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
384 |
] |
73 | 385 |
]. |
386 |
||
387 |
selection notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
388 |
self showSelection:selection. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
389 |
contextView selection:selection. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
390 |
selection > 1 ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
391 |
contextView scrollToLine:(selection - 1) |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
392 |
] |
73 | 393 |
]. |
394 |
||
395 |
m := contextView middleButtonMenu. |
|
396 |
m notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
397 |
canAbort := inspecting or:[Object abortSignal isHandled]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
398 |
canAbort ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
399 |
abortButton enable. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
400 |
m enable:#doAbort. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
401 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
402 |
abortButton disable. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
403 |
m disable:#doAbort. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
404 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
405 |
exclusive ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
406 |
terminateButton disable. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
407 |
m disable:#doTerminate. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
408 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
409 |
terminateButton enable. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
410 |
m enable:#doTerminate. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
411 |
] |
73 | 412 |
]. |
413 |
||
414 |
" |
|
415 |
drawableId is nil, if this is a new debugger. Then do a realize. |
|
416 |
Otherwise, its probably better to do a rerealize, which shows the |
|
417 |
view at the previous position, without a need for the user to set the |
|
418 |
position again |
|
419 |
" |
|
420 |
drawableId notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
421 |
self rerealize |
73 | 422 |
] ifFalse:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
423 |
self realize. |
73 | 424 |
]. |
425 |
||
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
426 |
exclusive ifTrue:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
427 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
428 |
Debugging system process `' , (inspectedProcess nameOrId) printString , '''. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
429 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
430 |
This is a modal debugger - all event processing is stopped.. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
431 |
Therefore, you cannot interact with other views or |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
432 |
open any other tools while this debugger is active. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
433 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
434 |
Also, there is no event processing (redraw) for other views.' |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
435 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
436 |
|
73 | 437 |
" |
438 |
bring us to the top |
|
439 |
" |
|
440 |
self raise. |
|
105 | 441 |
device flush. |
73 | 442 |
|
443 |
canContinue := true. |
|
444 |
exitAction := nil. |
|
445 |
||
446 |
" |
|
447 |
enter private event handling loop. This is left (and we come back here again) |
|
448 |
when any button was pressed which requires continuation of the debuggee or |
|
449 |
closedown of the debugger. |
|
450 |
" |
|
451 |
||
132 | 452 |
[self controlLoop] valueOnUnwindDo:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
453 |
windowGroup notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
454 |
windowGroup setProcess:nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
455 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
456 |
self destroy |
132 | 457 |
]. |
73 | 458 |
|
459 |
" |
|
460 |
release all context stuff. |
|
461 |
This is required to avoid keeping references to the debuggees objects |
|
462 |
forever. (since the debugger is reused for faster startup next time) |
|
463 |
" |
|
464 |
contextArray := nil. |
|
465 |
codeView acceptAction:nil. |
|
466 |
contextView contents:nil. |
|
467 |
||
468 |
(exitAction ~~ #step) ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
469 |
receiverInspector release. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
470 |
contextInspector release. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
471 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
472 |
self unrealize. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
473 |
device flush. |
73 | 474 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
475 |
(exitAction == #abort) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
476 |
self cacheMyself. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
477 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
478 |
have to catch errors occuring in unwind-blocks |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
479 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
480 |
Object errorSignal handle:[:ex | |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
481 |
'ignored error while unwinding: ' errorPrint. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
482 |
ex errorString errorPrintNL. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
483 |
ex proceed |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
484 |
] do:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
485 |
Object abortSignal raise. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
486 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
487 |
'abort failed' errorPrintNL |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
488 |
]. |
61 | 489 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
490 |
(exitAction == #return) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
491 |
selectedContext notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
492 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
493 |
if there is a selection in the codeView, |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
494 |
evaluate it and use the result as return value |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
495 |
" |
73 | 496 |
"/ disabled for now, there is almost always a selection (the current line) |
497 |
"/ and that is syntactically incorrect ... |
|
498 |
"/ ... leading to a popup warning from the codeView |
|
499 |
"/ |
|
500 |
"/ codeView hasSelection ifTrue:[ |
|
501 |
"/ s := codeView selection asString. |
|
502 |
"/ Object errorSignal handle:[:ex | |
|
503 |
"/ 'DEBUGGER: error - returning nil' printNL. |
|
504 |
"/ retval := nil. |
|
505 |
"/ ex return |
|
506 |
"/ ] do:[ |
|
507 |
"/ retval := codeView doItAction value:s. |
|
508 |
"/ ]. |
|
509 |
"/ ]. |
|
510 |
||
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
511 |
con := selectedContext. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
512 |
self cacheMyself. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
513 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
514 |
have to catch errors occuring in unwind-blocks |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
515 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
516 |
Object errorSignal handle:[:ex | |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
517 |
'ignored error while unwinding: ' errorPrint. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
518 |
ex errorString errorPrintNL. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
519 |
ex proceed |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
520 |
] do:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
521 |
con unwind:retval. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
522 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
523 |
'cannot return from selected context' errorPrintNL |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
524 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
525 |
]. |
73 | 526 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
527 |
(exitAction == #restart) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
528 |
selectedContext notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
529 |
con := selectedContext. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
530 |
self cacheMyself. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
531 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
532 |
have to catch errors occuring in unwind-blocks |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
533 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
534 |
Object errorSignal handle:[:ex | |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
535 |
'ignored error while unwinding: ' errorPrint. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
536 |
ex errorString errorPrintNL. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
537 |
ex proceed |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
538 |
] do:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
539 |
con unwindAndRestart. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
540 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
541 |
'cannot restart selected context' errorPrintNL |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
542 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
543 |
]. |
73 | 544 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
545 |
(exitAction == #quickTerminate) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
546 |
self cacheMyself. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
547 |
Processor activeProcess terminateNoSignal |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
548 |
]. |
73 | 549 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
550 |
(exitAction == #terminate) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
551 |
self cacheMyself. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
552 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
553 |
have to catch errors occuring in unwind-blocks |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
554 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
555 |
Object errorSignal handle:[:ex | |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
556 |
'ignored error while unwinding: ' errorPrint. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
557 |
ex errorString errorPrintNL. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
558 |
ex proceed |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
559 |
] do:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
560 |
Processor activeProcess terminate. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
561 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
562 |
'cannot terminate process' errorPrintNL |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
563 |
] |
73 | 564 |
]. |
565 |
||
566 |
selectedContext := actualContext := nil. |
|
567 |
||
568 |
grabber notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
569 |
device grabPointerInView:grabber. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
570 |
grabber := nil. |
61 | 571 |
]. |
73 | 572 |
|
573 |
(exitAction == #step) ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
574 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
575 |
schedule another stepInterrupt |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
576 |
- must enter myself into the collection of open debuggers, |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
577 |
in case the stepping process comes back again via a halt or signal |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
578 |
before the step is finished. In this case, the stepping debugger should |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
579 |
come up (instead of a new one) |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
580 |
- must flush caches since optimized methods not always |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
581 |
look for pending interrupts |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
582 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
583 |
OpenDebuggers isNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
584 |
OpenDebuggers := WeakArray with:self |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
585 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
586 |
(OpenDebuggers includes:self) ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
587 |
idx := OpenDebuggers identityIndexOf:nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
588 |
idx ~~ 0 ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
589 |
OpenDebuggers at:idx put:self |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
590 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
591 |
OpenDebuggers := OpenDebuggers copyWith:self |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
592 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
593 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
594 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
595 |
self label:'single stepping - please wait ...'. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
596 |
stepping := true. |
73 | 597 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
598 |
ObjectMemory stepInterruptHandler:self. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
599 |
stepForReturn ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
600 |
ObjectMemory flushInlineCaches. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
601 |
StepInterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
602 |
InterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
603 |
InStepInterrupt := nil |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
604 |
] |
73 | 605 |
] ifFalse:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
606 |
OpenDebuggers notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
607 |
idx := OpenDebuggers identityIndexOf:self. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
608 |
idx ~~ 0 ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
609 |
OpenDebuggers at:idx put:nil |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
610 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
611 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
612 |
self cacheMyself. |
73 | 613 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
614 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
615 |
"Created: 24.11.1995 / 19:52:54 / cg" |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
616 |
"Modified: 22.12.1995 / 23:16:12 / cg" |
73 | 617 |
! |
618 |
||
619 |
openOn:aProcess |
|
620 |
"enter the debugger on a process - |
|
621 |
in this case, we are just inspecting the context chain of the process, |
|
622 |
not running on top of the debugged process, but as a separate |
|
623 |
one. (think of it as an inspector showing more detail, and offering |
|
624 |
some more control operations)" |
|
625 |
||
127 | 626 |
|bpanel dummy| |
73 | 627 |
|
628 |
busy := true. |
|
629 |
bigStep := false. |
|
630 |
inspecting := true. |
|
631 |
inspectedProcess := aProcess. |
|
632 |
nChainShown := 50. |
|
633 |
||
634 |
bpanel := abortButton superView. |
|
635 |
||
636 |
stopButton := Button new. |
|
637 |
stopButton label:(resources at:'stop'); |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
638 |
action:[self doStop]. |
73 | 639 |
bpanel addSubView:stopButton after:continueButton. |
640 |
||
92 | 641 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 642 |
dummy borderWidth:0; level:0. |
61 | 643 |
|
73 | 644 |
"/ stepButton destroy. |
645 |
"/ sendButton destroy. |
|
646 |
||
647 |
updateButton := Button |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
648 |
label:(resources at:'update') |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
649 |
action:[self updateContext] |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
650 |
in:bpanel. |
73 | 651 |
monitorToggle := Toggle in:bpanel. |
652 |
monitorToggle label:(resources at:'monitor'). |
|
653 |
monitorToggle pressAction:[self autoUpdateOn]. |
|
654 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
655 |
||
656 |
"can only look into process - context chain is not active" |
|
657 |
canContinue := true. |
|
658 |
||
659 |
terminateButton enable. |
|
660 |
abortButton enable. |
|
661 |
||
662 |
sendButton disable. |
|
663 |
stepButton disable. |
|
78 | 664 |
nextButton disable. |
73 | 665 |
"/ continueButton disable. |
666 |
"/ returnButton disable. |
|
667 |
"/ restartButton disable. |
|
668 |
||
669 |
aProcess isNil ifTrue:[ |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
670 |
terminateButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
671 |
abortButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
672 |
continueButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
673 |
returnButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
674 |
restartButton disable. |
73 | 675 |
] ifFalse:[ |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
676 |
(aProcess suspendedContext isNil |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
677 |
or:[Processor isSystemProcess:aProcess]) ifTrue:[ |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
678 |
terminateButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
679 |
abortButton disable. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
680 |
]. |
73 | 681 |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
682 |
self setContext:aProcess suspendedContext. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
683 |
|
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
684 |
catchBlock := [ |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
685 |
catchBlock := nil. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
686 |
contextArray := nil. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
687 |
selectedContext := actualContext := nil. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
688 |
(exitAction == #terminate) ifTrue:[ |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
689 |
aProcess terminate. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
690 |
]. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
691 |
(exitAction == #quickTerminate) ifTrue:[ |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
692 |
aProcess terminateNoSignal. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
693 |
]. |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
694 |
super destroy |
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
695 |
]. |
73 | 696 |
]. |
697 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
698 |
|
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
699 |
"Modified: 22.12.1995 / 23:04:32 / cg" |
266 | 700 |
! ! |
701 |
||
702 |
!DebugView methodsFor:'help'! |
|
703 |
||
704 |
helpTextFor:aComponent |
|
705 |
|s| |
|
706 |
||
707 |
aComponent == abortButton ifTrue:[ |
|
708 |
s := 'HELP_ABORT' |
|
709 |
]. |
|
710 |
aComponent == terminateButton ifTrue:[ |
|
711 |
s := 'HELP_TERMINATE' |
|
712 |
]. |
|
713 |
aComponent == continueButton ifTrue:[ |
|
714 |
s := 'HELP_CONTINUE' |
|
715 |
]. |
|
716 |
aComponent == stepButton ifTrue:[ |
|
717 |
s := 'HELP_STEP' |
|
718 |
]. |
|
719 |
aComponent == nextButton ifTrue:[ |
|
720 |
s := 'HELP_NEXT' |
|
721 |
]. |
|
722 |
aComponent == stepButton ifTrue:[ |
|
723 |
s := 'HELP_STEP' |
|
724 |
]. |
|
725 |
aComponent == sendButton ifTrue:[ |
|
726 |
s := 'HELP_SEND' |
|
727 |
]. |
|
728 |
aComponent == returnButton ifTrue:[ |
|
729 |
s := 'HELP_RETURN' |
|
730 |
]. |
|
731 |
aComponent == restartButton ifTrue:[ |
|
732 |
s := 'HELP_RESTART' |
|
733 |
]. |
|
734 |
aComponent == contextView ifTrue:[ |
|
735 |
s := 'HELP_WALKBACK' |
|
736 |
]. |
|
737 |
aComponent == codeView ifTrue:[ |
|
738 |
s := 'HELP_CODEVIEW' |
|
739 |
]. |
|
740 |
aComponent == monitorToggle ifTrue:[ |
|
741 |
s := 'HELP_MONITOR' |
|
742 |
]. |
|
743 |
aComponent == updateButton ifTrue:[ |
|
744 |
s := 'HELP_UPDATE' |
|
745 |
]. |
|
746 |
aComponent == stopButton ifTrue:[ |
|
747 |
s := 'HELP_STOP' |
|
748 |
]. |
|
749 |
(aComponent isSubViewOf:receiverInspector) ifTrue:[ |
|
750 |
s := 'HELP_REC_INSP' |
|
751 |
]. |
|
752 |
(aComponent isSubViewOf:contextInspector) ifTrue:[ |
|
753 |
s := 'HELP_CON_INSP' |
|
754 |
]. |
|
755 |
||
756 |
s notNil ifTrue:[ |
|
757 |
^ resources string:s |
|
758 |
]. |
|
759 |
^ nil |
|
760 |
||
761 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
762 |
! ! |
|
763 |
||
764 |
!DebugView methodsFor:'initialization'! |
|
765 |
||
766 |
addToCurrentProject |
|
767 |
"ignored here" |
|
768 |
||
769 |
^ self |
|
770 |
! |
|
771 |
||
772 |
createOnTop |
|
773 |
^ false "true" |
|
73 | 774 |
! |
775 |
||
266 | 776 |
initialize |
777 |
|v panel hpanel bpanel separator| |
|
778 |
||
779 |
super initialize. |
|
780 |
||
781 |
font := font on:device. |
|
782 |
||
783 |
busy := false. |
|
784 |
exclusive := false. |
|
785 |
inspecting := false. |
|
786 |
exitAction := nil. |
|
787 |
bigStep := false. |
|
788 |
canContinue := false. |
|
789 |
canAbort := false. |
|
790 |
||
791 |
bpanel := HorizontalPanelView |
|
792 |
"/ origin:(0.0 @ 0.0) |
|
793 |
"/ extent:(1.0 @ (font height * 2)) |
|
794 |
in:self. |
|
795 |
bpanel horizontalLayout:#leftSpace. |
|
796 |
bpanel verticalSpace:ViewSpacing // 2. |
|
797 |
||
798 |
terminateButton := Button |
|
799 |
label:(resources at:'terminate') |
|
800 |
action:[terminateButton turnOffWithoutRedraw. self doTerminate] |
|
801 |
in:bpanel. |
|
802 |
separator := View extent:(10 @ 5) in:bpanel. |
|
803 |
separator borderWidth:0; level:0. |
|
804 |
||
805 |
abortButton := Button |
|
806 |
label:(resources at:'abort') |
|
807 |
action:[abortButton turnOffWithoutRedraw. self doAbort] |
|
808 |
in:bpanel. |
|
809 |
returnButton := Button |
|
810 |
label:(resources at:'return') |
|
811 |
action:[returnButton turnOff. self doReturn] |
|
812 |
in:bpanel. |
|
813 |
||
814 |
restartButton := Button |
|
815 |
label:(resources at:'restart') |
|
816 |
action:[restartButton turnOff. self doRestart] |
|
817 |
in:bpanel. |
|
818 |
||
819 |
separator := View extent:(10 @ 5) in:bpanel. |
|
820 |
separator borderWidth:0; level:0. |
|
73 | 821 |
|
266 | 822 |
continueButton := Button |
823 |
label:(resources at:'continue') |
|
824 |
action:[continueButton turnOffWithoutRedraw. self doContinue] |
|
825 |
in:bpanel. |
|
826 |
||
827 |
separator := View extent:(10 @ 5) in:bpanel. |
|
828 |
separator borderWidth:0; level:0. |
|
829 |
||
830 |
nextButton := Button |
|
831 |
label:(resources at:'next') |
|
832 |
action:[stepButton turnOff. self doNext] |
|
833 |
in:bpanel. |
|
834 |
stepButton := Button |
|
835 |
label:(resources at:'step') |
|
836 |
action:[stepButton turnOff. self doStep] |
|
837 |
in:bpanel. |
|
838 |
sendButton := Button |
|
839 |
label:(resources at:'send') |
|
840 |
action:[sendButton turnOff. self doSend] |
|
841 |
in:bpanel. |
|
842 |
||
843 |
bpanel origin:(0.0 @ 0.0) |
|
844 |
extent:(1.0 @ (bpanel preferredExtent y)). |
|
73 | 845 |
|
266 | 846 |
panel := VariableVerticalPanel |
847 |
origin:(0.0 @ bpanel height) |
|
848 |
corner:(1.0 @ 1.0) |
|
849 |
in:self. |
|
850 |
||
851 |
v := ScrollableView for:SelectionInListView in:panel. |
|
852 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
853 |
||
854 |
contextView := v scrolledView. |
|
855 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
856 |
||
857 |
v := ScrollableView for:CodeView in:panel. |
|
858 |
v origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
859 |
||
860 |
codeView := v scrolledView. |
|
861 |
||
862 |
hpanel := VariableHorizontalPanel in:panel. |
|
863 |
hpanel origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
864 |
||
865 |
receiverInspector := InspectorView |
|
866 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
|
867 |
in:hpanel. |
|
868 |
||
869 |
contextInspector := ContextInspectorView |
|
870 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
|
871 |
in:hpanel |
|
872 |
! |
|
873 |
||
874 |
initializeMiddleButtonMenu |
|
875 |
|labels m| |
|
73 | 876 |
|
266 | 877 |
labels := resources array:#( |
878 |
'show more' |
|
879 |
'-' |
|
880 |
'skip' |
|
881 |
'-' |
|
882 |
" |
|
883 |
'continue' |
|
884 |
'terminate' |
|
885 |
'abort' |
|
886 |
'-' |
|
887 |
'step' |
|
888 |
'send' |
|
889 |
'-' |
|
890 |
'return' |
|
891 |
'restart' |
|
892 |
'-' |
|
893 |
" |
|
894 |
'remove breakpoint' |
|
895 |
'remove all trace & breakpoints' |
|
896 |
'-' |
|
897 |
'browse' |
|
898 |
'browse class' |
|
899 |
'browse class hierarchy' |
|
900 |
'browse full class protocol' |
|
901 |
'implementors' |
|
902 |
'senders' |
|
903 |
'-' |
|
904 |
'inspect context' |
|
905 |
'copy walkback text' |
|
906 |
'-' |
|
907 |
'quickTerminate' |
|
908 |
'=' |
|
909 |
'exit smalltalk (no confirmation)' |
|
910 |
). |
|
911 |
||
912 |
m := (PopUpMenu |
|
913 |
labels:labels |
|
914 |
selectors:#( |
|
915 |
showMore |
|
916 |
nil |
|
917 |
skip |
|
918 |
nil |
|
919 |
" |
|
920 |
doContinue |
|
921 |
doTerminate |
|
922 |
doAbort |
|
923 |
nil |
|
924 |
doStep |
|
925 |
doSend |
|
926 |
nil |
|
927 |
doReturn |
|
928 |
doRestart |
|
929 |
nil |
|
930 |
" |
|
931 |
removeBreakpoint |
|
932 |
removeAllBreakpoints |
|
933 |
nil |
|
934 |
browse |
|
935 |
browseClass |
|
936 |
browseClassHierarchy |
|
937 |
browseFullClassProtocol |
|
938 |
implementors |
|
939 |
senders |
|
940 |
nil |
|
941 |
inspectContext |
|
942 |
copyWalkbackText |
|
943 |
nil |
|
944 |
quickTerminate |
|
945 |
nil |
|
946 |
exit |
|
947 |
) |
|
948 |
receiver:self |
|
949 |
for:contextView). |
|
950 |
||
951 |
contextView middleButtonMenu:m. |
|
952 |
||
953 |
inspecting ifTrue:[ |
|
954 |
m notNil ifTrue:[ |
|
955 |
m disableAll:#(doTraceStep removeBreakpoint browse browseClass |
|
956 |
browseClassHierarchy browseFullClassProtocol |
|
957 |
implementors senders inspectContext skip). |
|
958 |
]. |
|
959 |
] |
|
960 |
||
961 |
"Modified: 22.11.1995 / 21:40:33 / cg" |
|
962 |
! |
|
963 |
||
964 |
realize |
|
965 |
super realize. |
|
966 |
"/ exclusive ifTrue:[ |
|
967 |
"/ windowGroup := nil |
|
968 |
"/ ]. |
|
969 |
||
970 |
inspecting ifTrue:[ |
|
971 |
inspectedProcess notNil ifTrue:[ |
|
972 |
" |
|
973 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
974 |
to run between mine and the debugged processes prio) |
|
975 |
" |
|
976 |
Processor activeProcess |
|
977 |
priority:(inspectedProcess priority + 2 min:16). |
|
73 | 978 |
] |
266 | 979 |
] |
980 |
! |
|
981 |
||
982 |
setLabelFor:aMessage in:aProcess |
|
983 |
|l nm| |
|
984 |
||
985 |
l := aMessage , ' ('. |
|
986 |
nm := aProcess name. |
|
987 |
nm notNil ifTrue:[ |
|
988 |
l := l , (nm contractTo:17) , ''. |
|
73 | 989 |
]. |
266 | 990 |
l := l , '[' , aProcess id printString , '])'. |
991 |
self label:l. |
|
0 | 992 |
! ! |
993 |
||
994 |
!DebugView methodsFor:'interrupt handling'! |
|
995 |
||
996 |
stepInterrupt |
|
57 | 997 |
|where here s isWrap method lastWrappedConAddr wrappedMethod inBlock left ignore| |
0 | 998 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
999 |
"/ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1000 |
"/ should no longer happen |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1001 |
"/ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1002 |
stepForReturn ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1003 |
self enter:thisContext sender. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1004 |
^ self |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1005 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1006 |
|
52 | 1007 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1008 |
'stray step interrupt' errorPrintNL. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1009 |
^ self |
52 | 1010 |
]. |
1011 |
||
29 | 1012 |
" |
57 | 1013 |
kludge to hide breakpoint wrappers in the context list: |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1014 |
check if we are in a wrapper methods hidden setup-sequence |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1015 |
if so, ignore the interrupt and continue single sending |
29 | 1016 |
" |
1017 |
here := thisContext. "stepInterrupt" |
|
1018 |
here := here sender. "the interrupted context" |
|
1019 |
||
57 | 1020 |
"/ '*******' printNL. |
29 | 1021 |
"/ 'here in ' print. |
1022 |
"/ ((ObjectMemory addressOf:here) printStringRadix:16)print. '' printNL. |
|
10 | 1023 |
|
29 | 1024 |
where := here. |
1025 |
isWrap := false. |
|
57 | 1026 |
left := false. |
1027 |
||
1028 |
inWrap ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1029 |
wrappedMethod := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1030 |
5 timesRepeat:[ |
29 | 1031 |
"/ where selector printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1032 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1033 |
method := where method. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1034 |
(method notNil and:[method isWrapped]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1035 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1036 |
in a wrapper method |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1037 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1038 |
wrappedMethod ~~ method ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1039 |
wrappedMethod := method. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1040 |
lastWrappedConAddr := ObjectMemory addressOf:where. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1041 |
where sender receiver == method originalMethod ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1042 |
isWrap := true. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1043 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1044 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1045 |
(ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[ |
57 | 1046 |
"/ 'change stepCon from: ' print. |
1047 |
"/ (steppedContextAddress printStringRadix:16)print. |
|
1048 |
"/ ' to: ' print. |
|
1049 |
"/ (lastWrappedConAddr printStringRadix:16)printNL. |
|
1050 |
||
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1051 |
inWrap := false. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1052 |
steppedContextAddress := lastWrappedConAddr |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1053 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1054 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1055 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1056 |
where := where sender |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1057 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1058 |
]. |
29 | 1059 |
]. |
1060 |
||
1061 |
isWrap ifTrue:[ |
|
1062 |
"/ 'ignore wrap' printNL. |
|
57 | 1063 |
"/ ' ' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1064 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1065 |
ignore, while in wrappers hidden setup |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1066 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1067 |
where := nil. here := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1068 |
ObjectMemory flushInlineCaches. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1069 |
StepInterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1070 |
InterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1071 |
InStepInterrupt := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1072 |
^ nil |
29 | 1073 |
]. |
1074 |
||
57 | 1075 |
inBlock := false. |
1076 |
||
29 | 1077 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1078 |
is this for a send or a step/next ? |
29 | 1079 |
" |
1080 |
bigStep ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1081 |
" |
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
1082 |
a step or next - ignore all contexts below the interesting one |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1083 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1084 |
where := here. "the interrupted context" |
57 | 1085 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1086 |
where home notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1087 |
"/ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1088 |
"/ in a block called by 'our' context ? |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1089 |
"/ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1090 |
(ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[ |
57 | 1091 |
"/ '*block*' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1092 |
inBlock := true |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1093 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1094 |
]. |
57 | 1095 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1096 |
(ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1097 |
where := where sender. |
57 | 1098 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1099 |
where home notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1100 |
(ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[ |
57 | 1101 |
"/ '*block*' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1102 |
inBlock := true. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1103 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1104 |
]. |
57 | 1105 |
|
1106 |
"/ 'looking for ' print. |
|
29 | 1107 |
"/ (steppedContextAddress printStringRadix:16)print. '' printNL. |
57 | 1108 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1109 |
(ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1110 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1111 |
check if we are in a context below steppedContext |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1112 |
(i.e. if steppedContext can be reached from |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1113 |
interrupted context. Not using context-ref but its |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1114 |
address to avoid creation of many useless contexts.) |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1115 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1116 |
inBlock ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1117 |
[where notNil] whileTrue:[ |
29 | 1118 |
"/ ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
1119 |
"/ where selector printNL. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1120 |
(ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[ |
57 | 1121 |
"/ 'found it - below; ignore' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1122 |
" |
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
1123 |
found the interesting context somwehere up in the |
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
1124 |
chain. We seem to be still below the interesting one ... |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1125 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1126 |
tracing == true ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1127 |
here printString printNewline |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1128 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1129 |
where := nil. here := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1130 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1131 |
yes, a context below |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1132 |
- continue and schedule another stepInterrupt. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1133 |
Must flush caches since optimized methods not always |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1134 |
look for pending interrupts |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1135 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1136 |
ObjectMemory flushInlineCaches. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1137 |
StepInterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1138 |
InterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1139 |
InStepInterrupt := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1140 |
^ nil |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1141 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1142 |
where := where sender |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1143 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1144 |
s := 'left stepped method'. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1145 |
left := true. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1146 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1147 |
] ifTrue:[ |
29 | 1148 |
"/ 'found it right in sender' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1149 |
s := 'after step' |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1150 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1151 |
] ifTrue:[ |
29 | 1152 |
"/ 'found it right away' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1153 |
s := 'after step' |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1154 |
]. |
0 | 1155 |
] ifFalse:[ |
57 | 1156 |
"/ ' send' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1157 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1158 |
a send |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1159 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1160 |
steppedContextAddress := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1161 |
s := 'after send' |
0 | 1162 |
]. |
7 | 1163 |
|
57 | 1164 |
inBlock ifTrue:[ |
1165 |
"/ 'inBlock' printNL. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1166 |
s := 'in block'. |
57 | 1167 |
]. |
1168 |
||
1169 |
"/ where notNil ifTrue:[ |
|
1170 |
"/ '(' print. steppedContextLineno print. ') ' print. |
|
1171 |
"/ where print. |
|
1172 |
"/ '[' print. where lineNumber print. ']' printNL. |
|
1173 |
"/ ]. |
|
1174 |
||
1175 |
ignore := false. |
|
78 | 1176 |
|
57 | 1177 |
(bigStep |
78 | 1178 |
and:[steppedContextLineno notNil |
57 | 1179 |
and:[where notNil |
78 | 1180 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
57 | 1181 |
"/ 'same line - ignored' printNL. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1182 |
ignore := true |
57 | 1183 |
]. |
1184 |
||
1185 |
(left not |
|
1186 |
and:[skipLineNr notNil |
|
1187 |
and:[where lineNumber ~~ skipLineNr]]) ifTrue:[ |
|
1188 |
"/ 'skip (' print. skipLineNr print. ' unreached - ignored' printNL. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1189 |
ignore := true |
57 | 1190 |
]. |
1191 |
||
1192 |
ignore ifTrue:[ |
|
1193 |
"/' ' printNL. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1194 |
where := nil. here := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1195 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1196 |
yes, a context below |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1197 |
- continue and schedule another stepInterrupt. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1198 |
Must flush caches since optimized methods not always |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1199 |
look for pending interrupts |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1200 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1201 |
ObjectMemory flushInlineCaches. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1202 |
StepInterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1203 |
InterruptPending := 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1204 |
InStepInterrupt := nil. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1205 |
^ nil |
57 | 1206 |
]. |
1207 |
||
1208 |
"/ ' ' printNL. |
|
1209 |
||
29 | 1210 |
name := Processor activeProcess nameOrId. |
7 | 1211 |
self label:(s , ' (process: ' , name , ')'). |
1212 |
||
57 | 1213 |
tracing := false. |
1214 |
bigStep := false. |
|
1215 |
||
0 | 1216 |
"release refs to context" |
1217 |
where := nil. here := nil. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1218 |
self enter:thisContext sender |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1219 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1220 |
"Modified: 14.12.1995 / 21:46:20 / cg" |
0 | 1221 |
! ! |
1222 |
||
266 | 1223 |
!DebugView methodsFor:'menu / button actions'! |
1224 |
||
1225 |
autoUpdateOff |
|
1226 |
"stop the update process" |
|
1227 |
||
1228 |
updateProcess notNil ifTrue:[ |
|
1229 |
monitorToggle lampColor:(Color yellow). |
|
1230 |
updateProcess terminate. |
|
1231 |
updateProcess := nil |
|
1232 |
] |
|
1233 |
! |
|
1234 |
||
1235 |
autoUpdateOn |
|
1236 |
"fork a subprocess which updates the contextList in regular intervals" |
|
1237 |
||
1238 |
updateProcess isNil ifTrue:[ |
|
1239 |
updateProcess := |
|
1240 |
[ |
|
1241 |
[true] whileTrue:[ |
|
1242 |
monitorToggle showLamp ifTrue:[ |
|
1243 |
monitorToggle lampColor:(Color yellow). |
|
1244 |
] ifFalse:[ |
|
1245 |
monitorToggle activeForegroundColor:Color black. |
|
1246 |
]. |
|
1247 |
(Delay forSeconds:0.25) wait. |
|
1248 |
self updateContext. |
|
1249 |
monitorToggle showLamp ifTrue:[ |
|
1250 |
monitorToggle lampColor:(Color red). |
|
1251 |
] ifFalse:[ |
|
1252 |
monitorToggle activeForegroundColor:Color red. |
|
1253 |
]. |
|
1254 |
(Delay forSeconds:0.25) wait. |
|
1255 |
self updateContext. |
|
1256 |
] |
|
1257 |
] forkAt:(Processor activePriority - 1) |
|
1258 |
] |
|
1259 |
||
1260 |
! |
|
1261 |
||
1262 |
browse |
|
1263 |
|w| |
|
1264 |
||
1265 |
w := selectedContext method who. |
|
1266 |
SystemBrowser openInClass:(w at:1) selector:(w at:2). |
|
1267 |
||
1268 |
"Created: 22.11.1995 / 21:27:01 / cg" |
|
1269 |
! |
|
1270 |
||
1271 |
browseClass |
|
1272 |
SystemBrowser browseClass:(selectedContext method who at:1). |
|
1273 |
! |
|
1274 |
||
1275 |
browseClassHierarchy |
|
1276 |
SystemBrowser browseClassHierarchy:(selectedContext method who at:1). |
|
1277 |
! |
|
1278 |
||
1279 |
browseFullClassProtocol |
|
1280 |
SystemBrowser browseFullClassProtocol:(selectedContext method who at:1). |
|
1281 |
! |
|
1282 |
||
1283 |
copyWalkbackText |
|
1284 |
"place the contents of the walkback view into the copy-paste buffer. |
|
1285 |
This allows pasting it into some other view for printing ..." |
|
1286 |
||
1287 |
self setTextSelection:(contextArray collect:[:con | con fullPrintString]) asStringCollection |
|
1288 |
||
1289 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
1290 |
! |
|
1291 |
||
1292 |
doAbort |
|
1293 |
"abort - send Object>>abortSignal, which is usually cought |
|
1294 |
at save places (for example: in the event loop) and returns back |
|
1295 |
from whatever the process is doing, but does not terminate it." |
|
1296 |
||
1297 |
inspecting ifTrue:[ |
|
1298 |
inspectedProcess isDead ifTrue:[ |
|
1299 |
self showTerminated. |
|
1300 |
^ self |
|
1301 |
]. |
|
1302 |
(Object abortSignal isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
1303 |
self showError:'** the process does not handle the abort signal **' |
|
1304 |
] ifTrue:[ |
|
1305 |
self interruptProcessWith:[Object abortSignal raise]. |
|
1306 |
]. |
|
1307 |
^ self |
|
1308 |
]. |
|
1309 |
||
1310 |
steppedContextAddress := nil. |
|
1311 |
haveControl := false. |
|
1312 |
exitAction := #abort. |
|
1313 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1314 |
"exit private event-loop" |
|
1315 |
catchBlock notNil ifTrue:[ |
|
1316 |
abortButton turnOff. |
|
1317 |
catchBlock value. |
|
1318 |
'DEBUGGER: oops, abort failed' errorPrintNL. |
|
1319 |
] |
|
1320 |
]. |
|
1321 |
^ self. |
|
1322 |
||
1323 |
"obsolete ..." |
|
1324 |
"/ Processor activeProcess id == 0 ifTrue:[ |
|
1325 |
"/ "dont allow termination of main-thread" |
|
1326 |
"/ exitAction := #abort |
|
1327 |
"/ ] ifFalse:[ |
|
1328 |
"/ exitAction := #terminate |
|
1329 |
"/ ] |
|
1330 |
! |
|
1331 |
||
1332 |
doContinue |
|
1333 |
"continue from menu" |
|
1334 |
||
1335 |
inspecting ifTrue:[ |
|
1336 |
self processPerform:#resume. |
|
1337 |
^ self |
|
1338 |
]. |
|
1339 |
canContinue ifTrue:[ |
|
1340 |
steppedContextAddress := nil. |
|
1341 |
tracing := false. |
|
1342 |
haveControl := false. |
|
1343 |
exitAction := #continue. |
|
1344 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1345 |
"exit private event-loop" |
|
1346 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1347 |
'DEBUGGER: oops, continue failed' errorPrintNL. |
|
1348 |
continueButton turnOff. |
|
1349 |
]. |
|
1350 |
] ifFalse:[ |
|
1351 |
inspecting ifFalse:[ |
|
1352 |
'resuming top context' errorPrintNL. |
|
1353 |
self showSelection:1. |
|
1354 |
self doReturn |
|
1355 |
] |
|
1356 |
] |
|
1357 |
! |
|
1358 |
||
1359 |
doNext |
|
1360 |
"skip for next source-code line" |
|
1361 |
||
1362 |
self doStep:nil |
|
1363 |
! |
|
1364 |
||
1365 |
doNoTrace |
|
1366 |
traceView notNil ifTrue:[ |
|
1367 |
traceView topView destroy. |
|
1368 |
traceView := nil. |
|
1369 |
]. |
|
1370 |
tracing := false |
|
1371 |
! |
|
1372 |
||
1373 |
doRestart |
|
1374 |
"restart - the selected context will be restarted" |
|
1375 |
||
1376 |
inspecting ifTrue:[ |
|
1377 |
selectedContext isNil ifTrue:[ |
|
1378 |
^ self showError:'** select a context first **' |
|
1379 |
]. |
|
1380 |
self interruptProcessWith:[selectedContext unwindAndRestart]. |
|
1381 |
^ self |
|
1382 |
]. |
|
1383 |
||
1384 |
steppedContextAddress := nil. |
|
1385 |
haveControl := false. |
|
1386 |
exitAction := #restart. |
|
1387 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1388 |
"exit private event-loop" |
|
1389 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1390 |
'DEBUGGER: oops, restart failed' errorPrintNL. |
|
1391 |
restartButton turnOff. |
|
1392 |
]. |
|
1393 |
! |
|
1394 |
||
1395 |
doReturn |
|
1396 |
"return - the selected context will do a ^nil" |
|
1397 |
||
1398 |
inspecting ifTrue:[ |
|
1399 |
selectedContext isNil ifTrue:[ |
|
1400 |
^ self showError:'** select a context first **' |
|
1401 |
]. |
|
1402 |
self interruptProcessWith:[selectedContext unwind]. |
|
1403 |
^ self |
|
1404 |
]. |
|
1405 |
||
1406 |
steppedContextAddress := nil. |
|
1407 |
haveControl := false. |
|
1408 |
exitAction := #return. |
|
1409 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1410 |
"exit private event-loop" |
|
1411 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1412 |
'DEBUGGER: oops, return failed' errorPrintNL. |
|
1413 |
returnButton turnOff. |
|
1414 |
]. |
|
1415 |
! |
|
1416 |
||
1417 |
doSend |
|
1418 |
"single send; reenter with next message send" |
|
1419 |
||
1420 |
inspecting ifTrue:[^ self]. |
|
1421 |
||
1422 |
canContinue ifTrue:[ |
|
1423 |
steppedContextAddress := nil. |
|
1424 |
haveControl := false. |
|
1425 |
exitAction := #step. |
|
1426 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1427 |
"exit private event-loop" |
|
1428 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1429 |
'DEBUGGER: oops, send failed' errorPrintNL. |
|
1430 |
sendButton turnOff. |
|
1431 |
]. |
|
1432 |
] |
|
1433 |
! |
|
1434 |
||
1435 |
doStep |
|
1436 |
"skip for next send in selected method" |
|
1437 |
||
1438 |
self doStep:-1 |
|
1439 |
! |
|
1440 |
||
1441 |
doStep:lineNr |
|
1442 |
"step until we pass lineNr (if nonNil) or to next line (if nil) |
|
1443 |
or to next send (if -1)" |
|
1444 |
||
1445 |
|con method| |
|
1446 |
||
1447 |
inspecting ifTrue:[^ self]. |
|
1448 |
||
1449 |
canContinue ifTrue:[ |
|
1450 |
selectedContext notNil ifTrue:[ |
|
1451 |
con := selectedContext. |
|
1452 |
steppedContextLineno := actualContext lineNumber. |
|
1453 |
] ifFalse:[ |
|
1454 |
con := contextArray at:2. |
|
1455 |
steppedContextLineno := con lineNumber. |
|
1456 |
]. |
|
1457 |
skipLineNr := lineNr. |
|
1458 |
||
1459 |
lineNr == -1 ifTrue:[ |
|
1460 |
steppedContextLineno := skipLineNr := nil. |
|
1461 |
]. |
|
1462 |
||
1463 |
steppedContextAddress := ObjectMemory addressOf:con. |
|
1464 |
" |
|
1465 |
if we step in a wrapped method, |
|
1466 |
prepare to skip the prolog ... |
|
1467 |
" |
|
1468 |
"/ ' step con:' print. steppedContextAddress printHex. ' ' printNL. |
|
1469 |
inWrap := false. |
|
1470 |
method := con method. |
|
1471 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
1472 |
inWrap := true |
|
1473 |
]. |
|
1474 |
||
1475 |
con := nil. |
|
1476 |
bigStep := true. |
|
1477 |
haveControl := false. |
|
1478 |
exitAction := #step. |
|
1479 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1480 |
"exit private event-loop" |
|
1481 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1482 |
'DEBUGGER: oops, step failed' errorPrintNL. |
|
1483 |
stepButton turnOff. |
|
1484 |
nextButton turnOff. |
|
1485 |
sendButton turnOff. |
|
1486 |
]. |
|
1487 |
] |
|
1488 |
! |
|
1489 |
||
1490 |
doStop |
|
1491 |
"stop the process (if its running, otherwise this is a no-op)" |
|
1492 |
||
1493 |
inspecting ifTrue:[ |
|
1494 |
self processPerform:#stop. |
|
1495 |
^ self |
|
1496 |
]. |
|
1497 |
! |
|
1498 |
||
1499 |
doTerminate |
|
1500 |
"terminate - the process has a chance for cleanup" |
|
1501 |
||
1502 |
inspecting ifTrue:[ |
|
1503 |
self processPerform:#terminate. |
|
1504 |
^ self |
|
1505 |
]. |
|
1506 |
||
1507 |
steppedContextAddress := nil. |
|
1508 |
haveControl := false. |
|
1509 |
exitAction := #terminate. |
|
1510 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1511 |
"exit private event-loop" |
|
1512 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1513 |
inspecting ifFalse:[ |
|
1514 |
'DEBUGGER: oops, terminate failed' errorPrintNL. |
|
1515 |
self warn:'terminate failed'. |
|
1516 |
]. |
|
1517 |
terminateButton turnOff. |
|
1518 |
]. |
|
1519 |
! |
|
1520 |
||
1521 |
doTrace |
|
1522 |
"tracing - not really implemented ..." |
|
1523 |
||
1524 |
self warn:'this function is not yet implemented'. |
|
1525 |
||
1526 |
"/ |v b| |
|
1527 |
"/ |
|
1528 |
"/ traceView isNil ifTrue:[ |
|
1529 |
"/ v := StandardSystemView on:Display. |
|
1530 |
"/ v label:'Debugger-Trace'. |
|
1531 |
"/ v icon:icon. |
|
1532 |
"/ |
|
1533 |
"/ b := Button label:'untrace' in:v. |
|
1534 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
1535 |
"/ b action:[ |
|
1536 |
"/ StepInterruptPending := nil. |
|
1537 |
"/ tracing := false. |
|
1538 |
"/ v unrealize. |
|
1539 |
"/ traceView := nil |
|
1540 |
"/ ]. |
|
1541 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
1542 |
"/ traceView origin:(0 @ (b height)) |
|
1543 |
"/ extent:[v width @ (v height - b height)] |
|
1544 |
"/ ]. |
|
1545 |
"/ v realize. |
|
1546 |
"/ |
|
1547 |
"/ tracing := true. |
|
1548 |
! |
|
1549 |
||
1550 |
doTraceStep |
|
1551 |
"tracestep - not implemented yet" |
|
1552 |
||
1553 |
canContinue ifTrue:[ |
|
1554 |
tracing := true. |
|
1555 |
self doStep |
|
1556 |
] |
|
1557 |
! |
|
1558 |
||
1559 |
exit |
|
1560 |
"exit from menu: immediate exit from smalltalk" |
|
1561 |
||
1562 |
OperatingSystem exit |
|
1563 |
! |
|
1564 |
||
1565 |
implementors |
|
1566 |
"open a browser on the implementors" |
|
1567 |
||
1568 |
selectedContext isNil ifTrue:[ |
|
1569 |
^ self showError:'** select a context first **' |
|
1570 |
]. |
|
1571 |
SystemBrowser browseImplementorsOf:selectedContext selector. |
|
1572 |
! |
|
1573 |
||
1574 |
inspectContext |
|
1575 |
"launch an inspector on the currently selected context" |
|
1576 |
||
1577 |
contextView selection notNil ifTrue:[ |
|
1578 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
|
1579 |
(contextArray at:(contextView selection)) inspect. |
|
1580 |
] |
|
1581 |
] |
|
1582 |
! |
|
1583 |
||
1584 |
quickTerminate |
|
1585 |
"quick terminate - the process will get no chance for cleanup actions" |
|
1586 |
||
1587 |
inspecting ifTrue:[ |
|
1588 |
self processPerform:#terminateNoSignal. |
|
1589 |
^ self |
|
1590 |
]. |
|
1591 |
||
1592 |
steppedContextAddress := nil. |
|
1593 |
haveControl := false. |
|
1594 |
exitAction := #quickTerminate. |
|
1595 |
ProcessorScheduler isPureEventDriven ifFalse:[ |
|
1596 |
"exit private event-loop" |
|
1597 |
catchBlock notNil ifTrue:[catchBlock value]. |
|
1598 |
inspecting ifFalse:[ |
|
1599 |
'DEBUGGER: oops, terminate failed' errorPrintNL. |
|
1600 |
self warn:'terminate failed'. |
|
1601 |
]. |
|
1602 |
terminateButton turnOff. |
|
1603 |
]. |
|
1604 |
! |
|
1605 |
||
1606 |
removeAllBreakpoints |
|
1607 |
"remove all trace & breakpoints - if any" |
|
1608 |
||
1609 |
MessageTracer unwrapAllMethods |
|
1610 |
! |
|
1611 |
||
1612 |
removeBreakpoint |
|
1613 |
"remove breakpoint on the selected contexts method - if any" |
|
1614 |
||
1615 |
|implementorClass method| |
|
1616 |
||
1617 |
selectedContext isNil ifTrue:[ |
|
1618 |
^ self showError:'** select a context first **' |
|
1619 |
]. |
|
1620 |
||
1621 |
implementorClass := selectedContext methodClass. |
|
1622 |
implementorClass notNil ifTrue:[ |
|
1623 |
method := implementorClass compiledMethodAt:selectedContext selector. |
|
1624 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
1625 |
MessageTracer unwrapMethod:method |
|
1626 |
] |
|
1627 |
]. |
|
1628 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
1629 |
! |
|
1630 |
||
1631 |
senders |
|
1632 |
"open a browser on the senders" |
|
1633 |
||
1634 |
selectedContext isNil ifTrue:[ |
|
1635 |
^ self showError:'** select a context first **' |
|
1636 |
]. |
|
1637 |
SystemBrowser browseAllCallsOn:selectedContext selector. |
|
1638 |
! |
|
1639 |
||
1640 |
showMore |
|
1641 |
"double number of contexts shown" |
|
1642 |
||
1643 |
|oldSelection con| |
|
1644 |
||
1645 |
contextArray notNil ifTrue:[ |
|
1646 |
oldSelection := contextView selection. |
|
1647 |
nChainShown := nChainShown * 2. |
|
1648 |
con := contextArray at:1. |
|
1649 |
contextArray at:1 put:nil. |
|
1650 |
self setContext:con. |
|
1651 |
contextView selection:oldSelection. |
|
1652 |
] |
|
1653 |
! |
|
1654 |
||
1655 |
skip |
|
1656 |
"skip for cursor line in selected method" |
|
1657 |
||
1658 |
self doStep:codeView cursorLine. |
|
1659 |
! ! |
|
1660 |
||
1661 |
!DebugView methodsFor:'private'! |
|
1662 |
||
1663 |
busy |
|
1664 |
^ busy |
|
1665 |
! |
|
1666 |
||
1667 |
cacheMyself |
|
1668 |
"remember myself for next debug session" |
|
1669 |
||
1670 |
"caching the last debugger will make the next debugger appear |
|
1671 |
faster, since no resources have to be allocated in the display. |
|
1672 |
We have to be careful to release all refs to the debuggee, though. |
|
1673 |
Otherwise, the GC will not be able to release it" |
|
1674 |
||
1675 |
windowGroup notNil ifTrue:[ |
|
1676 |
windowGroup setProcess:nil. |
|
1677 |
]. |
|
1678 |
||
1679 |
busy := false. |
|
1680 |
codeView acceptAction:nil. |
|
1681 |
codeView doItAction:nil. |
|
1682 |
codeView contents:nil. |
|
1683 |
receiverInspector release. |
|
1684 |
contextInspector release. |
|
1685 |
inspectedProcess := nil. |
|
1686 |
exitAction := nil. |
|
1687 |
contextArray := nil. |
|
1688 |
selectedContext := actualContext := nil. |
|
1689 |
catchBlock := nil. |
|
1690 |
grabber := nil. |
|
1691 |
self autoUpdateOff. |
|
1692 |
||
1693 |
exclusive ifTrue:[CachedExclusive := self] ifFalse:[CachedDebugger := self]. |
|
1694 |
! |
|
1695 |
||
1696 |
exclusive:aBoolean |
|
1697 |
exclusive := aBoolean |
|
1698 |
! |
|
1699 |
||
1700 |
inspectedProcess |
|
1701 |
^ inspectedProcess |
|
1702 |
! |
|
1703 |
||
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
1704 |
interestingContextFrom:aContext |
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
1705 |
"return an interesting contexts offset, or nil. |
266 | 1706 |
This is the context initially shown in the walkback. |
1707 |
We move up the calling chain, skipping all intermediate Signal |
|
1708 |
and Exception contexts, to present the context in which the error |
|
1709 |
actually occured. |
|
1710 |
Just for your convenience :-)" |
|
1711 |
||
1712 |
|c found offset sel prev ex| |
|
1713 |
||
1714 |
"somewhere, at the bottom, there must be a raise ..." |
|
1715 |
||
1716 |
c := aContext. |
|
1717 |
1 to:5 do:[:i | |
|
269 | 1718 |
c isNil ifTrue:[^ 1 "^ nil"]. |
1719 |
sel := c selector. |
|
1720 |
(sel == #raise) ifTrue:[ |
|
1721 |
(c receiver isKindOf:Exception) ifTrue:[ |
|
1722 |
ex := c receiver. |
|
1723 |
offset := i. |
|
1724 |
found := c |
|
1725 |
] ifFalse:[ |
|
1726 |
(c receiver isKindOf:Signal) ifTrue:[ |
|
1727 |
offset := i. |
|
1728 |
found := c |
|
1729 |
] |
|
1730 |
] |
|
1731 |
]. |
|
1732 |
c := c sender. |
|
266 | 1733 |
]. |
1734 |
||
1735 |
" |
|
1736 |
if this is a noHandler exception, skip forward |
|
1737 |
to the erronous context |
|
1738 |
" |
|
1739 |
ex notNil ifTrue:[ |
|
269 | 1740 |
ex signal == Signal noHandlerSignal ifTrue:[ |
1741 |
c := ex suspendedContext |
|
1742 |
] |
|
266 | 1743 |
]. |
1744 |
||
1745 |
(c := found) isNil ifTrue:[^ 1]. |
|
1746 |
||
1747 |
" |
|
1748 |
got it; move up, skipping all intermediate Signal and |
|
1749 |
Exception contexts |
|
1750 |
" |
|
1751 |
prev := nil. |
|
1752 |
[ |
|
269 | 1753 |
((c receiver isSignal) |
1754 |
or:[(c receiver isKindOf:Exception)]) |
|
266 | 1755 |
] whileTrue:[ |
269 | 1756 |
prev := c. |
1757 |
(c := c sender) isNil ifTrue:[^ offset]. |
|
1758 |
offset := offset + 1. |
|
266 | 1759 |
]. |
1760 |
||
1761 |
" |
|
1762 |
now, we are one above the raise |
|
1763 |
" |
|
1764 |
||
1765 |
" |
|
269 | 1766 |
if the sender-method of the raise is one of objects error methods ... |
266 | 1767 |
" |
1768 |
( #( halt halt: |
|
269 | 1769 |
error error: |
1770 |
doesNotUnderstand: |
|
1771 |
subclassResponsibility |
|
1772 |
primitiveFailed) includes:c selector) |
|
266 | 1773 |
ifTrue:[ |
269 | 1774 |
c selector == #doesNotUnderstand: ifTrue:[ |
1775 |
" |
|
1776 |
one more up, to get to the originating context |
|
1777 |
" |
|
1778 |
(c := c sender) isNil ifTrue:[^ offset]. |
|
1779 |
offset := offset + 1. |
|
1780 |
]. |
|
1781 |
(c := c sender) isNil ifTrue:[^ offset]. |
|
1782 |
offset := offset + 1. |
|
266 | 1783 |
] ifFalse:[ |
269 | 1784 |
" |
1785 |
ok, got the raise - if its a BreakPoint, look for the sender |
|
1786 |
" |
|
1787 |
(MessageTracer notNil and:[prev receiver == MessageTracer breakpointSignal]) ifTrue:[ |
|
1788 |
offset := offset + 1 |
|
1789 |
]. |
|
266 | 1790 |
]. |
1791 |
||
1792 |
^ offset |
|
269 | 1793 |
|
1794 |
"Created: 10.12.1995 / 13:55:21 / cg" |
|
266 | 1795 |
! |
1796 |
||
1797 |
interruptProcessWith:aBlock |
|
1798 |
"let inspected process do something, then update the context list" |
|
1799 |
||
1800 |
inspectedProcess isDead ifTrue:[ |
|
1801 |
self showTerminated. |
|
1802 |
^ self |
|
1803 |
]. |
|
1804 |
inspectedProcess interruptWith:aBlock. |
|
1805 |
" |
|
1806 |
give the process a chance to run, then update |
|
1807 |
" |
|
1808 |
(Delay forSeconds:0.2) wait. |
|
1809 |
self setContext:(inspectedProcess suspendedContext). |
|
1810 |
! |
|
1811 |
||
1812 |
processPerform:aMessage |
|
1813 |
"do something, then update the context list" |
|
1814 |
||
1815 |
inspectedProcess isDead ifTrue:[ |
|
1816 |
self showTerminated. |
|
1817 |
^ self |
|
1818 |
]. |
|
1819 |
inspectedProcess perform:aMessage. |
|
1820 |
" |
|
1821 |
give the process a chance to run, then update |
|
1822 |
" |
|
1823 |
(Delay forSeconds:0.2) wait. |
|
1824 |
self setContext:(inspectedProcess suspendedContext). |
|
1825 |
! |
|
1826 |
||
1827 |
setContext:aContext |
|
1828 |
"show calling chain from aContext in the walk-back listview" |
|
1829 |
||
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1830 |
self setContext:aContext releaseInspectors:true |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1831 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1832 |
"Modified: 14.12.1995 / 19:10:51 / cg" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1833 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1834 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1835 |
setContext:aContext releaseInspectors:releaseInspectors |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1836 |
"show calling chain from aContext in the walk-back listview" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1837 |
|
266 | 1838 |
|con text method caller caller2 m count| |
1839 |
||
1840 |
(contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1841 |
"no change" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1842 |
^ false |
266 | 1843 |
]. |
1844 |
||
1845 |
m := contextView middleButtonMenu. |
|
1846 |
m notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1847 |
m disable:#showMore. |
266 | 1848 |
]. |
1849 |
||
1850 |
aContext isNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1851 |
text := Array with:'** no context **'. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1852 |
contextArray := nil. |
266 | 1853 |
] ifFalse:[ |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1854 |
text := OrderedCollection new:nChainShown. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1855 |
contextArray := OrderedCollection new:nChainShown. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1856 |
con := aContext. |
266 | 1857 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1858 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1859 |
get them all |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1860 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1861 |
count := 0. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1862 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1863 |
contextArray add:con. count := count + 1. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1864 |
(MoreDebuggingDetail == true) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1865 |
text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1866 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1867 |
text add:con printString. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1868 |
]. |
266 | 1869 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1870 |
method := con method. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1871 |
(method notNil and:[method isWrapped]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1872 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1873 |
kludge: if its a wrapped method, then hide the wrap-call |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1874 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1875 |
caller := con sender. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1876 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1877 |
caller2 := caller sender. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1878 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1879 |
con := caller2 |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1880 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1881 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1882 |
caller := caller2 := nil |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1883 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1884 |
con := con sender |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1885 |
]. |
266 | 1886 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1887 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1888 |
did we reach the end ? |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1889 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1890 |
(con isNil or:[con sender isNil]) ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1891 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1892 |
the very last one is the startup context |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1893 |
(in main) - it has nil as receiver and nil as selector |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1894 |
" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1895 |
contextArray last selector isNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1896 |
contextArray removeLast. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1897 |
text removeLast |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1898 |
] |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1899 |
] ifFalse:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1900 |
m notNil ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1901 |
m enable:#showMore. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1902 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1903 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1904 |
]. |
266 | 1905 |
]. |
1906 |
||
1907 |
contextView setList:text. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1908 |
releaseInspectors ifTrue:[ |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1909 |
receiverInspector release. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1910 |
contextInspector release. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1911 |
]. |
266 | 1912 |
|
1913 |
m notNil ifTrue:[ |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1914 |
m disable:#removeBreakpoint. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1915 |
m disable:#implementors. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1916 |
m disable:#senders. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1917 |
m disable:#browseClass. |
266 | 1918 |
]. |
1919 |
^ true |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1920 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1921 |
"Created: 14.12.1995 / 19:10:31 / cg" |
266 | 1922 |
! |
1923 |
||
1924 |
showError:message |
|
1925 |
codeView contents:(resources string:message). |
|
1926 |
shown ifTrue:[ |
|
1927 |
exclusive ifTrue:[ |
|
1928 |
"/ consider this a kludge: |
|
1929 |
"/ if exclusive, cannot use flash, since it suspends |
|
1930 |
"/ (but we cannot suspend here ...) |
|
1931 |
codeView redrawInverted. device flush. |
|
1932 |
OperatingSystem millisecondDelay:200. |
|
1933 |
codeView redraw |
|
1934 |
] ifFalse:[ |
|
1935 |
codeView flash |
|
1936 |
] |
|
1937 |
] |
|
1938 |
||
1939 |
"Modified: 24.11.1995 / 22:07:30 / cg" |
|
1940 |
! |
|
1941 |
||
1942 |
showTerminated |
|
1943 |
self showError:'** the process has terminated **' |
|
1944 |
! |
|
1945 |
||
1946 |
stepping |
|
1947 |
^ stepping |
|
1948 |
! |
|
1949 |
||
1950 |
unstep |
|
1951 |
stepping := false. |
|
1952 |
bigStep := false. |
|
1953 |
steppedContextAddress := nil. |
|
1954 |
exitAction := nil |
|
1955 |
! |
|
1956 |
||
1957 |
updateContext |
|
1958 |
|oldContext idx| |
|
1959 |
||
1960 |
inspectedProcess state == #dead ifTrue:[ |
|
1961 |
self showTerminated. |
|
1962 |
^ self |
|
1963 |
]. |
|
1964 |
||
1965 |
oldContext := selectedContext. |
|
1966 |
(self setContext:(inspectedProcess suspendedContext)) ifTrue:[ |
|
1967 |
oldContext notNil ifTrue:[ |
|
1968 |
contextArray notNil ifTrue:[ |
|
1969 |
idx := contextArray identityIndexOf:oldContext. |
|
1970 |
idx ~~ 0 ifTrue:[ |
|
1971 |
self showSelection:idx |
|
1972 |
] ifFalse:[ |
|
1973 |
codeView contents:('** context returned **') |
|
1974 |
] |
|
1975 |
] |
|
1976 |
] |
|
1977 |
] |
|
1978 |
! ! |
|
1979 |
||
1980 |
!DebugView methodsFor:'private control loop'! |
|
1981 |
||
1982 |
controlLoop |
|
1983 |
"this is a kludge: |
|
1984 |
start a dispatchloop which exits when |
|
1985 |
either continue, return or step is pressed |
|
1986 |
" |
|
1987 |
||
1988 |
haveControl := true. |
|
1989 |
[haveControl] whileTrue:[ |
|
1990 |
self controlLoopCatchingErrors |
|
1991 |
]. |
|
1992 |
catchBlock := nil. |
|
1993 |
! |
|
1994 |
||
1995 |
controlLoopCatchingErrors |
|
1996 |
"setup a self removing catch-block" |
|
1997 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
1998 |
||
1999 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
2000 |
"if we do not have multiple processes or its a system process |
|
2001 |
we start another dispatch loop, which exits when |
|
2002 |
either continue, return or step is pressed |
|
2003 |
or (via the catchBlock) if an error occurs. |
|
2004 |
Since our display is an extra exclusive one, |
|
2005 |
all processing for normal views stops here ... |
|
2006 |
" |
|
2007 |
||
2008 |
WindowGroup setActiveGroup:windowGroup. |
|
2009 |
SignalSet anySignal handle:[:ex | |
|
2010 |
self showError:'*** Error in modal debugger: |
|
2011 |
||
2012 |
>>>> Signal: ' , ex signal printString , ' |
|
2013 |
>>>> In: ' , ex suspendedContext printString , ' |
|
2014 |
>>>> Message: ' , ex errorString , ' |
|
2015 |
||
2016 |
cought & ignored.'. |
|
2017 |
ex return. |
|
2018 |
] do:[ |
|
2019 |
Object userNotificationSignal handle:[:ex | |
|
2020 |
self showError:ex errorString |
|
2021 |
] do:[ |
|
2022 |
device dispatchModalWhile:[haveControl]. |
|
2023 |
] |
|
2024 |
]. |
|
2025 |
WindowGroup setActiveGroup:nil. |
|
2026 |
] ifFalse:[ |
|
2027 |
"we do have multiple processes - |
|
2028 |
simply enter the DebugViews-Windowgroup event loop. |
|
2029 |
effectively suspending event processing for the currently |
|
2030 |
active group. |
|
2031 |
" |
|
2032 |
SignalSet anySignal handle:[:ex | |
|
2033 |
|answer| |
|
2034 |
||
2035 |
self topView raiseDeiconified. |
|
2036 |
ex signal == Exception recursiveExceptionSignal ifTrue:[ |
|
2037 |
self showError:'*** Recursive error in debugger: |
|
2038 |
||
2039 |
>>>> Signal: ' , ex signal printString , ' |
|
2040 |
>>>> In: ' , ex suspendedContext printString , ' |
|
2041 |
>>>> Message: ' , ex errorString , ' |
|
2042 |
||
2043 |
cought & ignored.'. |
|
2044 |
ex return |
|
2045 |
]. |
|
2046 |
answer := Dialog |
|
2047 |
choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs |
|
2048 |
labels:#('debug' 'proceed' 'cancel' ) |
|
2049 |
values:#(#debug #proceed #cancel) |
|
2050 |
default:#cancel. |
|
2051 |
answer == #debug ifTrue:[ |
|
2052 |
Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString. |
|
2053 |
ex proceed. |
|
2054 |
]. |
|
2055 |
answer == #proceed ifTrue:[ |
|
2056 |
ex proceed. |
|
2057 |
]. |
|
2058 |
ex return. |
|
2059 |
] do:[ |
|
2060 |
windowGroup eventLoopWhile:[true] onLeave:[] |
|
2061 |
]. |
|
2062 |
]. |
|
2063 |
catchBlock := nil. |
|
2064 |
||
2065 |
"Created: 24.11.1995 / 20:33:45 / cg" |
|
2066 |
"Modified: 24.11.1995 / 22:57:41 / cg" |
|
2067 |
! ! |
|
2068 |
||
0 | 2069 |
!DebugView methodsFor:'user interaction'! |
2070 |
||
266 | 2071 |
codeAccept:someCode |
2072 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
2073 |
and including selected method cannot be continued." |
|
2074 |
||
2075 |
" |
|
2076 |
actually, this is not true, since the active methods will still be |
|
2077 |
executed correctly - however, the code shown in the debugger is no |
|
2078 |
longer in sync (showing the new code) with the executed code. |
|
2079 |
Therefore, we hide those contexts to avoid confusion .... |
|
2080 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
2081 |
||
2082 |
"walk up context chain and find highest context which is either the selected context, |
|
2083 |
or - if its a block-context - whose home is the selected context" |
|
2084 |
||
2085 |
|con top sel implementorClass method newMethod| |
|
2086 |
||
2087 |
codeView cursor:Cursor execute. |
|
2088 |
||
2089 |
" |
|
2090 |
find the method-home context for this one |
|
2091 |
" |
|
2092 |
con := selectedContext. |
|
2093 |
top := con. |
|
2094 |
[con notNil] whileTrue:[ |
|
2095 |
(con methodHome == selectedContext) ifTrue:[ |
|
2096 |
top := con |
|
2097 |
]. |
|
2098 |
con := con sender |
|
2099 |
]. |
|
2100 |
" |
|
2101 |
use class&selector to find the method for the compilation |
|
2102 |
and compile. |
|
2103 |
" |
|
2104 |
sel := selectedContext selector. |
|
2105 |
implementorClass := selectedContext methodClass. |
|
2106 |
method := implementorClass compiledMethodAt:sel. |
|
2107 |
newMethod := implementorClass compilerClass |
|
2108 |
compile:someCode |
|
2109 |
forClass:implementorClass |
|
2110 |
inCategory:(method category) |
|
2111 |
notifying:codeView. |
|
2112 |
||
2113 |
inspecting ifFalse:[ |
|
2114 |
" |
|
2115 |
if it worked, remove everything up to and including top |
|
2116 |
from context chain |
|
2117 |
" |
|
2118 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
2119 |
self setContext:(top sender). |
|
2120 |
||
2121 |
" |
|
2122 |
continue/step is no longer possible |
|
2123 |
" |
|
2124 |
canContinue := false. |
|
2125 |
self showSelection:1. |
|
2126 |
exitAction := #return |
|
2127 |
]. |
|
2128 |
]. |
|
2129 |
codeView cursor:Cursor normal |
|
2130 |
! |
|
2131 |
||
2132 |
destroy |
|
2133 |
"closing the debugger implies an abort or continue" |
|
2134 |
||
2135 |
contextView middleButtonMenu hide. |
|
2136 |
||
2137 |
" |
|
2138 |
we manually release all private data, since the Debugger |
|
2139 |
is cached for reuse - thus the memory would not be collectable |
|
2140 |
otherwise. |
|
2141 |
" |
|
2142 |
codeView acceptAction:nil. |
|
2143 |
codeView doItAction:nil. |
|
2144 |
codeView contents:nil. |
|
2145 |
catchBlock := nil. |
|
2146 |
||
2147 |
receiverInspector release. |
|
2148 |
contextInspector release. |
|
2149 |
inspectedProcess := nil. |
|
2150 |
exitAction := nil. |
|
2151 |
contextArray := nil. |
|
2152 |
selectedContext := actualContext := nil. |
|
2153 |
grabber := nil. |
|
2154 |
self autoUpdateOff. |
|
2155 |
||
2156 |
inspecting ifFalse:[ |
|
2157 |
exclusive ifTrue:[ |
|
2158 |
CachedExclusive == self ifTrue:[ |
|
2159 |
CachedExclusive := nil. |
|
2160 |
] |
|
2161 |
] ifFalse:[ |
|
2162 |
CachedDebugger == self ifTrue:[ |
|
2163 |
CachedDebugger := nil |
|
2164 |
] |
|
2165 |
]. |
|
2166 |
||
2167 |
inspecting ifFalse:[ |
|
2168 |
canAbort ifTrue:[ |
|
2169 |
self doAbort. |
|
2170 |
] ifFalse:[ |
|
2171 |
self doContinue |
|
2172 |
] |
|
2173 |
]. |
|
2174 |
]. |
|
2175 |
super destroy "/ 1.12.94 |
|
2176 |
! |
|
2177 |
||
0 | 2178 |
showSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2179 |
"user clicked on a header line - show selected code in textView. |
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
2180 |
Also sent to autoselect an interesting context on entry." |
0 | 2181 |
|
56 | 2182 |
|con homeContext sel method code canAccept |
105 | 2183 |
implementorClass lineNrInMethod rec m line |
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2184 |
sender selSender tryVars possibleBlocks errMsg |
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2185 |
mthd cls w| |
0 | 2186 |
|
2187 |
contextArray notNil ifTrue:[ |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2188 |
lineNr <= contextArray size ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2189 |
con := contextArray at:lineNr. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2190 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2191 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2192 |
clicking on the '** ...'-line shows more ... |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2193 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2194 |
con isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2195 |
line := contextView list at:lineNr. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2196 |
(line startsWith:'**') ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2197 |
self showMore. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2198 |
contextView selection:lineNr. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2199 |
con := contextArray at:lineNr |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2200 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2201 |
con isNil ifTrue:[^ self]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2202 |
]. |
105 | 2203 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2204 |
self withWaitCursorDo:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2205 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2206 |
give it to the (lower right) inspector |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2207 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2208 |
contextInspector inspect:con. |
105 | 2209 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2210 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2211 |
get the home context |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2212 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2213 |
con isBlockContext ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2214 |
homeContext := con methodHome |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2215 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2216 |
homeContext := con |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2217 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2218 |
con canReturn ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2219 |
returnButton enable. restartButton enable. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2220 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2221 |
returnButton disable. restartButton disable. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2222 |
]. |
105 | 2223 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2224 |
lineNrInMethod := con lineNumber. |
105 | 2225 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2226 |
canAccept := false. |
105 | 2227 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2228 |
homeContext isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2229 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2230 |
mhmh - an optimized block |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2231 |
should get the block here, and get the method from |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2232 |
that one ... |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2233 |
But in 2.10.x, there is no easy way to get to the block |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2234 |
since that one is not in the context. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2235 |
Starting with 2.11, the new block calling scheme will fix this. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2236 |
" |
105 | 2237 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2238 |
"temporary kludge - peek into the sender context. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2239 |
If its a do-like method and there is a single block variable |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2240 |
in the args or temporaries, that must be the one. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2241 |
This helps in some cases. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2242 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2243 |
(sender := con sender) notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2244 |
tryVars := false. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2245 |
(selSender := sender selector) notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2246 |
(selSender endsWith:'do:') ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2247 |
tryVars := true. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2248 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2249 |
(selSender endsWith:'Do:') ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2250 |
tryVars := true. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2251 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2252 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2253 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2254 |
tryVars ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2255 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2256 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2257 |
possibleBlocks size == 1 ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2258 |
method := possibleBlocks first method. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2259 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2260 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2261 |
]. |
105 | 2262 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2263 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2264 |
"fetch rec here - so we wont need context in doItAction" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2265 |
rec := homeContext receiver. |
105 | 2266 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2267 |
sel := homeContext selector. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2268 |
sel notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2269 |
canAccept := true. |
56 | 2270 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2271 |
implementorClass := homeContext methodClass. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2272 |
implementorClass isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2273 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2274 |
special: look if this context was created by |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2275 |
valueWithReceiver kind of method invocation; |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2276 |
if so, grab the method from the sender and show it |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2277 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2278 |
((sender := con sender) notNil |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2279 |
and:[(sender selector startsWith:'valueWithReceiver:') |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2280 |
and:[sender receiver isMethod]]) ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2281 |
method := sender receiver. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2282 |
code := method source. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2283 |
canAccept := false. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2284 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2285 |
(method := con method) notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2286 |
code := method source. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2287 |
canAccept := false. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2288 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2289 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2290 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2291 |
method := implementorClass compiledMethodAt:sel. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2292 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2293 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2294 |
]. |
105 | 2295 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2296 |
code isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2297 |
errMsg := nil. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2298 |
method notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2299 |
code := method source. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2300 |
code isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2301 |
method sourceFilename notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2302 |
codeView contents:(resources |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2303 |
string:'** no sourcefile: %1 **' |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2304 |
with:method sourceFilename). |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2305 |
codeView flash |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2306 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2307 |
errMsg := '** no source **' |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2308 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2309 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2310 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2311 |
homeContext isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2312 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2313 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2314 |
errMsg := '** no method - no source **' |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2315 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2316 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2317 |
errMsg notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2318 |
self showError:errMsg |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2319 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2320 |
]. |
105 | 2321 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2322 |
code isNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2323 |
canAccept := false. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2324 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2325 |
codeView contents:code. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2326 |
(lineNrInMethod notNil and:[lineNrInMethod ~~ 0]) ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2327 |
"/ lineNrInMethod > codeView list size ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2328 |
"/ lineNrInMethod := codeView list size + 1 |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2329 |
"/ ]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2330 |
"/ codeView selectLine:lineNrInMethod. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2331 |
"/ codeView makeSelectionVisible |
132 | 2332 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2333 |
lineNrInMethod <= codeView list size ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2334 |
(lineNrInMethod == 255 |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2335 |
and:[method notNil |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2336 |
and:[method code isNil]]) ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2337 |
"/ means: do not really know in interpreted methods |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2338 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2339 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2340 |
codeView selectLine:lineNrInMethod. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2341 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2342 |
codeView makeSelectionVisible |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2343 |
] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2344 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2345 |
]. |
105 | 2346 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2347 |
canAccept ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2348 |
codeView acceptAction:[:code | self codeAccept:code asString] |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2349 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2350 |
codeView acceptAction:nil. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2351 |
]. |
105 | 2352 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2353 |
receiverInspector inspect:rec. |
105 | 2354 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2355 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2356 |
the one below is wrong: currently, the |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2357 |
evaluator cannot handle passed contexts. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2358 |
Once it does, pass con as in:-arg |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2359 |
" |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2360 |
codeView doItAction:[:theCode | |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2361 |
rec class evaluatorClass |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2362 |
evaluate:theCode |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2363 |
in:nil "/ *** con |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2364 |
receiver:rec |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2365 |
notifying:codeView |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2366 |
logged:true |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2367 |
ifFail:nil |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2368 |
]. |
45 | 2369 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2370 |
selectedContext := homeContext. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2371 |
actualContext := con |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2372 |
]. |
0 | 2373 |
]. |
2374 |
||
105 | 2375 |
"clear out locals to prevent keeping around unneeded contexts |
2376 |
(due to the block held in codeView). |
|
2377 |
(not really needed, since stuff gets collected away sooner or later ... |
|
2378 |
... but this makes it a bit sooner) |
|
2379 |
" |
|
0 | 2380 |
con := nil. |
29 | 2381 |
homeContext := nil. |
2382 |
||
105 | 2383 |
" |
2384 |
enable/disable some menu items |
|
2385 |
" |
|
45 | 2386 |
m := contextView middleButtonMenu. |
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2387 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2388 |
m enableAll:#(implementors senders inspectContext skip skipForReturn). |
29 | 2389 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2390 |
(method notNil and:[method isWrapped]) ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2391 |
m enable:#removeBreakpoint. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2392 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2393 |
m disable:#removeBreakpoint. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2394 |
]. |
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2395 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2396 |
mthd := selectedContext method. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2397 |
mthd notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2398 |
w := mthd who. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2399 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2400 |
m enable:#browseClass. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2401 |
w notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2402 |
cls := w at:1 |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2403 |
]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2404 |
cls notNil ifTrue:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2405 |
m enableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol). |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2406 |
] ifFalse:[ |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2407 |
m disableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol). |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2408 |
]. |
29 | 2409 |
] |
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2410 |
|
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2411 |
"Modified: 14.12.1995 / 21:26:02 / cg" |
73 | 2412 |
! ! |
2413 |
||
266 | 2414 |
!DebugView class methodsFor:'documentation'! |
78 | 2415 |
|
266 | 2416 |
version |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2417 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.62 1995-12-22 22:17:17 cg Exp $' |
0 | 2418 |
! ! |