author | Claus Gittinger <cg@exept.de> |
Tue, 22 Oct 1996 12:41:16 +0200 | |
changeset 787 | dab2fdc4a811 |
parent 786 | 429c3146c03d |
child 788 | 26d452e40e52 |
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 |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
22 |
stackInspector steppedContext' |
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 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
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 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
82 |
!DebugView class methodsFor:'initialization'! |
243 | 83 |
|
84 |
reinitialize |
|
85 |
self newDebugger |
|
86 |
! ! |
|
87 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
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 | |
|
775
f741dc4afe19
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
144 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
526 | 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 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
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 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
303 |
|con selection m idx retval enteredByInterrupt sel| |
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. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
381 |
steppedContext notNil ifTrue:[ |
374 | 382 |
" |
383 |
if we came here by a big-step, show the method where we are |
|
384 |
" |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
385 |
aContext == steppedContext ifTrue:[ |
374 | 386 |
selection := 1 |
387 |
] ifFalse:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
388 |
aContext sender == steppedContext ifTrue:[ |
374 | 389 |
selection := 2 |
390 |
] |
|
391 |
]. |
|
392 |
" |
|
393 |
for bigStep, we could also be in a block below the actual method ... |
|
394 |
" |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
395 |
(aContext home notNil |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
396 |
and:[aContext home == steppedContext]) ifTrue:[ |
374 | 397 |
selection := 1 |
398 |
] ifFalse:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
399 |
(aContext sender home notNil |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
400 |
and:[aContext sender home == steppedContext]) ifTrue:[ |
374 | 401 |
selection := 2 |
402 |
] |
|
403 |
]. |
|
404 |
] |
|
73 | 405 |
] ifFalse:[ |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
406 |
steppedContext isNil ifTrue:[ |
374 | 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 |
" |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
415 |
aContext == steppedContext ifTrue:[ |
374 | 416 |
selection := 1 |
417 |
] ifFalse:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
418 |
aContext sender == steppedContext ifTrue:[ |
374 | 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. |
|
775
f741dc4afe19
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
628 |
idx == 0 ifTrue:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
629 |
idx := OpenDebuggers identityIndexOf:0 |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
630 |
]. |
374 | 631 |
idx ~~ 0 ifTrue:[ |
632 |
OpenDebuggers at:idx put:self |
|
633 |
] ifFalse:[ |
|
634 |
OpenDebuggers := OpenDebuggers copyWith:self |
|
635 |
] |
|
636 |
] |
|
637 |
]. |
|
638 |
self label:'single stepping - please wait ...'. |
|
639 |
stepping := true. |
|
73 | 640 |
|
374 | 641 |
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
|
642 |
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
|
643 |
"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
|
644 |
Context singleStepInterruptRequest raiseWith:#next |
529
57a78164dae5
allow different implementations of singleStep (JAVA support)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
645 |
] ifFalse:[ |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
646 |
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
|
647 |
] |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
648 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
649 |
"/ see if we came here through an interrupt-action |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
650 |
"/ (i.e. aProcess interruptWith:...) |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
651 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
652 |
enteredByInterrupt := false. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
653 |
con := thisContext sender. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
654 |
[enteredByInterrupt not |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
655 |
and:[con notNil |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
656 |
and:[con ~~ aContext]]] whileTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
657 |
((sel := con selector) == #timerInterrupt |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
658 |
or:[sel == #ioInterrupt]) ifTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
659 |
enteredByInterrupt := true. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
660 |
] ifFalse:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
661 |
con := con sender |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
662 |
]. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
663 |
]. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
664 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
665 |
ObjectMemory flushInlineCaches. |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
666 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
667 |
enteredByInterrupt ifTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
668 |
"/ dont want to step through all intermediate |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
669 |
"/ (scheduler-) contexts; place a return-trap on the |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
670 |
"/ one right below the interresting one |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
671 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
672 |
"/ 'special unwind return' printCR. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
673 |
con unwindThenDo:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
674 |
ObjectMemory stepInterruptHandler:self. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
675 |
InStepInterrupt := nil. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
676 |
StepInterruptPending := 1. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
677 |
InterruptPending := 1]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
678 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
679 |
"/ 'normal step return' printCR. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
680 |
skipLineNr ~~ #return ifTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
681 |
StepInterruptPending := 1. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
682 |
InterruptPending := 1. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
683 |
] ifFalse:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
684 |
"/ 'step for return' printCR. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
685 |
] |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
686 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
687 |
InStepInterrupt := nil |
374 | 688 |
] |
73 | 689 |
] ifFalse:[ |
374 | 690 |
OpenDebuggers notNil ifTrue:[ |
691 |
idx := OpenDebuggers identityIndexOf:self. |
|
692 |
idx ~~ 0 ifTrue:[ |
|
693 |
OpenDebuggers at:idx put:nil |
|
694 |
] |
|
695 |
]. |
|
696 |
self cacheMyself. |
|
73 | 697 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
698 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
699 |
"Created: 24.11.1995 / 19:52:54 / cg" |
528
a5ba1a3d0b45
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
527
diff
changeset
|
700 |
"Modified: 3.5.1996 / 23:58:16 / stefan" |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
701 |
"Modified: 21.10.1996 / 13:45:43 / cg" |
73 | 702 |
! |
703 |
||
704 |
openOn:aProcess |
|
705 |
"enter the debugger on a process - |
|
706 |
in this case, we are just inspecting the context chain of the process, |
|
707 |
not running on top of the debugged process, but as a separate |
|
708 |
one. (think of it as an inspector showing more detail, and offering |
|
709 |
some more control operations)" |
|
710 |
||
127 | 711 |
|bpanel dummy| |
73 | 712 |
|
713 |
busy := true. |
|
714 |
bigStep := false. |
|
715 |
inspecting := true. |
|
716 |
inspectedProcess := aProcess. |
|
717 |
nChainShown := 50. |
|
718 |
||
719 |
bpanel := abortButton superView. |
|
720 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
721 |
"/ stopButton := Button new. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
722 |
"/ stopButton label:(resources at:'stop'); |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
723 |
"/ action:[self doStop]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
724 |
"/ bpanel addSubView:stopButton after:continueButton. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
725 |
"/ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
726 |
bpanel elementsChangeSize:true. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
727 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
728 |
aProcess state == #run ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
729 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
730 |
continueButton foregroundColor:Color red darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
731 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
732 |
continueButton label:(resources at:'stop'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
733 |
continueButton action:[self doStop]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
734 |
returnButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
735 |
restartButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
736 |
] ifFalse:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
737 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
738 |
continueButton foregroundColor:Color green darkened darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
739 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
740 |
continueButton label:(resources at:'continue'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
741 |
continueButton action:[self doContinue]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
742 |
returnButton enable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
743 |
restartButton enable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
744 |
]. |
73 | 745 |
|
92 | 746 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 747 |
dummy borderWidth:0; level:0. |
61 | 748 |
|
73 | 749 |
"/ stepButton destroy. |
750 |
"/ sendButton destroy. |
|
751 |
||
752 |
updateButton := Button |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
753 |
label:(resources at:'update') |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
754 |
action:[self updateContext] |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
755 |
in:bpanel. |
73 | 756 |
monitorToggle := Toggle in:bpanel. |
757 |
monitorToggle label:(resources at:'monitor'). |
|
758 |
monitorToggle pressAction:[self autoUpdateOn]. |
|
759 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
760 |
||
761 |
"can only look into process - context chain is not active" |
|
762 |
canContinue := true. |
|
763 |
||
764 |
terminateButton enable. |
|
765 |
abortButton enable. |
|
766 |
||
767 |
sendButton disable. |
|
768 |
stepButton disable. |
|
78 | 769 |
nextButton disable. |
73 | 770 |
"/ continueButton disable. |
771 |
"/ returnButton disable. |
|
772 |
"/ restartButton disable. |
|
773 |
||
774 |
aProcess isNil ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
775 |
terminateButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
776 |
abortButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
777 |
continueButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
778 |
returnButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
779 |
restartButton disable. |
73 | 780 |
] ifFalse:[ |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
781 |
(aProcess suspendedContext isNil |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
782 |
or:[Processor isSystemProcess:aProcess]) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
783 |
terminateButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
784 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
785 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
786 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
787 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
788 |
catchBlock := [ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
789 |
catchBlock := nil. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
790 |
contextArray := nil. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
791 |
selectedContext := actualContext := nil. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
792 |
steppedContext := nil. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
793 |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
794 |
(exitAction == #terminate) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
795 |
aProcess terminate. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
796 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
797 |
(exitAction == #quickTerminate) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
798 |
aProcess terminateNoSignal. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
799 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
800 |
super destroy |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
801 |
]. |
73 | 802 |
]. |
803 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
804 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
805 |
"Modified: 21.10.1996 / 13:43:05 / cg" |
266 | 806 |
! ! |
807 |
||
808 |
!DebugView methodsFor:'help'! |
|
809 |
||
810 |
helpTextFor:aComponent |
|
811 |
|s| |
|
812 |
||
813 |
aComponent == abortButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
814 |
s := 'HELP_ABORT' |
266 | 815 |
]. |
816 |
aComponent == terminateButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
817 |
s := 'HELP_TERMINATE' |
266 | 818 |
]. |
819 |
aComponent == continueButton ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
820 |
continueButton label = (resources string:'stop') ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
821 |
s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
822 |
] ifFalse:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
823 |
s := 'HELP_CONTINUE' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
824 |
] |
266 | 825 |
]. |
826 |
aComponent == stepButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
827 |
s := 'HELP_STEP' |
266 | 828 |
]. |
829 |
aComponent == nextButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
830 |
s := 'HELP_NEXT' |
266 | 831 |
]. |
832 |
aComponent == stepButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
833 |
s := 'HELP_STEP' |
266 | 834 |
]. |
835 |
aComponent == sendButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
836 |
s := 'HELP_SEND' |
266 | 837 |
]. |
838 |
aComponent == returnButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
839 |
s := 'HELP_RETURN' |
266 | 840 |
]. |
841 |
aComponent == restartButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
842 |
s := 'HELP_RESTART' |
266 | 843 |
]. |
844 |
aComponent == contextView ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
845 |
s := 'HELP_WALKBACK' |
266 | 846 |
]. |
847 |
aComponent == codeView ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
848 |
s := 'HELP_CODEVIEW' |
266 | 849 |
]. |
850 |
aComponent == monitorToggle ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
851 |
s := 'HELP_MONITOR' |
266 | 852 |
]. |
853 |
aComponent == updateButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
854 |
s := 'HELP_UPDATE' |
266 | 855 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
856 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
857 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
858 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
859 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
860 |
s := 'HELP_REC_INSP' |
266 | 861 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
862 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
863 |
s := 'HELP_CON_INSP' |
266 | 864 |
]. |
865 |
||
866 |
s notNil ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
867 |
^ resources string:s |
266 | 868 |
]. |
869 |
^ nil |
|
870 |
||
871 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
872 |
"Modified: 20.10.1996 / 18:14:59 / cg" |
266 | 873 |
! ! |
874 |
||
875 |
!DebugView methodsFor:'initialization'! |
|
876 |
||
877 |
addToCurrentProject |
|
878 |
"ignored here" |
|
879 |
||
880 |
^ self |
|
881 |
! |
|
882 |
||
883 |
initialize |
|
884 |
|v panel hpanel bpanel separator| |
|
885 |
||
886 |
super initialize. |
|
887 |
||
888 |
font := font on:device. |
|
889 |
||
890 |
busy := false. |
|
891 |
exclusive := false. |
|
892 |
inspecting := false. |
|
893 |
exitAction := nil. |
|
894 |
bigStep := false. |
|
895 |
canContinue := false. |
|
896 |
canAbort := false. |
|
897 |
||
898 |
bpanel := HorizontalPanelView |
|
899 |
"/ origin:(0.0 @ 0.0) |
|
900 |
"/ 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
|
901 |
in:self. |
266 | 902 |
bpanel horizontalLayout:#leftSpace. |
903 |
bpanel verticalSpace:ViewSpacing // 2. |
|
904 |
||
905 |
terminateButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
906 |
label:(resources at:'terminate') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
907 |
action:[terminateButton turnOffWithoutRedraw. self doTerminate] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
908 |
in:bpanel. |
266 | 909 |
separator := View extent:(10 @ 5) in:bpanel. |
910 |
separator borderWidth:0; level:0. |
|
911 |
||
912 |
abortButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
913 |
label:(resources at:'abort') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
914 |
action:[abortButton turnOffWithoutRedraw. self doAbort] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
915 |
in:bpanel. |
266 | 916 |
returnButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
917 |
label:(resources at:'return') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
918 |
action:[returnButton turnOff. self doReturn] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
919 |
in:bpanel. |
266 | 920 |
|
921 |
restartButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
922 |
label:(resources at:'restart') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
923 |
action:[restartButton turnOff. self doRestart] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
924 |
in:bpanel. |
266 | 925 |
|
926 |
separator := View extent:(10 @ 5) in:bpanel. |
|
927 |
separator borderWidth:0; level:0. |
|
73 | 928 |
|
266 | 929 |
continueButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
930 |
label:(resources at:'continue') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
931 |
action:[continueButton turnOffWithoutRedraw. self doContinue] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
932 |
in:bpanel. |
266 | 933 |
|
934 |
separator := View extent:(10 @ 5) in:bpanel. |
|
935 |
separator borderWidth:0; level:0. |
|
936 |
||
937 |
nextButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
938 |
label:(resources at:'next') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
939 |
action:[stepButton turnOff. self doNext] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
940 |
in:bpanel. |
266 | 941 |
stepButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
942 |
label:(resources at:'step') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
943 |
action:[stepButton turnOff. self doStep] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
944 |
in:bpanel. |
266 | 945 |
sendButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
946 |
label:(resources at:'send') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
947 |
action:[sendButton turnOff. self doSend] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
948 |
in:bpanel. |
266 | 949 |
|
950 |
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
|
951 |
extent:(1.0 @ (bpanel preferredExtent y)). |
73 | 952 |
|
266 | 953 |
panel := VariableVerticalPanel |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
954 |
origin:(0.0 @ bpanel height) |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
955 |
corner:(1.0 @ 1.0) |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
956 |
in:self. |
266 | 957 |
|
958 |
v := ScrollableView for:SelectionInListView in:panel. |
|
959 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
960 |
||
961 |
contextView := v scrolledView. |
|
962 |
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
|
963 |
contextView doubleClickAction:[:line | self browse]. |
266 | 964 |
|
965 |
v := ScrollableView for:CodeView in:panel. |
|
966 |
v origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
967 |
||
968 |
codeView := v scrolledView. |
|
969 |
||
970 |
hpanel := VariableHorizontalPanel in:panel. |
|
971 |
hpanel origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
972 |
||
973 |
receiverInspector := InspectorView |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
974 |
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
|
975 |
in:hpanel. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
976 |
receiverInspector label:'receiver'. |
266 | 977 |
|
978 |
contextInspector := ContextInspectorView |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
979 |
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
|
980 |
in:hpanel. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
981 |
contextInspector label:'context'. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
982 |
|
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
983 |
"Modified: 28.6.1996 / 15:31:31 / cg" |
266 | 984 |
! |
985 |
||
986 |
initializeMiddleButtonMenu |
|
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
987 |
|labels selectors m| |
266 | 988 |
|
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
989 |
exclusive ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
990 |
labels := resources array:#( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
991 |
'show more' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
992 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
993 |
'remove breakpoint' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
994 |
'remove all trace & breakpoints' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
995 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
996 |
'copy walkback text' |
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 |
'quickTerminate' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
999 |
'=' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1000 |
'exit smalltalk (no confirmation)' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1001 |
). |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1002 |
selectors := #( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1003 |
showMore |
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 |
removeBreakpoint |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1006 |
removeAllBreakpoints |
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 |
copyWalkbackText |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1009 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1010 |
quickTerminate |
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 |
exit |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1013 |
) |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1014 |
] ifFalse:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1015 |
labels := resources array:#( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1016 |
'show more' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1017 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1018 |
'skip' |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1019 |
'step out' |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1020 |
'-' |
266 | 1021 |
" |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1022 |
'continue' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1023 |
'terminate' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1024 |
'abort' |
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 |
'step' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1027 |
'send' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1028 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1029 |
'return' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1030 |
'restart' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1031 |
'-' |
266 | 1032 |
" |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1033 |
'remove breakpoint' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1034 |
'remove all trace & breakpoints' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1035 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1036 |
'browse' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1037 |
'browse class' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1038 |
'browse class hierarchy' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1039 |
'browse full class protocol' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1040 |
'implementors' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1041 |
'senders' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1042 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1043 |
'inspect context' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1044 |
'copy walkback text' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1045 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1046 |
'quickTerminate' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1047 |
'=' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1048 |
'exit smalltalk (no confirmation)' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1049 |
). |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1050 |
|
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1051 |
selectors := #( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1052 |
showMore |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1053 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1054 |
skip |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1055 |
skipForReturn |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1056 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1057 |
" |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1058 |
doContinue |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1059 |
doTerminate |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1060 |
doAbort |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1061 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1062 |
doStep |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1063 |
doSend |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1064 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1065 |
doReturn |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1066 |
doRestart |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1067 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1068 |
" |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1069 |
removeBreakpoint |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1070 |
removeAllBreakpoints |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1071 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1072 |
browse |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1073 |
browseClass |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1074 |
browseClassHierarchy |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1075 |
browseFullClassProtocol |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1076 |
implementors |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1077 |
senders |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1078 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1079 |
inspectContext |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1080 |
copyWalkbackText |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1081 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1082 |
quickTerminate |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1083 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1084 |
exit |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1085 |
). |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1086 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1087 |
|
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1088 |
m := PopUpMenu |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1089 |
labels:labels |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1090 |
selectors:selectors |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1091 |
receiver:self |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1092 |
for:contextView. |
266 | 1093 |
|
1094 |
contextView middleButtonMenu:m. |
|
1095 |
||
1096 |
inspecting ifTrue:[ |
|
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1097 |
m notNil ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1098 |
m disableAll:#(doTraceStep removeBreakpoint browse browseClass |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1099 |
browseClassHierarchy browseFullClassProtocol |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1100 |
implementors senders inspectContext skip doStepOut). |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1101 |
]. |
266 | 1102 |
] |
1103 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1104 |
"Modified: 14.10.1996 / 13:21:26 / cg" |
266 | 1105 |
! |
1106 |
||
1107 |
realize |
|
1108 |
super realize. |
|
1109 |
"/ exclusive ifTrue:[ |
|
1110 |
"/ windowGroup := nil |
|
1111 |
"/ ]. |
|
1112 |
||
1113 |
inspecting ifTrue:[ |
|
1114 |
inspectedProcess notNil ifTrue:[ |
|
1115 |
" |
|
1116 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
1117 |
to run between mine and the debugged processes prio) |
|
1118 |
" |
|
1119 |
Processor activeProcess |
|
1120 |
priority:(inspectedProcess priority + 2 min:16). |
|
73 | 1121 |
] |
266 | 1122 |
] |
1123 |
! |
|
1124 |
||
1125 |
setLabelFor:aMessage in:aProcess |
|
1126 |
|l nm| |
|
1127 |
||
1128 |
l := aMessage , ' ('. |
|
1129 |
nm := aProcess name. |
|
1130 |
nm notNil ifTrue:[ |
|
1131 |
l := l , (nm contractTo:17) , ''. |
|
73 | 1132 |
]. |
266 | 1133 |
l := l , '[' , aProcess id printString , '])'. |
1134 |
self label:l. |
|
0 | 1135 |
! ! |
1136 |
||
1137 |
!DebugView methodsFor:'interrupt handling'! |
|
1138 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1139 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1140 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1141 |
'contextIRQ' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1142 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1143 |
^ self stepOrNext |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1144 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1145 |
"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
|
1146 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1147 |
|
0 | 1148 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1149 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1150 |
'stepIRQ' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1151 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1152 |
^ self stepOrNext |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1153 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1154 |
"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
|
1155 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1156 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1157 |
stepOrNext |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1158 |
|where here s isWrap method lastWrappedConAddr wrappedMethod |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1159 |
inBlock left ignore contextBelow lastWrappedContext| |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1160 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1161 |
skipLineNr == #return ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1162 |
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
|
1163 |
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
|
1164 |
here := thisContext sender sender. |
755 | 1165 |
here setLineNumber:nil. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1166 |
here := nil. |
755 | 1167 |
self enter:thisContext sender sender sender. |
554 | 1168 |
^ self |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1169 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1170 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1171 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1172 |
"/ "/ 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
|
1173 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1174 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1175 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1176 |
"/ 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
|
1177 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1178 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1179 |
|
52 | 1180 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
554 | 1181 |
'stray step interrupt' errorPrintNL. |
1182 |
^ self |
|
52 | 1183 |
]. |
1184 |
||
29 | 1185 |
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
|
1186 |
here := here sender. "the caller; step- or contextIRQ" |
29 | 1187 |
here := here sender. "the interrupted context" |
1188 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1189 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1190 |
'*******' printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1191 |
'here in ' print. |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1192 |
inWrap ifTrue:['(wrap) ' print.]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1193 |
((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
|
1194 |
here selector printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1195 |
]. |
10 | 1196 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1197 |
" |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1198 |
kludge to hide breakpoint wrappers in the context list: |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1199 |
check if we are in a wrapper methods hidden setup-sequence |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1200 |
if so, ignore the interrupt and continue single sending |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1201 |
" |
29 | 1202 |
where := here. |
1203 |
isWrap := false. |
|
57 | 1204 |
left := false. |
1205 |
||
1206 |
inWrap ifTrue:[ |
|
554 | 1207 |
wrappedMethod := nil. |
1208 |
5 timesRepeat:[ |
|
29 | 1209 |
"/ where selector printNL. |
554 | 1210 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
1211 |
method := where method. |
|
1212 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
1213 |
" |
|
1214 |
in a wrapper method |
|
1215 |
" |
|
1216 |
wrappedMethod ~~ method ifTrue:[ |
|
1217 |
wrappedMethod := method. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1218 |
lastWrappedContext := where. |
554 | 1219 |
where sender receiver == method originalMethod ifFalse:[ |
1220 |
isWrap := true. |
|
1221 |
] |
|
1222 |
] ifFalse:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1223 |
where == steppedContext ifTrue:[ |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1224 |
"/DebuggingDebugger ifTrue:[ |
57 | 1225 |
"/ 'change stepCon from: ' print. |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1226 |
"/ steppedContext print. |
57 | 1227 |
"/ ' to: ' print. |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1228 |
"/ lastWrappedContext printNL. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1229 |
"/]. |
554 | 1230 |
inWrap := false. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1231 |
steppedContext := lastWrappedContext |
554 | 1232 |
] |
1233 |
] |
|
1234 |
]. |
|
1235 |
where := where sender |
|
1236 |
] |
|
1237 |
]. |
|
29 | 1238 |
]. |
1239 |
||
1240 |
isWrap ifTrue:[ |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1241 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1242 |
'ignore wrap' printNL. |
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 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1245 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1246 |
"/ 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
|
1247 |
"/ |
554 | 1248 |
where := nil. here := nil. |
1249 |
ObjectMemory flushInlineCaches. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1250 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1251 |
skipLineNr == #return ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1252 |
'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
|
1253 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1254 |
|
554 | 1255 |
StepInterruptPending := 1. |
1256 |
InterruptPending := 1. |
|
1257 |
InStepInterrupt := nil. |
|
1258 |
^ nil |
|
29 | 1259 |
]. |
1260 |
||
57 | 1261 |
inBlock := false. |
1262 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1263 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1264 |
"/ 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
|
1265 |
"/ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1266 |
(bigStep |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1267 |
and:[steppedContext notNil]) ifTrue:[ |
554 | 1268 |
" |
1269 |
a step or next - ignore all contexts below the interesting one |
|
1270 |
" |
|
1271 |
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
|
1272 |
contextBelow := nil. |
57 | 1273 |
|
554 | 1274 |
where home notNil ifTrue:[ |
1275 |
"/ |
|
1276 |
"/ in a block called by 'our' context ? |
|
1277 |
"/ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1278 |
where home == steppedContext ifTrue:[ |
57 | 1279 |
"/ '*block*' printNL. |
554 | 1280 |
inBlock := true |
1281 |
] |
|
1282 |
]. |
|
57 | 1283 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1284 |
where == steppedContext ifFalse:[ |
554 | 1285 |
where := where sender. |
57 | 1286 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1287 |
where notNil ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1288 |
where home == steppedContext ifTrue:[ |
57 | 1289 |
"/ '*block*' printNL. |
554 | 1290 |
inBlock := true. |
1291 |
] |
|
1292 |
]. |
|
57 | 1293 |
|
1294 |
"/ 'looking for ' print. |
|
29 | 1295 |
"/ (steppedContextAddress printStringRadix:16)print. '' printNL. |
57 | 1296 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1297 |
"/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1298 |
"/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1299 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1300 |
where == steppedContext ifFalse:[ |
554 | 1301 |
" |
1302 |
check if we are in a context below steppedContext |
|
1303 |
(i.e. if steppedContext can be reached from |
|
1304 |
interrupted context. Not using context-ref but its |
|
1305 |
address to avoid creation of many useless contexts.) |
|
1306 |
" |
|
1307 |
inBlock ifFalse:[ |
|
1308 |
[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
|
1309 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1310 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1311 |
((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
|
1312 |
where selector printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1313 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1314 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1315 |
where == steppedContext ifTrue:[ |
57 | 1316 |
"/ 'found it - below; ignore' printNL. |
554 | 1317 |
" |
1318 |
found the interesting context somwehere up in the |
|
1319 |
chain. We seem to be still below the interesting one ... |
|
1320 |
" |
|
1321 |
tracing == true ifTrue:[ |
|
1322 |
here printString printCR |
|
1323 |
]. |
|
1324 |
where := nil. here := nil. |
|
1325 |
" |
|
1326 |
yes, a context below |
|
1327 |
- continue and schedule another stepInterrupt. |
|
1328 |
Must flush caches since optimized methods not always |
|
1329 |
look for pending interrupts |
|
1330 |
" |
|
1331 |
ObjectMemory flushInlineCaches. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1332 |
(contextBelow notNil |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1333 |
and:[inBlock not]) ifTrue:[ |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1334 |
"/ '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
|
1335 |
"/ 'con= ' print. contextBelow printCR. |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1336 |
contextBelow selector notNil ifTrue:[ |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1337 |
self label:'single stepping - please wait ...(' , contextBelow selector , ')'. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1338 |
]. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1339 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1340 |
DebuggingDebugger == true ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1341 |
'below stepCon; continue until unwind of: ' print. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1342 |
contextBelow printCR. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1343 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1344 |
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
|
1345 |
StepInterruptPending := nil. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1346 |
] ifFalse:[ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1347 |
here selector notNil ifTrue:[ |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1348 |
self label:'single stepping - please wait ...(' , here selector , ')'. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1349 |
]. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1350 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1351 |
DebuggingDebugger == true ifTrue:[ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1352 |
'in stepCon; continue single stepping' printCR. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1353 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1354 |
StepInterruptPending := 1. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1355 |
InterruptPending := 1. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1356 |
]. |
554 | 1357 |
InStepInterrupt := nil. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1358 |
|
554 | 1359 |
^ nil |
1360 |
]. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1361 |
|
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1362 |
where home == steppedContext ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1363 |
inBlock := true. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1364 |
]. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1365 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1366 |
contextBelow := where. |
554 | 1367 |
where := where sender |
1368 |
]. |
|
1369 |
s := 'left stepped method'. |
|
1370 |
left := true. |
|
1371 |
]. |
|
1372 |
] ifTrue:[ |
|
29 | 1373 |
"/ 'found it right in sender' printNL. |
554 | 1374 |
s := 'after step' |
1375 |
]. |
|
1376 |
] ifTrue:[ |
|
29 | 1377 |
"/ 'found it right away' printNL. |
554 | 1378 |
s := 'after step' |
1379 |
]. |
|
0 | 1380 |
] ifFalse:[ |
57 | 1381 |
"/ ' send' printNL. |
554 | 1382 |
" |
1383 |
a send |
|
1384 |
" |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1385 |
steppedContext := nil. |
554 | 1386 |
s := 'after send' |
0 | 1387 |
]. |
7 | 1388 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1389 |
left ifTrue:[ |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1390 |
"/ special care for stepInterrupt in send, |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1391 |
"/ when created a dummy context (lineNr == 1) |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1392 |
|
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1393 |
steppedContext lineNumber isNil ifTrue:[ |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1394 |
steppedContext selector == here sender selector ifTrue:[ |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1395 |
left := false. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1396 |
s := 'after step'. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1397 |
steppedContext := here sender. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1398 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1399 |
] |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1400 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1401 |
|
57 | 1402 |
inBlock ifTrue:[ |
1403 |
"/ 'inBlock' printNL. |
|
554 | 1404 |
s := 'in block'. |
57 | 1405 |
]. |
1406 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1407 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1408 |
where notNil ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1409 |
'(' 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
|
1410 |
where print. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1411 |
'[' 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
|
1412 |
]. |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
1413 |
]. |
57 | 1414 |
|
1415 |
ignore := false. |
|
78 | 1416 |
|
57 | 1417 |
(bigStep |
78 | 1418 |
and:[steppedContextLineno notNil |
57 | 1419 |
and:[where notNil |
78 | 1420 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1421 |
DebuggingDebugger == true ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1422 |
'same line - ignored' printNL. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1423 |
]. |
554 | 1424 |
ignore := true |
57 | 1425 |
]. |
1426 |
||
1427 |
(left not |
|
1428 |
and:[skipLineNr notNil |
|
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1429 |
and:[where notNil |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1430 |
and:[where lineNumber < skipLineNr]]]) ifTrue:[ |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1431 |
DebuggingDebugger == true ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1432 |
'skip (' print. skipLineNr print. ' unreached - ignored' printNL. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1433 |
]. |
554 | 1434 |
ignore := true |
57 | 1435 |
]. |
1436 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1437 |
(steppedContextLineno isNil |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1438 |
and:[skipLineNr isNil |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1439 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1440 |
DebuggingDebugger == true ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1441 |
'same line2 (after conIRQ) - ignored' printNL. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1442 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1443 |
ignore := true |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1444 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1445 |
|
57 | 1446 |
ignore ifTrue:[ |
1447 |
"/' ' printNL. |
|
554 | 1448 |
where := nil. here := nil. |
1449 |
" |
|
1450 |
yes, a context below |
|
1451 |
- continue and schedule another stepInterrupt. |
|
1452 |
Must flush caches since optimized methods not always |
|
1453 |
look for pending interrupts |
|
1454 |
" |
|
1455 |
ObjectMemory flushInlineCaches. |
|
1456 |
StepInterruptPending := 1. |
|
1457 |
InterruptPending := 1. |
|
1458 |
InStepInterrupt := nil. |
|
1459 |
^ nil |
|
57 | 1460 |
]. |
1461 |
||
1462 |
"/ ' ' printNL. |
|
1463 |
||
29 | 1464 |
name := Processor activeProcess nameOrId. |
7 | 1465 |
self label:(s , ' (process: ' , name , ')'). |
1466 |
||
57 | 1467 |
tracing := false. |
1468 |
bigStep := false. |
|
1469 |
||
0 | 1470 |
"release refs to context" |
1471 |
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
|
1472 |
"/'enter' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1473 |
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
|
1474 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1475 |
"Created: 14.10.1996 / 12:53:39 / cg" |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1476 |
"Modified: 22.10.1996 / 11:31:44 / cg" |
0 | 1477 |
! ! |
1478 |
||
266 | 1479 |
!DebugView methodsFor:'menu / button actions'! |
1480 |
||
1481 |
autoUpdateOff |
|
1482 |
"stop the update process" |
|
1483 |
||
1484 |
updateProcess notNil ifTrue:[ |
|
1485 |
monitorToggle lampColor:(Color yellow). |
|
1486 |
updateProcess terminate. |
|
1487 |
updateProcess := nil |
|
1488 |
] |
|
1489 |
! |
|
1490 |
||
1491 |
autoUpdateOn |
|
1492 |
"fork a subprocess which updates the contextList in regular intervals" |
|
1493 |
||
1494 |
updateProcess isNil ifTrue:[ |
|
1495 |
updateProcess := |
|
1496 |
[ |
|
1497 |
[true] whileTrue:[ |
|
1498 |
monitorToggle showLamp ifTrue:[ |
|
1499 |
monitorToggle lampColor:(Color yellow). |
|
1500 |
] ifFalse:[ |
|
1501 |
monitorToggle activeForegroundColor:Color black. |
|
1502 |
]. |
|
1503 |
(Delay forSeconds:0.25) wait. |
|
1504 |
self updateContext. |
|
1505 |
monitorToggle showLamp ifTrue:[ |
|
1506 |
monitorToggle lampColor:(Color red). |
|
1507 |
] ifFalse:[ |
|
1508 |
monitorToggle activeForegroundColor:Color red. |
|
1509 |
]. |
|
1510 |
(Delay forSeconds:0.25) wait. |
|
1511 |
self updateContext. |
|
1512 |
] |
|
1513 |
] forkAt:(Processor activePriority - 1) |
|
1514 |
] |
|
1515 |
||
1516 |
! |
|
1517 |
||
1518 |
browse |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1519 |
|mthd w sel cls| |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1520 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1521 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1522 |
mthd notNil ifTrue:[ |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1523 |
w := selectedContext method who. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1524 |
w notNil ifTrue:[ |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1525 |
cls := w at:1. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1526 |
sel := w at:2. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1527 |
] |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1528 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1529 |
cls isNil ifTrue:[ |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1530 |
"/ class not found - try receiver |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1531 |
cls := selectedContext receiver class |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1532 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1533 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1534 |
cls browserClass openInClass:cls selector:sel. |
266 | 1535 |
|
1536 |
"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
|
1537 |
"Modified: 28.6.1996 / 17:33:50 / cg" |
266 | 1538 |
! |
1539 |
||
1540 |
browseClass |
|
527 | 1541 |
|w cls| |
1542 |
||
1543 |
w := selectedContext method who. |
|
1544 |
cls := w at:1. |
|
1545 |
cls browserClass browseClass:cls |
|
1546 |
||
1547 |
"Modified: 3.5.1996 / 12:37:59 / cg" |
|
266 | 1548 |
! |
1549 |
||
1550 |
browseClassHierarchy |
|
527 | 1551 |
|w cls| |
1552 |
||
1553 |
w := selectedContext method who. |
|
1554 |
cls := w at:1. |
|
1555 |
cls browserClass browseClassHierarchy:cls. |
|
1556 |
||
1557 |
"Modified: 3.5.1996 / 12:38:17 / cg" |
|
266 | 1558 |
! |
1559 |
||
1560 |
browseFullClassProtocol |
|
527 | 1561 |
|w cls| |
1562 |
||
1563 |
w := selectedContext method who. |
|
1564 |
cls := w at:1. |
|
1565 |
cls browserClass browseFullClassProtocol:cls. |
|
1566 |
||
1567 |
"Modified: 3.5.1996 / 12:38:30 / cg" |
|
266 | 1568 |
! |
1569 |
||
1570 |
copyWalkbackText |
|
1571 |
"place the contents of the walkback view into the copy-paste buffer. |
|
1572 |
This allows pasting it into some other view for printing ..." |
|
1573 |
||
1574 |
self setTextSelection:(contextArray collect:[:con | con fullPrintString]) asStringCollection |
|
1575 |
||
1576 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
1577 |
! |
|
1578 |
||
1579 |
doAbort |
|
1580 |
"abort - send Object>>abortSignal, which is usually cought |
|
1581 |
at save places (for example: in the event loop) and returns back |
|
1582 |
from whatever the process is doing, but does not terminate it." |
|
1583 |
||
1584 |
inspecting ifTrue:[ |
|
477 | 1585 |
inspectedProcess isDead ifTrue:[ |
1586 |
self showTerminated. |
|
1587 |
^ self |
|
1588 |
]. |
|
1589 |
(Object abortSignal isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
1590 |
self showError:'** the process does not handle the abort signal **' |
|
1591 |
] ifTrue:[ |
|
1592 |
self interruptProcessWith:[Object abortSignal raise]. |
|
1593 |
]. |
|
1594 |
^ self |
|
266 | 1595 |
]. |
1596 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1597 |
steppedContext := nil. |
266 | 1598 |
haveControl := false. |
1599 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1600 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1601 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1602 |
catchBlock notNil ifTrue:[ |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1603 |
abortButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1604 |
catchBlock value. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1605 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1606 |
"/ not reached |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1607 |
'DEBUGGER: oops, abort failed' errorPrintNL. |
266 | 1608 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1609 |
|
266 | 1610 |
^ self. |
1611 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1612 |
"Modified: 21.10.1996 / 13:47:28 / cg" |
266 | 1613 |
! |
1614 |
||
1615 |
doContinue |
|
1616 |
"continue from menu" |
|
1617 |
||
1618 |
inspecting ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1619 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1620 |
continueButton foregroundColor:Color red darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1621 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1622 |
continueButton label:(resources string:'stop'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1623 |
continueButton action:[self doStop]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1624 |
|
477 | 1625 |
self processPerform:#resume. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1626 |
|
477 | 1627 |
^ self |
266 | 1628 |
]. |
1629 |
canContinue ifTrue:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1630 |
steppedContext := nil. |
477 | 1631 |
tracing := false. |
1632 |
haveControl := false. |
|
1633 |
exitAction := #continue. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1634 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1635 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1636 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1637 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1638 |
"/ not reached. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1639 |
'DEBUGGER: oops, continue failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1640 |
continueButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1641 |
|
266 | 1642 |
] ifFalse:[ |
477 | 1643 |
inspecting ifFalse:[ |
1644 |
'resuming top context' errorPrintNL. |
|
1645 |
self showSelection:1. |
|
1646 |
self doReturn |
|
1647 |
] |
|
266 | 1648 |
] |
477 | 1649 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1650 |
"Modified: 21.10.1996 / 13:47:31 / cg" |
266 | 1651 |
! |
1652 |
||
1653 |
doNext |
|
1654 |
"skip for next source-code line" |
|
1655 |
||
1656 |
self doStep:nil |
|
1657 |
! |
|
1658 |
||
1659 |
doNoTrace |
|
1660 |
traceView notNil ifTrue:[ |
|
1661 |
traceView topView destroy. |
|
1662 |
traceView := nil. |
|
1663 |
]. |
|
1664 |
tracing := false |
|
1665 |
! |
|
1666 |
||
1667 |
doRestart |
|
1668 |
"restart - the selected context will be restarted" |
|
1669 |
||
1670 |
inspecting ifTrue:[ |
|
477 | 1671 |
selectedContext isNil ifTrue:[ |
1672 |
^ self showError:'** select a context first **' |
|
1673 |
]. |
|
1674 |
self interruptProcessWith:[selectedContext unwindAndRestart]. |
|
1675 |
^ self |
|
266 | 1676 |
]. |
1677 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1678 |
steppedContext := nil. |
266 | 1679 |
haveControl := false. |
1680 |
exitAction := #restart. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1681 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1682 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1683 |
catchBlock notNil ifTrue:[catchBlock value]. |
477 | 1684 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1685 |
"/ not reached |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1686 |
'DEBUGGER: oops, restart failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1687 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1688 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1689 |
"Modified: 21.10.1996 / 13:47:35 / cg" |
266 | 1690 |
! |
1691 |
||
1692 |
doReturn |
|
1693 |
"return - the selected context will do a ^nil" |
|
1694 |
||
1695 |
inspecting ifTrue:[ |
|
477 | 1696 |
selectedContext isNil ifTrue:[ |
1697 |
^ self showError:'** select a context first **' |
|
1698 |
]. |
|
1699 |
self interruptProcessWith:[selectedContext unwind]. |
|
1700 |
^ self |
|
266 | 1701 |
]. |
1702 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1703 |
steppedContext := nil. |
266 | 1704 |
haveControl := false. |
1705 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1706 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1707 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1708 |
catchBlock notNil ifTrue:[catchBlock value]. |
477 | 1709 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1710 |
"/ not reached |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1711 |
'DEBUGGER: oops, return failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1712 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1713 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1714 |
"Modified: 21.10.1996 / 13:47:38 / cg" |
266 | 1715 |
! |
1716 |
||
1717 |
doSend |
|
1718 |
"single send; reenter with next message send" |
|
1719 |
||
1720 |
inspecting ifTrue:[^ self]. |
|
1721 |
||
1722 |
canContinue ifTrue:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1723 |
steppedContext := nil. |
477 | 1724 |
haveControl := false. |
1725 |
exitAction := #step. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1726 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1727 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1728 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1729 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1730 |
"/ not reached |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1731 |
'DEBUGGER: oops, send failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1732 |
sendButton turnOff. |
266 | 1733 |
] |
477 | 1734 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1735 |
"Modified: 21.10.1996 / 13:47:41 / cg" |
266 | 1736 |
! |
1737 |
||
1738 |
doStep |
|
1739 |
"skip for next send in selected method" |
|
1740 |
||
1741 |
self doStep:-1 |
|
1742 |
! |
|
1743 |
||
1744 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1745 |
"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
|
1746 |
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
|
1747 |
or to next line (if nil) or to next send (if -1)" |
266 | 1748 |
|
1749 |
|con method| |
|
1750 |
||
1751 |
inspecting ifTrue:[^ self]. |
|
1752 |
||
1753 |
canContinue ifTrue:[ |
|
477 | 1754 |
selectedContext notNil ifTrue:[ |
1755 |
con := selectedContext. |
|
1756 |
steppedContextLineno := actualContext lineNumber. |
|
1757 |
] ifFalse:[ |
|
1758 |
con := contextArray at:2. |
|
1759 |
steppedContextLineno := con lineNumber. |
|
1760 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1761 |
|
477 | 1762 |
skipLineNr := lineNr. |
266 | 1763 |
|
477 | 1764 |
lineNr == -1 ifTrue:[ |
1765 |
steppedContextLineno := skipLineNr := nil. |
|
1766 |
]. |
|
266 | 1767 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1768 |
steppedContext := con. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1769 |
|
477 | 1770 |
" |
1771 |
if we step in a wrapped method, |
|
1772 |
prepare to skip the prolog ... |
|
1773 |
" |
|
266 | 1774 |
"/ ' step con:' print. steppedContextAddress printHex. ' ' printNL. |
477 | 1775 |
inWrap := false. |
1776 |
method := con method. |
|
1777 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
1778 |
inWrap := true |
|
1779 |
]. |
|
266 | 1780 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1781 |
lineNr == #return ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1782 |
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
|
1783 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1784 |
|
477 | 1785 |
con := nil. |
1786 |
bigStep := true. |
|
1787 |
haveControl := false. |
|
1788 |
exitAction := #step. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1789 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1790 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1791 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1792 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1793 |
"/ not reached |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1794 |
'DEBUGGER: oops, step failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1795 |
stepButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1796 |
nextButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1797 |
sendButton turnOff. |
266 | 1798 |
] |
477 | 1799 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1800 |
"Modified: 21.10.1996 / 13:47:49 / cg" |
266 | 1801 |
! |
1802 |
||
1803 |
doStop |
|
1804 |
"stop the process (if its running, otherwise this is a no-op)" |
|
1805 |
||
1806 |
inspecting ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1807 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1808 |
continueButton foregroundColor:Color green darkened darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1809 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1810 |
continueButton label:(resources string:'continue'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1811 |
continueButton action:[self doContinue]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1812 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1813 |
self processPerform:#stop. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1814 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1815 |
^ self |
266 | 1816 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1817 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1818 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 1819 |
! |
1820 |
||
1821 |
doTerminate |
|
1822 |
"terminate - the process has a chance for cleanup" |
|
1823 |
||
1824 |
inspecting ifTrue:[ |
|
477 | 1825 |
self processPerform:#terminate. |
1826 |
^ self |
|
266 | 1827 |
]. |
1828 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1829 |
steppedContext := nil. |
266 | 1830 |
haveControl := false. |
1831 |
exitAction := #terminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1832 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1833 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1834 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1835 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1836 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1837 |
inspecting ifFalse:[ |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1838 |
'DEBUGGER: oops, terminate failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1839 |
self warn:'terminate failed'. |
266 | 1840 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1841 |
terminateButton turnOff. |
477 | 1842 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1843 |
"Modified: 21.10.1996 / 13:48:00 / cg" |
266 | 1844 |
! |
1845 |
||
1846 |
doTrace |
|
1847 |
"tracing - not really implemented ..." |
|
1848 |
||
1849 |
self warn:'this function is not yet implemented'. |
|
1850 |
||
1851 |
"/ |v b| |
|
1852 |
"/ |
|
1853 |
"/ traceView isNil ifTrue:[ |
|
1854 |
"/ v := StandardSystemView on:Display. |
|
1855 |
"/ v label:'Debugger-Trace'. |
|
1856 |
"/ v icon:icon. |
|
1857 |
"/ |
|
1858 |
"/ b := Button label:'untrace' in:v. |
|
1859 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
1860 |
"/ b action:[ |
|
1861 |
"/ StepInterruptPending := nil. |
|
1862 |
"/ tracing := false. |
|
1863 |
"/ v unrealize. |
|
1864 |
"/ traceView := nil |
|
1865 |
"/ ]. |
|
1866 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
1867 |
"/ traceView origin:(0 @ (b height)) |
|
1868 |
"/ extent:[v width @ (v height - b height)] |
|
1869 |
"/ ]. |
|
1870 |
"/ v realize. |
|
1871 |
"/ |
|
1872 |
"/ tracing := true. |
|
1873 |
! |
|
1874 |
||
1875 |
doTraceStep |
|
1876 |
"tracestep - not implemented yet" |
|
1877 |
||
1878 |
canContinue ifTrue:[ |
|
1879 |
tracing := true. |
|
1880 |
self doStep |
|
1881 |
] |
|
1882 |
! |
|
1883 |
||
1884 |
exit |
|
1885 |
"exit from menu: immediate exit from smalltalk" |
|
1886 |
||
1887 |
OperatingSystem exit |
|
1888 |
! |
|
1889 |
||
1890 |
implementors |
|
1891 |
"open a browser on the implementors" |
|
1892 |
||
1893 |
selectedContext isNil ifTrue:[ |
|
1894 |
^ self showError:'** select a context first **' |
|
1895 |
]. |
|
1896 |
SystemBrowser browseImplementorsOf:selectedContext selector. |
|
1897 |
! |
|
1898 |
||
1899 |
inspectContext |
|
1900 |
"launch an inspector on the currently selected context" |
|
1901 |
||
1902 |
contextView selection notNil ifTrue:[ |
|
1903 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
|
1904 |
(contextArray at:(contextView selection)) inspect. |
|
1905 |
] |
|
1906 |
] |
|
1907 |
! |
|
1908 |
||
1909 |
quickTerminate |
|
1910 |
"quick terminate - the process will get no chance for cleanup actions" |
|
1911 |
||
1912 |
inspecting ifTrue:[ |
|
477 | 1913 |
self processPerform:#terminateNoSignal. |
1914 |
^ self |
|
266 | 1915 |
]. |
1916 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1917 |
steppedContext := nil. |
266 | 1918 |
haveControl := false. |
1919 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1920 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1921 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1922 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1923 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1924 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1925 |
inspecting ifFalse:[ |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1926 |
'DEBUGGER: oops, terminate failed' errorPrintNL. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1927 |
self warn:'terminate failed'. |
266 | 1928 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1929 |
terminateButton turnOff. |
477 | 1930 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1931 |
"Modified: 21.10.1996 / 13:48:05 / cg" |
266 | 1932 |
! |
1933 |
||
1934 |
removeAllBreakpoints |
|
1935 |
"remove all trace & breakpoints - if any" |
|
1936 |
||
1937 |
MessageTracer unwrapAllMethods |
|
1938 |
! |
|
1939 |
||
1940 |
removeBreakpoint |
|
1941 |
"remove breakpoint on the selected contexts method - if any" |
|
1942 |
||
1943 |
|implementorClass method| |
|
1944 |
||
1945 |
selectedContext isNil ifTrue:[ |
|
1946 |
^ self showError:'** select a context first **' |
|
1947 |
]. |
|
1948 |
||
1949 |
implementorClass := selectedContext methodClass. |
|
1950 |
implementorClass notNil ifTrue:[ |
|
1951 |
method := implementorClass compiledMethodAt:selectedContext selector. |
|
1952 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
1953 |
MessageTracer unwrapMethod:method |
|
1954 |
] |
|
1955 |
]. |
|
1956 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
1957 |
! |
|
1958 |
||
1959 |
senders |
|
1960 |
"open a browser on the senders" |
|
1961 |
||
1962 |
selectedContext isNil ifTrue:[ |
|
1963 |
^ self showError:'** select a context first **' |
|
1964 |
]. |
|
1965 |
SystemBrowser browseAllCallsOn:selectedContext selector. |
|
1966 |
! |
|
1967 |
||
1968 |
showMore |
|
1969 |
"double number of contexts shown" |
|
1970 |
||
1971 |
|oldSelection con| |
|
1972 |
||
1973 |
contextArray notNil ifTrue:[ |
|
563 | 1974 |
oldSelection := contextView selection. |
1975 |
nChainShown := nChainShown * 2. |
|
1976 |
con := contextArray at:1. |
|
1977 |
contextArray at:1 put:nil. |
|
1978 |
self setContext:con. |
|
1979 |
contextView setSelection:oldSelection. |
|
266 | 1980 |
] |
563 | 1981 |
|
1982 |
"Modified: 25.5.1996 / 12:26:55 / cg" |
|
266 | 1983 |
! |
1984 |
||
1985 |
skip |
|
1986 |
"skip for cursor line in selected method" |
|
1987 |
||
1988 |
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
|
1989 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1990 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1991 |
skipForReturn |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1992 |
"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
|
1993 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1994 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1995 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1996 |
"Modified: 14.10.1996 / 13:22:46 / cg" |
266 | 1997 |
! ! |
1998 |
||
1999 |
!DebugView methodsFor:'private'! |
|
2000 |
||
2001 |
busy |
|
2002 |
^ busy |
|
2003 |
! |
|
2004 |
||
2005 |
cacheMyself |
|
2006 |
"remember myself for next debug session" |
|
2007 |
||
2008 |
"caching the last debugger will make the next debugger appear |
|
2009 |
faster, since no resources have to be allocated in the display. |
|
2010 |
We have to be careful to release all refs to the debuggee, though. |
|
2011 |
Otherwise, the GC will not be able to release it" |
|
2012 |
||
2013 |
windowGroup notNil ifTrue:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2014 |
windowGroup setProcess:nil. |
266 | 2015 |
]. |
2016 |
||
2017 |
busy := false. |
|
2018 |
codeView acceptAction:nil. |
|
2019 |
codeView doItAction:nil. |
|
2020 |
codeView contents:nil. |
|
2021 |
receiverInspector release. |
|
2022 |
contextInspector release. |
|
2023 |
inspectedProcess := nil. |
|
2024 |
exitAction := nil. |
|
2025 |
contextArray := nil. |
|
2026 |
selectedContext := actualContext := nil. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2027 |
steppedContext := nil. |
266 | 2028 |
catchBlock := nil. |
2029 |
grabber := nil. |
|
2030 |
self autoUpdateOff. |
|
2031 |
||
2032 |
exclusive ifTrue:[CachedExclusive := self] ifFalse:[CachedDebugger := self]. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2033 |
|
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2034 |
"Modified: 21.10.1996 / 13:42:45 / cg" |
266 | 2035 |
! |
2036 |
||
2037 |
exclusive:aBoolean |
|
2038 |
exclusive := aBoolean |
|
2039 |
! |
|
2040 |
||
2041 |
inspectedProcess |
|
2042 |
^ inspectedProcess |
|
2043 |
! |
|
2044 |
||
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
2045 |
interestingContextFrom:aContext |
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
2046 |
"return an interesting contexts offset, or nil. |
266 | 2047 |
This is the context initially shown in the walkback. |
2048 |
We move up the calling chain, skipping all intermediate Signal |
|
2049 |
and Exception contexts, to present the context in which the error |
|
2050 |
actually occured. |
|
2051 |
Just for your convenience :-)" |
|
2052 |
||
2053 |
|c found offset sel prev ex| |
|
2054 |
||
687 | 2055 |
aContext isBlockContext ifTrue:[^ 1]. |
2056 |
||
266 | 2057 |
"somewhere, at the bottom, there must be a raise ..." |
2058 |
||
2059 |
c := aContext. |
|
2060 |
1 to:5 do:[:i | |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2061 |
c isNil ifTrue:[^ 1 "^ nil"]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2062 |
sel := c selector. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2063 |
(sel == #raise) ifTrue:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2064 |
(c receiver isKindOf:Exception) ifTrue:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2065 |
ex := c receiver. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2066 |
offset := i. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2067 |
found := c |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2068 |
] ifFalse:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2069 |
(c receiver isSignal) ifTrue:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2070 |
offset := i. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2071 |
found := c |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2072 |
] |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2073 |
] |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2074 |
]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2075 |
c := c sender. |
266 | 2076 |
]. |
2077 |
||
2078 |
" |
|
2079 |
if this is a noHandler exception, skip forward |
|
2080 |
to the erronous context |
|
2081 |
" |
|
2082 |
ex notNil ifTrue:[ |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2083 |
ex signal == Signal noHandlerSignal ifTrue:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2084 |
c := ex suspendedContext |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2085 |
] |
266 | 2086 |
]. |
2087 |
||
687 | 2088 |
(c := found) isNil ifTrue:[ |
2089 |
"/ this is a kludge, but convenient. |
|
2090 |
"/ show the place where the divisionByZero happend, |
|
2091 |
"/ not where the signal was raised. |
|
2092 |
||
2093 |
sel := aContext selector. |
|
2094 |
(sel == #// |
|
2095 |
or:[sel == #/ |
|
2096 |
or:[sel == #\\]]) ifTrue:[ |
|
2097 |
^ 2 |
|
2098 |
]. |
|
2099 |
||
2100 |
^ 1 |
|
2101 |
]. |
|
266 | 2102 |
|
2103 |
" |
|
2104 |
got it; move up, skipping all intermediate Signal and |
|
2105 |
Exception contexts |
|
2106 |
" |
|
2107 |
prev := nil. |
|
2108 |
[ |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2109 |
((c receiver isSignal) |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2110 |
or:[(c receiver isKindOf:Exception)]) |
266 | 2111 |
] whileTrue:[ |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2112 |
prev := c. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2113 |
(c := c sender) isNil ifTrue:[^ offset]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2114 |
offset := offset + 1. |
266 | 2115 |
]. |
2116 |
||
2117 |
" |
|
687 | 2118 |
now, we are one above the raising context |
266 | 2119 |
" |
2120 |
||
2121 |
" |
|
269 | 2122 |
if the sender-method of the raise is one of objects error methods ... |
266 | 2123 |
" |
2124 |
( #( halt halt: |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2125 |
error error: |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2126 |
doesNotUnderstand: |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2127 |
subclassResponsibility |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2128 |
primitiveFailed) includes:c selector) |
266 | 2129 |
ifTrue:[ |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2130 |
c selector == #doesNotUnderstand: ifTrue:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2131 |
" |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2132 |
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
|
2133 |
" |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2134 |
(c := c sender) isNil ifTrue:[^ offset]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2135 |
offset := offset + 1. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2136 |
]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2137 |
(c := c sender) isNil ifTrue:[^ offset]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2138 |
offset := offset + 1. |
266 | 2139 |
] ifFalse:[ |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2140 |
" |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2141 |
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
|
2142 |
" |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2143 |
(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
|
2144 |
offset := offset + 1 |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2145 |
]. |
266 | 2146 |
]. |
2147 |
||
2148 |
^ offset |
|
269 | 2149 |
|
2150 |
"Created: 10.12.1995 / 13:55:21 / cg" |
|
687 | 2151 |
"Modified: 26.7.1996 / 16:34:58 / cg" |
266 | 2152 |
! |
2153 |
||
2154 |
interruptProcessWith:aBlock |
|
2155 |
"let inspected process do something, then update the context list" |
|
2156 |
||
2157 |
inspectedProcess isDead ifTrue:[ |
|
2158 |
self showTerminated. |
|
2159 |
^ self |
|
2160 |
]. |
|
2161 |
inspectedProcess interruptWith:aBlock. |
|
2162 |
" |
|
2163 |
give the process a chance to run, then update |
|
2164 |
" |
|
2165 |
(Delay forSeconds:0.2) wait. |
|
2166 |
self setContext:(inspectedProcess suspendedContext). |
|
2167 |
! |
|
2168 |
||
2169 |
processPerform:aMessage |
|
2170 |
"do something, then update the context list" |
|
2171 |
||
2172 |
inspectedProcess isDead ifTrue:[ |
|
2173 |
self showTerminated. |
|
2174 |
^ self |
|
2175 |
]. |
|
2176 |
inspectedProcess perform:aMessage. |
|
2177 |
" |
|
2178 |
give the process a chance to run, then update |
|
2179 |
" |
|
2180 |
(Delay forSeconds:0.2) wait. |
|
2181 |
self setContext:(inspectedProcess suspendedContext). |
|
2182 |
! |
|
2183 |
||
2184 |
setContext:aContext |
|
2185 |
"show calling chain from aContext in the walk-back listview" |
|
2186 |
||
641 | 2187 |
^ 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
|
2188 |
|
641 | 2189 |
"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
|
2190 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2191 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2192 |
setContext:aContext releaseInspectors:releaseInspectors |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2193 |
"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
|
2194 |
|
266 | 2195 |
|con text method caller caller2 m count| |
2196 |
||
2197 |
(contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[ |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2198 |
"no change" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2199 |
^ false |
266 | 2200 |
]. |
2201 |
||
2202 |
m := contextView middleButtonMenu. |
|
2203 |
m notNil ifTrue:[ |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2204 |
m disable:#showMore. |
266 | 2205 |
]. |
2206 |
||
2207 |
aContext isNil ifTrue:[ |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2208 |
text := Array with:'** no context **'. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2209 |
contextArray := nil. |
266 | 2210 |
] ifFalse:[ |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2211 |
text := OrderedCollection new:nChainShown. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2212 |
contextArray := OrderedCollection new:nChainShown. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2213 |
con := aContext. |
266 | 2214 |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2215 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2216 |
get them all |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2217 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2218 |
count := 0. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2219 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2220 |
contextArray add:con. count := count + 1. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2221 |
(MoreDebuggingDetail == true) ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2222 |
text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2223 |
] ifFalse:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2224 |
text add:con printString. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2225 |
]. |
266 | 2226 |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2227 |
method := con method. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2228 |
(method notNil and:[method isWrapped]) ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2229 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2230 |
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
|
2231 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2232 |
caller := con sender. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2233 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2234 |
caller2 := caller sender. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2235 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2236 |
con := caller2 |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2237 |
] |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2238 |
]. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2239 |
caller := caller2 := nil |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2240 |
]. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2241 |
con := con sender |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2242 |
]. |
266 | 2243 |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2244 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2245 |
did we reach the end ? |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2246 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2247 |
(con isNil or:[con sender isNil]) ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2248 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2249 |
the very last one is the startup context |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2250 |
(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
|
2251 |
" |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2252 |
contextArray last selector isNil ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2253 |
contextArray removeLast. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2254 |
text removeLast |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2255 |
] |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2256 |
] ifFalse:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2257 |
m notNil ifTrue:[ |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2258 |
m enable:#showMore. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2259 |
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
|
2260 |
]. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2261 |
]. |
266 | 2262 |
]. |
2263 |
||
2264 |
contextView setList:text. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2265 |
releaseInspectors ifTrue:[ |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2266 |
receiverInspector release. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2267 |
contextInspector release. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2268 |
]. |
266 | 2269 |
|
2270 |
m notNil ifTrue:[ |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2271 |
m disable:#removeBreakpoint. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2272 |
m disable:#implementors. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2273 |
m disable:#senders. |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2274 |
m disable:#browseClass. |
266 | 2275 |
]. |
2276 |
^ true |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2277 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2278 |
"Created: 14.12.1995 / 19:10:31 / cg" |
266 | 2279 |
! |
2280 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2281 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2282 |
"show calling chain from aContext in the walk-back listview. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2283 |
Ignore any non-interresting interrupt-context." |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2284 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2285 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2286 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2287 |
con := aContext. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2288 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2289 |
con := con sender. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2290 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2291 |
con := con sender. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2292 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2293 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2294 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2295 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2296 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2297 |
"Modified: 27.6.1996 / 17:21:59 / cg" |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2298 |
"Created: 20.10.1996 / 18:10:21 / cg" |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2299 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2300 |
|
266 | 2301 |
showError:message |
2302 |
codeView contents:(resources string:message). |
|
2303 |
shown ifTrue:[ |
|
2304 |
exclusive ifTrue:[ |
|
2305 |
"/ consider this a kludge: |
|
2306 |
"/ if exclusive, cannot use flash, since it suspends |
|
2307 |
"/ (but we cannot suspend here ...) |
|
2308 |
codeView redrawInverted. device flush. |
|
2309 |
OperatingSystem millisecondDelay:200. |
|
2310 |
codeView redraw |
|
2311 |
] ifFalse:[ |
|
2312 |
codeView flash |
|
2313 |
] |
|
2314 |
] |
|
2315 |
||
2316 |
"Modified: 24.11.1995 / 22:07:30 / cg" |
|
2317 |
! |
|
2318 |
||
2319 |
showTerminated |
|
2320 |
self showError:'** the process has terminated **' |
|
2321 |
! |
|
2322 |
||
2323 |
stepping |
|
2324 |
^ stepping |
|
2325 |
! |
|
2326 |
||
2327 |
unstep |
|
2328 |
stepping := false. |
|
2329 |
bigStep := false. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2330 |
steppedContext := nil. |
266 | 2331 |
exitAction := nil |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2332 |
|
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2333 |
"Modified: 21.10.1996 / 13:47:53 / cg" |
266 | 2334 |
! |
2335 |
||
2336 |
updateContext |
|
2337 |
|oldContext idx| |
|
2338 |
||
2339 |
inspectedProcess state == #dead ifTrue:[ |
|
642
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2340 |
self showTerminated. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2341 |
^ self |
266 | 2342 |
]. |
2343 |
||
2344 |
oldContext := selectedContext. |
|
642
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2345 |
[ |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2346 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
642
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2347 |
oldContext notNil ifTrue:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2348 |
contextArray notNil ifTrue:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2349 |
idx := contextArray identityIndexOf:oldContext. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2350 |
idx ~~ 0 ifTrue:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2351 |
self showSelection:idx |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2352 |
] ifFalse:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2353 |
codeView contents:('** context returned **') |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2354 |
] |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2355 |
] |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2356 |
] |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2357 |
]. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2358 |
] valueUninterruptably. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2359 |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2360 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
266 | 2361 |
! ! |
2362 |
||
2363 |
!DebugView methodsFor:'private control loop'! |
|
2364 |
||
2365 |
controlLoop |
|
2366 |
"this is a kludge: |
|
664 | 2367 |
start a dispatchloop which exits when |
2368 |
either continue, return or step is pressed |
|
266 | 2369 |
" |
2370 |
||
2371 |
haveControl := true. |
|
664 | 2372 |
[ |
2373 |
[haveControl] whileTrue:[ |
|
2374 |
self controlLoopCatchingErrors |
|
2375 |
]. |
|
2376 |
] valueNowOrOnUnwindDo:[ |
|
2377 |
catchBlock := nil. |
|
2378 |
haveControl := false |
|
266 | 2379 |
]. |
664 | 2380 |
|
2381 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 2382 |
! |
2383 |
||
2384 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2385 |
"this is the debuggers own private event handling loop; |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2386 |
errors are cought, to prevent recursive debugger-invocations." |
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2387 |
|
266 | 2388 |
"setup a self removing catch-block" |
2389 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
2390 |
||
2391 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
448 | 2392 |
"if we do not have multiple processes or its a system process |
2393 |
we start another dispatch loop, which exits when |
|
2394 |
either continue, return or step is pressed |
|
2395 |
or (via the catchBlock) if an error occurs. |
|
2396 |
Since our display is an extra exclusive one, |
|
2397 |
all processing for normal views stops here ... |
|
2398 |
" |
|
266 | 2399 |
|
448 | 2400 |
WindowGroup setActiveGroup:windowGroup. |
2401 |
SignalSet anySignal handle:[:ex | |
|
2402 |
|signal| |
|
334 | 2403 |
|
448 | 2404 |
signal := ex signal. |
2405 |
self showError:'*** Error in modal debugger: |
|
266 | 2406 |
|
334 | 2407 |
>>>> Signal: ' , signal printString , ' |
266 | 2408 |
>>>> In: ' , ex suspendedContext printString , ' |
2409 |
>>>> Message: ' , ex errorString , ' |
|
2410 |
||
2411 |
cought & ignored.'. |
|
448 | 2412 |
ex return. |
2413 |
] do:[ |
|
2414 |
Object userNotificationSignal handle:[:ex | |
|
2415 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
|
2416 |
ex proceed |
|
2417 |
]. |
|
2418 |
self showError:ex errorString |
|
2419 |
] do:[ |
|
530 | 2420 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
2421 |
haveControl]. |
|
448 | 2422 |
] |
2423 |
]. |
|
2424 |
WindowGroup setActiveGroup:nil. |
|
266 | 2425 |
] ifFalse:[ |
448 | 2426 |
"we do have multiple processes - |
2427 |
simply enter the DebugViews-Windowgroup event loop. |
|
2428 |
effectively suspending event processing for the currently |
|
2429 |
active group. |
|
2430 |
" |
|
2431 |
SignalSet anySignal handle:[:ex | |
|
2432 |
|answer signal| |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2433 |
|
448 | 2434 |
signal := ex signal. |
266 | 2435 |
|
448 | 2436 |
"/ |
2437 |
"/ ignore recursive breakpoints |
|
2438 |
"/ |
|
2439 |
signal == MessageTracer breakpointSignal ifTrue:[ |
|
2440 |
'breakpoint in debugger ignored' errorPrintNL. |
|
2441 |
ex proceed |
|
2442 |
]. |
|
2443 |
(signal == ActivityNotificationSignal) ifTrue:[ |
|
2444 |
ex proceed |
|
2445 |
]. |
|
2446 |
signal == Exception recursiveExceptionSignal ifTrue:[ |
|
2447 |
ex parameter signal == MessageTracer breakpointSignal ifTrue:[ |
|
2448 |
'recursive breakpoint in debugger ignored' errorPrintNL. |
|
2449 |
ex proceed. |
|
2450 |
]. |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2451 |
|
448 | 2452 |
self showError:'*** Recursive error in debugger: |
266 | 2453 |
|
2454 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 2455 |
>>>> ' , ex parameter signal printString , ' |
266 | 2456 |
>>>> In: ' , ex suspendedContext printString , ' |
2457 |
>>>> Message: ' , ex errorString , ' |
|
2458 |
||
2459 |
cought & ignored.'. |
|
448 | 2460 |
ex return |
2461 |
]. |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2462 |
|
448 | 2463 |
self topView raiseDeiconified. |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2464 |
|
448 | 2465 |
answer := Dialog |
2466 |
choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs |
|
2467 |
labels:#('debug' 'proceed' 'cancel' ) |
|
2468 |
values:#(#debug #proceed #cancel) |
|
2469 |
default:#cancel. |
|
2470 |
answer == #debug ifTrue:[ |
|
2471 |
Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString. |
|
2472 |
ex proceed. |
|
2473 |
]. |
|
2474 |
answer == #proceed ifTrue:[ |
|
2475 |
ex proceed. |
|
2476 |
]. |
|
2477 |
ex return. |
|
2478 |
] do:[ |
|
530 | 2479 |
windowGroup eventLoopWhile:[Processor activeProcess state:#debug. |
2480 |
true] onLeave:[] |
|
448 | 2481 |
]. |
266 | 2482 |
]. |
2483 |
catchBlock := nil. |
|
2484 |
||
2485 |
"Created: 24.11.1995 / 20:33:45 / cg" |
|
530 | 2486 |
"Modified: 7.5.1996 / 10:04:41 / cg" |
266 | 2487 |
! ! |
2488 |
||
0 | 2489 |
!DebugView methodsFor:'user interaction'! |
2490 |
||
266 | 2491 |
codeAccept:someCode |
2492 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
2493 |
and including selected method cannot be continued." |
|
2494 |
||
2495 |
" |
|
2496 |
actually, this is not true, since the active methods will still be |
|
2497 |
executed correctly - however, the code shown in the debugger is no |
|
2498 |
longer in sync (showing the new code) with the executed code. |
|
2499 |
Therefore, we hide those contexts to avoid confusion .... |
|
2500 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
2501 |
||
2502 |
"walk up context chain and find highest context which is either the selected context, |
|
2503 |
or - if its a block-context - whose home is the selected context" |
|
2504 |
||
2505 |
|con top sel implementorClass method newMethod| |
|
2506 |
||
2507 |
codeView cursor:Cursor execute. |
|
2508 |
||
2509 |
" |
|
2510 |
find the method-home context for this one |
|
2511 |
" |
|
2512 |
con := selectedContext. |
|
2513 |
top := con. |
|
2514 |
[con notNil] whileTrue:[ |
|
2515 |
(con methodHome == selectedContext) ifTrue:[ |
|
2516 |
top := con |
|
2517 |
]. |
|
2518 |
con := con sender |
|
2519 |
]. |
|
2520 |
" |
|
2521 |
use class&selector to find the method for the compilation |
|
2522 |
and compile. |
|
2523 |
" |
|
2524 |
sel := selectedContext selector. |
|
2525 |
implementorClass := selectedContext methodClass. |
|
2526 |
method := implementorClass compiledMethodAt:sel. |
|
2527 |
newMethod := implementorClass compilerClass |
|
2528 |
compile:someCode |
|
2529 |
forClass:implementorClass |
|
2530 |
inCategory:(method category) |
|
2531 |
notifying:codeView. |
|
2532 |
||
2533 |
inspecting ifFalse:[ |
|
2534 |
" |
|
2535 |
if it worked, remove everything up to and including top |
|
2536 |
from context chain |
|
2537 |
" |
|
2538 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
2539 |
self setContext:(top sender). |
|
2540 |
||
2541 |
" |
|
2542 |
continue/step is no longer possible |
|
2543 |
" |
|
2544 |
canContinue := false. |
|
2545 |
self showSelection:1. |
|
2546 |
exitAction := #return |
|
2547 |
]. |
|
2548 |
]. |
|
2549 |
codeView cursor:Cursor normal |
|
2550 |
! |
|
2551 |
||
2552 |
destroy |
|
2553 |
"closing the debugger implies an abort or continue" |
|
2554 |
||
2555 |
contextView middleButtonMenu hide. |
|
2556 |
||
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2557 |
inspecting ifFalse:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2558 |
CachedExclusive == self ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2559 |
CachedExclusive := nil. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2560 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2561 |
CachedDebugger == self ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2562 |
CachedDebugger := nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2563 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2564 |
|
669
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2565 |
"/ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2566 |
"/ catch invalid return; |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2567 |
"/ 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
|
2568 |
"/ 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
|
2569 |
"/ #destroy-window function. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2570 |
"/ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2571 |
Context invalidReturnSignal handle:[:ex | |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2572 |
'DEBUGGER: OOPS - non regular debugView closing' infoPrintCR. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2573 |
DebugView newDebugger. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2574 |
ex return. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2575 |
] do:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2576 |
inspecting ifFalse:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2577 |
canAbort ifTrue:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2578 |
self doAbort. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2579 |
] ifFalse:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2580 |
self doContinue |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2581 |
] |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
2582 |
]. |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2583 |
]. |
554 | 2584 |
'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
|
2585 |
DebugView newDebugger. |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2586 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2587 |
|
266 | 2588 |
" |
2589 |
we manually release all private data, since the Debugger |
|
2590 |
is cached for reuse - thus the memory would not be collectable |
|
2591 |
otherwise. |
|
2592 |
" |
|
2593 |
codeView acceptAction:nil. |
|
2594 |
codeView doItAction:nil. |
|
2595 |
codeView contents:nil. |
|
2596 |
catchBlock := nil. |
|
2597 |
||
2598 |
receiverInspector release. |
|
2599 |
contextInspector release. |
|
2600 |
inspectedProcess := nil. |
|
2601 |
exitAction := nil. |
|
2602 |
contextArray := nil. |
|
2603 |
selectedContext := actualContext := nil. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2604 |
steppedContext := nil. |
266 | 2605 |
grabber := nil. |
2606 |
self autoUpdateOff. |
|
2607 |
||
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2608 |
super destroy "/ 1.12.94 |
266 | 2609 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2610 |
"Modified: 21.10.1996 / 13:43:40 / cg" |
266 | 2611 |
! |
2612 |
||
0 | 2613 |
showSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2614 |
"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
|
2615 |
Also sent to autoselect an interesting context on entry." |
0 | 2616 |
|
56 | 2617 |
|con homeContext sel method code canAccept |
105 | 2618 |
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
|
2619 |
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
|
2620 |
mthd cls w| |
0 | 2621 |
|
2622 |
contextArray notNil ifTrue:[ |
|
563 | 2623 |
lineNr <= contextArray size ifTrue:[ |
2624 |
con := contextArray at:lineNr. |
|
2625 |
]. |
|
2626 |
" |
|
2627 |
clicking on the '** ...'-line shows more ... |
|
2628 |
" |
|
2629 |
con isNil ifTrue:[ |
|
2630 |
line := contextView list at:lineNr. |
|
2631 |
(line startsWith:'**') ifTrue:[ |
|
2632 |
self showMore. |
|
2633 |
contextView setSelection:lineNr. |
|
2634 |
con := contextArray at:lineNr |
|
2635 |
]. |
|
2636 |
con isNil ifTrue:[^ self]. |
|
2637 |
]. |
|
105 | 2638 |
|
563 | 2639 |
self withWaitCursorDo:[ |
2640 |
" |
|
2641 |
give it to the (lower right) inspector |
|
2642 |
" |
|
2643 |
contextInspector inspect:con. |
|
105 | 2644 |
|
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2645 |
con hasStackToShow ifTrue:[ |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2646 |
stackInspector isNil ifTrue:[ |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2647 |
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
|
2648 |
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
|
2649 |
|
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2650 |
stackInspector := InspectorView |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2651 |
origin:(0.6 @ 0.0) corner:(1.0 @ 1.0) |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2652 |
in:contextInspector superView. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2653 |
stackInspector realize. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2654 |
stackInspector label:'stack'. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2655 |
stackInspector hideReceiver:true. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2656 |
]. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2657 |
stackInspector inspect:(con stackFrame asArray). |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2658 |
stackInspector showLast. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2659 |
] ifFalse:[ |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2660 |
stackInspector notNil ifTrue:[ |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2661 |
stackInspector destroy. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2662 |
stackInspector := nil. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2663 |
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
|
2664 |
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
|
2665 |
] |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2666 |
]. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2667 |
|
563 | 2668 |
" |
2669 |
get the home context |
|
2670 |
" |
|
2671 |
con isBlockContext ifTrue:[ |
|
2672 |
homeContext := con methodHome |
|
2673 |
] ifFalse:[ |
|
2674 |
homeContext := con |
|
2675 |
]. |
|
2676 |
con canReturn ifTrue:[ |
|
2677 |
returnButton enable. restartButton enable. |
|
2678 |
] ifFalse:[ |
|
2679 |
returnButton disable. restartButton disable. |
|
2680 |
]. |
|
105 | 2681 |
|
563 | 2682 |
lineNrInMethod := con lineNumber. |
105 | 2683 |
|
563 | 2684 |
canAccept := false. |
105 | 2685 |
|
563 | 2686 |
homeContext isNil ifTrue:[ |
2687 |
" |
|
2688 |
mhmh - an optimized block |
|
2689 |
should get the block here, and get the method from |
|
2690 |
that one ... |
|
2691 |
But in 2.10.x, there is no easy way to get to the block |
|
2692 |
since that one is not in the context. |
|
2693 |
Starting with 2.11, the new block calling scheme will fix this. |
|
2694 |
" |
|
105 | 2695 |
|
563 | 2696 |
"temporary kludge - peek into the sender context. |
2697 |
If its a do-like method and there is a single block variable |
|
2698 |
in the args or temporaries, that must be the one. |
|
2699 |
This helps in some cases. |
|
2700 |
" |
|
2701 |
(sender := con sender) notNil ifTrue:[ |
|
2702 |
tryVars := false. |
|
2703 |
(selSender := sender selector) notNil ifTrue:[ |
|
2704 |
(selSender endsWith:'do:') ifTrue:[ |
|
2705 |
tryVars := true. |
|
2706 |
] ifFalse:[ |
|
2707 |
(selSender endsWith:'Do:') ifTrue:[ |
|
2708 |
tryVars := true. |
|
2709 |
] |
|
2710 |
] |
|
2711 |
]. |
|
2712 |
tryVars ifTrue:[ |
|
2713 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
2714 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
2715 |
possibleBlocks size == 1 ifTrue:[ |
|
2716 |
method := possibleBlocks first method. |
|
2717 |
]. |
|
2718 |
] |
|
2719 |
]. |
|
105 | 2720 |
|
563 | 2721 |
] ifFalse:[ |
2722 |
"fetch rec here - so we wont need context in doItAction" |
|
2723 |
rec := homeContext receiver. |
|
105 | 2724 |
|
563 | 2725 |
sel := homeContext selector. |
2726 |
sel notNil ifTrue:[ |
|
2727 |
canAccept := true. |
|
56 | 2728 |
|
563 | 2729 |
implementorClass := homeContext methodClass. |
2730 |
implementorClass isNil ifTrue:[ |
|
2731 |
" |
|
2732 |
special: look if this context was created by |
|
2733 |
valueWithReceiver kind of method invocation; |
|
2734 |
if so, grab the method from the sender and show it |
|
2735 |
" |
|
2736 |
((sender := con sender) notNil |
|
2737 |
and:[(sender selector startsWith:'valueWithReceiver:') |
|
2738 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
2739 |
method := sender receiver. |
|
655
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2740 |
self sensor shiftDown ifTrue:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2741 |
code := method decompiledSource |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2742 |
] ifFalse:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2743 |
code := method source. |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2744 |
]. |
563 | 2745 |
canAccept := false. |
2746 |
] ifFalse:[ |
|
2747 |
(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
|
2748 |
self sensor shiftDown ifTrue:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2749 |
code := method decompiledSource |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2750 |
] ifFalse:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2751 |
code := method source. |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2752 |
]. |
563 | 2753 |
canAccept := false. |
2754 |
] |
|
2755 |
] |
|
2756 |
] ifFalse:[ |
|
2757 |
method := implementorClass compiledMethodAt:sel. |
|
2758 |
]. |
|
2759 |
] |
|
2760 |
]. |
|
105 | 2761 |
|
563 | 2762 |
code isNil ifTrue:[ |
2763 |
errMsg := nil. |
|
2764 |
method notNil ifTrue:[ |
|
655
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2765 |
self sensor shiftDown ifTrue:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2766 |
code := method decompiledSource |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2767 |
] ifFalse:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2768 |
code := method source. |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2769 |
]. |
563 | 2770 |
code isNil ifTrue:[ |
2771 |
method sourceFilename notNil ifTrue:[ |
|
2772 |
codeView contents:(resources |
|
2773 |
string:'** no sourcefile: %1 **' |
|
2774 |
with:method sourceFilename). |
|
2775 |
codeView flash |
|
2776 |
] ifFalse:[ |
|
2777 |
errMsg := '** no source **' |
|
2778 |
] |
|
2779 |
] |
|
2780 |
] ifFalse:[ |
|
2781 |
homeContext isNil ifTrue:[ |
|
2782 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
2783 |
] ifFalse:[ |
|
2784 |
errMsg := '** no method - no source **' |
|
2785 |
] |
|
2786 |
]. |
|
2787 |
errMsg notNil ifTrue:[ |
|
2788 |
self showError:errMsg |
|
2789 |
] |
|
2790 |
]. |
|
105 | 2791 |
|
563 | 2792 |
code isNil ifTrue:[ |
2793 |
canAccept := false. |
|
2794 |
] ifFalse:[ |
|
2795 |
codeView contents:code. |
|
2796 |
(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
|
2797 |
"/ 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
|
2798 |
"/ 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
|
2799 |
"/ ]. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2800 |
"/ codeView selectLine:lineNrInMethod. |
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
2801 |
"/ codeView makeSelectionVisible |
132 | 2802 |
|
563 | 2803 |
lineNrInMethod <= codeView list size ifTrue:[ |
2804 |
(lineNrInMethod == 255 |
|
2805 |
and:[method notNil |
|
2806 |
and:[method code isNil]]) ifTrue:[ |
|
2807 |
"/ means: do not really know in interpreted methods |
|
2808 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
2809 |
] ifFalse:[ |
|
2810 |
codeView selectLine:lineNrInMethod. |
|
2811 |
]. |
|
2812 |
codeView makeSelectionVisible |
|
2813 |
] |
|
2814 |
]. |
|
2815 |
]. |
|
105 | 2816 |
|
563 | 2817 |
canAccept ifTrue:[ |
2818 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
2819 |
] ifFalse:[ |
|
2820 |
codeView acceptAction:nil. |
|
2821 |
]. |
|
105 | 2822 |
|
563 | 2823 |
receiverInspector inspect:rec. |
105 | 2824 |
|
563 | 2825 |
" |
2826 |
the one below is wrong: currently, the |
|
2827 |
evaluator cannot handle passed contexts. |
|
2828 |
Once it does, pass con as in:-arg |
|
2829 |
" |
|
2830 |
codeView doItAction:[:theCode | |
|
2831 |
rec class evaluatorClass |
|
2832 |
evaluate:theCode |
|
2833 |
in:nil "/ *** con |
|
2834 |
receiver:rec |
|
2835 |
notifying:codeView |
|
2836 |
logged:true |
|
2837 |
ifFail:nil |
|
2838 |
]. |
|
45 | 2839 |
|
563 | 2840 |
selectedContext := homeContext. |
2841 |
actualContext := con |
|
2842 |
]. |
|
0 | 2843 |
]. |
2844 |
||
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2845 |
con isContext ifFalse:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2846 |
sendButton disable. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2847 |
] ifTrue:[ |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2848 |
sendButton enable. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2849 |
]. |
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
2850 |
|
105 | 2851 |
"clear out locals to prevent keeping around unneeded contexts |
2852 |
(due to the block held in codeView). |
|
2853 |
(not really needed, since stuff gets collected away sooner or later ... |
|
2854 |
... but this makes it a bit sooner) |
|
2855 |
" |
|
0 | 2856 |
con := nil. |
29 | 2857 |
homeContext := nil. |
2858 |
||
105 | 2859 |
" |
2860 |
enable/disable some menu items |
|
2861 |
" |
|
45 | 2862 |
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
|
2863 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
563 | 2864 |
m enableAll:#(implementors senders inspectContext skip skipForReturn). |
29 | 2865 |
|
563 | 2866 |
(method notNil and:[method isWrapped]) ifTrue:[ |
2867 |
m enable:#removeBreakpoint. |
|
2868 |
] ifFalse:[ |
|
2869 |
m disable:#removeBreakpoint. |
|
2870 |
]. |
|
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2871 |
|
563 | 2872 |
mthd := selectedContext method. |
2873 |
mthd notNil ifTrue:[ |
|
2874 |
w := mthd who. |
|
2875 |
]. |
|
2876 |
m enable:#browseClass. |
|
2877 |
w notNil ifTrue:[ |
|
2878 |
cls := w at:1 |
|
2879 |
]. |
|
2880 |
cls notNil ifTrue:[ |
|
2881 |
m enableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol). |
|
2882 |
] ifFalse:[ |
|
2883 |
m disableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol). |
|
2884 |
]. |
|
29 | 2885 |
] |
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
2886 |
|
655
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
2887 |
"Modified: 3.7.1996 / 10:09:00 / cg" |
73 | 2888 |
! ! |
2889 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2890 |
!DebugView class methodsFor:'documentation'! |
78 | 2891 |
|
266 | 2892 |
version |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
2893 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.108 1996-10-22 10:41:16 cg Exp $' |
0 | 2894 |
! ! |