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