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