changeset 15413 | 764b28599a90 |
parent 15412 | 8b43bca192e9 |
child 15497 | c05f957c8150 |
15412:8b43bca192e9 | 15413:764b28599a90 |
---|---|
1 " |
1 " |
2 COPYRIGHT (c) 1989 by Claus Gittinger |
2 COPYRIGHT (c) 1989 by Claus Gittinger |
3 All Rights Reserved |
3 All Rights Reserved |
4 |
4 |
5 This software is furnished under a license and may be used |
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 |
6 only in accordance with the terms of that license and with the |
7 inclusion of the above copyright notice. This software may not |
7 inclusion of the above copyright notice. This software may not |
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
71 !DebugView class methodsFor:'documentation'! |
71 !DebugView class methodsFor:'documentation'! |
72 |
72 |
73 copyright |
73 copyright |
74 " |
74 " |
75 COPYRIGHT (c) 1989 by Claus Gittinger |
75 COPYRIGHT (c) 1989 by Claus Gittinger |
76 All Rights Reserved |
76 All Rights Reserved |
77 |
77 |
78 This software is furnished under a license and may be used |
78 This software is furnished under a license and may be used |
79 only in accordance with the terms of that license and with the |
79 only in accordance with the terms of that license and with the |
80 inclusion of the above copyright notice. This software may not |
80 inclusion of the above copyright notice. This software may not |
81 be provided or otherwise made available to, or used by, any |
81 be provided or otherwise made available to, or used by, any |
96 |
96 |
97 The whole setup might be changed, once the required process primitives |
97 The whole setup might be changed, once the required process primitives |
98 are available, which allow control of another processes execution |
98 are available, which allow control of another processes execution |
99 (i.e. single-step, restart & return). The setup will be changed then, |
99 (i.e. single-step, restart & return). The setup will be changed then, |
100 to have the debugger control the debuggee (i.e. two processes). |
100 to have the debugger control the debuggee (i.e. two processes). |
101 However, as it works as it is, and is reliable enough, |
101 However, as it works as it is, and is reliable enough, |
102 why should we change it without a particular need...). |
102 why should we change it without a particular need...). |
103 |
103 |
104 Only the 'stopped' debugged process is affected; |
104 Only the 'stopped' debugged process is affected; |
105 other processes continue to respond to events. |
105 other processes continue to respond to events. |
106 The one exception to this is when an error occurs within the dispatcher process |
106 The one exception to this is when an error occurs within the dispatcher process |
108 will sit on an exclusive display connection. |
108 will sit on an exclusive display connection. |
109 |
109 |
110 See additional information in 'doc/misc/debugger.doc'. |
110 See additional information in 'doc/misc/debugger.doc'. |
111 |
111 |
112 Notice & Warning (attention when changing thingslike menus, window spec etc. here): |
112 Notice & Warning (attention when changing thingslike menus, window spec etc. here): |
113 the DebugView class caches the last used debugger in a class variable, |
113 the DebugView class caches the last used debugger in a class variable, |
114 and hides/shows this window without recreating one from scratch. This is done to make |
114 and hides/shows this window without recreating one from scratch. This is done to make |
115 the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint. |
115 the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint. |
116 |
116 |
117 It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one) |
117 It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one) |
118 is kept there. You will notice this, if a debugger comes up without showing any contents. |
118 is kept there. You will notice this, if a debugger comes up without showing any contents. |
119 In this case, close (or destroy) the broken debugView, and execute |
119 In this case, close (or destroy) the broken debugView, and execute |
120 Debugger newDebugger |
120 Debugger newDebugger |
121 which removes the cached debugger and forces creation of a new one the next time. |
121 which removes the cached debugger and forces creation of a new one the next time. |
122 This is a temporary workaround - the debugger should be fixed to avoid this situation. |
122 This is a temporary workaround - the debugger should be fixed to avoid this situation. |
123 |
123 |
124 You must also flush the cached debugger, if you change the debugger's |
124 You must also flush the cached debugger, if you change the debugger's |
125 initialization code (buttons, menu, etc.) or the debugger's class layout, |
125 initialization code (buttons, menu, etc.) or the debugger's class layout, |
126 and you want the new code to become effective. |
126 and you want the new code to become effective. |
127 |
127 |
128 [author:] |
128 [author:] |
129 Claus Gittinger |
129 Claus Gittinger |
130 |
130 |
131 [see also:] |
131 [see also:] |
132 Exception Signal |
132 Exception Signal |
133 Process |
133 Process |
134 " |
134 " |
135 ! ! |
135 ! ! |
136 |
136 |
137 !DebugView class methodsFor:'initialization'! |
137 !DebugView class methodsFor:'initialization'! |
138 |
138 |
179 CachedDebugger := nil. |
179 CachedDebugger := nil. |
180 CachedExclusive := nil. |
180 CachedExclusive := nil. |
181 OpenDebuggers := nil. |
181 OpenDebuggers := nil. |
182 |
182 |
183 (Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
183 (Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
184 Debugger := self |
184 Debugger := self |
185 ]. |
185 ]. |
186 |
186 |
187 " |
187 " |
188 DebugView newDebugger |
188 DebugView newDebugger |
189 " |
189 " |
250 "the information (if any) about the ignore-state of a halt" |
250 "the information (if any) about the ignore-state of a halt" |
251 |
251 |
252 IgnoredHalts isNil ifTrue:[^ nil]. |
252 IgnoredHalts isNil ifTrue:[^ nil]. |
253 |
253 |
254 IgnoredHalts do:[:ign | |
254 IgnoredHalts do:[:ign | |
255 (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
255 (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
256 "/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) |
256 "/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) |
257 ifTrue:[ |
257 ifTrue:[ |
258 ^ ign |
258 ^ ign |
259 ]. |
259 ]. |
260 ]. |
260 ]. |
261 ^ nil. |
261 ^ nil. |
262 ! |
262 ! |
263 |
263 |
264 hasIgnoredHalts |
264 hasIgnoredHalts |
265 self removeInactiveIgnores. |
265 self removeInactiveIgnores. |
266 ^ IgnoredHalts notEmptyOrNil |
266 ^ IgnoredHalts notEmptyOrNil |
267 ! |
267 ! |
268 |
268 |
269 ignoreBreakpointWithParameter:parameterOrNil |
269 ignoreBreakpointWithParameter:parameterOrNil |
270 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
270 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
271 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
271 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
272 |
272 |
273 "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
273 "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
274 or until some time has elapsed. |
274 or until some time has elapsed. |
275 With nil count and time arguments, such an ignored breakpoint is reactivated" |
275 With nil count and time arguments, such an ignored breakpoint is reactivated" |
276 |
276 |
277 self |
277 self |
278 ignoreHaltOrBreakpoint:#halt |
278 ignoreHaltOrBreakpoint:#halt |
279 method:nil line:nil |
279 method:nil line:nil |
280 parameter:parameterOrNil |
280 parameter:parameterOrNil |
281 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
281 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
282 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
282 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
283 orIfCalledFromMethod:nil |
283 orIfCalledFromMethod:nil |
284 ! |
284 ! |
285 |
285 |
286 ignoreHaltIn:haltingMethod at:lineNrOfHalt |
286 ignoreHaltIn:haltingMethod at:lineNrOfHalt |
287 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
287 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
288 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
288 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
289 |
289 |
290 "remember to ignore a halt in some method for some number of invocations |
290 "remember to ignore a halt in some method for some number of invocations |
291 or until some time has elapsed. |
291 or until some time has elapsed. |
292 With nil count and time arguments, such an ignored halt is reactivated" |
292 With nil count and time arguments, such an ignored halt is reactivated" |
293 |
293 |
294 self |
294 self |
295 ignoreHaltOrBreakpoint:#halt |
295 ignoreHaltOrBreakpoint:#halt |
296 method:haltingMethod line:lineNrOfHalt |
296 method:haltingMethod line:lineNrOfHalt |
297 parameter:nil |
297 parameter:nil |
298 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
298 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
299 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
299 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
300 orIfCalledFromMethod:nil |
300 orIfCalledFromMethod:nil |
301 ! |
301 ! |
302 |
302 |
303 ignoreHaltIn:haltingMethod at:lineNrOfHalt |
303 ignoreHaltIn:haltingMethod at:lineNrOfHalt |
304 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
304 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
305 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
305 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
306 orIfCalledFromMethod:ifCalledForMethodOrNil |
306 orIfCalledFromMethod:ifCalledForMethodOrNil |
307 |
307 |
308 "remember to ignore a halt in some method for some number of invocations |
308 "remember to ignore a halt in some method for some number of invocations |
309 or until some time has elapsed. |
309 or until some time has elapsed. |
310 With nil count and time arguments, such an ignored halt is reactivated" |
310 With nil count and time arguments, such an ignored halt is reactivated" |
311 |
311 |
312 self |
312 self |
313 ignoreHaltOrBreakpoint:#halt |
313 ignoreHaltOrBreakpoint:#halt |
314 method:haltingMethod line:lineNrOfHalt |
314 method:haltingMethod line:lineNrOfHalt |
315 parameter:nil |
315 parameter:nil |
316 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
316 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
317 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
317 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
318 orIfCalledFromMethod:ifCalledForMethodOrNil |
318 orIfCalledFromMethod:ifCalledForMethodOrNil |
319 ! |
319 ! |
320 |
320 |
321 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
321 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
322 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
322 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
323 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
323 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
324 |
324 |
325 "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
325 "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
326 or until some time has elapsed. |
326 or until some time has elapsed. |
327 With nil count and time arguments, such an ignored breakpoint is reactivated" |
327 With nil count and time arguments, such an ignored breakpoint is reactivated" |
328 |
328 |
329 ^ self |
329 ^ self |
330 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
330 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
331 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
331 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
332 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
332 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
333 orIfCalledFromMethod:nil |
333 orIfCalledFromMethod:nil |
334 ! |
334 ! |
335 |
335 |
336 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
336 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
337 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
337 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
338 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
338 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
339 orIfCalledFromMethod:ifCalledFromMethodOrNil |
339 orIfCalledFromMethod:ifCalledFromMethodOrNil |
340 |
340 |
341 "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
341 "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
342 or until some time has elapsed. |
342 or until some time has elapsed. |
343 With nil count and time arguments, such an ignored breakpoint is reactivated" |
343 With nil count and time arguments, such an ignored breakpoint is reactivated" |
344 |
344 |
345 |oldEntry ign| |
345 |oldEntry ign| |
346 |
346 |
347 IgnoredHalts notNil ifTrue:[ |
347 IgnoredHalts notNil ifTrue:[ |
348 self removeInactiveIgnores. |
348 self removeInactiveIgnores. |
349 type == #halt ifTrue:[ |
349 type == #halt ifTrue:[ |
350 oldEntry := IgnoredHalts |
350 oldEntry := IgnoredHalts |
351 detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil] |
351 detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil] |
352 ifNone:nil. |
352 ifNone:nil. |
353 ] ifFalse:[ |
353 ] ifFalse:[ |
354 oldEntry := IgnoredHalts |
354 oldEntry := IgnoredHalts |
355 detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil] |
355 detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil] |
356 ifNone:nil. |
356 ifNone:nil. |
357 ]. |
357 ]. |
358 oldEntry notNil ifTrue:[ |
358 oldEntry notNil ifTrue:[ |
359 (processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[ |
359 (processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[ |
360 receiverClassOrNil notNil ifTrue:[ |
360 receiverClassOrNil notNil ifTrue:[ |
361 oldEntry ignoreForReceiverClass:receiverClassOrNil. |
361 oldEntry ignoreForReceiverClass:receiverClassOrNil. |
362 ]. |
362 ]. |
363 processOrNil notNil ifTrue:[ |
363 processOrNil notNil ifTrue:[ |
364 oldEntry ignoreForProcess:processOrNil. |
364 oldEntry ignoreForProcess:processOrNil. |
365 ]. |
365 ]. |
366 ^ self. |
366 ^ self. |
367 ]. |
367 ]. |
368 IgnoredHalts remove:oldEntry ifAbsent:[]. |
368 IgnoredHalts remove:oldEntry ifAbsent:[]. |
369 ] |
369 ] |
370 ]. |
370 ]. |
371 |
371 |
372 (countOrNil notNil |
372 (countOrNil notNil |
373 or:[dTOrNil notNil |
373 or:[dTOrNil notNil |
374 or:[untilShiftKey == true |
374 or:[untilShiftKey == true |
375 or:[receiverClassOrNil notNil |
375 or:[receiverClassOrNil notNil |
376 or:[processOrNil notNil |
376 or:[processOrNil notNil |
377 or:[ifCalledFromMethodOrNil notNil]]]]] |
377 or:[ifCalledFromMethodOrNil notNil]]]]] |
378 ) ifTrue:[ |
378 ) ifTrue:[ |
379 IgnoredHalts isNil ifTrue:[ |
379 IgnoredHalts isNil ifTrue:[ |
380 IgnoredHalts := OrderedCollection new. |
380 IgnoredHalts := OrderedCollection new. |
381 ]. |
381 ]. |
382 type == #halt ifTrue:[ |
382 type == #halt ifTrue:[ |
383 ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil. |
383 ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil. |
384 ] ifFalse:[ |
384 ] ifFalse:[ |
385 ign := IgnoredHalt new breakpointWithParameter:parameterOrNil. |
385 ign := IgnoredHalt new breakpointWithParameter:parameterOrNil. |
386 ]. |
386 ]. |
387 |
387 |
388 (countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
388 (countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
389 ign ignoreCount:countOrNil. |
389 ign ignoreCount:countOrNil. |
390 ]. |
390 ]. |
391 (dTOrNil notNil) ifTrue:[ |
391 (dTOrNil notNil) ifTrue:[ |
392 ign ignoreEndTime:(Timestamp now + dTOrNil). |
392 ign ignoreEndTime:(Timestamp now + dTOrNil). |
393 ]. |
393 ]. |
394 untilShiftKey == true ifTrue:[ |
394 untilShiftKey == true ifTrue:[ |
395 ign ignoreUntilShiftKeyPressed:true. |
395 ign ignoreUntilShiftKeyPressed:true. |
396 ]. |
396 ]. |
397 receiverClassOrNil notNil ifTrue:[ |
397 receiverClassOrNil notNil ifTrue:[ |
398 ign ignoreForReceiverClass:receiverClassOrNil. |
398 ign ignoreForReceiverClass:receiverClassOrNil. |
399 ]. |
399 ]. |
400 processOrNil notNil ifTrue:[ |
400 processOrNil notNil ifTrue:[ |
401 ign ignoreForProcess:processOrNil. |
401 ign ignoreForProcess:processOrNil. |
402 ]. |
402 ]. |
403 ifCalledFromMethodOrNil notNil ifTrue:[ |
403 ifCalledFromMethodOrNil notNil ifTrue:[ |
404 ign ignoreIfCalledFromMethod:ifCalledFromMethodOrNil. |
404 ign ignoreIfCalledFromMethod:ifCalledFromMethodOrNil. |
405 ]. |
405 ]. |
406 IgnoredHalts add:ign. |
406 IgnoredHalts add:ign. |
407 ]. |
407 ]. |
408 Smalltalk changed:#ignoredHalts. |
408 Smalltalk changed:#ignoredHalts. |
409 |
409 |
410 "Created: / 06-03-2012 / 12:37:58 / cg" |
410 "Created: / 06-03-2012 / 12:37:58 / cg" |
411 ! |
411 ! |
415 |
415 |
416 IgnoredHalts isNil ifTrue:[^ false]. |
416 IgnoredHalts isNil ifTrue:[^ false]. |
417 |
417 |
418 "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
418 "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
419 IgnoredHalts do:[:ign | |
419 IgnoredHalts do:[:ign | |
420 (ign isForBreakpointWithParameter:parameter) ifTrue:[ |
420 (ign isForBreakpointWithParameter:parameter) ifTrue:[ |
421 Transcript show:'Debugger [info]: break ignored for ', parameter. |
421 Transcript show:'Debugger [info]: break ignored for ', parameter. |
422 |
422 |
423 modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
423 modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
424 ign isHaltIgnored ifFalse:[ |
424 ign isHaltIgnored ifFalse:[ |
425 Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter. |
425 Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter. |
426 IgnoredHalts remove:ign ifAbsent:[]. |
426 IgnoredHalts remove:ign ifAbsent:[]. |
427 ]. |
427 ]. |
428 ^ true. |
428 ^ true. |
429 ]. |
429 ]. |
430 ]. |
430 ]. |
431 |
431 |
432 IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty. |
432 IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty. |
433 |
433 |
434 ^ false. |
434 ^ false. |
441 |
441 |
442 IgnoredHalts isNil ifTrue:[^ false]. |
442 IgnoredHalts isNil ifTrue:[^ false]. |
443 |
443 |
444 "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
444 "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
445 IgnoredHalts do:[:ign | |
445 IgnoredHalts do:[:ign | |
446 (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[ |
446 (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[ |
447 Transcript show:'Debugger [info]: halt/break ignored in ', haltingMethod whoString. |
447 Transcript show:'Debugger [info]: halt/break ignored in ', haltingMethod whoString. |
448 Transcript show:' ('; show:ign; showCR:')'. |
448 Transcript show:' ('; show:ign; showCR:')'. |
449 |
449 |
450 modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
450 modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
451 ign isHaltIgnored ifFalse:[ |
451 ign isHaltIgnored ifFalse:[ |
452 Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString. |
452 Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString. |
453 IgnoredHalts remove:ign ifAbsent:[]. |
453 IgnoredHalts remove:ign ifAbsent:[]. |
454 ]. |
454 ]. |
455 ^ true. |
455 ^ true. |
456 ]. |
456 ]. |
457 ]. |
457 ]. |
458 |
458 |
459 IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty. |
459 IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty. |
460 |
460 |
461 ^ false. |
461 ^ false. |
463 "Modified (comment): / 06-03-2012 / 12:51:43 / cg" |
463 "Modified (comment): / 06-03-2012 / 12:51:43 / cg" |
464 ! |
464 ! |
465 |
465 |
466 removeInactiveIgnores |
466 removeInactiveIgnores |
467 IgnoredHalts notNil ifTrue:[ |
467 IgnoredHalts notNil ifTrue:[ |
468 IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
468 IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
469 ]. |
469 ]. |
470 ! |
470 ! |
471 |
471 |
472 stopIgnoringHalts |
472 stopIgnoringHalts |
473 "forget about all ignored halts" |
473 "forget about all ignored halts" |
481 effectively reenables the breakpoint/halt" |
481 effectively reenables the breakpoint/halt" |
482 |
482 |
483 IgnoredHalts isNil ifTrue:[^ self]. |
483 IgnoredHalts isNil ifTrue:[^ self]. |
484 |
484 |
485 IgnoredHalts := IgnoredHalts reject:[:ign | |
485 IgnoredHalts := IgnoredHalts reject:[:ign | |
486 (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
486 (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
487 ]. |
487 ]. |
488 ! ! |
488 ! ! |
489 |
489 |
490 !DebugView class methodsFor:'instance creation / entering'! |
490 !DebugView class methodsFor:'instance creation / entering'! |
491 |
491 |
493 "enter a debugger" |
493 "enter a debugger" |
494 |
494 |
495 <context: #return> |
495 <context: #return> |
496 |
496 |
497 ^ self |
497 ^ self |
498 enter:thisContext sender |
498 enter:thisContext sender |
499 withMessage:'Debugger Entered' |
499 withMessage:'Debugger Entered' |
500 mayProceed:true. |
500 mayProceed:true. |
501 ! |
501 ! |
502 |
502 |
503 enter:aContext withMessage:aString |
503 enter:aContext withMessage:aString |
504 "enter a debugger" |
504 "enter a debugger" |
505 |
505 |
506 <context: #return> |
506 <context: #return> |
507 |
507 |
508 ^ self |
508 ^ self |
509 enter:aContext |
509 enter:aContext |
510 withMessage:aString |
510 withMessage:aString |
511 mayProceed:true |
511 mayProceed:true |
512 ! |
512 ! |
513 |
513 |
514 enter:aContext withMessage:aString mayProceed:mayProceed |
514 enter:aContext withMessage:aString mayProceed:mayProceed |
515 "enter a debugger; if this is a recursive invocation, enter |
515 "enter a debugger; if this is a recursive invocation, enter |
516 a MiniDebugger instead. |
516 a MiniDebugger instead. |
520 <context: #return> |
520 <context: #return> |
521 |
521 |
522 |display| |
522 |display| |
523 |
523 |
524 (NumberOfDebuggers ? 0) > self maxNumberOfDebuggers ifTrue:[ |
524 (NumberOfDebuggers ? 0) > self maxNumberOfDebuggers ifTrue:[ |
525 NumberOfDebuggers := self allInstances count:[:d | d isOpen]. |
525 NumberOfDebuggers := self allInstances count:[:d | d isOpen]. |
526 NumberOfDebuggers > self maxNumberOfDebuggers ifTrue:[ |
526 NumberOfDebuggers > self maxNumberOfDebuggers ifTrue:[ |
527 MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true. |
527 MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true. |
528 ]. |
528 ]. |
529 ]. |
529 ]. |
530 |
530 |
531 DebuggingDebugger == true ifTrue:[ |
531 DebuggingDebugger == true ifTrue:[ |
532 '==> enter1: (' print. aContext print. ')' printCR. |
532 '==> enter1: (' print. aContext print. ')' printCR. |
533 ]. |
533 ]. |
534 |
534 |
535 display := (self debuggerOnMainDisplayOnly) |
535 display := (self debuggerOnMainDisplayOnly) |
536 ifTrue:[ Display ] |
536 ifTrue:[ Display ] |
537 ifFalse:[ Screen current ]. |
537 ifFalse:[ Screen current ]. |
538 |
538 |
539 Screen currentScreenQuerySignal answer:display |
539 Screen currentScreenQuerySignal answer:display |
540 do:[ |
540 do:[ |
541 StepInterruptPending := nil. |
541 StepInterruptPending := nil. |
542 ControlInterrupt handle:[:ex | |
542 ControlInterrupt handle:[:ex | |
543 'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
543 'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
544 ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
544 ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
545 ex proceed |
545 ex proceed |
546 ] do:[ |
546 ] do:[ |
547 |debugger| |
547 |debugger| |
548 |
548 |
549 " |
549 " |
550 well, it could be a stepping or sending debugger up there; |
550 well, it could be a stepping or sending debugger up there; |
551 in this case, return to it. This happens, when a stepping process |
551 in this case, return to it. This happens, when a stepping process |
552 runs into an error (for example, a halt). In this case, we want the |
552 runs into an error (for example, a halt). In this case, we want the |
553 stepping debugger to come up again instead of a new one. |
553 stepping debugger to come up again instead of a new one. |
554 " |
554 " |
555 (debugger := self openDebuggerForActiveProcess) notNil ifTrue:[ |
555 (debugger := self openDebuggerForActiveProcess) notNil ifTrue:[ |
556 debugger unstep. |
556 debugger unstep. |
557 debugger setLabelFor:aString in:Processor activeProcess. |
557 debugger setLabelFor:aString in:Processor activeProcess. |
558 debugger mayProceed:mayProceed. |
558 debugger mayProceed:mayProceed. |
559 ^ debugger enter:aContext select:nil. |
559 ^ debugger enter:aContext select:nil. |
560 ]. |
560 ]. |
561 ]. |
561 ]. |
562 ^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
562 ^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
563 ]. |
563 ]. |
564 |
564 |
565 "Modified: / 06-11-2013 / 20:58:54 / cg" |
565 "Modified: / 06-11-2013 / 20:58:54 / cg" |
566 ! |
566 ! |
567 |
567 |
570 a MiniDebugger instead. |
570 a MiniDebugger instead. |
571 This is the standard way of entering the debugger; |
571 This is the standard way of entering the debugger; |
572 sent from error- and halt messages." |
572 sent from error- and halt messages." |
573 |
573 |
574 ^ self |
574 ^ self |
575 enter:ex returnableSuspendedContext |
575 enter:ex returnableSuspendedContext |
576 withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger) |
576 withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger) |
577 mayProceed:(ex mayProceed). |
577 mayProceed:(ex mayProceed). |
578 ! |
578 ! |
579 |
579 |
580 enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
580 enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
581 "enter a debugger - do not check for recursive invocation" |
581 "enter a debugger - do not check for recursive invocation" |
582 |
582 |
588 NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1. |
588 NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1. |
589 |
589 |
590 "/ ignore halts & breakpoints while setting up the debugger |
590 "/ ignore halts & breakpoints while setting up the debugger |
591 "/ to avoid recursive debugging ... |
591 "/ to avoid recursive debugging ... |
592 ControlInterrupt handle:[:ex | |
592 ControlInterrupt handle:[:ex | |
593 'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
593 'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
594 ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
594 ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
595 ex proceed |
595 ex proceed |
596 ] do:[ |
596 ] do:[ |
597 aDebugger := self new. |
597 aDebugger := self new. |
598 ]. |
598 ]. |
599 |
599 |
600 aDebugger isNil ifTrue:[ |
600 aDebugger isNil ifTrue:[ |
601 'DebugView [error]: cannot open debugger' errorPrintCR. |
601 'DebugView [error]: cannot open debugger' errorPrintCR. |
602 'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
602 'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
603 mayProceed ifTrue:[ |
603 mayProceed ifTrue:[ |
604 (Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs |
604 (Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs |
605 yesLabel:'Continue' noLabel:'Abort') |
605 yesLabel:'Continue' noLabel:'Abort') |
606 ifTrue:[ |
606 ifTrue:[ |
607 ^ nil |
607 ^ nil |
608 ]. |
608 ]. |
609 ] ifFalse:[ |
609 ] ifFalse:[ |
610 self information:'Error caught.\\Press OK to abort the operation.' withCRs. |
610 self information:'Error caught.\\Press OK to abort the operation.' withCRs. |
611 ]. |
611 ]. |
612 AbortOperationRequest raise. |
612 AbortOperationRequest raise. |
613 "not reached" |
613 "not reached" |
614 ]. |
614 ]. |
615 |
615 |
616 aDebugger mayProceed:mayProceed. |
616 aDebugger mayProceed:mayProceed. |
617 aDebugger setLabelFor:aString in:Processor activeProcess. |
617 aDebugger setLabelFor:aString in:Processor activeProcess. |
618 aDebugger enter:aContext select:nil. |
618 aDebugger enter:aContext select:nil. |
619 ^ nil. |
619 ^ nil. |
620 |
620 |
621 " |
621 " |
622 nil halt |
622 nil halt |
623 " |
623 " |
624 |
624 |
625 "Modified: / 18.11.2001 / 00:29:23 / cg" |
625 "Modified: / 18.11.2001 / 00:29:23 / cg" |
626 ! |
626 ! |
627 |
627 |
629 "enter a debugger" |
629 "enter a debugger" |
630 |
630 |
631 <context: #return> |
631 <context: #return> |
632 |
632 |
633 ^ self |
633 ^ self |
634 enter:(thisContext sender) |
634 enter:(thisContext sender) |
635 withMessage:message |
635 withMessage:message |
636 mayProceed:true. |
636 mayProceed:true. |
637 ! |
637 ! |
638 |
638 |
639 new |
639 new |
640 "return a new DebugView. |
640 "return a new DebugView. |
641 - return a cached debugger if it already exists. |
641 - return a cached debugger if it already exists. |
645 |debugger currentScreen debuggerScreen| |
645 |debugger currentScreen debuggerScreen| |
646 |
646 |
647 currentScreen := Screen current. |
647 currentScreen := Screen current. |
648 |
648 |
649 currentScreen notNil ifTrue:[ |
649 currentScreen notNil ifTrue:[ |
650 (currentScreen suppressDebugger) ifTrue:[ |
650 (currentScreen suppressDebugger) ifTrue:[ |
651 "/ no debuggers with that device - show an alertBox which aborts... |
651 "/ no debuggers with that device - show an alertBox which aborts... |
652 ^ nil. |
652 ^ nil. |
653 ]. |
653 ]. |
654 (currentScreen mayOpenDebugger) ifFalse:[ |
654 (currentScreen mayOpenDebugger) ifFalse:[ |
655 "/ no debugger on that device - but on the main screen |
655 "/ no debugger on that device - but on the main screen |
656 currentScreen := Display ? Screen default. |
656 currentScreen := Display ? Screen default. |
657 ]. |
657 ]. |
658 ]. |
658 ]. |
659 |
659 |
660 " |
660 " |
661 need a blocking debugger if no processes or |
661 need a blocking debugger if no processes or |
662 or if its a timing/interrupt process |
662 or if its a timing/interrupt process |
663 (because otherwise we would not get any events here ... |
663 (because otherwise we would not get any events here ... |
664 " |
664 " |
665 Processor activeProcessIsSystemProcess ifTrue:[ |
665 Processor activeProcessIsSystemProcess ifTrue:[ |
666 ((debugger := CachedExclusive) isNil |
666 ((debugger := CachedExclusive) isNil |
667 or:[debugger device ~~ currentScreen |
667 or:[debugger device ~~ currentScreen |
668 or:[currentScreen isNil |
668 or:[currentScreen isNil |
669 or:[currentScreen isOpen not]]]) ifTrue:[ |
669 or:[currentScreen isOpen not]]]) ifTrue:[ |
670 debugger := self newExclusive |
670 debugger := self newExclusive |
671 ]. |
671 ]. |
672 CachedExclusive := nil. |
672 CachedExclusive := nil. |
673 ] ifFalse:[ |
673 ] ifFalse:[ |
674 CachedDebugger notNil ifTrue:[ |
674 CachedDebugger notNil ifTrue:[ |
675 (CachedDebugger device ~~ currentScreen |
675 (CachedDebugger device ~~ currentScreen |
676 or:[currentScreen isNil |
676 or:[currentScreen isNil |
677 or:[currentScreen isOpen not |
677 or:[currentScreen isOpen not |
678 or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
678 or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
679 CachedDebugger := nil |
679 CachedDebugger := nil |
680 ] |
680 ] |
681 ]. |
681 ]. |
682 |
682 |
683 (debugger := CachedDebugger) notNil ifTrue:[ |
683 (debugger := CachedDebugger) notNil ifTrue:[ |
684 CachedDebugger := nil. |
684 CachedDebugger := nil. |
685 ] ifFalse:[ |
685 ] ifFalse:[ |
686 debuggerScreen := currentScreen. |
686 debuggerScreen := currentScreen. |
687 debuggerScreen isNil ifTrue:[ |
687 debuggerScreen isNil ifTrue:[ |
688 "/ use the default display |
688 "/ use the default display |
689 debuggerScreen := Screen default. |
689 debuggerScreen := Screen default. |
690 ]. |
690 ]. |
691 (debuggerScreen isNil |
691 (debuggerScreen isNil |
692 or:[debuggerScreen isOpen not |
692 or:[debuggerScreen isOpen not |
693 "/ or:[debuggerDevice mayOpenDebugger not] |
693 "/ or:[debuggerDevice mayOpenDebugger not] |
694 ]) ifTrue:[ |
694 ]) ifTrue:[ |
695 "/ no debugger |
695 "/ no debugger |
696 ^ nil. |
696 ^ nil. |
697 ]. |
697 ]. |
698 |
698 |
699 Screen currentScreenQuerySignal answer:debuggerScreen |
699 Screen currentScreenQuerySignal answer:debuggerScreen |
700 do:[ |
700 do:[ |
701 debugger := super new. |
701 debugger := super new. |
702 ]. |
702 ]. |
703 debugger label:'Debugger'. |
703 debugger label:'Debugger'. |
704 debugger icon:self defaultIcon. |
704 debugger icon:self defaultIcon. |
705 ] |
705 ] |
706 ]. |
706 ]. |
707 ^ debugger |
707 ^ debugger |
708 |
708 |
709 "Modified: 31.7.1997 / 21:20:27 / cg" |
709 "Modified: 31.7.1997 / 21:20:27 / cg" |
710 ! |
710 ! |
735 in this case, return to it. This happens, when a stepping process |
735 in this case, return to it. This happens, when a stepping process |
736 runs into an error (for example, a halt). In this case, we want the |
736 runs into an error (for example, a halt). In this case, we want the |
737 stepping debugger to come up again instead of a new one. |
737 stepping debugger to come up again instead of a new one. |
738 " |
738 " |
739 OpenDebuggers notNil ifTrue:[ |
739 OpenDebuggers notNil ifTrue:[ |
740 active := Processor activeProcess. |
740 active := Processor activeProcess. |
741 OpenDebuggers do:[:aDebugger | |
741 OpenDebuggers do:[:aDebugger | |
742 |debuggersProcess| |
742 |debuggersProcess| |
743 |
743 |
744 (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
744 (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
745 debuggersProcess := aDebugger inspectedProcess. |
745 debuggersProcess := aDebugger inspectedProcess. |
746 debuggersProcess == active ifTrue:[ |
746 debuggersProcess == active ifTrue:[ |
747 aDebugger device isOpen ifTrue:[ |
747 aDebugger device isOpen ifTrue:[ |
748 DebuggingDebugger == true ifTrue:[ |
748 DebuggingDebugger == true ifTrue:[ |
749 'reusing cached debugger' errorPrintCR. |
749 'reusing cached debugger' errorPrintCR. |
750 ]. |
750 ]. |
751 aDebugger unstep. |
751 aDebugger unstep. |
752 ^ aDebugger. |
752 ^ aDebugger. |
753 ] |
753 ] |
754 ]. |
754 ]. |
755 (debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[ |
755 (debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[ |
756 aDebugger destroy. |
756 aDebugger destroy. |
757 ]. |
757 ]. |
758 ] |
758 ] |
759 ] |
759 ] |
760 ]. |
760 ]. |
761 ^ nil |
761 ^ nil |
762 |
762 |
763 "Created: / 06-11-2013 / 20:57:49 / cg" |
763 "Created: / 06-11-2013 / 20:57:49 / cg" |
764 ! |
764 ! |
770 |aDebugger label nm| |
770 |aDebugger label nm| |
771 |
771 |
772 aDebugger := super new. |
772 aDebugger := super new. |
773 aDebugger icon:self defaultIcon. |
773 aDebugger icon:self defaultIcon. |
774 aProcess notNil ifTrue:[ |
774 aProcess notNil ifTrue:[ |
775 nm := aProcess name. |
775 nm := aProcess name. |
776 nm notNil ifTrue:[ |
776 nm notNil ifTrue:[ |
777 nm := (nm contractTo:17) , '-' , aProcess id printString |
777 nm := (nm contractTo:17) , '-' , aProcess id printString |
778 ] ifFalse:[ |
778 ] ifFalse:[ |
779 nm := aProcess id printString |
779 nm := aProcess id printString |
780 ]. |
780 ]. |
781 label := 'Debugger [' , nm , ']'. |
781 label := 'Debugger [' , nm , ']'. |
782 ] ifFalse:[ |
782 ] ifFalse:[ |
783 label := 'no process' |
783 label := 'no process' |
784 ]. |
784 ]. |
785 aDebugger label:label iconLabel:'Debugger'. |
785 aDebugger label:label iconLabel:'Debugger'. |
786 aDebugger openOn:aProcess. |
786 aDebugger openOn:aProcess. |
787 ^ nil |
787 ^ nil |
788 |
788 |
804 (Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp |
804 (Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp |
805 " |
805 " |
806 |
806 |
807 <resource: #menu> |
807 <resource: #menu> |
808 |
808 |
809 ^ |
809 ^ |
810 #(Menu |
810 #(Menu |
811 ( |
811 ( |
812 (MenuItem |
812 (MenuItem |
813 enabled: canRemoveBreakpoint |
813 enabled: canRemoveBreakpoint |
814 label: 'Remove Breakpoint' |
814 label: 'Remove Breakpoint' |
815 itemValue: removeBreakpoint |
815 itemValue: removeBreakpoint |
816 ) |
816 ) |
817 (MenuItem |
817 (MenuItem |
818 label: 'Remove all Breakpoints' |
818 label: 'Remove all Breakpoints' |
819 itemValue: removeAllBreakpoints |
819 itemValue: removeAllBreakpoints |
820 ) |
820 ) |
821 (MenuItem |
821 (MenuItem |
822 label: '-' |
822 label: '-' |
823 ) |
823 ) |
824 (MenuItem |
824 (MenuItem |
825 label: 'Ignore this Halt/BreakPoint' |
825 label: 'Ignore this Halt/BreakPoint' |
826 submenu: |
826 submenu: |
827 (Menu |
827 (Menu |
828 ( |
828 ( |
829 (MenuItem |
829 (MenuItem |
830 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
830 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
831 label: 'Forever (Until Ignoring is Stopped)' |
831 label: 'Forever (Until Ignoring is Stopped)' |
832 itemValue: ignoreHaltForever |
832 itemValue: ignoreHaltForever |
833 ) |
833 ) |
834 (MenuItem |
834 (MenuItem |
835 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
835 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
836 label: 'For Some Time...' |
836 label: 'For Some Time...' |
837 itemValue: openIgnoreHaltUntilTimeElapsedDialog |
837 itemValue: openIgnoreHaltUntilTimeElapsedDialog |
838 ) |
838 ) |
839 (MenuItem |
839 (MenuItem |
840 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
840 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
841 label: 'For the Next N Times...' |
841 label: 'For the Next N Times...' |
842 itemValue: openIgnoreHaltNTimesDialog |
842 itemValue: openIgnoreHaltNTimesDialog |
843 ) |
843 ) |
844 (MenuItem |
844 (MenuItem |
845 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
845 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
846 label: 'Until Shift-Key is Pressed' |
846 label: 'Until Shift-Key is Pressed' |
847 itemValue: ignoreHaltUntilShiftKeyIsPressed |
847 itemValue: ignoreHaltUntilShiftKeyIsPressed |
848 ) |
848 ) |
849 (MenuItem |
849 (MenuItem |
850 label: '-' |
850 label: '-' |
851 ) |
851 ) |
852 (MenuItem |
852 (MenuItem |
853 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
853 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
854 label: 'In Current Process' |
854 label: 'In Current Process' |
855 itemValue: ignoreHaltForCurrentProcess |
855 itemValue: ignoreHaltForCurrentProcess |
856 ) |
856 ) |
857 (MenuItem |
857 (MenuItem |
858 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
858 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
859 label: 'For this Receiver Class' |
859 label: 'For this Receiver Class' |
860 itemValue: ignoreHaltForThisReceiverClass |
860 itemValue: ignoreHaltForThisReceiverClass |
861 ) |
861 ) |
862 (MenuItem |
862 (MenuItem |
863 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
863 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
864 label: 'If Called from Any Of' |
864 label: 'If Called from Any Of' |
865 submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf |
865 submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf |
866 ) |
866 ) |
867 ) |
867 ) |
868 nil |
868 nil |
869 nil |
869 nil |
870 ) |
870 ) |
871 ) |
871 ) |
872 (MenuItem |
872 (MenuItem |
873 enabled: isStoppedAtBreakPointWithParameter |
873 enabled: isStoppedAtBreakPointWithParameter |
874 label: 'Ignore all BreakPoints with this Parameter' |
874 label: 'Ignore all BreakPoints with this Parameter' |
875 submenu: |
875 submenu: |
876 (Menu |
876 (Menu |
877 ( |
877 ( |
878 (MenuItem |
878 (MenuItem |
879 enabled: isStoppedAtBreakPointWithParameter |
879 enabled: isStoppedAtBreakPointWithParameter |
880 label: 'Forever (Reenable in BreakPoint-Browser)' |
880 label: 'Forever (Reenable in BreakPoint-Browser)' |
881 itemValue: ignoreBreakpointsWithThisParameterForever |
881 itemValue: ignoreBreakpointsWithThisParameterForever |
882 ) |
882 ) |
883 (MenuItem |
883 (MenuItem |
884 enabled: isStoppedAtBreakPointWithParameter |
884 enabled: isStoppedAtBreakPointWithParameter |
885 label: 'For Some Time...' |
885 label: 'For Some Time...' |
886 itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
886 itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
887 ) |
887 ) |
888 (MenuItem |
888 (MenuItem |
889 enabled: isStoppedAtBreakPointWithParameter |
889 enabled: isStoppedAtBreakPointWithParameter |
890 label: 'For the Next N Times...' |
890 label: 'For the Next N Times...' |
891 itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog |
891 itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog |
892 ) |
892 ) |
893 (MenuItem |
893 (MenuItem |
894 enabled: isStoppedAtBreakPointWithParameter |
894 enabled: isStoppedAtBreakPointWithParameter |
895 label: 'Until Shift-Key is Pressed' |
895 label: 'Until Shift-Key is Pressed' |
896 itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
896 itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
897 ) |
897 ) |
898 (MenuItem |
898 (MenuItem |
899 label: '-' |
899 label: '-' |
900 ) |
900 ) |
901 (MenuItem |
901 (MenuItem |
902 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
902 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
903 label: 'In Current Process' |
903 label: 'In Current Process' |
904 itemValue: ignoreAllHaltsForCurrentProcess |
904 itemValue: ignoreAllHaltsForCurrentProcess |
905 ) |
905 ) |
906 (MenuItem |
906 (MenuItem |
907 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
907 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
908 label: 'For this Receiver Class' |
908 label: 'For this Receiver Class' |
909 itemValue: ignoreAllHaltsForThisReceiverClass |
909 itemValue: ignoreAllHaltsForThisReceiverClass |
910 ) |
910 ) |
911 (MenuItem |
911 (MenuItem |
912 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
912 enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
913 label: 'If Called from Any Of' |
913 label: 'If Called from Any Of' |
914 submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
914 submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
915 ) |
915 ) |
916 ) |
916 ) |
917 nil |
917 nil |
918 nil |
918 nil |
919 ) |
919 ) |
920 ) |
920 ) |
921 (MenuItem |
921 (MenuItem |
922 label: 'Ignore all Halts/BreakPoints' |
922 label: 'Ignore all Halts/BreakPoints' |
923 submenu: |
923 submenu: |
924 (Menu |
924 (Menu |
925 ( |
925 ( |
926 (MenuItem |
926 (MenuItem |
927 label: 'Forever (Until Ignoring is Stopped)' |
927 label: 'Forever (Until Ignoring is Stopped)' |
928 itemValue: ignoreAllHaltsForever |
928 itemValue: ignoreAllHaltsForever |
929 ) |
929 ) |
930 (MenuItem |
930 (MenuItem |
931 label: 'For Some Time...' |
931 label: 'For Some Time...' |
932 itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
932 itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
933 ) |
933 ) |
934 (MenuItem |
934 (MenuItem |
935 label: 'Until Shift-Key is Pressed' |
935 label: 'Until Shift-Key is Pressed' |
936 itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
936 itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
937 ) |
937 ) |
938 ) |
938 ) |
939 nil |
939 nil |
940 nil |
940 nil |
941 ) |
941 ) |
942 ) |
942 ) |
943 (MenuItem |
943 (MenuItem |
944 enabled: hasHaltsToIgnore |
944 enabled: hasHaltsToIgnore |
945 label: 'Stop Ignoring' |
945 label: 'Stop Ignoring' |
946 itemValue: stopIgnoringHalts |
946 itemValue: stopIgnoringHalts |
947 ) |
947 ) |
948 (MenuItem |
948 (MenuItem |
949 label: '-' |
949 label: '-' |
950 ) |
950 ) |
951 (MenuItem |
951 (MenuItem |
952 enabled: canAddBreakpoint |
952 enabled: canAddBreakpoint |
953 label: 'Add Breakpoint' |
953 label: 'Add Breakpoint' |
954 itemValue: addBreakpoint |
954 itemValue: addBreakpoint |
955 ) |
955 ) |
956 (MenuItem |
956 (MenuItem |
957 label: 'Manage Breakpoints' |
957 label: 'Manage Breakpoints' |
958 itemValue: openBreakPointBrowser |
958 itemValue: openBreakPointBrowser |
959 ) |
959 ) |
960 (MenuItem |
960 (MenuItem |
961 label: '-' |
961 label: '-' |
962 ) |
962 ) |
963 (MenuItem |
963 (MenuItem |
964 label: 'Allow Halt in Debugger' |
964 label: 'Allow Halt in Debugger' |
965 itemValue: allowBreakPointsInDebugger: |
965 itemValue: allowBreakPointsInDebugger: |
966 indication: allowBreakPointsInDebugger |
966 indication: allowBreakPointsInDebugger |
967 ) |
967 ) |
968 ) |
968 ) |
969 nil |
969 nil |
970 nil |
970 nil |
971 ) |
971 ) |
972 ! |
972 ! |
973 |
973 |
974 classMenuSpec |
974 classMenuSpec |
975 "This resource specification was automatically generated |
975 "This resource specification was automatically generated |
984 (Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp |
984 (Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp |
985 " |
985 " |
986 |
986 |
987 <resource: #menu> |
987 <resource: #menu> |
988 |
988 |
989 ^ |
989 ^ |
990 #(Menu |
990 #(Menu |
991 ( |
991 ( |
992 (MenuItem |
992 (MenuItem |
993 enabled: canBrowseImplementingClass |
993 enabled: canBrowseImplementingClass |
994 label: 'Browse Implementing Class' |
994 label: 'Browse Implementing Class' |
995 itemValue: browseImplementingClass |
995 itemValue: browseImplementingClass |
996 ) |
996 ) |
997 (MenuItem |
997 (MenuItem |
998 enabled: canBrowseReceiversClass |
998 enabled: canBrowseReceiversClass |
999 label: 'Browse Receiver''s Class' |
999 label: 'Browse Receiver''s Class' |
1000 itemValue: browseReceiversClass |
1000 itemValue: browseReceiversClass |
1001 ) |
1001 ) |
1002 (MenuItem |
1002 (MenuItem |
1003 enabled: canBrowseProcessesApplication |
1003 enabled: canBrowseProcessesApplication |
1004 label: 'Browse Application Class' |
1004 label: 'Browse Application Class' |
1005 itemValue: browseProcessesApplication |
1005 itemValue: browseProcessesApplication |
1006 ) |
1006 ) |
1007 (MenuItem |
1007 (MenuItem |
1008 label: '-' |
1008 label: '-' |
1009 ) |
1009 ) |
1010 (MenuItem |
1010 (MenuItem |
1011 enabled: canBrowseClassHierarchy |
1011 enabled: canBrowseClassHierarchy |
1012 label: 'Browse Receiver''s Class Hierarchy' |
1012 label: 'Browse Receiver''s Class Hierarchy' |
1013 itemValue: browseClassHierarchy |
1013 itemValue: browseClassHierarchy |
1014 isVisible: false |
1014 isVisible: false |
1015 ) |
1015 ) |
1016 (MenuItem |
1016 (MenuItem |
1017 enabled: canBrowseFullClassProtocol |
1017 enabled: canBrowseFullClassProtocol |
1018 label: 'Browse Receiver''s Full Protocol' |
1018 label: 'Browse Receiver''s Full Protocol' |
1019 itemValue: browseFullClassProtocol |
1019 itemValue: browseFullClassProtocol |
1020 isVisible: false |
1020 isVisible: false |
1021 ) |
1021 ) |
1022 (MenuItem |
1022 (MenuItem |
1023 label: '-' |
1023 label: '-' |
1024 isVisible: false |
1024 isVisible: false |
1025 ) |
1025 ) |
1026 (MenuItem |
1026 (MenuItem |
1027 enabled: canInspectWidgetHierarchy |
1027 enabled: canInspectWidgetHierarchy |
1028 label: 'Inspect Widget Hierarchy' |
1028 label: 'Inspect Widget Hierarchy' |
1029 itemValue: inspectWidgetHierarchy |
1029 itemValue: inspectWidgetHierarchy |
1030 ) |
1030 ) |
1031 ) |
1031 ) |
1032 nil |
1032 nil |
1033 nil |
1033 nil |
1034 ) |
1034 ) |
1035 ! |
1035 ! |
1036 |
1036 |
1037 contextMenuSpec |
1037 contextMenuSpec |
1038 "This resource specification was automatically generated |
1038 "This resource specification was automatically generated |
1047 (Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp |
1047 (Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp |
1048 " |
1048 " |
1049 |
1049 |
1050 <resource: #menu> |
1050 <resource: #menu> |
1051 |
1051 |
1052 ^ |
1052 ^ |
1053 #(Menu |
1053 #(Menu |
1054 ( |
1054 ( |
1055 (MenuItem |
1055 (MenuItem |
1056 enabled: canReturn |
1056 enabled: canReturn |
1057 label: 'Return' |
1057 label: 'Return' |
1058 itemValue: doReturn |
1058 itemValue: doReturn |
1059 ) |
1059 ) |
1060 (MenuItem |
1060 (MenuItem |
1061 enabled: canRestart |
1061 enabled: canRestart |
1062 label: 'Restart' |
1062 label: 'Restart' |
1063 itemValue: doRestart |
1063 itemValue: doRestart |
1064 ) |
1064 ) |
1065 (MenuItem |
1065 (MenuItem |
1066 label: '-' |
1066 label: '-' |
1067 ) |
1067 ) |
1068 (MenuItem |
1068 (MenuItem |
1069 enabled: hasContextSelected |
1069 enabled: hasContextSelected |
1070 label: 'Inspect' |
1070 label: 'Inspect' |
1071 itemValue: inspectContext |
1071 itemValue: inspectContext |
1072 ) |
1072 ) |
1073 (MenuItem |
1073 (MenuItem |
1074 label: 'Copy WalkBack Text' |
1074 label: 'Copy WalkBack Text' |
1075 itemValue: copyWalkbackText |
1075 itemValue: copyWalkbackText |
1076 ) |
1076 ) |
1077 (MenuItem |
1077 (MenuItem |
1078 label: 'Inspect Method' |
1078 label: 'Inspect Method' |
1079 itemValue: inspectContextsMethod |
1079 itemValue: inspectContextsMethod |
1080 ) |
1080 ) |
1081 (MenuItem |
1081 (MenuItem |
1082 label: 'Bookmark Method in SystemBrowser' |
1082 label: 'Bookmark Method in SystemBrowser' |
1083 itemValue: addBrowserBookmark |
1083 itemValue: addBrowserBookmark |
1084 ) |
1084 ) |
1085 (MenuItem |
1085 (MenuItem |
1086 label: '-' |
1086 label: '-' |
1087 ) |
1087 ) |
1088 (MenuItem |
1088 (MenuItem |
1089 enabled: hasBlockContextSelected |
1089 enabled: hasBlockContextSelected |
1090 label: 'Find Home Context in Caller Chain...' |
1090 label: 'Find Home Context in Caller Chain...' |
1091 itemValue: findHomeContext |
1091 itemValue: findHomeContext |
1092 ) |
1092 ) |
1093 (MenuItem |
1093 (MenuItem |
1094 enabled: hasContextSelected |
1094 enabled: hasContextSelected |
1095 label: 'Find Context with String in Source...' |
1095 label: 'Find Context with String in Source...' |
1096 itemValue: findContextWithStringInSource |
1096 itemValue: findContextWithStringInSource |
1097 ) |
1097 ) |
1098 (MenuItem |
1098 (MenuItem |
1099 enabled: hasContextSelected |
1099 enabled: hasContextSelected |
1100 label: 'Find Context with Value in Variable...' |
1100 label: 'Find Context with Value in Variable...' |
1101 itemValue: findContextWithValueInVariable |
1101 itemValue: findContextWithValueInVariable |
1102 ) |
1102 ) |
1103 (MenuItem |
1103 (MenuItem |
1104 enabled: hasContextSelected |
1104 enabled: hasContextSelected |
1105 label: 'Find Next Exception Handler' |
1105 label: 'Find Next Exception Handler' |
1106 itemValue: findNextExceptionHandlerContext |
1106 itemValue: findNextExceptionHandlerContext |
1107 ) |
1107 ) |
1108 (MenuItem |
1108 (MenuItem |
1109 enabled: hasContextSelected |
1109 enabled: hasContextSelected |
1110 label: 'Find Handler For...' |
1110 label: 'Find Handler For...' |
1111 itemValue: findHandlerFor |
1111 itemValue: findHandlerFor |
1112 ) |
1112 ) |
1113 (MenuItem |
1113 (MenuItem |
1114 label: 'Find Dialog Opener...' |
1114 label: 'Find Dialog Opener...' |
1115 itemValue: doGotoDialogOpener |
1115 itemValue: doGotoDialogOpener |
1116 ) |
1116 ) |
1117 (MenuItem |
1117 (MenuItem |
1118 label: 'Find Application Action Method...' |
1118 label: 'Find Application Action Method...' |
1119 itemValue: doGotoApplicationActionMethod |
1119 itemValue: doGotoApplicationActionMethod |
1120 ) |
1120 ) |
1121 (MenuItem |
1121 (MenuItem |
1122 label: '-' |
1122 label: '-' |
1123 ) |
1123 ) |
1124 (MenuItem |
1124 (MenuItem |
1125 label: 'Remember Callchain && Highlight on Next Entry' |
1125 label: 'Remember Callchain && Highlight on Next Entry' |
1126 itemValue: rememberCallchain |
1126 itemValue: rememberCallchain |
1127 ) |
1127 ) |
1128 (MenuItem |
1128 (MenuItem |
1129 label: 'Clear Remembered Callchain' |
1129 label: 'Clear Remembered Callchain' |
1130 itemValue: clearRememberedCallchain |
1130 itemValue: clearRememberedCallchain |
1131 ) |
1131 ) |
1132 ) |
1132 ) |
1133 nil |
1133 nil |
1134 nil |
1134 nil |
1135 ) |
1135 ) |
1136 ! |
1136 ! |
1137 |
1137 |
1138 fileMenuSpec |
1138 fileMenuSpec |
1139 "This resource specification was automatically generated |
1139 "This resource specification was automatically generated |
1148 (Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp |
1148 (Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp |
1149 " |
1149 " |
1150 |
1150 |
1151 <resource: #menu> |
1151 <resource: #menu> |
1152 |
1152 |
1153 ^ |
1153 ^ |
1154 #(Menu |
1154 #(Menu |
1155 ( |
1155 ( |
1156 (MenuItem |
1156 (MenuItem |
1157 enabled: canSendEmail |
1157 enabled: canSendEmail |
1158 label: 'Report a Bug via eMail...' |
1158 label: 'Report a Bug via eMail...' |
1159 itemValue: doOpenReportMailApp |
1159 itemValue: doOpenReportMailApp |
1160 ) |
1160 ) |
1161 (MenuItem |
1161 (MenuItem |
1162 label: '-' |
1162 label: '-' |
1163 ) |
1163 ) |
1164 (MenuItem |
1164 (MenuItem |
1165 enabled: canCloseAllDebuggers |
1165 enabled: canCloseAllDebuggers |
1166 label: 'Close all Debuggers...' |
1166 label: 'Close all Debuggers...' |
1167 itemValue: closeAllDebuggers |
1167 itemValue: closeAllDebuggers |
1168 isVisible: isNotInspecting |
1168 isVisible: isNotInspecting |
1169 ) |
1169 ) |
1170 (MenuItem |
1170 (MenuItem |
1171 label: '-' |
1171 label: '-' |
1172 ) |
1172 ) |
1173 (MenuItem |
1173 (MenuItem |
1174 label: 'Exit' |
1174 label: 'Exit' |
1175 itemValue: closeRequest |
1175 itemValue: closeRequest |
1176 isVisible: isInspecting |
1176 isVisible: isInspecting |
1177 ) |
1177 ) |
1178 (MenuItem |
1178 (MenuItem |
1179 label: 'Close Debugger and Abort' |
1179 label: 'Close Debugger and Abort' |
1180 itemValue: closeRequest |
1180 itemValue: closeRequest |
1181 isVisible: isNotInspecting |
1181 isVisible: isNotInspecting |
1182 ) |
1182 ) |
1183 ) |
1183 ) |
1184 nil |
1184 nil |
1185 nil |
1185 nil |
1186 ) |
1186 ) |
1187 ! |
1187 ! |
1188 |
1188 |
1189 helpMenuSpec |
1189 helpMenuSpec |
1190 "This resource specification was automatically generated |
1190 "This resource specification was automatically generated |
1199 (Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp |
1199 (Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp |
1200 " |
1200 " |
1201 |
1201 |
1202 <resource: #menu> |
1202 <resource: #menu> |
1203 |
1203 |
1204 ^ |
1204 ^ |
1205 #(Menu |
1205 #(Menu |
1206 ( |
1206 ( |
1207 (MenuItem |
1207 (MenuItem |
1208 label: 'Debugger''s Documentation' |
1208 label: 'Debugger''s Documentation' |
1209 itemValue: openHTMLDocument: |
1209 itemValue: openHTMLDocument: |
1210 argument: 'tools/debugger/TOP.html' |
1210 argument: 'tools/debugger/TOP.html' |
1211 ) |
1211 ) |
1212 (MenuItem |
1212 (MenuItem |
1213 label: '-' |
1213 label: '-' |
1214 ) |
1214 ) |
1215 (MenuItem |
1215 (MenuItem |
1216 label: 'About DebugView...' |
1216 label: 'About DebugView...' |
1217 itemValue: openAboutThisApplication |
1217 itemValue: openAboutThisApplication |
1218 ) |
1218 ) |
1219 ) |
1219 ) |
1220 nil |
1220 nil |
1221 nil |
1221 nil |
1222 ) |
1222 ) |
1223 ! |
1223 ! |
1224 |
1224 |
1225 menuSpec |
1225 menuSpec |
1226 "This resource specification was automatically generated |
1226 "This resource specification was automatically generated |
1235 (Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
1235 (Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
1236 " |
1236 " |
1237 |
1237 |
1238 <resource: #menu> |
1238 <resource: #menu> |
1239 |
1239 |
1240 ^ |
1240 ^ |
1241 #(Menu |
1241 #(Menu |
1242 ( |
1242 ( |
1243 (MenuItem |
1243 (MenuItem |
1244 label: 'File' |
1244 label: 'File' |
1245 submenuChannel: fileMenuSpec |
1245 submenuChannel: fileMenuSpec |
1246 ) |
1246 ) |
1247 (MenuItem |
1247 (MenuItem |
1248 label: 'View' |
1248 label: 'View' |
1249 submenuChannel: viewMenuSpec |
1249 submenuChannel: viewMenuSpec |
1250 ) |
1250 ) |
1251 (MenuItem |
1251 (MenuItem |
1252 label: 'Process' |
1252 label: 'Process' |
1253 submenuChannel: processMenuSpec |
1253 submenuChannel: processMenuSpec |
1254 ) |
1254 ) |
1255 (MenuItem |
1255 (MenuItem |
1256 label: 'Context' |
1256 label: 'Context' |
1257 submenuChannel: contextMenuSpec |
1257 submenuChannel: contextMenuSpec |
1258 ) |
1258 ) |
1259 (MenuItem |
1259 (MenuItem |
1260 label: 'Receiver' |
1260 label: 'Receiver' |
1261 submenuChannel: classMenuSpec |
1261 submenuChannel: classMenuSpec |
1262 ) |
1262 ) |
1263 (MenuItem |
1263 (MenuItem |
1264 label: 'Selector' |
1264 label: 'Selector' |
1265 submenuChannel: selectorMenuSpec |
1265 submenuChannel: selectorMenuSpec |
1266 ) |
1266 ) |
1267 (MenuItem |
1267 (MenuItem |
1268 label: 'Breakpoint' |
1268 label: 'Breakpoint' |
1269 submenuChannel: breakPointMenuSpec |
1269 submenuChannel: breakPointMenuSpec |
1270 ) |
1270 ) |
1271 (MenuItem |
1271 (MenuItem |
1272 label: 'MENU_Help' |
1272 label: 'MENU_Help' |
1273 startGroup: conditionalRight |
1273 startGroup: conditionalRight |
1274 submenuChannel: helpMenuSpec |
1274 submenuChannel: helpMenuSpec |
1275 ) |
1275 ) |
1276 ) |
1276 ) |
1277 nil |
1277 nil |
1278 nil |
1278 nil |
1279 ) |
1279 ) |
1280 ! |
1280 ! |
1281 |
1281 |
1282 processMenuSpec |
1282 processMenuSpec |
1283 "This resource specification was automatically generated |
1283 "This resource specification was automatically generated |
1292 (Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp |
1292 (Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp |
1293 " |
1293 " |
1294 |
1294 |
1295 <resource: #menu> |
1295 <resource: #menu> |
1296 |
1296 |
1297 ^ |
1297 ^ |
1298 #(Menu |
1298 #(Menu |
1299 ( |
1299 ( |
1300 (MenuItem |
1300 (MenuItem |
1301 label: 'Continue' |
1301 label: 'Continue' |
1302 itemValue: doContinue |
1302 itemValue: doContinue |
1303 ) |
1303 ) |
1304 (MenuItem |
1304 (MenuItem |
1305 label: 'Next (Line-Step)' |
1305 label: 'Next (Line-Step)' |
1306 itemValue: doNext |
1306 itemValue: doNext |
1307 ) |
1307 ) |
1308 (MenuItem |
1308 (MenuItem |
1309 label: 'Step' |
1309 label: 'Step' |
1310 itemValue: doStep |
1310 itemValue: doStep |
1311 ) |
1311 ) |
1312 (MenuItem |
1312 (MenuItem |
1313 label: '-' |
1313 label: '-' |
1314 ) |
1314 ) |
1315 (MenuItem |
1315 (MenuItem |
1316 label: 'After 5 Seconds' |
1316 label: 'After 5 Seconds' |
1317 submenu: |
1317 submenu: |
1318 (Menu |
1318 (Menu |
1319 ( |
1319 ( |
1320 (MenuItem |
1320 (MenuItem |
1321 label: 'Continue' |
1321 label: 'Continue' |
1322 itemValue: doContinueAfterDelay |
1322 itemValue: doContinueAfterDelay |
1323 ) |
1323 ) |
1324 (MenuItem |
1324 (MenuItem |
1325 label: 'Next (Line-Step)' |
1325 label: 'Next (Line-Step)' |
1326 itemValue: doNextAfterDelay |
1326 itemValue: doNextAfterDelay |
1327 ) |
1327 ) |
1328 (MenuItem |
1328 (MenuItem |
1329 label: 'Step' |
1329 label: 'Step' |
1330 itemValue: doStepAfterDelay |
1330 itemValue: doStepAfterDelay |
1331 ) |
1331 ) |
1332 ) |
1332 ) |
1333 nil |
1333 nil |
1334 nil |
1334 nil |
1335 ) |
1335 ) |
1336 ) |
1336 ) |
1337 (MenuItem |
1337 (MenuItem |
1338 label: '-' |
1338 label: '-' |
1339 ) |
1339 ) |
1340 (MenuItem |
1340 (MenuItem |
1341 label: 'Skip to Cursor Line' |
1341 label: 'Skip to Cursor Line' |
1342 itemValue: skip |
1342 itemValue: skip |
1343 ) |
1343 ) |
1344 (MenuItem |
1344 (MenuItem |
1345 label: 'Step Out (Skip until Return)' |
1345 label: 'Step Out (Skip until Return)' |
1346 itemValue: skipForReturn |
1346 itemValue: skipForReturn |
1347 ) |
1347 ) |
1348 (MenuItem |
1348 (MenuItem |
1349 label: 'Skip until Entering...' |
1349 label: 'Skip until Entering...' |
1350 itemValue: skipUntilEntering |
1350 itemValue: skipUntilEntering |
1351 ) |
1351 ) |
1352 (MenuItem |
1352 (MenuItem |
1353 label: '-' |
1353 label: '-' |
1354 ) |
1354 ) |
1355 (MenuItem |
1355 (MenuItem |
1356 label: 'Abort' |
1356 label: 'Abort' |
1357 itemValue: doAbort |
1357 itemValue: doAbort |
1358 ) |
1358 ) |
1359 (MenuItem |
1359 (MenuItem |
1360 enabled: abortAllIsHandled |
1360 enabled: abortAllIsHandled |
1361 label: 'Abort All' |
1361 label: 'Abort All' |
1362 itemValue: doAbortAll |
1362 itemValue: doAbortAll |
1363 ) |
1363 ) |
1364 (MenuItem |
1364 (MenuItem |
1365 label: '-' |
1365 label: '-' |
1366 ) |
1366 ) |
1367 (MenuItem |
1367 (MenuItem |
1368 label: 'Inspect' |
1368 label: 'Inspect' |
1369 itemValue: doInspectProcess |
1369 itemValue: doInspectProcess |
1370 ) |
1370 ) |
1371 (MenuItem |
1371 (MenuItem |
1372 label: 'Change Priority...' |
1372 label: 'Change Priority...' |
1373 itemValue: doChangeProcessPriority |
1373 itemValue: doChangeProcessPriority |
1374 ) |
1374 ) |
1375 (MenuItem |
1375 (MenuItem |
1376 label: '-' |
1376 label: '-' |
1377 ) |
1377 ) |
1378 (MenuItem |
1378 (MenuItem |
1379 label: 'Terminate' |
1379 label: 'Terminate' |
1380 itemValue: doTerminate |
1380 itemValue: doTerminate |
1381 ) |
1381 ) |
1382 (MenuItem |
1382 (MenuItem |
1383 label: 'Hard Terminate (Danger)' |
1383 label: 'Hard Terminate (Danger)' |
1384 itemValue: quickTerminate |
1384 itemValue: quickTerminate |
1385 isVisible: false |
1385 isVisible: false |
1386 ) |
1386 ) |
1387 ) |
1387 ) |
1388 nil |
1388 nil |
1389 nil |
1389 nil |
1390 ) |
1390 ) |
1391 ! |
1391 ! |
1392 |
1392 |
1393 selectorMenuSpec |
1393 selectorMenuSpec |
1394 "This resource specification was automatically generated |
1394 "This resource specification was automatically generated |
1403 (Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp |
1403 (Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp |
1404 " |
1404 " |
1405 |
1405 |
1406 <resource: #menu> |
1406 <resource: #menu> |
1407 |
1407 |
1408 ^ |
1408 ^ |
1409 #(Menu |
1409 #(Menu |
1410 ( |
1410 ( |
1411 (MenuItem |
1411 (MenuItem |
1412 label: 'Browse Implementors...' |
1412 label: 'Browse Implementors...' |
1413 itemValue: browseImplementorsOf |
1413 itemValue: browseImplementorsOf |
1414 ) |
1414 ) |
1415 (MenuItem |
1415 (MenuItem |
1416 label: 'Browse Senders...' |
1416 label: 'Browse Senders...' |
1417 itemValue: browseSendersOf |
1417 itemValue: browseSendersOf |
1418 ) |
1418 ) |
1419 (MenuItem |
1419 (MenuItem |
1420 label: '-' |
1420 label: '-' |
1421 ) |
1421 ) |
1422 (MenuItem |
1422 (MenuItem |
1423 enabled: canDefineMethod |
1423 enabled: canDefineMethod |
1424 label: 'Define Missing Method' |
1424 label: 'Define Missing Method' |
1425 itemValue: doDefineMethod |
1425 itemValue: doDefineMethod |
1426 ) |
1426 ) |
1427 ) |
1427 ) |
1428 nil |
1428 nil |
1429 nil |
1429 nil |
1430 ) |
1430 ) |
1431 ! |
1431 ! |
1432 |
1432 |
1433 viewMenuSpec |
1433 viewMenuSpec |
1434 "This resource specification was automatically generated |
1434 "This resource specification was automatically generated |
1443 (Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp |
1443 (Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp |
1444 " |
1444 " |
1445 |
1445 |
1446 <resource: #menu> |
1446 <resource: #menu> |
1447 |
1447 |
1448 ^ |
1448 ^ |
1449 #(Menu |
1449 #(Menu |
1450 ( |
1450 ( |
1451 (MenuItem |
1451 (MenuItem |
1452 enabled: canShowMore |
1452 enabled: canShowMore |
1453 label: 'Show More WalkBack' |
1453 label: 'Show More WalkBack' |
1454 itemValue: showMoreWalkback |
1454 itemValue: showMoreWalkback |
1455 ) |
1455 ) |
1456 (MenuItem |
1456 (MenuItem |
1457 enabled: canShowMore |
1457 enabled: canShowMore |
1458 label: 'Show Full WalkBack' |
1458 label: 'Show Full WalkBack' |
1459 itemValue: showFullWalkback |
1459 itemValue: showFullWalkback |
1460 ) |
1460 ) |
1461 (MenuItem |
1461 (MenuItem |
1462 label: '-' |
1462 label: '-' |
1463 ) |
1463 ) |
1464 (MenuItem |
1464 (MenuItem |
1465 label: 'Show Dense WalkBack' |
1465 label: 'Show Dense WalkBack' |
1466 itemValue: showingDenseWalkback: |
1466 itemValue: showingDenseWalkback: |
1467 hideMenuOnActivated: false |
1467 hideMenuOnActivated: false |
1468 indication: showingDenseWalkback |
1468 indication: showingDenseWalkback |
1469 ) |
1469 ) |
1470 (MenuItem |
1470 (MenuItem |
1471 enabled: notShowingDenseWalkbackHolder |
1471 enabled: notShowingDenseWalkbackHolder |
1472 label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)' |
1472 label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)' |
1473 itemValue: showingSupportCode: |
1473 itemValue: showingSupportCode: |
1474 hideMenuOnActivated: false |
1474 hideMenuOnActivated: false |
1475 indication: showingSupportCode |
1475 indication: showingSupportCode |
1476 ) |
1476 ) |
1477 (MenuItem |
1477 (MenuItem |
1478 label: '-' |
1478 label: '-' |
1479 ) |
1479 ) |
1480 (MenuItem |
1480 (MenuItem |
1481 label: 'Raise Debugger when Entering' |
1481 label: 'Raise Debugger when Entering' |
1482 itemValue: autoRaiseView: |
1482 itemValue: autoRaiseView: |
1483 hideMenuOnActivated: false |
1483 hideMenuOnActivated: false |
1484 indication: autoRaiseView |
1484 indication: autoRaiseView |
1485 ) |
1485 ) |
1486 (MenuItem |
1486 (MenuItem |
1487 label: '-' |
1487 label: '-' |
1488 ) |
1488 ) |
1489 (MenuItem |
1489 (MenuItem |
1490 label: 'Settings...' |
1490 label: 'Settings...' |
1491 itemValue: openSettingsDialog |
1491 itemValue: openSettingsDialog |
1492 ) |
1492 ) |
1493 ) |
1493 ) |
1494 nil |
1494 nil |
1495 nil |
1495 nil |
1496 ) |
1496 ) |
1497 ! ! |
1497 ! ! |
1498 |
1498 |
1499 !DebugView class methodsFor:'misc'! |
1499 !DebugView class methodsFor:'misc'! |
1500 |
1500 |
1510 "/ fetch some contexts... |
1510 "/ fetch some contexts... |
1511 someContexts := Array new:25. |
1511 someContexts := Array new:25. |
1512 con := aContext. |
1512 con := aContext. |
1513 idx := 1. |
1513 idx := 1. |
1514 [(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
1514 [(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
1515 someContexts at:idx put:con. |
1515 someContexts at:idx put:con. |
1516 con := con sender. |
1516 con := con sender. |
1517 idx := idx + 1. |
1517 idx := idx + 1. |
1518 ]. |
1518 ]. |
1519 "/ search... |
1519 "/ search... |
1520 idx := self interestingContextIndexIn:someContexts. |
1520 idx := self interestingContextIndexIn:someContexts. |
1521 ^ someContexts at:idx. |
1521 ^ someContexts at:idx. |
1522 |
1522 |
1542 (con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1]. "/ we are already there |
1542 (con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1]. "/ we are already there |
1543 |
1543 |
1544 "/ somewhere, at the bottom, there must be a raise ... |
1544 "/ somewhere, at the bottom, there must be a raise ... |
1545 "/ find the exception |
1545 "/ find the exception |
1546 1 to:5 do:[:i | |
1546 1 to:5 do:[:i | |
1547 found isNil ifTrue:[ |
1547 found isNil ifTrue:[ |
1548 con := aContextArray at:i ifAbsent:nil. |
1548 con := aContextArray at:i ifAbsent:nil. |
1549 con notNil ifTrue:[ |
1549 con notNil ifTrue:[ |
1550 sel := con selector ? ''. |
1550 sel := con selector ? ''. |
1551 (sel isSymbol |
1551 (sel isSymbol |
1552 and:[ (sel startsWith:'raise') |
1552 and:[ (sel startsWith:'raise') |
1553 and:[ ((rcvr := con receiver) isLazyValue not) |
1553 and:[ ((rcvr := con receiver) isLazyValue not) |
1554 and:[ rcvr isExceptionCreator]]]) ifTrue:[ |
1554 and:[ rcvr isExceptionCreator]]]) ifTrue:[ |
1555 offset := i. |
1555 offset := i. |
1556 found := con. |
1556 found := con. |
1557 |
1557 |
1558 "/ if this is a noHandler exception, |
1558 "/ if this is a noHandler exception, |
1559 "/ skip forward to the erronous context |
1559 "/ skip forward to the erronous context |
1560 (rcvr isException) ifTrue:[ |
1560 (rcvr isException) ifTrue:[ |
1561 rcvr creator == Signal noHandlerSignal ifTrue:[ |
1561 rcvr creator == Signal noHandlerSignal ifTrue:[ |
1562 found := rcvr suspendedContext. |
1562 found := rcvr suspendedContext. |
1563 offset := aContextArray identityIndexOf:found. |
1563 offset := aContextArray identityIndexOf:found. |
1564 ] |
1564 ] |
1565 ]. |
1565 ]. |
1566 ]. |
1566 ]. |
1567 ]. |
1567 ]. |
1568 ]. |
1568 ]. |
1569 ]. |
1569 ]. |
1570 "/ Transcript showCR:con. |
1570 "/ Transcript showCR:con. |
1571 "/ Transcript show:'1 '; showCR:found. |
1571 "/ Transcript show:'1 '; showCR:found. |
1572 |
1572 |
1573 found isNil ifTrue:[ |
1573 found isNil ifTrue:[ |
1574 "/ this is a kludge, but convenient. |
1574 "/ this is a kludge, but convenient. |
1575 "/ show the place where the error (divisionByZero...) happend, |
1575 "/ show the place where the error (divisionByZero...) happend, |
1576 "/ not where the signal was raised. |
1576 "/ not where the signal was raised. |
1577 con := (aContextArray at:1). |
1577 con := (aContextArray at:1). |
1578 sel := con methodHome selector. |
1578 sel := con methodHome selector. |
1579 |
1579 |
1580 "/ Transcript show:'2 '; showCR:con. |
1580 "/ Transcript show:'2 '; showCR:con. |
1581 "/ typically a DivisionByZero - show caller of division |
1581 "/ typically a DivisionByZero - show caller of division |
1582 (sel == #// |
1582 (sel == #// |
1583 or:[sel == #/ |
1583 or:[sel == #/ |
1584 or:[sel == #\\]]) ifTrue:[ |
1584 or:[sel == #\\]]) ifTrue:[ |
1585 ^ 2 |
1585 ^ 2 |
1586 ]. |
1586 ]. |
1587 |
1587 |
1588 "/ show the place of the bad message; not where the Signal was raised... |
1588 "/ show the place of the bad message; not where the Signal was raised... |
1589 (sel == #doesNotUnderstand:) ifTrue:[ |
1589 (sel == #doesNotUnderstand:) ifTrue:[ |
1590 idx := 3. |
1590 idx := 3. |
1591 nMax > 2 ifTrue:[ |
1591 nMax > 2 ifTrue:[ |
1592 sel := (aContextArray at:idx) selector ? ''. |
1592 sel := (aContextArray at:idx) selector ? ''. |
1593 sel == #doesNotUnderstand: ifTrue:[ |
1593 sel == #doesNotUnderstand: ifTrue:[ |
1594 idx := 4 |
1594 idx := 4 |
1595 ]. |
1595 ]. |
1596 nMax > idx ifTrue:[ |
1596 nMax > idx ifTrue:[ |
1597 sel := (aContextArray at:idx) selector ? ''. |
1597 sel := (aContextArray at:idx) selector ? ''. |
1598 "/ show the place of the perfor-send; not where the Signal was raised... |
1598 "/ show the place of the perfor-send; not where the Signal was raised... |
1599 ((sel == #perform:) |
1599 ((sel == #perform:) |
1600 or:[sel startsWith:'perform:with']) ifTrue:[ |
1600 or:[sel startsWith:'perform:with']) ifTrue:[ |
1601 idx := idx + 1 |
1601 idx := idx + 1 |
1602 ]. |
1602 ]. |
1603 ] |
1603 ] |
1604 ]. |
1604 ]. |
1605 ^ idx min:nMax |
1605 ^ idx min:nMax |
1606 ]. |
1606 ]. |
1607 |
1607 |
1608 "/ show the bad method; not where the Signal was raised... |
1608 "/ show the bad method; not where the Signal was raised... |
1609 (sel == #noByteCode) ifTrue:[ |
1609 (sel == #noByteCode) ifTrue:[ |
1610 ^ 2 |
1610 ^ 2 |
1611 ]. |
1611 ]. |
1612 |
1612 |
1613 "/ "/ show the place of the halt; not where the HaltSignal was raised... |
1613 "/ "/ show the place of the halt; not where the HaltSignal was raised... |
1614 "/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
1614 "/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
1615 "/ ^ 2 |
1615 "/ ^ 2 |
1616 "/ ]. |
1616 "/ ]. |
1630 "/ ]. |
1630 "/ ]. |
1631 "/ ]. |
1631 "/ ]. |
1632 "/ ^ 2 |
1632 "/ ^ 2 |
1633 "/ ]. |
1633 "/ ]. |
1634 |
1634 |
1635 "/ show the place of signalInterrupt-call; not where the Signal was raised... |
1635 "/ show the place of signalInterrupt-call; not where the Signal was raised... |
1636 (sel == #signalInterrupt:) ifTrue:[ |
1636 (sel == #signalInterrupt:) ifTrue:[ |
1637 ^ 2 |
1637 ^ 2 |
1638 ]. |
1638 ]. |
1639 |
1639 |
1640 "/ "/ show the place of error-call; not where the ErrorSignal was raised... |
1640 "/ "/ show the place of error-call; not where the ErrorSignal was raised... |
1641 "/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
1641 "/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
1642 "/ con method mclass == Object ifTrue:[ |
1642 "/ con method mclass == Object ifTrue:[ |
1643 "/ ^ 2 |
1643 "/ ^ 2 |
1647 "/ "/ show the place of the send; not where the Signal was raised... |
1647 "/ "/ show the place of the send; not where the Signal was raised... |
1648 "/ (sel == #subclassResponsibility) ifTrue:[ |
1648 "/ (sel == #subclassResponsibility) ifTrue:[ |
1649 "/ ^ 2 |
1649 "/ ^ 2 |
1650 "/ ]. |
1650 "/ ]. |
1651 |
1651 |
1652 "/ show the place of the bad index; not where the Signal was raised... |
1652 "/ show the place of the bad index; not where the Signal was raised... |
1653 ( #(#notIndexed |
1653 ( #(#notIndexed |
1654 #indexNotIntegerOrOutOfBounds: |
1654 #indexNotIntegerOrOutOfBounds: |
1655 #subscriptBoundsError: |
1655 #subscriptBoundsError: |
1656 #elementBoundsError: |
1656 #elementBoundsError: |
1657 "/ #subclassResponsibility |
1657 "/ #subclassResponsibility |
1658 ) includes:sel) ifTrue:[ |
1658 ) includes:sel) ifTrue:[ |
1659 idx := 2. |
1659 idx := 2. |
1660 [ idx <= 3 |
1660 [ idx <= 3 |
1661 and:[ |
1661 and:[ |
1662 sel := (aContextArray at:idx) selector. |
1662 sel := (aContextArray at:idx) selector. |
1663 #(#notIndexed |
1663 #(#notIndexed |
1664 #indexNotIntegerOrOutOfBounds: |
1664 #indexNotIntegerOrOutOfBounds: |
1665 #subscriptBoundsError: |
1665 #subscriptBoundsError: |
1666 #elementBoundsError: ) includes:sel |
1666 #elementBoundsError: ) includes:sel |
1667 ] |
1667 ] |
1668 ] whileTrue:[ idx := idx + 1 ]. |
1668 ] whileTrue:[ idx := idx + 1 ]. |
1669 sel := (aContextArray at:idx) selector. |
1669 sel := (aContextArray at:idx) selector. |
1670 (nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
1670 (nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
1671 ifTrue:[ |
1671 ifTrue:[ |
1672 sel := (aContextArray at:idx+1) selector. |
1672 sel := (aContextArray at:idx+1) selector. |
1673 (nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
1673 (nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
1674 ifTrue:[ |
1674 ifTrue:[ |
1675 sel := (aContextArray at:idx+2) selector. |
1675 sel := (aContextArray at:idx+2) selector. |
1676 (nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
1676 (nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
1677 ifTrue:[ |
1677 ifTrue:[ |
1678 ^ idx+3 |
1678 ^ idx+3 |
1679 ]. |
1679 ]. |
1680 ^ idx+2 |
1680 ^ idx+2 |
1681 ]. |
1681 ]. |
1682 ^ idx+1 |
1682 ^ idx+1 |
1683 ]. |
1683 ]. |
1684 ^ idx |
1684 ^ idx |
1685 ]. |
1685 ]. |
1686 offset := 1. |
1686 offset := 1. |
1687 ]. |
1687 ]. |
1688 |
1688 |
1689 "/ the above is all too hard-coded; |
1689 "/ the above is all too hard-coded; |
1690 "/ ask the method, if it thinks it should be skipped in the walkback. |
1690 "/ ask the method, if it thinks it should be skipped in the walkback. |
1691 "/ as more methods get flagged, remove code from above. |
1691 "/ as more methods get flagged, remove code from above. |
1692 con := aContextArray at:offset ifAbsent:nil. |
1692 con := aContextArray at:offset ifAbsent:nil. |
1693 "/ Transcript show:'2 '; showCR:con. |
1693 "/ Transcript show:'2 '; showCR:con. |
1694 [ |
1694 [ |
1695 con notNil |
1695 con notNil |
1696 and:[ (methodHome := con methodHome) notNil |
1696 and:[ (methodHome := con methodHome) notNil |
1697 and:[ (method := methodHome method) notNil |
1697 and:[ (method := methodHome method) notNil |
1698 and:[ method shouldBeSkippedInDebuggersWalkBack ]]] |
1698 and:[ method shouldBeSkippedInDebuggersWalkBack ]]] |
1699 ] whileTrue:[ |
1699 ] whileTrue:[ |
1700 "/ Transcript showCR:con methodHome method. |
1700 "/ Transcript showCR:con methodHome method. |
1701 offset := offset + 1. |
1701 offset := offset + 1. |
1702 con := aContextArray at:offset ifAbsent:nil. |
1702 con := aContextArray at:offset ifAbsent:nil. |
1703 ]. |
1703 ]. |
1704 methodHome := nil. "/ help GC |
1704 methodHome := nil. "/ help GC |
1705 |
1705 |
1706 " |
1706 " |
1707 got it; move up, skipping all intermediate Signal and |
1707 got it; move up, skipping all intermediate Signal and |
1708 Exception contexts |
1708 Exception contexts |
1709 " |
1709 " |
1710 prev := nil. |
1710 prev := nil. |
1711 rcvr := con receiver. |
1711 rcvr := con receiver. |
1712 [ |
1712 [ |
1713 rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
1713 rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
1714 ] whileTrue:[ |
1714 ] whileTrue:[ |
1715 prev := con. |
1715 prev := con. |
1716 nMax > offset ifFalse:[^ offset]. |
1716 nMax > offset ifFalse:[^ offset]. |
1717 |
1717 |
1718 offset := offset + 1. |
1718 offset := offset + 1. |
1719 con := aContextArray at:offset. |
1719 con := aContextArray at:offset. |
1720 rcvr := con receiver. |
1720 rcvr := con receiver. |
1721 ]. |
1721 ]. |
1722 |
1722 |
1723 " |
1723 " |
1724 now, we are one above the raising context |
1724 now, we are one above the raising context |
1725 " |
1725 " |
1726 "/ Transcript show:'3 '; showCR:con. |
1726 "/ Transcript show:'3 '; showCR:con. |
1727 |
1727 |
1728 (con selector == #retry:coercing:) ifTrue:[ |
1728 (con selector == #retry:coercing:) ifTrue:[ |
1729 "/ show the operation which failed to coerce, not the coerce |
1729 "/ show the operation which failed to coerce, not the coerce |
1730 ^ offset + 1 |
1730 ^ offset + 1 |
1731 ]. |
1731 ]. |
1732 |
1732 |
1733 " |
1733 " |
1734 if the sender-method of the raise is one of object's error methods ... |
1734 if the sender-method of the raise is one of object's error methods ... |
1735 " |
1735 " |
1736 ( #( halt halt: |
1736 ( #( halt halt: |
1737 error error: |
1737 error error: |
1738 doesNotUnderstand: |
1738 doesNotUnderstand: |
1739 subclassResponsibility |
1739 subclassResponsibility |
1740 primitiveFailed) includes:con selector) |
1740 primitiveFailed) includes:con selector) |
1741 ifTrue:[ |
1741 ifTrue:[ |
1742 con selector == #doesNotUnderstand: ifTrue:[ |
1742 con selector == #doesNotUnderstand: ifTrue:[ |
1743 " |
1743 " |
1744 one more up, to get to the originating context |
1744 one more up, to get to the originating context |
1745 " |
1745 " |
1746 con := aContextArray at:(offset + 1). |
1746 con := aContextArray at:(offset + 1). |
1747 con isNil ifTrue:[^ offset]. |
1747 con isNil ifTrue:[^ offset]. |
1748 offset := offset + 1. |
1748 offset := offset + 1. |
1749 ]. |
1749 ]. |
1750 con := aContextArray at:(offset + 1). |
1750 con := aContextArray at:(offset + 1). |
1751 con isNil ifTrue:[^ offset]. |
1751 con isNil ifTrue:[^ offset]. |
1752 offset := offset + 1. |
1752 offset := offset + 1. |
1753 ] ifFalse:[ |
1753 ] ifFalse:[ |
1754 " |
1754 " |
1755 ok, got the raise - if its a BreakPoint, look for the sender |
1755 ok, got the raise - if its a BreakPoint, look for the sender |
1756 " |
1756 " |
1757 (prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
1757 (prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
1758 offset := offset + 1 |
1758 offset := offset + 1 |
1759 ]. |
1759 ]. |
1760 ]. |
1760 ]. |
1761 |
1761 |
1762 ^ offset |
1762 ^ offset |
1763 |
1763 |
1764 "Created: / 17-11-2001 / 20:37:49 / cg" |
1764 "Created: / 17-11-2001 / 20:37:49 / cg" |
1777 |
1777 |
1778 !DebugView methodsFor:'aspects'! |
1778 !DebugView methodsFor:'aspects'! |
1779 |
1779 |
1780 verboseBacktraceHolder |
1780 verboseBacktraceHolder |
1781 verboseBacktraceHolder isNil ifTrue:[ |
1781 verboseBacktraceHolder isNil ifTrue:[ |
1782 verboseBacktraceHolder := ValueHolder with:false |
1782 verboseBacktraceHolder := ValueHolder with:false |
1783 ]. |
1783 ]. |
1784 ^ verboseBacktraceHolder |
1784 ^ verboseBacktraceHolder |
1785 ! ! |
1785 ! ! |
1786 |
1786 |
1787 !DebugView methodsFor:'basic'! |
1787 !DebugView methodsFor:'basic'! |
1789 enableDisableActions |
1789 enableDisableActions |
1790 |m| |
1790 |m| |
1791 |
1791 |
1792 m := contextView middleButtonMenu. |
1792 m := contextView middleButtonMenu. |
1793 m notNil ifTrue:[ |
1793 m notNil ifTrue:[ |
1794 self updateMenuItems. |
1794 self updateMenuItems. |
1795 |
1795 |
1796 (inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
1796 (inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
1797 abortButton enable. |
1797 abortButton enable. |
1798 m enable:#doAbort. |
1798 m enable:#doAbort. |
1799 ] ifFalse:[ |
1799 ] ifFalse:[ |
1800 abortButton disable. |
1800 abortButton disable. |
1801 m disable:#doAbort. |
1801 m disable:#doAbort. |
1802 ]. |
1802 ]. |
1803 exclusive ifTrue:[ |
1803 exclusive ifTrue:[ |
1804 terminateButton disable. |
1804 terminateButton disable. |
1805 m disable:#doTerminate. |
1805 m disable:#doTerminate. |
1806 ] ifFalse:[ |
1806 ] ifFalse:[ |
1807 terminateButton enable. |
1807 terminateButton enable. |
1808 m enable:#doTerminate. |
1808 m enable:#doTerminate. |
1809 ] |
1809 ] |
1810 ]. |
1810 ]. |
1811 |
1811 |
1812 mayProceed == false ifTrue:[ |
1812 mayProceed == false ifTrue:[ |
1813 continueButton disable. |
1813 continueButton disable. |
1814 m notNil ifTrue:[m disable:#doContinue]. |
1814 m notNil ifTrue:[m disable:#doContinue]. |
1815 ] ifFalse:[ |
1815 ] ifFalse:[ |
1816 continueButton enable. |
1816 continueButton enable. |
1817 m notNil ifTrue:[m enable:#doContinue] |
1817 m notNil ifTrue:[m enable:#doContinue] |
1818 ]. |
1818 ]. |
1819 |
1819 |
1820 "Created: / 16.11.2001 / 17:40:51 / cg" |
1820 "Created: / 16.11.2001 / 17:40:51 / cg" |
1821 ! |
1821 ! |
1822 |
1822 |
1824 "enter a debugger" |
1824 "enter a debugger" |
1825 |
1825 |
1826 <context: #return> |
1826 <context: #return> |
1827 |
1827 |
1828 ^ self |
1828 ^ self |
1829 enter:thisContext sender |
1829 enter:thisContext sender |
1830 select: nil. |
1830 select: nil. |
1831 |
1831 |
1832 "Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1832 "Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1833 ! |
1833 ! |
1834 |
1834 |
1835 enter:aContext select:initialSelectionOrNil |
1835 enter:aContext select:initialSelectionOrNil |
1839 <context: #return> |
1839 <context: #return> |
1840 |
1840 |
1841 |con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c| |
1841 |con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c| |
1842 |
1842 |
1843 DebuggingDebugger == true ifTrue:[ |
1843 DebuggingDebugger == true ifTrue:[ |
1844 '==> enter2: (' print. aContext print. |
1844 '==> enter2: (' print. aContext print. |
1845 ') select: ' print. initialSelectionOrNil printCR. |
1845 ') select: ' print. initialSelectionOrNil printCR. |
1846 ]. |
1846 ]. |
1847 thisContext isRecursive ifTrue:[ |
1847 thisContext isRecursive ifTrue:[ |
1848 "/ care for the special case, were the Debugger was autoloaded. |
1848 "/ care for the special case, were the Debugger was autoloaded. |
1849 "/ in this case, thisContext IS recursive, but thats no error |
1849 "/ in this case, thisContext IS recursive, but thats no error |
1850 "/ condition. |
1850 "/ condition. |
1851 foundNoByteCodeContext := false. |
1851 foundNoByteCodeContext := false. |
1852 foundExitContext := false. |
1852 foundExitContext := false. |
1853 |
1853 |
1854 c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
1854 c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
1855 [ |
1855 [ |
1856 foundNoByteCodeContext not |
1856 foundNoByteCodeContext not |
1857 and:[ foundExitContext not |
1857 and:[ foundExitContext not |
1858 and:[c notNil |
1858 and:[c notNil |
1859 and:[c selector ~~ #enter:withMessage:mayProceed: |
1859 and:[c selector ~~ #enter:withMessage:mayProceed: |
1860 ]]]] |
1860 ]]]] |
1861 whileTrue:[ |
1861 whileTrue:[ |
1862 c selector == #exit_unwindThenDo: ifTrue:[ |
1862 c selector == #exit_unwindThenDo: ifTrue:[ |
1863 foundExitContext := true |
1863 foundExitContext := true |
1864 ]. |
1864 ]. |
1865 c selector == #noByteCode ifTrue:[ |
1865 c selector == #noByteCode ifTrue:[ |
1866 foundNoByteCodeContext := true |
1866 foundNoByteCodeContext := true |
1867 ]. |
1867 ]. |
1868 c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
1868 c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
1869 ]. |
1869 ]. |
1870 |
1870 |
1871 (foundNoByteCodeContext not |
1871 (foundNoByteCodeContext not |
1872 and:[ foundExitContext not]) ifFalse:[ |
1872 and:[ foundExitContext not]) ifFalse:[ |
1873 ('DebugView [warning]: reentered') errorPrintCR. |
1873 ('DebugView [warning]: reentered') errorPrintCR. |
1874 |
1874 |
1875 ^ MiniDebugger |
1875 ^ MiniDebugger |
1876 enter:aContext |
1876 enter:aContext |
1877 withMessage:'DebugView [error]: recursive error (in debugger)' |
1877 withMessage:'DebugView [error]: recursive error (in debugger)' |
1878 mayProceed:mayProceed. |
1878 mayProceed:mayProceed. |
1879 ]. |
1879 ]. |
1880 foundExitContext ifTrue:[ |
1880 foundExitContext ifTrue:[ |
1881 'DebugView [error]: recursive error (in debugger) ignored' printCR. |
1881 'DebugView [error]: recursive error (in debugger) ignored' printCR. |
1882 ^ self. |
1882 ^ self. |
1883 ]. |
1883 ]. |
1884 ]. |
1884 ]. |
1885 |
1885 |
1886 "/'entering: ' print. aContext printCR. |
1886 "/'entering: ' print. aContext printCR. |
1887 "/'initial: ' print. initialSelectionOrNil printCR. |
1887 "/'initial: ' print. initialSelectionOrNil printCR. |
1888 thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1888 thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1889 |
1889 |
1890 (self isHaltToBeIgnored) ifTrue:[ |
1890 (self isHaltToBeIgnored) ifTrue:[ |
1891 ^ self. |
1891 ^ self. |
1892 ]. |
1892 ]. |
1893 "/ "/ does not work yet - but we should ignore any breakpoints while stepping |
1893 "/ "/ does not work yet - but we should ignore any breakpoints while stepping |
1894 "/ (stepping and:[steppedContext notNil]) ifTrue:[ |
1894 "/ (stepping and:[steppedContext notNil]) ifTrue:[ |
1895 "/ self isEnteredDueToBreakpointOrHalt ifTrue:[ |
1895 "/ self isEnteredDueToBreakpointOrHalt ifTrue:[ |
1896 "/ 'DebugView [info]: ignored other interrupt while stepping' infoPrintCR. |
1896 "/ 'DebugView [info]: ignored other interrupt while stepping' infoPrintCR. |
1916 "/ On a multiUser system, ungrab all of them ... |
1916 "/ On a multiUser system, ungrab all of them ... |
1917 "/ Q: this is good for multi-screen apps (where an error should not happen), |
1917 "/ Q: this is good for multi-screen apps (where an error should not happen), |
1918 "/ but not for multi-user development, where the debugger is entered often. |
1918 "/ but not for multi-user development, where the debugger is entered often. |
1919 "/ What is a good solution to this dilemma ? |
1919 "/ What is a good solution to this dilemma ? |
1920 Screen allScreens do:[:aScreen | |
1920 Screen allScreens do:[:aScreen | |
1921 aScreen ungrabPointer. |
1921 aScreen ungrabPointer. |
1922 aScreen ungrabKeyboard. |
1922 aScreen ungrabKeyboard. |
1923 ]. |
1923 ]. |
1924 |
1924 |
1925 ("inspectedProcess suspendedContext isNil |
1925 ("inspectedProcess suspendedContext isNil |
1926 or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
1926 or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
1927 terminateButton disable. |
1927 terminateButton disable. |
1928 ] ifFalse:[ |
1928 ] ifFalse:[ |
1929 terminateButton enable. |
1929 terminateButton enable. |
1930 abortButton enable. |
1930 abortButton enable. |
1931 ]. |
1931 ]. |
1932 |
1932 |
1933 iAmNew ifFalse:[ |
1933 iAmNew ifFalse:[ |
1934 "/ not the first time - disable buttons & menus |
1934 "/ not the first time - disable buttons & menus |
1935 "/ from the previous life |
1935 "/ from the previous life |
1936 self turnOffAllButtons. |
1936 self turnOffAllButtons. |
1937 |
1937 |
1938 m := contextView middleButtonMenu. |
1938 m := contextView middleButtonMenu. |
1939 m notNil ifTrue:[ |
1939 m notNil ifTrue:[ |
1940 m disableAll:#(showMore "skip skipForReturn" inspectContext). |
1940 m disableAll:#(showMore "skip skipForReturn" inspectContext). |
1941 ]. |
1941 ]. |
1942 self showingDenseWalkback:(self verboseBacktraceHolder value not). |
1942 self showingDenseWalkback:(self verboseBacktraceHolder value not). |
1943 ]. |
1943 ]. |
1944 self iconLabel:'Debugger'. |
1944 self iconLabel:'Debugger'. |
1945 |
1945 |
1946 windowGroup isNil ifTrue:[ |
1946 windowGroup isNil ifTrue:[ |
1947 self windowGroup: WindowGroup new. |
1947 self windowGroup: WindowGroup new. |
1948 windowGroup addTopView:self. |
1948 windowGroup addTopView:self. |
1949 ]. |
1949 ]. |
1950 exclusive ifFalse:[ |
1950 exclusive ifFalse:[ |
1951 "/ create a (modal) windowGroup for myself |
1951 "/ create a (modal) windowGroup for myself |
1952 |
1952 |
1953 windowGroup setModal:true. |
1953 windowGroup setModal:true. |
1954 ] ifTrue:[ |
1954 ] ifTrue:[ |
1955 "/ create a windowGroup with a synchronous sensor for me |
1955 "/ create a windowGroup with a synchronous sensor for me |
1956 |
1956 |
1957 windowGroup beSynchronous. |
1957 windowGroup beSynchronous. |
1958 ]. |
1958 ]. |
1959 windowGroup setProcess:Processor activeProcess. |
1959 windowGroup setProcess:Processor activeProcess. |
1960 IsDebuggingQuery answer:true do:[ |
1960 IsDebuggingQuery answer:true do:[ |
1961 |
1961 |
1962 " |
1962 " |
1963 get the walkback list; clear inspectors if we did not come here by single stepping) |
1963 get the walkback list; clear inspectors if we did not come here by single stepping) |
1964 " |
1964 " |
1965 "/Transcript show:'0 '; showCR:aContext. |
1965 "/Transcript show:'0 '; showCR:aContext. |
1966 "/Transcript show:'0 '; showCR:thisContext sender. |
1966 "/Transcript show:'0 '; showCR:thisContext sender. |
1967 "/Transcript show:'0 '; showCR:thisContext sender sender. |
1967 "/Transcript show:'0 '; showCR:thisContext sender sender. |
1968 "/Transcript show:'0 '; showCR:thisContext sender sender sender. |
1968 "/Transcript show:'0 '; showCR:thisContext sender sender sender. |
1969 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender. |
1969 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender. |
1973 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender . |
1973 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender . |
1974 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender. |
1974 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender. |
1975 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender. |
1975 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender. |
1976 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender. |
1976 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender. |
1977 "/Transcript showCR:initialSelectionOrNil. |
1977 "/Transcript showCR:initialSelectionOrNil. |
1978 self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
1978 self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
1979 "/'after setContext; first is ' print. |
1979 "/'after setContext; first is ' print. |
1980 "/(contextArray at:1 ifAbsent:nil) printCR. |
1980 "/(contextArray at:1 ifAbsent:nil) printCR. |
1981 self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
1981 self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
1982 |
1982 |
1983 self updateButtonsAndMenuItemsForContext:aContext. |
1983 self updateButtonsAndMenuItemsForContext:aContext. |
1984 |
1984 |
1985 " |
1985 " |
1986 If this is a new debugger, do a realize. |
1986 If this is a new debugger, do a realize. |
1987 Otherwise, its probably better to do a map, which shows the |
1987 Otherwise, its probably better to do a map, which shows the |
1988 view at the previous position, without a need for the user to set the |
1988 view at the previous position, without a need for the user to set the |
1989 position again |
1989 position again |
1990 " |
1990 " |
1991 iAmNew ifTrue:[ |
1991 iAmNew ifTrue:[ |
1992 self realize. |
1992 self realize. |
1993 ] ifFalse:[ |
1993 ] ifFalse:[ |
1994 self remap. |
1994 self remap. |
1995 ]. |
1995 ]. |
1996 self setForegroundWindow. |
1996 self setForegroundWindow. |
1997 |
1997 |
1998 exclusive ifTrue:[ |
1998 exclusive ifTrue:[ |
1999 self showError:' |
1999 self showError:' |
2000 Debugging system process `' , (inspectedProcess nameOrId) printString , '''. |
2000 Debugging system process `' , (inspectedProcess nameOrId) printString , '''. |
2001 |
2001 |
2002 This is a modal debugger - all event processing is stopped.. |
2002 This is a modal debugger - all event processing is stopped.. |
2003 Therefore, you cannot interact with other views or |
2003 Therefore, you cannot interact with other views or |
2004 open any other tools while this debugger is active. |
2004 open any other tools while this debugger is active. |
2005 |
2005 |
2006 Also, there is no event processing (redraw) for other views.' |
2006 Also, there is no event processing (redraw) for other views.' |
2007 ]. |
2007 ]. |
2008 |
2008 |
2009 self autoRaiseView ifTrue:[ |
2009 self autoRaiseView ifTrue:[ |
2010 "/ self raise. |
2010 "/ self raise. |
2011 self raiseDeiconified. |
2011 self raiseDeiconified. |
2012 self topView activate; setForegroundWindow; activate. |
2012 self topView activate; setForegroundWindow; activate. |
2013 ]. |
2013 ]. |
2014 |
2014 |
2015 canContinue := true. |
2015 canContinue := true. |
2016 exitAction := nil. |
2016 exitAction := nil. |
2017 |
2017 |
2018 "/ enter private event handling loop. This is left (and we come back here again) |
2018 "/ enter private event handling loop. This is left (and we come back here again) |
2019 "/ when any button was pressed which requires continuation of the debuggee or |
2019 "/ when any button was pressed which requires continuation of the debuggee or |
2020 "/ closedown of the debugger. |
2020 "/ closedown of the debugger. |
2021 [self controlLoop] ifCurtailed:[ |
2021 [self controlLoop] ifCurtailed:[ |
2022 windowGroup notNil ifTrue:[ |
2022 windowGroup notNil ifTrue:[ |
2023 windowGroup setProcess:nil. |
2023 windowGroup setProcess:nil. |
2024 ]. |
2024 ]. |
2025 NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
2025 NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
2026 self destroy |
2026 self destroy |
2027 ]. |
2027 ]. |
2028 NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
2028 NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
2029 ]. |
2029 ]. |
2030 "/ here after my own control loop is finished. |
2030 "/ here after my own control loop is finished. |
2031 |
2031 |
2032 "/ release all context stuff. |
2032 "/ release all context stuff. |
2033 "/ This is required to avoid keeping references to the debuggees objects |
2033 "/ This is required to avoid keeping references to the debuggees objects |
2036 |
2036 |
2037 codeView acceptAction:nil. |
2037 codeView acceptAction:nil. |
2038 codeView doItAction:nil. |
2038 codeView doItAction:nil. |
2039 |
2039 |
2040 ObjectMemory stepInterruptHandler == self ifTrue:[ |
2040 ObjectMemory stepInterruptHandler == self ifTrue:[ |
2041 ObjectMemory stepInterruptHandler:nil. |
2041 ObjectMemory stepInterruptHandler:nil. |
2042 ]. |
2042 ]. |
2043 |
2043 |
2044 lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
2044 lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
2045 lastSelectionInContextInspector := contextInspector selectedKeyName. |
2045 lastSelectionInContextInspector := contextInspector selectedKeyName. |
2046 |
2046 |
2047 (exitAction ~~ #step) ifTrue:[ |
2047 (exitAction ~~ #step) ifTrue:[ |
2048 "/ not stepping or continue - close window |
2048 "/ not stepping or continue - close window |
2049 self cacheMyself. |
2049 self cacheMyself. |
2050 receiverInspector release. |
2050 receiverInspector release. |
2051 contextInspector release. |
2051 contextInspector release. |
2052 |
2052 |
2053 self unmap. |
2053 self unmap. |
2054 self flush. |
2054 self flush. |
2055 |
2055 |
2056 (exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
2056 (exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
2057 (exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
2057 (exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
2058 (exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
2058 (exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
2059 (exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
2059 (exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
2060 (exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ]. |
2060 (exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ]. |
2061 (exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
2061 (exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
2062 (exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
2062 (exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
2063 exitAction isBlock ifTrue:[ |
2063 exitAction isBlock ifTrue:[ |
2064 self exit_unwindThenDo:exitAction. |
2064 self exit_unwindThenDo:exitAction. |
2065 "does not return" |
2065 "does not return" |
2066 ]. |
2066 ]. |
2067 "not reached" |
2067 "not reached" |
2068 ^ self |
2068 ^ self |
2069 ]. |
2069 ]. |
2070 |
2070 |
2071 "/ stepping - window stays open |
2071 "/ stepping - window stays open |
2072 selectedContext := actualContext := firstContext := nil. |
2072 selectedContext := actualContext := firstContext := nil. |
2073 |
2073 |
2074 "/ restore the previous pointer grab |
2074 "/ restore the previous pointer grab |
2075 grabber notNil ifTrue:[ |
2075 grabber notNil ifTrue:[ |
2076 self graphicsDevice grabPointerInView:grabber. |
2076 self graphicsDevice grabPointerInView:grabber. |
2077 grabber := nil. |
2077 grabber := nil. |
2078 ]. |
2078 ]. |
2079 |
2079 |
2080 (exitAction == #step) ifTrue:[ |
2080 (exitAction == #step) ifTrue:[ |
2081 " |
2081 " |
2082 schedule another stepInterrupt |
2082 schedule another stepInterrupt |
2083 - must enter myself into the collection of open debuggers, |
2083 - must enter myself into the collection of open debuggers, |
2084 in case the stepping process comes back again via a halt or signal |
2084 in case the stepping process comes back again via a halt or signal |
2085 before the step is finished. In this case, the stepping debugger should |
2085 before the step is finished. In this case, the stepping debugger should |
2086 come up (instead of a new one) |
2086 come up (instead of a new one) |
2087 - must flush caches since optimized methods not always |
2087 - must flush caches since optimized methods not always |
2088 look for pending interrupts |
2088 look for pending interrupts |
2089 " |
2089 " |
2090 |
2090 |
2091 "/ |
2091 "/ |
2092 "/ also must care for stepping into a return |
2092 "/ also must care for stepping into a return |
2093 "/ |
2093 "/ |
2094 steppedContext notNil ifTrue:[ |
2094 steppedContext notNil ifTrue:[ |
2095 Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
2095 Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
2096 ]. |
2096 ]. |
2097 |
2097 |
2098 OpenDebuggers isNil ifTrue:[ |
2098 OpenDebuggers isNil ifTrue:[ |
2099 OpenDebuggers := WeakIdentitySet new. |
2099 OpenDebuggers := WeakIdentitySet new. |
2100 ]. |
2100 ]. |
2101 OpenDebuggers add:self. |
2101 OpenDebuggers add:self. |
2102 |
2102 |
2103 self label:'single stepping - please wait ...'. |
2103 self label:'single stepping - please wait ...'. |
2104 stepping := true. |
2104 stepping := true. |
2105 |
2105 |
2106 ObjectMemory stepInterruptHandler:self. |
2106 ObjectMemory stepInterruptHandler:self. |
2107 Processor activeProcess stepInterruptHandler:self. |
2107 Processor activeProcess stepInterruptHandler:self. |
2108 ObjectMemory flushCaches. |
2108 ObjectMemory flushCaches. |
2109 |
2109 |
2110 Context singleStepInterruptRequest isHandled ifTrue:[ |
2110 Context singleStepInterruptRequest isHandled ifTrue:[ |
2111 Context singleStepInterruptRequest |
2111 Context singleStepInterruptRequest |
2112 raiseWith: |
2112 raiseWith: |
2113 (("bigStep" steppedContextLineno notNil) |
2113 (("bigStep" steppedContextLineno notNil) |
2114 ifTrue:[#next] |
2114 ifTrue:[#next] |
2115 ifFalse:[#step]) |
2115 ifFalse:[#step]) |
2116 ] ifFalse:[ |
2116 ] ifFalse:[ |
2117 "/ see if we came here through an interrupt-action |
2117 "/ see if we came here through an interrupt-action |
2118 "/ (i.e. aProcess interruptWith:...) |
2118 "/ (i.e. aProcess interruptWith:...) |
2119 |
2119 |
2120 enteredByInterrupt := false. |
2120 enteredByInterrupt := false. |
2121 con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
2121 con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
2122 [enteredByInterrupt not |
2122 [enteredByInterrupt not |
2123 and:[con notNil |
2123 and:[con notNil |
2124 and:[con ~~ aContext]]] whileTrue:[ |
2124 and:[con ~~ aContext]]] whileTrue:[ |
2125 ((sel := con selector) == #timerInterrupt |
2125 ((sel := con selector) == #timerInterrupt |
2126 or:[sel == #ioInterrupt]) ifTrue:[ |
2126 or:[sel == #ioInterrupt]) ifTrue:[ |
2127 enteredByInterrupt := true. |
2127 enteredByInterrupt := true. |
2128 ] ifFalse:[ |
2128 ] ifFalse:[ |
2129 con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
2129 con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
2130 ]. |
2130 ]. |
2131 ]. |
2131 ]. |
2132 |
2132 |
2133 ObjectMemory flushInlineCaches. |
2133 ObjectMemory flushInlineCaches. |
2134 |
2134 |
2135 DebuggingDebugger == true ifTrue:[ |
2135 DebuggingDebugger == true ifTrue:[ |
2136 enteredByInterrupt printCR. |
2136 enteredByInterrupt printCR. |
2137 ]. |
2137 ]. |
2138 enteredByInterrupt ifTrue:[ |
2138 enteredByInterrupt ifTrue:[ |
2139 "/ don't want to step through all intermediate |
2139 "/ don't want to step through all intermediate |
2140 "/ (scheduler-) contexts; place a return-trap on the |
2140 "/ (scheduler-) contexts; place a return-trap on the |
2141 "/ one right below the interesting one |
2141 "/ one right below the interesting one |
2142 |
2142 |
2143 "/ 'special unwind return' printCR. |
2143 "/ 'special unwind return' printCR. |
2144 con unwindThenDo:[ |
2144 con unwindThenDo:[ |
2145 Processor activeProcess stepInterruptHandler:self. |
2145 Processor activeProcess stepInterruptHandler:self. |
2146 ObjectMemory stepInterruptHandler:self. |
2146 ObjectMemory stepInterruptHandler:self. |
2147 InStepInterrupt := nil. |
2147 InStepInterrupt := nil. |
2148 StepInterruptPending := 1. |
2148 StepInterruptPending := 1. |
2149 InterruptPending := 1]. |
2149 InterruptPending := 1]. |
2150 ] ifFalse:[ |
2150 ] ifFalse:[ |
2151 "/ 'normal step return' printCR. |
2151 "/ 'normal step return' printCR. |
2152 skipLineNr ~~ #return ifTrue:[ |
2152 skipLineNr ~~ #return ifTrue:[ |
2153 StepInterruptPending := 1. |
2153 StepInterruptPending := 1. |
2154 InterruptPending := 1. |
2154 InterruptPending := 1. |
2155 ] ifFalse:[ |
2155 ] ifFalse:[ |
2156 "/ 'step for return' printCR. |
2156 "/ 'step for return' printCR. |
2157 ] |
2157 ] |
2158 ]. |
2158 ]. |
2159 InStepInterrupt := nil |
2159 InStepInterrupt := nil |
2160 ] |
2160 ] |
2161 ] ifFalse:[ |
2161 ] ifFalse:[ |
2162 OpenDebuggers notNil ifTrue:[ |
2162 OpenDebuggers notNil ifTrue:[ |
2163 OpenDebuggers remove:self ifAbsent:[]. |
2163 OpenDebuggers remove:self ifAbsent:[]. |
2164 ]. |
2164 ]. |
2165 self cacheMyself. |
2165 self cacheMyself. |
2166 ] |
2166 ] |
2167 |
2167 |
2168 "Modified: / 17-04-1997 / 13:01:32 / stefan" |
2168 "Modified: / 17-04-1997 / 13:01:32 / stefan" |
2169 "Created: / 30-10-1997 / 21:08:18 / cg" |
2169 "Created: / 30-10-1997 / 21:08:18 / cg" |
2170 "Modified: / 13-10-1998 / 19:56:59 / ps" |
2170 "Modified: / 13-10-1998 / 19:56:59 / ps" |
2205 |
2205 |
2206 exit_resend |
2206 exit_resend |
2207 |con| |
2207 |con| |
2208 |
2208 |
2209 selectedContext notNil ifTrue:[ |
2209 selectedContext notNil ifTrue:[ |
2210 con := selectedContext. |
2210 con := selectedContext. |
2211 self cacheMyself. |
2211 self cacheMyself. |
2212 " |
2212 " |
2213 have to catch errors occuring in unwind-blocks |
2213 have to catch errors occuring in unwind-blocks |
2214 " |
2214 " |
2215 Error handle:[:ex | |
2215 Error handle:[:ex | |
2216 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2216 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2217 ex description infoPrintCR. |
2217 ex description infoPrintCR. |
2218 ex proceed |
2218 ex proceed |
2219 ] do:[ |
2219 ] do:[ |
2220 ^ con unwindThenResend. |
2220 ^ con unwindThenResend. |
2221 ]. |
2221 ]. |
2222 'DebugView [warning]: cannot resend selected context''s message' errorPrintCR |
2222 'DebugView [warning]: cannot resend selected context''s message' errorPrintCR |
2223 ] |
2223 ] |
2224 ! |
2224 ! |
2225 |
2225 |
2226 exit_restart |
2226 exit_restart |
2227 |con| |
2227 |con| |
2228 |
2228 |
2229 selectedContext notNil ifTrue:[ |
2229 selectedContext notNil ifTrue:[ |
2230 con := selectedContext. |
2230 con := selectedContext. |
2231 self cacheMyself. |
2231 self cacheMyself. |
2232 " |
2232 " |
2233 have to catch errors occuring in unwind-blocks |
2233 have to catch errors occuring in unwind-blocks |
2234 " |
2234 " |
2235 Error handle:[:ex | |
2235 Error handle:[:ex | |
2236 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2236 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2237 ex description infoPrintCR. |
2237 ex description infoPrintCR. |
2238 ex proceed |
2238 ex proceed |
2239 ] do:[ |
2239 ] do:[ |
2240 con unwindAndRestart. |
2240 con unwindAndRestart. |
2241 ]. |
2241 ]. |
2242 'DebugView [warning]: cannot restart selected context' errorPrintCR |
2242 'DebugView [warning]: cannot restart selected context' errorPrintCR |
2243 ] |
2243 ] |
2244 |
2244 |
2245 "Created: / 16-11-2001 / 17:23:17 / cg" |
2245 "Created: / 16-11-2001 / 17:23:17 / cg" |
2246 "Modified: / 26-09-2012 / 15:09:52 / cg" |
2246 "Modified: / 26-09-2012 / 15:09:52 / cg" |
2247 ! |
2247 ! |
2250 |con retVal| |
2250 |con retVal| |
2251 |
2251 |
2252 retVal := nil. |
2252 retVal := nil. |
2253 |
2253 |
2254 selectedContext notNil ifTrue:[ |
2254 selectedContext notNil ifTrue:[ |
2255 " |
2255 " |
2256 if there is a selection in the codeView, |
2256 if there is a selection in the codeView, |
2257 evaluate it and use the result as return value |
2257 evaluate it and use the result as return value |
2258 " |
2258 " |
2259 "/ disabled for now, there is almost always a selection (the current line) |
2259 "/ disabled for now, there is almost always a selection (the current line) |
2260 "/ and that is syntactically incorrect ... |
2260 "/ and that is syntactically incorrect ... |
2261 "/ ... leading to a popup warning from the codeView |
2261 "/ ... leading to a popup warning from the codeView |
2262 "/ |
2262 "/ |
2263 "/ codeView hasSelection ifTrue:[ |
2263 "/ codeView hasSelection ifTrue:[ |
2271 "/ s := codeView selection asString. |
2271 "/ s := codeView selection asString. |
2272 "/ retVal := codeView doItAction value:s. |
2272 "/ retVal := codeView doItAction value:s. |
2273 "/ ]. |
2273 "/ ]. |
2274 "/ ]. |
2274 "/ ]. |
2275 |
2275 |
2276 con := selectedContext. |
2276 con := selectedContext. |
2277 self cacheMyself. |
2277 self cacheMyself. |
2278 " |
2278 " |
2279 have to catch errors occuring in unwind-blocks |
2279 have to catch errors occuring in unwind-blocks |
2280 " |
2280 " |
2281 Error handle:[:ex | |
2281 Error handle:[:ex | |
2282 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2282 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2283 ex description infoPrintCR. |
2283 ex description infoPrintCR. |
2284 ex proceed |
2284 ex proceed |
2285 ] do:[ |
2285 ] do:[ |
2286 con unwind:retVal. |
2286 con unwind:retVal. |
2287 ]. |
2287 ]. |
2288 'DebugView [warning]: cannot return from selected context' errorPrintCR |
2288 'DebugView [warning]: cannot return from selected context' errorPrintCR |
2289 ] |
2289 ] |
2290 |
2290 |
2291 "Created: / 16.11.2001 / 17:22:24 / cg" |
2291 "Created: / 16.11.2001 / 17:22:24 / cg" |
2292 "Modified: / 17.11.2001 / 23:20:21 / cg" |
2292 "Modified: / 17.11.2001 / 23:20:21 / cg" |
2293 ! |
2293 ! |
2296 |
2296 |
2297 " |
2297 " |
2298 have to catch errors occuring in unwind-blocks |
2298 have to catch errors occuring in unwind-blocks |
2299 " |
2299 " |
2300 Error handle:[:ex | |
2300 Error handle:[:ex | |
2301 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2301 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2302 ex description infoPrintCR. |
2302 ex description infoPrintCR. |
2303 ex proceed |
2303 ex proceed |
2304 ] do:[ |
2304 ] do:[ |
2305 self cacheMyself. |
2305 self cacheMyself. |
2306 Processor activeProcess terminate. |
2306 Processor activeProcess terminate. |
2307 ]. |
2307 ]. |
2308 'DebugView [warning]: cannot terminate process' errorPrintCR |
2308 'DebugView [warning]: cannot terminate process' errorPrintCR |
2309 |
2309 |
2310 "Created: / 16.11.2001 / 17:24:20 / cg" |
2310 "Created: / 16.11.2001 / 17:24:20 / cg" |
2311 "Modified: / 17.11.2001 / 23:20:27 / cg" |
2311 "Modified: / 17.11.2001 / 23:20:27 / cg" |
2327 " |
2327 " |
2328 self cacheMyself. |
2328 self cacheMyself. |
2329 con := thisContext sender. |
2329 con := thisContext sender. |
2330 |
2330 |
2331 Error handle:[:ex | |
2331 Error handle:[:ex | |
2332 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2332 'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2333 ex description infoPrintCR. |
2333 ex description infoPrintCR. |
2334 ex proceed |
2334 ex proceed |
2335 ] do:[ |
2335 ] do:[ |
2336 "/ find the enter:select context. |
2336 "/ find the enter:select context. |
2337 [(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ |
2337 [(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ |
2338 con := con sender |
2338 con := con sender |
2339 ]. |
2339 ]. |
2340 |
2340 |
2341 "/ must skip over its caller (because this one has a ControlInterrupt handler too) |
2341 "/ must skip over its caller (because this one has a ControlInterrupt handler too) |
2342 con sender receiver == self class ifTrue:[ |
2342 con sender receiver == self class ifTrue:[ |
2343 con := con sender. |
2343 con := con sender. |
2344 con sender receiver == self class ifTrue:[ |
2344 con sender receiver == self class ifTrue:[ |
2345 con := con sender methodHome. |
2345 con := con sender methodHome. |
2346 ]. |
2346 ]. |
2347 ]. |
2347 ]. |
2348 |
2348 |
2349 con unwindThenDo:aBlock. |
2349 con unwindThenDo:aBlock. |
2350 ]. |
2350 ]. |
2351 'DebugView [warning]: abort failed' errorPrintCR |
2351 'DebugView [warning]: abort failed' errorPrintCR |
2352 |
2352 |
2353 "Created: / 16.11.2001 / 17:20:45 / cg" |
2353 "Created: / 16.11.2001 / 17:20:45 / cg" |
2354 "Modified: / 18.11.2001 / 00:58:14 / cg" |
2354 "Modified: / 18.11.2001 / 00:58:14 / cg" |
2356 |
2356 |
2357 initialSelectionOnEntry:initialSelectionOrNil context:aContext |
2357 initialSelectionOnEntry:initialSelectionOrNil context:aContext |
2358 |selection con1 con2 h| |
2358 |selection con1 con2 h| |
2359 |
2359 |
2360 initialSelectionOrNil notNil ifTrue:[ |
2360 initialSelectionOrNil notNil ifTrue:[ |
2361 ^ initialSelectionOrNil |
2361 ^ initialSelectionOrNil |
2362 ]. |
2362 ]. |
2363 |
2363 |
2364 " |
2364 " |
2365 and find the one context to show initially |
2365 and find the one context to show initially |
2366 - if we came here by a send (single step), its the top context; |
2366 - if we came here by a send (single step), its the top context; |
2373 con2 := (contextArray at:2 ifAbsent:nil). |
2373 con2 := (contextArray at:2 ifAbsent:nil). |
2374 "/ Transcript show:'x '; showCR:exitAction. |
2374 "/ Transcript show:'x '; showCR:exitAction. |
2375 |
2375 |
2376 "/ came here via a step? |
2376 "/ came here via a step? |
2377 exitAction == #step ifTrue:[ |
2377 exitAction == #step ifTrue:[ |
2378 selection := 1. |
2378 selection := 1. |
2379 steppedContext notNil ifTrue:[ |
2379 steppedContext notNil ifTrue:[ |
2380 |
2380 |
2381 " |
2381 " |
2382 if we came here by a big-step, show the method where we are |
2382 if we came here by a big-step, show the method where we are |
2383 " |
2383 " |
2384 con1 == steppedContext ifTrue:[ |
2384 con1 == steppedContext ifTrue:[ |
2385 selection := 1 |
2385 selection := 1 |
2386 ] ifFalse:[ |
2386 ] ifFalse:[ |
2387 con2 == steppedContext ifTrue:[ |
2387 con2 == steppedContext ifTrue:[ |
2388 selection := 2 |
2388 selection := 2 |
2389 ] |
2389 ] |
2390 ]. |
2390 ]. |
2391 " |
2391 " |
2392 for bigStep, we could also be in a block below the actual method ... |
2392 for bigStep, we could also be in a block below the actual method ... |
2393 " |
2393 " |
2394 ((h := con1 home) notNil |
2394 ((h := con1 home) notNil |
2395 and:[h == steppedContext]) ifTrue:[ |
2395 and:[h == steppedContext]) ifTrue:[ |
2396 selection := 1 |
2396 selection := 1 |
2397 ] ifFalse:[ |
2397 ] ifFalse:[ |
2398 (con2 notNil |
2398 (con2 notNil |
2399 and:[(h := con2 home) notNil |
2399 and:[(h := con2 home) notNil |
2400 and:[h == steppedContext]]) ifTrue:[ |
2400 and:[h == steppedContext]]) ifTrue:[ |
2401 selection := 2 |
2401 selection := 2 |
2402 ] |
2402 ] |
2403 ]. |
2403 ]. |
2404 h := nil. |
2404 h := nil. |
2405 ] |
2405 ] |
2406 ] ifFalse:[ |
2406 ] ifFalse:[ |
2407 steppedContext isNil ifTrue:[ |
2407 steppedContext isNil ifTrue:[ |
2408 " |
2408 " |
2409 preselect a more interesting context, (where halt/raise was ...) |
2409 preselect a more interesting context, (where halt/raise was ...) |
2410 " |
2410 " |
2411 "/ selection := self class interestingContextIndexFrom:aContext. |
2411 "/ selection := self class interestingContextIndexFrom:aContext. |
2412 selection := self class interestingContextIndexIn:contextArray. |
2412 selection := self class interestingContextIndexIn:contextArray. |
2413 "/ Transcript show:'x '; showCR:selection. |
2413 "/ Transcript show:'x '; showCR:selection. |
2414 selection := selection min:(contextArray size). |
2414 selection := selection min:(contextArray size). |
2415 ] ifFalse:[ |
2415 ] ifFalse:[ |
2416 " |
2416 " |
2417 if we came here by a big-step, show the method where we are |
2417 if we came here by a big-step, show the method where we are |
2418 " |
2418 " |
2419 con1 == steppedContext ifTrue:[ |
2419 con1 == steppedContext ifTrue:[ |
2420 selection := 1 |
2420 selection := 1 |
2421 ] ifFalse:[ |
2421 ] ifFalse:[ |
2422 con2 == steppedContext ifTrue:[ |
2422 con2 == steppedContext ifTrue:[ |
2423 selection := 2. |
2423 selection := 2. |
2424 ] |
2424 ] |
2425 ] |
2425 ] |
2426 ] |
2426 ] |
2427 ]. |
2427 ]. |
2428 ^ selection |
2428 ^ selection |
2429 |
2429 |
2430 "Created: / 17.11.2001 / 20:26:26 / cg" |
2430 "Created: / 17.11.2001 / 20:26:26 / cg" |
2431 "Modified: / 17.11.2001 / 22:51:46 / cg" |
2431 "Modified: / 17.11.2001 / 22:51:46 / cg" |
2466 continueButton label:(resources string:'Stop'). |
2466 continueButton label:(resources string:'Stop'). |
2467 w := w max:(continueButton preferredWidth). |
2467 w := w max:(continueButton preferredWidth). |
2468 continueButton preferredExtent:(w @ continueButton preferredHeight). |
2468 continueButton preferredExtent:(w @ continueButton preferredHeight). |
2469 |
2469 |
2470 aProcess state == #run ifTrue:[ |
2470 aProcess state == #run ifTrue:[ |
2471 self graphicsDevice hasColors ifTrue:[ |
2471 self graphicsDevice hasColors ifTrue:[ |
2472 continueButton foregroundColor:Color red darkened. |
2472 continueButton foregroundColor:Color red darkened. |
2473 ]. |
2473 ]. |
2474 continueButton label:(resources string:'Stop'). |
2474 continueButton label:(resources string:'Stop'). |
2475 continueButton action:[self doStop]. |
2475 continueButton action:[self doStop]. |
2476 ] ifFalse:[ |
2476 ] ifFalse:[ |
2477 self graphicsDevice hasColors ifTrue:[ |
2477 self graphicsDevice hasColors ifTrue:[ |
2478 continueButton foregroundColor:Color green darkened darkened. |
2478 continueButton foregroundColor:Color green darkened darkened. |
2479 ]. |
2479 ]. |
2480 continueButton label:(resources string:'Continue'). |
2480 continueButton label:(resources string:'Continue'). |
2481 continueButton action:[self doContinue]. |
2481 continueButton action:[self doContinue]. |
2482 ]. |
2482 ]. |
2483 continueButton preferredExtent:(w @ continueButton preferredHeight). |
2483 continueButton preferredExtent:(w @ continueButton preferredHeight). |
2484 |
2484 |
2485 returnButton disable. |
2485 returnButton disable. |
2486 restartButton disable. |
2486 restartButton disable. |
2490 |
2490 |
2491 "/ stepButton destroy. |
2491 "/ stepButton destroy. |
2492 "/ sendButton destroy. |
2492 "/ sendButton destroy. |
2493 |
2493 |
2494 updateButton := Button |
2494 updateButton := Button |
2495 label:(resources string:'Update') |
2495 label:(resources string:'Update') |
2496 action:[self updateContext] |
2496 action:[self updateContext] |
2497 in:bpanel. |
2497 in:bpanel. |
2498 monitorToggle := Toggle in:bpanel. |
2498 monitorToggle := Toggle in:bpanel. |
2499 monitorToggle label:(resources string:'Monitor'). |
2499 monitorToggle label:(resources string:'Monitor'). |
2500 monitorToggle pressAction:[self autoUpdateOn]. |
2500 monitorToggle pressAction:[self autoUpdateOn]. |
2501 monitorToggle releaseAction:[self autoUpdateOff]. |
2501 monitorToggle releaseAction:[self autoUpdateOff]. |
2502 |
2502 |
2511 nextButton disable; beInvisible. |
2511 nextButton disable; beInvisible. |
2512 nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
2512 nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
2513 nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
2513 nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
2514 |
2514 |
2515 aProcess isNil ifTrue:[ |
2515 aProcess isNil ifTrue:[ |
2516 terminateButton disable. |
2516 terminateButton disable. |
2517 abortButton disable. |
2517 abortButton disable. |
2518 continueButton disable. |
2518 continueButton disable. |
2519 returnButton disable. |
2519 returnButton disable. |
2520 restartButton disable. |
2520 restartButton disable. |
2521 ] ifFalse:[ |
2521 ] ifFalse:[ |
2522 (aProcess suspendedContext isNil |
2522 (aProcess suspendedContext isNil |
2523 or:[aProcess isSystemProcess]) ifTrue:[ |
2523 or:[aProcess isSystemProcess]) ifTrue:[ |
2524 terminateButton disable. |
2524 terminateButton disable. |
2525 ]. |
2525 ]. |
2526 |
2526 |
2527 self setContextSkippingInterruptContexts:aProcess suspendedContext. |
2527 self setContextSkippingInterruptContexts:aProcess suspendedContext. |
2528 |
2528 |
2529 catchBlock := [ |
2529 catchBlock := [ |
2530 catchBlock := nil. |
2530 catchBlock := nil. |
2531 contextArray := nil. |
2531 contextArray := nil. |
2532 selectedContext := actualContext := firstContext := nil. |
2532 selectedContext := actualContext := firstContext := nil. |
2533 steppedContext := wrapperContext := nil. |
2533 steppedContext := wrapperContext := nil. |
2534 |
2534 |
2535 (exitAction == #terminate) ifTrue:[ |
2535 (exitAction == #terminate) ifTrue:[ |
2536 aProcess terminate. |
2536 aProcess terminate. |
2537 ]. |
2537 ]. |
2538 (exitAction == #quickTerminate) ifTrue:[ |
2538 (exitAction == #quickTerminate) ifTrue:[ |
2539 aProcess terminateNoSignal. |
2539 aProcess terminateNoSignal. |
2540 ]. |
2540 ]. |
2541 super destroy |
2541 super destroy |
2542 ]. |
2542 ]. |
2543 ]. |
2543 ]. |
2544 self open |
2544 self open |
2545 |
2545 |
2546 "Modified: 20.3.1997 / 16:53:56 / cg" |
2546 "Modified: 20.3.1997 / 16:53:56 / cg" |
2547 "Modified: 17.4.1997 / 13:01:57 / stefan" |
2547 "Modified: 17.4.1997 / 13:01:57 / stefan" |
2549 |
2549 |
2550 selectContextWithIndex:index |
2550 selectContextWithIndex:index |
2551 self showSelection:index. |
2551 self showSelection:index. |
2552 contextView setSelection:index. |
2552 contextView setSelection:index. |
2553 index > 1 ifTrue:[ |
2553 index > 1 ifTrue:[ |
2554 contextView scrollToLine:(index - 1) |
2554 contextView scrollToLine:(index - 1) |
2555 ]. |
2555 ]. |
2556 ! |
2556 ! |
2557 |
2557 |
2558 setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
2558 setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
2559 |selection| |
2559 |selection| |
2560 |
2560 |
2561 selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
2561 selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
2562 selection notNil ifTrue:[ |
2562 selection notNil ifTrue:[ |
2563 self selectContextWithIndex:selection |
2563 self selectContextWithIndex:selection |
2564 ]. |
2564 ]. |
2565 |
2565 |
2566 "Created: / 16.11.2001 / 17:28:07 / cg" |
2566 "Created: / 16.11.2001 / 17:28:07 / cg" |
2567 "Modified: / 17.11.2001 / 20:27:21 / cg" |
2567 "Modified: / 17.11.2001 / 20:27:21 / cg" |
2568 ! |
2568 ! |
2591 |
2591 |
2592 flyByHelpTextFor:aComponent |
2592 flyByHelpTextFor:aComponent |
2593 |s| |
2593 |s| |
2594 |
2594 |
2595 aComponent == abortButton ifTrue:[ |
2595 aComponent == abortButton ifTrue:[ |
2596 s := 'Abort (unwind to eventLoop)' |
2596 s := 'Abort (unwind to eventLoop)' |
2597 ]. |
2597 ]. |
2598 aComponent == terminateButton ifTrue:[ |
2598 aComponent == terminateButton ifTrue:[ |
2599 Processor activeProcess isGUIProcess ifTrue:[ |
2599 Processor activeProcess isGUIProcess ifTrue:[ |
2600 s := 'Terminate the process (closes view and shuts down application)' |
2600 s := 'Terminate the process (closes view and shuts down application)' |
2601 ] ifFalse:[ |
2601 ] ifFalse:[ |
2602 s := 'Terminate the process' |
2602 s := 'Terminate the process' |
2603 ] |
2603 ] |
2604 ]. |
2604 ]. |
2605 aComponent == continueButton ifTrue:[ |
2605 aComponent == continueButton ifTrue:[ |
2606 continueButton label = (resources string:'Stop') ifTrue:[ |
2606 continueButton label = (resources string:'Stop') ifTrue:[ |
2607 s := 'Stop' |
2607 s := 'Stop' |
2608 ] ifFalse:[ |
2608 ] ifFalse:[ |
2609 s := 'Continue execution' |
2609 s := 'Continue execution' |
2610 ] |
2610 ] |
2611 ]. |
2611 ]. |
2612 aComponent == stepButton ifTrue:[ |
2612 aComponent == stepButton ifTrue:[ |
2613 s := 'Step to next send in selected context (don''t enter into called methods)' |
2613 s := 'Step to next send in selected context (don''t enter into called methods)' |
2614 ]. |
2614 ]. |
2615 aComponent == nextButton ifTrue:[ |
2615 aComponent == nextButton ifTrue:[ |
2616 s := 'Step to next line in selected context (don''t enter into called methods)' |
2616 s := 'Step to next line in selected context (don''t enter into called methods)' |
2617 ]. |
2617 ]. |
2618 aComponent == nextOverButton ifTrue:[ |
2618 aComponent == nextOverButton ifTrue:[ |
2619 s := 'Step over to cursor-line' |
2619 s := 'Step over to cursor-line' |
2620 ]. |
2620 ]. |
2621 aComponent == nextOutButton ifTrue:[ |
2621 aComponent == nextOutButton ifTrue:[ |
2622 s := 'Step out to caller' |
2622 s := 'Step out to caller' |
2623 ]. |
2623 ]. |
2624 aComponent == sendButton ifTrue:[ |
2624 aComponent == sendButton ifTrue:[ |
2625 s := 'Send next message (enter into called methods)' |
2625 s := 'Send next message (enter into called methods)' |
2626 ]. |
2626 ]. |
2627 aComponent == returnButton ifTrue:[ |
2627 aComponent == returnButton ifTrue:[ |
2628 restartButton enabled ifTrue:[ |
2628 restartButton enabled ifTrue:[ |
2629 s := 'Return from the selected method' |
2629 s := 'Return from the selected method' |
2630 ] ifFalse:[ |
2630 ] ifFalse:[ |
2631 s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
2631 s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
2632 ] |
2632 ] |
2633 ]. |
2633 ]. |
2634 aComponent == restartButton ifTrue:[ |
2634 aComponent == restartButton ifTrue:[ |
2635 restartButton enabled ifTrue:[ |
2635 restartButton enabled ifTrue:[ |
2636 s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again' |
2636 s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again' |
2637 ] ifFalse:[ |
2637 ] ifFalse:[ |
2638 s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
2638 s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
2639 ] |
2639 ] |
2640 ]. |
2640 ]. |
2641 aComponent == resendButton ifTrue:[ |
2641 aComponent == resendButton ifTrue:[ |
2642 resendButton enabled ifTrue:[ |
2642 resendButton enabled ifTrue:[ |
2643 s := 'Resend the selected method''s message.\If the code was changed in the meanwhile, the new method will be called with the original arguments.' |
2643 s := 'Resend the selected method''s message.\If the code was changed in the meanwhile, the new method will be called with the original arguments.' |
2644 ] ifFalse:[ |
2644 ] ifFalse:[ |
2645 s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
2645 s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
2646 ] |
2646 ] |
2647 ]. |
2647 ]. |
2648 aComponent == monitorToggle ifTrue:[ |
2648 aComponent == monitorToggle ifTrue:[ |
2649 s := 'Toggle monitoring' |
2649 s := 'Toggle monitoring' |
2650 ]. |
2650 ]. |
2651 aComponent == updateButton ifTrue:[ |
2651 aComponent == updateButton ifTrue:[ |
2652 s := 'Update' |
2652 s := 'Update' |
2653 ]. |
2653 ]. |
2654 aComponent == defineButton ifTrue:[ |
2654 aComponent == defineButton ifTrue:[ |
2655 s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then' |
2655 s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then' |
2656 ]. |
2656 ]. |
2657 aComponent == reportButton ifTrue:[ |
2657 aComponent == reportButton ifTrue:[ |
2658 s := 'Send a defect report via eMail' |
2658 s := 'Send a defect report via eMail' |
2659 ]. |
2659 ]. |
2660 s notNil ifTrue:[ |
2660 s notNil ifTrue:[ |
2661 ^ resources stringWithCRs:s |
2661 ^ resources stringWithCRs:s |
2662 ]. |
2662 ]. |
2663 ^ nil |
2663 ^ nil |
2664 |
2664 |
2665 "Modified: / 29-08-1995 / 23:38:54 / claus" |
2665 "Modified: / 29-08-1995 / 23:38:54 / claus" |
2666 "Modified: / 18-06-2010 / 11:34:51 / cg" |
2666 "Modified: / 18-06-2010 / 11:34:51 / cg" |
2679 |
2679 |
2680 pos := codeView characterPositionOfLine:line col:col. |
2680 pos := codeView characterPositionOfLine:line col:col. |
2681 interval := pos to:pos. |
2681 interval := pos to:pos. |
2682 |
2682 |
2683 self |
2683 self |
2684 withNodeValueAtInterval:interval |
2684 withNodeValueAtInterval:interval |
2685 do:[:value :description | |
2685 do:[:value :description | |
2686 |valueClassOrSizeString valueString| |
2686 |valueClassOrSizeString valueString| |
2687 |
2687 |
2688 valueClassOrSizeString := valueString := ''. |
2688 valueClassOrSizeString := valueString := ''. |
2689 |
2689 |
2690 "/ some heuristics as when to show the class name (a purely subjective preference) |
2690 "/ some heuristics as when to show the class name (a purely subjective preference) |
2691 value isString ifTrue:[ |
2691 value isString ifTrue:[ |
2692 value isText ifTrue:[ |
2692 value isText ifTrue:[ |
2693 valueString := '"',(value contractTo:80),'"'. |
2693 valueString := '"',(value contractTo:80),'"'. |
2694 ] ifFalse:[ |
2694 ] ifFalse:[ |
2695 valueString := value storeString contractTo:80. |
2695 valueString := value storeString contractTo:80. |
2696 ]. |
2696 ]. |
2697 ] ifFalse:[ |
2697 ] ifFalse:[ |
2698 (value isBoolean |
2698 (value isBoolean |
2699 or:[ value isInteger |
2699 or:[ value isInteger |
2700 or:[ value isSymbol ]]) ifTrue:[ |
2700 or:[ value isSymbol ]]) ifTrue:[ |
2701 valueString := value printString. |
2701 valueString := value printString. |
2702 ] ifFalse:[ |
2702 ] ifFalse:[ |
2703 valueClassOrSizeString := ' (',value class name,')'. |
2703 valueClassOrSizeString := ' (',value class name,')'. |
2704 |
2704 |
2705 (value isArray |
2705 (value isArray |
2706 or:[ value isOrderedCollection ]) ifTrue:[ |
2706 or:[ value isOrderedCollection ]) ifTrue:[ |
2707 valueClassOrSizeString := ' (size=',value size printString,')'. |
2707 valueClassOrSizeString := ' (size=',value size printString,')'. |
2708 ]. |
2708 ]. |
2709 |
2709 |
2710 Error handle:[:ex | |
2710 Error handle:[:ex | |
2711 valueString := '??? (',ex description,')' |
2711 valueString := '??? (',ex description,')' |
2712 ] do:[ |
2712 ] do:[ |
2713 [ |
2713 [ |
2714 valueString := value printString contractTo:80. |
2714 valueString := value printString contractTo:80. |
2715 ] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
2715 ] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
2716 ] |
2716 ] |
2717 ] |
2717 ] |
2718 ]. |
2718 ]. |
2719 description isEmptyOrNil ifTrue:[ |
2719 description isEmptyOrNil ifTrue:[ |
2720 s := valueString , valueClassOrSizeString |
2720 s := valueString , valueClassOrSizeString |
2721 ] ifFalse:[ |
2721 ] ifFalse:[ |
2722 s := description , ': ', valueString, valueClassOrSizeString |
2722 s := description , ': ', valueString, valueClassOrSizeString |
2723 ]. |
2723 ]. |
2724 ]. |
2724 ]. |
2725 "/ Transcript showCR:s. |
2725 "/ Transcript showCR:s. |
2726 ^ s |
2726 ^ s |
2727 |
2727 |
2728 "Modified: / 27-04-2010 / 17:51:53 / cg" |
2728 "Modified: / 27-04-2010 / 17:51:53 / cg" |
2729 ! |
2729 ! |
2730 |
2730 |
2731 helpTextFor:aComponent |
2731 helpTextFor:aComponent |
2732 |s| |
2732 |s| |
2733 |
2733 |
2734 aComponent == abortButton ifTrue:[ |
2734 aComponent == abortButton ifTrue:[ |
2735 s := 'HELP_ABORT' |
2735 s := 'HELP_ABORT' |
2736 ]. |
2736 ]. |
2737 aComponent == terminateButton ifTrue:[ |
2737 aComponent == terminateButton ifTrue:[ |
2738 s := 'HELP_TERMINATE' |
2738 s := 'HELP_TERMINATE' |
2739 ]. |
2739 ]. |
2740 aComponent == continueButton ifTrue:[ |
2740 aComponent == continueButton ifTrue:[ |
2741 continueButton label = (resources string:'Stop') ifTrue:[ |
2741 continueButton label = (resources string:'Stop') ifTrue:[ |
2742 s := 'HELP_STOP' |
2742 s := 'HELP_STOP' |
2743 ] ifFalse:[ |
2743 ] ifFalse:[ |
2744 s := 'HELP_CONTINUE' |
2744 s := 'HELP_CONTINUE' |
2745 ] |
2745 ] |
2746 ]. |
2746 ]. |
2747 aComponent == stepButton ifTrue:[ |
2747 aComponent == stepButton ifTrue:[ |
2748 s := 'HELP_STEP' |
2748 s := 'HELP_STEP' |
2749 ]. |
2749 ]. |
2750 aComponent == nextButton ifTrue:[ |
2750 aComponent == nextButton ifTrue:[ |
2751 s := 'HELP_NEXT' |
2751 s := 'HELP_NEXT' |
2752 ]. |
2752 ]. |
2753 aComponent == nextOverButton ifTrue:[ |
2753 aComponent == nextOverButton ifTrue:[ |
2754 s := 'HELP_NEXTOVER' |
2754 s := 'HELP_NEXTOVER' |
2755 ]. |
2755 ]. |
2756 aComponent == nextOutButton ifTrue:[ |
2756 aComponent == nextOutButton ifTrue:[ |
2757 s := 'HELP_NEXTOUT' |
2757 s := 'HELP_NEXTOUT' |
2758 ]. |
2758 ]. |
2759 aComponent == stepButton ifTrue:[ |
2759 aComponent == stepButton ifTrue:[ |
2760 s := 'HELP_STEP' |
2760 s := 'HELP_STEP' |
2761 ]. |
2761 ]. |
2762 aComponent == sendButton ifTrue:[ |
2762 aComponent == sendButton ifTrue:[ |
2763 s := 'HELP_SEND' |
2763 s := 'HELP_SEND' |
2764 ]. |
2764 ]. |
2765 aComponent == returnButton ifTrue:[ |
2765 aComponent == returnButton ifTrue:[ |
2766 returnButton enabled ifTrue:[ |
2766 returnButton enabled ifTrue:[ |
2767 s := 'HELP_RETURN' |
2767 s := 'HELP_RETURN' |
2768 ] ifFalse:[ |
2768 ] ifFalse:[ |
2769 s := 'HELP_RETURN_DISABLED' |
2769 s := 'HELP_RETURN_DISABLED' |
2770 ]. |
2770 ]. |
2771 ]. |
2771 ]. |
2772 aComponent == restartButton ifTrue:[ |
2772 aComponent == restartButton ifTrue:[ |
2773 restartButton enabled ifTrue:[ |
2773 restartButton enabled ifTrue:[ |
2774 s := 'HELP_RESTART' |
2774 s := 'HELP_RESTART' |
2775 ] ifFalse:[ |
2775 ] ifFalse:[ |
2776 s := 'HELP_RESTART_DISABLED' |
2776 s := 'HELP_RESTART_DISABLED' |
2777 ]. |
2777 ]. |
2778 ]. |
2778 ]. |
2779 aComponent == resendButton ifTrue:[ |
2779 aComponent == resendButton ifTrue:[ |
2780 resendButton enabled ifTrue:[ |
2780 resendButton enabled ifTrue:[ |
2781 s := 'HELP_RESEND' |
2781 s := 'HELP_RESEND' |
2782 ] ifFalse:[ |
2782 ] ifFalse:[ |
2783 s := 'HELP_RESEND_DISABLED' |
2783 s := 'HELP_RESEND_DISABLED' |
2784 ]. |
2784 ]. |
2785 ]. |
2785 ]. |
2786 aComponent == contextView ifTrue:[ |
2786 aComponent == contextView ifTrue:[ |
2787 s := 'HELP_WALKBACK' |
2787 s := 'HELP_WALKBACK' |
2788 ]. |
2788 ]. |
2789 aComponent == codeView ifTrue:[ |
2789 aComponent == codeView ifTrue:[ |
2790 s := 'HELP_CODEVIEW' |
2790 s := 'HELP_CODEVIEW' |
2791 ]. |
2791 ]. |
2792 aComponent == monitorToggle ifTrue:[ |
2792 aComponent == monitorToggle ifTrue:[ |
2793 s := 'HELP_MONITOR' |
2793 s := 'HELP_MONITOR' |
2794 ]. |
2794 ]. |
2795 aComponent == updateButton ifTrue:[ |
2795 aComponent == updateButton ifTrue:[ |
2796 s := 'HELP_UPDATE' |
2796 s := 'HELP_UPDATE' |
2797 ]. |
2797 ]. |
2798 aComponent == gotoDialogOpenerButton ifTrue:[ |
2798 aComponent == gotoDialogOpenerButton ifTrue:[ |
2799 s := 'HELP_GOTO_DIALOG_OPENER' |
2799 s := 'HELP_GOTO_DIALOG_OPENER' |
2800 ]. |
2800 ]. |
2801 aComponent == gotoApplicationActionMethodButton ifTrue:[ |
2801 aComponent == gotoApplicationActionMethodButton ifTrue:[ |
2802 s := 'HELP_GOTO_APPLICATION_ACTION' |
2802 s := 'HELP_GOTO_APPLICATION_ACTION' |
2803 ]. |
2803 ]. |
2804 "/ aComponent == stopButton ifTrue:[ |
2804 "/ aComponent == stopButton ifTrue:[ |
2805 "/ s := 'HELP_STOP' |
2805 "/ s := 'HELP_STOP' |
2806 "/ ]. |
2806 "/ ]. |
2807 (aComponent isComponentOf:receiverInspector) ifTrue:[ |
2807 (aComponent isComponentOf:receiverInspector) ifTrue:[ |
2808 s := 'HELP_REC_INSP' |
2808 s := 'HELP_REC_INSP' |
2809 ]. |
2809 ]. |
2810 (aComponent isComponentOf:contextInspector) ifTrue:[ |
2810 (aComponent isComponentOf:contextInspector) ifTrue:[ |
2811 s := 'HELP_CON_INSP' |
2811 s := 'HELP_CON_INSP' |
2812 ]. |
2812 ]. |
2813 |
2813 |
2814 s notNil ifTrue:[ |
2814 s notNil ifTrue:[ |
2815 ^ resources stringWithCRs:s |
2815 ^ resources stringWithCRs:s |
2816 ]. |
2816 ]. |
2817 ^ nil |
2817 ^ nil |
2818 |
2818 |
2819 "Modified: 29.8.1995 / 23:38:54 / claus" |
2819 "Modified: 29.8.1995 / 23:38:54 / claus" |
2820 "Modified: 4.3.1997 / 01:54:03 / cg" |
2820 "Modified: 4.3.1997 / 01:54:03 / cg" |
2841 "closing the debugger implies an abort or continue" |
2841 "closing the debugger implies an abort or continue" |
2842 |
2842 |
2843 |m| |
2843 |m| |
2844 |
2844 |
2845 withConfirmation ifTrue:[ |
2845 withConfirmation ifTrue:[ |
2846 self checkIfCodeIsReallyModified ifTrue:[ |
2846 self checkIfCodeIsReallyModified ifTrue:[ |
2847 (self confirm:('Code modified - exit anyway ?')) |
2847 (self confirm:('Code modified - exit anyway ?')) |
2848 ifFalse:[ |
2848 ifFalse:[ |
2849 ^ self |
2849 ^ self |
2850 ] |
2850 ] |
2851 ] |
2851 ] |
2852 ]. |
2852 ]. |
2853 |
2853 |
2854 self autoUpdateOff. |
2854 self autoUpdateOff. |
2855 |
2855 |
2856 (m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2856 (m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2857 inspecting ifFalse:[ |
2857 inspecting ifFalse:[ |
2858 "I am running on top of a process, abort or continue it" |
2858 "I am running on top of a process, abort or continue it" |
2859 |
2859 |
2860 windowGroup notNil ifTrue:[ |
2860 windowGroup notNil ifTrue:[ |
2861 windowGroup setProcess:nil. |
2861 windowGroup setProcess:nil. |
2862 ]. |
2862 ]. |
2863 self uncacheMyself. |
2863 self uncacheMyself. |
2864 |
2864 |
2865 "/ |
2865 "/ |
2866 "/ catch invalid return; |
2866 "/ catch invalid return; |
2867 "/ this happens, when my process has somehow died (quickterminate) |
2867 "/ this happens, when my process has somehow died (quickterminate) |
2868 "/ and I am a leftOver view, which gets terminated via the launchers |
2868 "/ and I am a leftOver view, which gets terminated via the launchers |
2869 "/ #destroy-window function. |
2869 "/ #destroy-window function. |
2870 "/ |
2870 "/ |
2871 Context cannotReturnSignal handle:[:ex | |
2871 Context cannotReturnSignal handle:[:ex | |
2872 'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
2872 'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
2873 self uncacheMyself. |
2873 self uncacheMyself. |
2874 Debugger newDebugger. |
2874 Debugger newDebugger. |
2875 ex return. |
2875 ex return. |
2876 ] do:[ |
2876 ] do:[ |
2877 AbortOperationRequest isHandled ifTrue:[ |
2877 AbortOperationRequest isHandled ifTrue:[ |
2878 self doAbort. |
2878 self doAbort. |
2879 ] ifFalse:[ |
2879 ] ifFalse:[ |
2880 self doContinue |
2880 self doContinue |
2881 ] |
2881 ] |
2882 ]. |
2882 ]. |
2883 "/ We don't reach this point normally |
2883 "/ We don't reach this point normally |
2884 'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
2884 'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
2885 ]. |
2885 ]. |
2886 |
2886 |
2887 Debugger newDebugger. |
2887 Debugger newDebugger. |
2888 "/ since I am going to be destroyed, remove me from the cache |
2888 "/ since I am going to be destroyed, remove me from the cache |
2889 self uncacheMyself. |
2889 self uncacheMyself. |
2903 |
2903 |
2904 self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger). |
2904 self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger). |
2905 |
2905 |
2906 hideSupportCode := userPrefs hideSupportCodeInDebugger ? false. |
2906 hideSupportCode := userPrefs hideSupportCodeInDebugger ? false. |
2907 ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
2907 ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
2908 "/ the debugger |
2908 "/ the debugger |
2909 |
2909 |
2910 busy := false. |
2910 busy := false. |
2911 exclusive := false. |
2911 exclusive := false. |
2912 inspecting := false. |
2912 inspecting := false. |
2913 exitAction := nil. |
2913 exitAction := nil. |
2927 mH := menuPanel preferredHeight. |
2927 mH := menuPanel preferredHeight. |
2928 menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2928 menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2929 |
2929 |
2930 newLayout := userPrefs useNewLayoutInDebugger. |
2930 newLayout := userPrefs useNewLayoutInDebugger. |
2931 newLayout ifFalse:[ |
2931 newLayout ifFalse:[ |
2932 bpanel := HorizontalPanelView in:self. |
2932 bpanel := HorizontalPanelView in:self. |
2933 |
2933 |
2934 self initializeButtonsIn:bpanel. |
2934 self initializeButtonsIn:bpanel. |
2935 |
2935 |
2936 bH := bpanel preferredHeight + 5. |
2936 bH := bpanel preferredHeight + 5. |
2937 bpanel origin:(0.0 @ mH) |
2937 bpanel origin:(0.0 @ mH) |
2938 extent:(1.0 @ bH). |
2938 extent:(1.0 @ bH). |
2939 panel := VariableVerticalPanel |
2939 panel := VariableVerticalPanel |
2940 origin:(0.0 @ (mH + bH)) |
2940 origin:(0.0 @ (mH + bH)) |
2941 corner:(1.0 @ 1.0) |
2941 corner:(1.0 @ 1.0) |
2942 in:self. |
2942 in:self. |
2943 |
2943 |
2944 v := self initializeContextListViewIn:panel. |
2944 v := self initializeContextListViewIn:panel. |
2945 v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
2945 v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
2946 |
2946 |
2947 codePanel := View in:panel. |
2947 codePanel := View in:panel. |
2948 v := self initializeCodeViewIn:codePanel. |
2948 v := self initializeCodeViewIn:codePanel. |
2949 v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
2949 v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
2950 codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
2950 codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
2951 |
2951 |
2952 v := self initializeInspectorViewsIn:panel. |
2952 v := self initializeInspectorViewsIn:panel. |
2953 v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
2953 v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
2954 |
2954 |
2955 ] ifTrue:[ |
2955 ] ifTrue:[ |
2956 bpanel1 := HorizontalPanelView in:self. |
2956 bpanel1 := HorizontalPanelView in:self. |
2957 self initializeButtons1In:bpanel1. |
2957 self initializeButtons1In:bpanel1. |
2958 |
2958 |
2959 contextInfoLabel := Label label:''. |
2959 contextInfoLabel := Label label:''. |
2960 contextInfoLabel adjust:#left. |
2960 contextInfoLabel adjust:#left. |
2961 bpanel1 add:contextInfoLabel. |
2961 bpanel1 add:contextInfoLabel. |
2962 |
2962 |
2963 bH1 := bpanel1 preferredHeight + 5. |
2963 bH1 := bpanel1 preferredHeight + 5. |
2964 bpanel1 origin:(0.0 @ mH) |
2964 bpanel1 origin:(0.0 @ mH) |
2965 extent:(1.0 @ bH1). |
2965 extent:(1.0 @ bH1). |
2966 panel := VariableVerticalPanel |
2966 panel := VariableVerticalPanel |
2967 origin:(0.0 @ (mH + bH1)) |
2967 origin:(0.0 @ (mH + bH1)) |
2968 corner:(1.0 @ 1.0) |
2968 corner:(1.0 @ 1.0) |
2969 in:self. |
2969 in:self. |
2970 "/ panel showHandle:true. |
2970 "/ panel showHandle:true. |
2971 "/ panel handlePosition:#left. |
2971 "/ panel handlePosition:#left. |
2972 |
2972 |
2973 v := self initializeContextListViewIn:panel. |
2973 v := self initializeContextListViewIn:panel. |
2974 v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
2974 v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
2975 |
2975 |
2976 codePanel := View in:panel. |
2976 codePanel := View in:panel. |
2977 bpanel2 := HorizontalPanelView in:codePanel. |
2977 bpanel2 := HorizontalPanelView in:codePanel. |
2978 self initializeButtons2In:bpanel2. |
2978 self initializeButtons2In:bpanel2. |
2979 |
2979 |
2980 bH2 := bpanel2 preferredHeight + 5. |
2980 bH2 := bpanel2 preferredHeight + 5. |
2981 bpanel2 origin:(0.0 @ 0.0) |
2981 bpanel2 origin:(0.0 @ 0.0) |
2982 extent:(1.0 @ bH2). |
2982 extent:(1.0 @ bH2). |
2983 |
2983 |
2984 exceptionInfoLabel := Label label:''. |
2984 exceptionInfoLabel := Label label:''. |
2985 exceptionInfoLabel adjust:#left. |
2985 exceptionInfoLabel adjust:#left. |
2986 |
2986 |
2987 exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
2987 exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
2988 exceptionAndTogglePanel horizontalLayout:#left. |
2988 exceptionAndTogglePanel horizontalLayout:#left. |
2989 exceptionAndTogglePanel |
2989 exceptionAndTogglePanel |
2990 geometryLayout: |
2990 geometryLayout: |
2991 ((LayoutFrame |
2991 ((LayoutFrame |
2992 origin:(0.0 @ 0.0) |
2992 origin:(0.0 @ 0.0) |
2993 corner:(1.0 @ 0.0)) |
2993 corner:(1.0 @ 0.0)) |
2994 topOffset:bH2; |
2994 topOffset:bH2; |
2995 bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
2995 bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
2996 rightOffset:-2). |
2996 rightOffset:-2). |
2997 |
2997 |
2998 methodCodeToggleSelectionHolder := 1 asValue. |
2998 methodCodeToggleSelectionHolder := 1 asValue. |
2999 methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
2999 methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
3000 codeToggleLabels := resources array:{ |
3000 codeToggleLabels := resources array:{ |
3001 'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
3001 'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
3002 'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
3002 'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
3003 }. |
3003 }. |
3004 methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
3004 methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
3005 methodCodeToggle list:codeToggleLabels. |
3005 methodCodeToggle list:codeToggleLabels. |
3006 methodCodeToggle useIndex:true. |
3006 methodCodeToggle useIndex:true. |
3007 methodCodeToggle model:methodCodeToggleSelectionHolder. |
3007 methodCodeToggle model:methodCodeToggleSelectionHolder. |
3008 methodCodeToggle beInvisible. |
3008 methodCodeToggle beInvisible. |
3009 |
3009 |
3010 exceptionAndTogglePanel add:exceptionInfoLabel. |
3010 exceptionAndTogglePanel add:exceptionInfoLabel. |
3011 |
3011 |
3012 v := self initializeCodeViewIn:codePanel. |
3012 v := self initializeCodeViewIn:codePanel. |
3013 v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
3013 v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
3014 codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
3014 codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
3015 |
3015 |
3016 v := self initializeInspectorViewsIn:panel. |
3016 v := self initializeInspectorViewsIn:panel. |
3017 v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
3017 v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
3018 ]. |
3018 ]. |
3019 |
3019 |
3020 DefaultDebuggerBackgroundColor notNil ifTrue:[ |
3020 DefaultDebuggerBackgroundColor notNil ifTrue:[ |
3021 self allViewBackground:DefaultDebuggerBackgroundColor. |
3021 self allViewBackground:DefaultDebuggerBackgroundColor. |
3022 ]. |
3022 ]. |
3023 LastExtent notNil ifTrue:[ |
3023 LastExtent notNil ifTrue:[ |
3024 self extent:LastExtent. |
3024 self extent:LastExtent. |
3025 ]. |
3025 ]. |
3026 LastOrigin notNil ifTrue:[ |
3026 LastOrigin notNil ifTrue:[ |
3027 self origin:LastOrigin. |
3027 self origin:LastOrigin. |
3028 ]. |
3028 ]. |
3029 |
3029 |
3030 " |
3030 " |
3031 Debugger newDebugger |
3031 Debugger newDebugger |
3032 " |
3032 " |
3034 "Modified: / 27-07-2012 / 14:46:07 / cg" |
3034 "Modified: / 27-07-2012 / 14:46:07 / cg" |
3035 ! |
3035 ! |
3036 |
3036 |
3037 initializeAbortButtonIn:bpanel |
3037 initializeAbortButtonIn:bpanel |
3038 abortButton := Button |
3038 abortButton := Button |
3039 label:(resources string:'Abort') |
3039 label:(resources string:'Abort') |
3040 action:[ |
3040 action:[ |
3041 abortButton turnOffWithoutRedraw. |
3041 abortButton turnOffWithoutRedraw. |
3042 self doAbort |
3042 self doAbort |
3043 ] |
3043 ] |
3044 in:bpanel. |
3044 in:bpanel. |
3045 |
3045 |
3046 "Created: / 17.11.2001 / 20:56:47 / cg" |
3046 "Created: / 17.11.2001 / 20:56:47 / cg" |
3047 "Modified: / 17.11.2001 / 20:57:17 / cg" |
3047 "Modified: / 17.11.2001 / 20:57:17 / cg" |
3048 ! |
3048 ! |
3049 |
3049 |
3075 self initializeGotoDialogOpenerButtonIn:bpanel. |
3075 self initializeGotoDialogOpenerButtonIn:bpanel. |
3076 self initializeGotoApplicationActionMethodButtonIn:bpanel. |
3076 self initializeGotoApplicationActionMethodButtonIn:bpanel. |
3077 self initializeDefineButtonIn:bpanel. |
3077 self initializeDefineButtonIn:bpanel. |
3078 |
3078 |
3079 (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
3079 (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
3080 separator := View extent:(10 @ 5) in:bpanel. |
3080 separator := View extent:(10 @ 5) in:bpanel. |
3081 separator borderWidth:0; level:0. |
3081 separator borderWidth:0; level:0. |
3082 self initializeReportButtonIn:bpanel. |
3082 self initializeReportButtonIn:bpanel. |
3083 ]. |
3083 ]. |
3084 "Modified: / 17.11.2001 / 21:02:59 / cg" |
3084 "Modified: / 17.11.2001 / 21:02:59 / cg" |
3085 ! |
3085 ! |
3086 |
3086 |
3087 initializeButtons2In:bpanel |
3087 initializeButtons2In:bpanel |
3218 separator := View extent:(30 @ 5) in:bpanel. |
3218 separator := View extent:(30 @ 5) in:bpanel. |
3219 separator borderWidth:0; level:0. |
3219 separator borderWidth:0; level:0. |
3220 |
3220 |
3221 self initializeDefineButtonIn:bpanel. |
3221 self initializeDefineButtonIn:bpanel. |
3222 (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
3222 (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
3223 self initializeReportButtonIn:bpanel. |
3223 self initializeReportButtonIn:bpanel. |
3224 ]. |
3224 ]. |
3225 |
3225 |
3226 |
3226 |
3227 "Created: / 17.11.2001 / 20:56:20 / cg" |
3227 "Created: / 17.11.2001 / 20:56:20 / cg" |
3228 "Modified: / 17.11.2001 / 21:03:18 / cg" |
3228 "Modified: / 17.11.2001 / 21:03:18 / cg" |
3230 |
3230 |
3231 initializeCodeViewIn:panel |
3231 initializeCodeViewIn:panel |
3232 |scrollableCodeView| |
3232 |scrollableCodeView| |
3233 |
3233 |
3234 (UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
3234 (UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
3235 scrollableCodeView := codeView := Tools::CodeView2 new. |
3235 scrollableCodeView := codeView := Tools::CodeView2 new. |
3236 codeView model: ValueHolder new. |
3236 codeView model: ValueHolder new. |
3237 codeView methodHolder: ValueHolder new. |
3237 codeView methodHolder: ValueHolder new. |
3238 codeView classHolder: ValueHolder new. |
3238 codeView classHolder: ValueHolder new. |
3239 ] ifFalse:[ |
3239 ] ifFalse:[ |
3240 scrollableCodeView := HVScrollableView |
3240 scrollableCodeView := HVScrollableView |
3241 for:CodeView |
3241 for:CodeView |
3242 miniScrollerH:true |
3242 miniScrollerH:true |
3243 miniScrollerV:false |
3243 miniScrollerV:false |
3244 in:panel. |
3244 in:panel. |
3245 |
3245 |
3246 codeView := scrollableCodeView scrolledView. |
3246 codeView := scrollableCodeView scrolledView. |
3247 codeView enableMotionEvents. "/ for active help |
3247 codeView enableMotionEvents. "/ for active help |
3248 ]. |
3248 ]. |
3249 |
3249 |
3250 (UserPreferences current showAcceptCancelBarInBrowser |
3250 (UserPreferences current showAcceptCancelBarInBrowser |
3251 and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
3251 and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
3252 ViewWithAcceptAndCancelBar notNil ifTrue:[ |
3252 ViewWithAcceptAndCancelBar notNil ifTrue:[ |
3253 |v| |
3253 |v| |
3254 |
3254 |
3255 v := ViewWithAcceptAndCancelBar new. |
3255 v := ViewWithAcceptAndCancelBar new. |
3256 v slaveView:scrollableCodeView. |
3256 v slaveView:scrollableCodeView. |
3257 v reallyModifiedHolder:(codeView isCodeView2 |
3257 v reallyModifiedHolder:(codeView isCodeView2 |
3258 ifTrue:[ codeView reallyModifiedChannel ] |
3258 ifTrue:[ codeView reallyModifiedChannel ] |
3259 ifFalse:[ |
3259 ifFalse:[ |
3260 BlockValue |
3260 BlockValue |
3261 with:[:m | |
3261 with:[:m | |
3262 |same| |
3262 |same| |
3263 |
3263 |
3264 same := (codeView contentsAsString string = currentMethod source string). |
3264 same := (codeView contentsAsString string = currentMethod source string). |
3265 codeView modifiedChannel setValue:false. "/ so it triggers again |
3265 codeView modifiedChannel setValue:false. "/ so it triggers again |
3266 same not. |
3266 same not. |
3267 ] |
3267 ] |
3268 argument:codeView modifiedChannel |
3268 argument:codeView modifiedChannel |
3269 ]). |
3269 ]). |
3270 v cancelAction: |
3270 v cancelAction: |
3271 [ |
3271 [ |
3272 "/ codeView setClipboardText:(codeView contents). "/ for undo |
3272 "/ codeView setClipboardText:(codeView contents). "/ for undo |
3273 codeView device rememberInCopyBufferHistory:(codeView contents). "/ for undo |
3273 codeView device rememberInCopyBufferHistory:(codeView contents). "/ for undo |
3274 codeView contents:(currentMethod source). |
3274 codeView contents:(currentMethod source). |
3275 codeView modifiedChannel setValue:false; changed. "/ trigger |
3275 codeView modifiedChannel setValue:false; changed. "/ trigger |
3276 codeView requestFocus. |
3276 codeView requestFocus. |
3277 ]. |
3277 ]. |
3278 v compareAction: |
3278 v compareAction: |
3279 [ |
3279 [ |
3280 v := DiffCodeView |
3280 v := DiffCodeView |
3281 openOn:codeView contentsAsString |
3281 openOn:codeView contentsAsString |
3282 label:(resources string:'Changed definition (to be accepted ?)') |
3282 label:(resources string:'Changed definition (to be accepted ?)') |
3283 and:currentMethod source |
3283 and:currentMethod source |
3284 label:(resources string:'Method''s Original Code'). |
3284 label:(resources string:'Method''s Original Code'). |
3285 v label:(resources string:'Changed Code in Debugger'). |
3285 v label:(resources string:'Changed Code in Debugger'). |
3286 v waitUntilVisible. |
3286 v waitUntilVisible. |
3287 "/ codeView requestFocus |
3287 "/ codeView requestFocus |
3288 ]. |
3288 ]. |
3289 scrollableCodeView := v. |
3289 scrollableCodeView := v. |
3290 ] |
3290 ] |
3291 ]. |
3291 ]. |
3292 |
3292 |
3293 panel add:scrollableCodeView. |
3293 panel add:scrollableCodeView. |
3294 ^ scrollableCodeView |
3294 ^ scrollableCodeView |
3295 |
3295 |
3298 |
3298 |
3299 initializeContextListViewIn:panel |
3299 initializeContextListViewIn:panel |
3300 |v| |
3300 |v| |
3301 |
3301 |
3302 v := HVScrollableView |
3302 v := HVScrollableView |
3303 for:SelectionInListView |
3303 for:SelectionInListView |
3304 miniScrollerH:true |
3304 miniScrollerH:true |
3305 miniScrollerV:false |
3305 miniScrollerV:false |
3306 in:panel. |
3306 in:panel. |
3307 v autoHideHorizontalScrollBar:true. |
3307 v autoHideHorizontalScrollBar:true. |
3308 |
3308 |
3309 contextView := v scrolledView. |
3309 contextView := v scrolledView. |
3310 contextView action:[:lineNr | self showSelection:lineNr]. |
3310 contextView action:[:lineNr | self showSelection:lineNr]. |
3311 contextView doubleClickAction:[:line | self browseImplementingClass]. |
3311 contextView doubleClickAction:[:line | self browseImplementingClass]. |
3322 contextView middleButtonMenu:(self middleButtonMenu). |
3322 contextView middleButtonMenu:(self middleButtonMenu). |
3323 ! |
3323 ! |
3324 |
3324 |
3325 initializeContinueButtonIn:bpanel |
3325 initializeContinueButtonIn:bpanel |
3326 continueButton := Button |
3326 continueButton := Button |
3327 label:(resources string:'Continue') |
3327 label:(resources string:'Continue') |
3328 action:[ |
3328 action:[ |
3329 continueButton turnOffWithoutRedraw. |
3329 continueButton turnOffWithoutRedraw. |
3330 self doContinue |
3330 self doContinue |
3331 ] |
3331 ] |
3332 in:bpanel. |
3332 in:bpanel. |
3333 |
3333 |
3334 "Created: / 17.11.2001 / 20:57:34 / cg" |
3334 "Created: / 17.11.2001 / 20:57:34 / cg" |
3335 ! |
3335 ! |
3336 |
3336 |
3337 initializeDefineButtonIn:bpanel |
3337 initializeDefineButtonIn:bpanel |
3338 defineButton := Button |
3338 defineButton := Button |
3339 label:(resources string:'Define') |
3339 label:(resources string:'Define') |
3340 action:[ |
3340 action:[ |
3341 defineButton turnOffWithoutRedraw. |
3341 defineButton turnOffWithoutRedraw. |
3342 self doDefine |
3342 self doDefine |
3343 ] |
3343 ] |
3344 in:bpanel. |
3344 in:bpanel. |
3345 defineButton beInvisible |
3345 defineButton beInvisible |
3346 |
3346 |
3347 "Created: / 17.11.2001 / 21:02:48 / cg" |
3347 "Created: / 17.11.2001 / 21:02:48 / cg" |
3348 ! |
3348 ! |
3349 |
3349 |
3350 initializeGotoApplicationActionMethodButtonIn:bpanel |
3350 initializeGotoApplicationActionMethodButtonIn:bpanel |
3351 gotoApplicationActionMethodButton := Button |
3351 gotoApplicationActionMethodButton := Button |
3352 label:(resources string:'Goto Responsible Application Method') |
3352 label:(resources string:'Goto Responsible Application Method') |
3353 action:[ |
3353 action:[ |
3354 gotoApplicationActionMethodButton turnOffWithoutRedraw. |
3354 gotoApplicationActionMethodButton turnOffWithoutRedraw. |
3355 self doGotoApplicationActionMethod |
3355 self doGotoApplicationActionMethod |
3356 ] |
3356 ] |
3357 in:bpanel. |
3357 in:bpanel. |
3358 |
3358 |
3359 gotoApplicationActionMethodButton beInvisible |
3359 gotoApplicationActionMethodButton beInvisible |
3360 ! |
3360 ! |
3361 |
3361 |
3362 initializeGotoDialogOpenerButtonIn:bpanel |
3362 initializeGotoDialogOpenerButtonIn:bpanel |
3363 gotoDialogOpenerButton := Button |
3363 gotoDialogOpenerButton := Button |
3364 label:(resources string:'Goto Dialog Opener') |
3364 label:(resources string:'Goto Dialog Opener') |
3365 action:[ |
3365 action:[ |
3366 gotoDialogOpenerButton turnOffWithoutRedraw. |
3366 gotoDialogOpenerButton turnOffWithoutRedraw. |
3367 self doGotoDialogOpener |
3367 self doGotoDialogOpener |
3368 ] |
3368 ] |
3369 in:bpanel. |
3369 in:bpanel. |
3370 |
3370 |
3371 gotoDialogOpenerButton beInvisible |
3371 gotoDialogOpenerButton beInvisible |
3372 ! |
3372 ! |
3373 |
3373 |
3374 initializeInspectorViewsIn:panel |
3374 initializeInspectorViewsIn:panel |
3375 |hpanel| |
3375 |hpanel| |
3376 |
3376 |
3377 hpanel := VariableHorizontalPanel in:panel. |
3377 hpanel := VariableHorizontalPanel in:panel. |
3378 |
3378 |
3379 receiverInspector := InspectorView |
3379 receiverInspector := InspectorView |
3380 origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
3380 origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
3381 in:hpanel. |
3381 in:hpanel. |
3382 receiverInspector fieldListLabel:'Receiver'. |
3382 receiverInspector fieldListLabel:'Receiver'. |
3383 |
3383 |
3384 contextInspector := ContextInspectorView |
3384 contextInspector := ContextInspectorView |
3385 origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
3385 origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
3386 in:hpanel. |
3386 in:hpanel. |
3387 contextInspector fieldListLabel:'Context'. |
3387 contextInspector fieldListLabel:'Context'. |
3388 |
3388 |
3389 ^ hpanel |
3389 ^ hpanel |
3390 ! |
3390 ! |
3391 |
3391 |
3392 initializeNextButtonIn:bpanel |
3392 initializeNextButtonIn:bpanel |
3393 nextButton := Button |
3393 nextButton := Button |
3394 label:(resources string:'Debug_Next') |
3394 label:(resources string:'Debug_Next') |
3395 action:[ |
3395 action:[ |
3396 stepButton turnOff. |
3396 stepButton turnOff. |
3397 self doNext |
3397 self doNext |
3398 ] |
3398 ] |
3399 in:bpanel. |
3399 in:bpanel. |
3400 |
3400 |
3401 "Created: / 17.11.2001 / 20:59:38 / cg" |
3401 "Created: / 17.11.2001 / 20:59:38 / cg" |
3402 ! |
3402 ! |
3403 |
3403 |
3404 initializeReportButtonIn:bpanel |
3404 initializeReportButtonIn:bpanel |
3405 reportButton := Button |
3405 reportButton := Button |
3406 label:(resources string:'Report by Mail...') |
3406 label:(resources string:'Report by Mail...') |
3407 action:[ |
3407 action:[ |
3408 reportButton turnOffWithoutRedraw. |
3408 reportButton turnOffWithoutRedraw. |
3409 self doOpenReportMailApp. |
3409 self doOpenReportMailApp. |
3410 ] |
3410 ] |
3411 in:bpanel. |
3411 in:bpanel. |
3412 |
3412 |
3413 "Created: / 17.11.2001 / 21:02:20 / cg" |
3413 "Created: / 17.11.2001 / 21:02:20 / cg" |
3414 ! |
3414 ! |
3415 |
3415 |
3416 initializeResendButtonIn:bpanel |
3416 initializeResendButtonIn:bpanel |
3417 resendButton := Button |
3417 resendButton := Button |
3418 label:(resources string:'Resend') |
3418 label:(resources string:'Resend') |
3419 action:[ |
3419 action:[ |
3420 resendButton turnOff. |
3420 resendButton turnOff. |
3421 self doResend |
3421 self doResend |
3422 ] |
3422 ] |
3423 in:bpanel. |
3423 in:bpanel. |
3424 |
3424 |
3425 "/ if we have this, we do not need the restart button |
3425 "/ if we have this, we do not need the restart button |
3426 restartButton beInvisible. |
3426 restartButton beInvisible. |
3427 ! |
3427 ! |
3428 |
3428 |
3429 initializeRestartButtonIn:bpanel |
3429 initializeRestartButtonIn:bpanel |
3430 restartButton := Button |
3430 restartButton := Button |
3431 label:(resources string:'Restart') |
3431 label:(resources string:'Restart') |
3432 action:[ |
3432 action:[ |
3433 restartButton turnOff. |
3433 restartButton turnOff. |
3434 self doRestart |
3434 self doRestart |
3435 ] |
3435 ] |
3436 in:bpanel. |
3436 in:bpanel. |
3437 |
3437 |
3438 "Created: / 17.11.2001 / 20:58:52 / cg" |
3438 "Created: / 17.11.2001 / 20:58:52 / cg" |
3439 ! |
3439 ! |
3440 |
3440 |
3441 initializeReturnButtonIn:bpanel |
3441 initializeReturnButtonIn:bpanel |
3442 returnButton := Button |
3442 returnButton := Button |
3443 label:(resources string:'Return') |
3443 label:(resources string:'Return') |
3444 action:[ |
3444 action:[ |
3445 returnButton turnOff. |
3445 returnButton turnOff. |
3446 self doReturn |
3446 self doReturn |
3447 ] |
3447 ] |
3448 in:bpanel. |
3448 in:bpanel. |
3449 |
3449 |
3450 "Created: / 17.11.2001 / 20:58:22 / cg" |
3450 "Created: / 17.11.2001 / 20:58:22 / cg" |
3451 ! |
3451 ! |
3452 |
3452 |
3453 initializeSendButtonIn:bpanel |
3453 initializeSendButtonIn:bpanel |
3454 sendButton := Button |
3454 sendButton := Button |
3455 label:(resources string:'Send') |
3455 label:(resources string:'Send') |
3456 action:[ |
3456 action:[ |
3457 sendButton turnOff. |
3457 sendButton turnOff. |
3458 self doSend |
3458 self doSend |
3459 ] |
3459 ] |
3460 in:bpanel. |
3460 in:bpanel. |
3461 |
3461 |
3462 "Created: / 17.11.2001 / 21:01:20 / cg" |
3462 "Created: / 17.11.2001 / 21:01:20 / cg" |
3463 ! |
3463 ! |
3464 |
3464 |
3465 initializeStepButtonIn:bpanel |
3465 initializeStepButtonIn:bpanel |
3466 stepButton := Button |
3466 stepButton := Button |
3467 label:(resources string:'Debug_Step') |
3467 label:(resources string:'Debug_Step') |
3468 action:[ |
3468 action:[ |
3469 stepButton turnOff. |
3469 stepButton turnOff. |
3470 self doStep |
3470 self doStep |
3471 ] |
3471 ] |
3472 in:bpanel. |
3472 in:bpanel. |
3473 |
3473 |
3474 "Created: / 17.11.2001 / 21:00:13 / cg" |
3474 "Created: / 17.11.2001 / 21:00:13 / cg" |
3475 ! |
3475 ! |
3476 |
3476 |
3477 initializeTerminateButtonIn:bpanel |
3477 initializeTerminateButtonIn:bpanel |
3478 terminateButton := Button |
3478 terminateButton := Button |
3479 label:(resources string:'Debug_Terminate') |
3479 label:(resources string:'Debug_Terminate') |
3480 action:[ |
3480 action:[ |
3481 terminateButton turnOffWithoutRedraw. |
3481 terminateButton turnOffWithoutRedraw. |
3482 self doTerminate |
3482 self doTerminate |
3483 ] |
3483 ] |
3484 in:bpanel. |
3484 in:bpanel. |
3485 |
3485 |
3486 terminateButton backgroundColor:Color red lightened. |
3486 terminateButton backgroundColor:Color red lightened. |
3487 "/ terminateButton foregroundColor:Color red. |
3487 "/ terminateButton foregroundColor:Color red. |
3488 |
3488 |
3489 "Created: / 17.11.2001 / 21:02:20 / cg" |
3489 "Created: / 17.11.2001 / 21:02:20 / cg" |
3491 |
3491 |
3492 postRealize |
3492 postRealize |
3493 super postRealize. |
3493 super postRealize. |
3494 |
3494 |
3495 inspecting ifTrue:[ |
3495 inspecting ifTrue:[ |
3496 inspectedProcess notNil ifTrue:[ |
3496 inspectedProcess notNil ifTrue:[ |
3497 " |
3497 " |
3498 set prio somewhat higher (by 2, to allow walkBack-update process |
3498 set prio somewhat higher (by 2, to allow walkBack-update process |
3499 to run between mine and the debugged processes prio) |
3499 to run between mine and the debugged processes prio) |
3500 " |
3500 " |
3501 Processor activeProcess |
3501 Processor activeProcess |
3502 priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
3502 priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
3503 ] |
3503 ] |
3504 ]. |
3504 ]. |
3505 |
3505 |
3506 self sensor addEventListener:self. |
3506 self sensor addEventListener:self. |
3507 |
3507 |
3508 "Created: 24.7.1997 / 18:17:44 / cg" |
3508 "Created: 24.7.1997 / 18:17:44 / cg" |
3511 reinitialize |
3511 reinitialize |
3512 "/ redefined - since the debugView runs on top of |
3512 "/ redefined - since the debugView runs on top of |
3513 "/ the debuggee, there would be no event loop for me. |
3513 "/ the debuggee, there would be no event loop for me. |
3514 |
3514 |
3515 self drawableId notNil ifTrue:[ |
3515 self drawableId notNil ifTrue:[ |
3516 ^ self |
3516 ^ self |
3517 ]. |
3517 ]. |
3518 "physically create the view & subviews" |
3518 "physically create the view & subviews" |
3519 self recreate. |
3519 self recreate. |
3520 ! |
3520 ! |
3521 |
3521 |
3533 receiverInspector release. |
3533 receiverInspector release. |
3534 contextInspector release. |
3534 contextInspector release. |
3535 inspectedProcess := nil. |
3535 inspectedProcess := nil. |
3536 contextArray := nil. |
3536 contextArray := nil. |
3537 ((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[ |
3537 ((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[ |
3538 selectedContext := nil. |
3538 selectedContext := nil. |
3539 ]. |
3539 ]. |
3540 actualContext := firstContext := nil. |
3540 actualContext := firstContext := nil. |
3541 steppedContext := wrapperContext := nil. |
3541 steppedContext := wrapperContext := nil. |
3542 catchBlock := nil. |
3542 catchBlock := nil. |
3543 grabber := nil. |
3543 grabber := nil. |
3550 setLabelFor:aMessage in:aProcess |
3550 setLabelFor:aMessage in:aProcess |
3551 |l lines processNameOrNil pidOrNil osPidString| |
3551 |l lines processNameOrNil pidOrNil osPidString| |
3552 |
3552 |
3553 lines := aMessage asStringCollection. |
3553 lines := aMessage asStringCollection. |
3554 lines size > 1 ifTrue:[ |
3554 lines size > 1 ifTrue:[ |
3555 l := lines first |
3555 l := lines first |
3556 ] ifFalse:[ |
3556 ] ifFalse:[ |
3557 l := aMessage. |
3557 l := aMessage. |
3558 ]. |
3558 ]. |
3559 |
3559 |
3560 l := l , ' ('. |
3560 l := l , ' ('. |
3561 Error handle:[:ex | |
3561 Error handle:[:ex | |
3562 l := l , '???' |
3562 l := l , '???' |
3563 ] do:[ |
3563 ] do:[ |
3564 processNameOrNil := aProcess name. |
3564 processNameOrNil := aProcess name. |
3565 processNameOrNil notNil ifTrue:[ |
3565 processNameOrNil notNil ifTrue:[ |
3566 l := l , (processNameOrNil contractTo:20) , ''. |
3566 l := l , (processNameOrNil contractTo:20) , ''. |
3567 ]. |
3567 ]. |
3568 pidOrNil := aProcess id printString. |
3568 pidOrNil := aProcess id printString. |
3569 l := l , '[' , pidOrNil , ']'. |
3569 l := l , '[' , pidOrNil , ']'. |
3570 ]. |
3570 ]. |
3571 l := l , ')'. |
3571 l := l , ')'. |
3572 self label:l. |
3572 self label:l. |
3573 |
3573 |
3574 ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
3574 ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
3575 osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
3575 osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
3576 ]. |
3576 ]. |
3577 |
3577 |
3578 exceptionInfoLabel notNil ifTrue:[ |
3578 exceptionInfoLabel notNil ifTrue:[ |
3579 exceptionInfoLabel |
3579 exceptionInfoLabel |
3580 label:(resources |
3580 label:(resources |
3581 string:'%1 in process %2 [%3]%4' |
3581 string:'%1 in process %2 [%3]%4' |
3582 with:(lines first colorizeAllWith:Color red) |
3582 with:(lines first colorizeAllWith:Color red) |
3583 with:(processNameOrNil ? '') |
3583 with:(processNameOrNil ? '') |
3584 with:(pidOrNil ? '') |
3584 with:(pidOrNil ? '') |
3585 with:(osPidString ? '')) |
3585 with:(osPidString ? '')) |
3586 ]. |
3586 ]. |
3587 |
3587 |
3588 "Modified: / 06-07-2006 / 12:43:19 / cg" |
3588 "Modified: / 06-07-2006 / 12:43:19 / cg" |
3589 ! ! |
3589 ! ! |
3590 |
3590 |
3591 !DebugView methodsFor:'interrupt handling'! |
3591 !DebugView methodsFor:'interrupt handling'! |
3592 |
3592 |
3593 contextInterrupt |
3593 contextInterrupt |
3594 DebuggingDebugger == true ifTrue:[ |
3594 DebuggingDebugger == true ifTrue:[ |
3595 'contextIRQ' printCR. |
3595 'contextIRQ' printCR. |
3596 thisContext methodHome sender fullPrint. |
3596 thisContext methodHome sender fullPrint. |
3597 ]. |
3597 ]. |
3598 self stepOrNext |
3598 self stepOrNext |
3599 |
3599 |
3600 "Modified: / 30.10.1997 / 21:22:25 / cg" |
3600 "Modified: / 30.10.1997 / 21:22:25 / cg" |
3601 ! |
3601 ! |
3602 |
3602 |
3603 stepInterrupt |
3603 stepInterrupt |
3604 DebuggingDebugger == true ifTrue:[ |
3604 DebuggingDebugger == true ifTrue:[ |
3605 'stepIRQ' print. |
3605 'stepIRQ' print. |
3606 "/ ' in ' print. thisContext sender fullPrint. |
3606 "/ ' in ' print. thisContext sender fullPrint. |
3607 '' printCR. |
3607 '' printCR. |
3608 ]. |
3608 ]. |
3609 Processor yield. |
3609 Processor yield. |
3610 self stepOrNext |
3610 self stepOrNext |
3611 |
3611 |
3612 "Modified: / 20-07-2012 / 14:06:54 / cg" |
3612 "Modified: / 20-07-2012 / 14:06:54 / cg" |
3613 ! |
3613 ! |
3614 |
3614 |
3615 stepOrNext |
3615 stepOrNext |
3616 |where here con s isWrap method wrappedMethod |
3616 |where here con s isWrap method wrappedMethod |
3617 originalMethodOfWrappedMethod originalMethodsContext |
3617 originalMethodOfWrappedMethod originalMethodsContext |
3618 inBlock subBlockLeft ignore contextBelow wrapContext |
3618 inBlock subBlockLeft ignore contextBelow wrapContext |
3619 leftWrap enteredWrap anyStepBlocks |
3619 leftWrap enteredWrap anyStepBlocks |
3620 oneMore initiallyShown inBlockBelow receiver processName| |
3620 oneMore initiallyShown inBlockBelow receiver processName| |
3621 |
3621 |
3627 "/ '' printCR |
3627 "/ '' printCR |
3628 |
3628 |
3629 processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
3629 processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
3630 |
3630 |
3631 skipLineNr == #return ifTrue:[ |
3631 skipLineNr == #return ifTrue:[ |
3632 self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
3632 self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
3633 here := thisContext sender sender. |
3633 here := thisContext sender sender. |
3634 here setLineNumber:nil. |
3634 here setLineNumber:nil. |
3635 here := nil. |
3635 here := nil. |
3636 con := thisContext sender sender sender. |
3636 con := thisContext sender sender sender. |
3637 |
3637 |
3638 HaltInterrupt handle:[:ex | |
3638 HaltInterrupt handle:[:ex | |
3639 ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
3639 ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
3640 ex proceed |
3640 ex proceed |
3641 ] do:[ |
3641 ] do:[ |
3642 self enter:con select:nil. |
3642 self enter:con select:nil. |
3643 ]. |
3643 ]. |
3644 con := nil. |
3644 con := nil. |
3645 ^ self |
3645 ^ self |
3646 ]. |
3646 ]. |
3647 |
3647 |
3648 "/ "/ |
3648 "/ "/ |
3649 "/ "/ should no longer happen |
3649 "/ "/ should no longer happen |
3650 "/ "/ |
3650 "/ "/ |
3653 "/ self enter:thisContext sender. |
3653 "/ self enter:thisContext sender. |
3654 "/ ^ self |
3654 "/ ^ self |
3655 "/ ]. |
3655 "/ ]. |
3656 |
3656 |
3657 Processor activeProcess ~~ inspectedProcess ifTrue:[ |
3657 Processor activeProcess ~~ inspectedProcess ifTrue:[ |
3658 'DebugView [info]: stray step interrupt' infoPrintCR. |
3658 'DebugView [info]: stray step interrupt' infoPrintCR. |
3659 ^ self |
3659 ^ self |
3660 ]. |
3660 ]. |
3661 |
3661 |
3662 here := thisContext. "stepInterrupt" |
3662 here := thisContext. "stepInterrupt" |
3663 here := here sender. "the caller; step- or contextIRQ" |
3663 here := here sender. "the caller; step- or contextIRQ" |
3664 here := here sender. "the interrupted context" |
3664 here := here sender. "the interrupted context" |
3665 |
3665 |
3666 DebuggingDebugger2 == true ifTrue:[ |
3666 DebuggingDebugger2 == true ifTrue:[ |
3667 '***************************' printCR. |
3667 '***************************' printCR. |
3668 'here in ' print. |
3668 'here in ' print. |
3669 inWrap ifTrue:['(wrap) ' print.]. |
3669 inWrap ifTrue:['(wrap) ' print.]. |
3670 ((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
3670 ((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
3671 here selector printCR. |
3671 here selector printCR. |
3672 'stepping in ' print. |
3672 'stepping in ' print. |
3673 steppedContext notNil ifTrue:[ |
3673 steppedContext notNil ifTrue:[ |
3674 ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print. |
3674 ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print. |
3675 ]. |
3675 ]. |
3676 steppedContext printCR. |
3676 steppedContext printCR. |
3677 ]. |
3677 ]. |
3678 |
3678 |
3679 "/ when single stepping, ignore breakpoints |
3679 "/ when single stepping, ignore breakpoints |
3680 here selector == #break ifTrue:[ |
3680 here selector == #break ifTrue:[ |
3681 (here receiver isKindOf:Breakpoint) ifTrue:[ |
3681 (here receiver isKindOf:Breakpoint) ifTrue:[ |
3682 false "here receiver isEnabled" ifFalse:[ |
3682 false "here receiver isEnabled" ifFalse:[ |
3683 con := nil. |
3683 con := nil. |
3684 where := nil. here := nil. |
3684 where := nil. here := nil. |
3685 StepInterruptPending := 1. |
3685 StepInterruptPending := 1. |
3686 InterruptPending := 1. |
3686 InterruptPending := 1. |
3687 InStepInterrupt := nil. |
3687 InStepInterrupt := nil. |
3688 ^ self |
3688 ^ self |
3689 ] |
3689 ] |
3690 ]. |
3690 ]. |
3691 ]. |
3691 ]. |
3692 |
3692 |
3693 "/ kludge: a bug-workaround; |
3693 "/ kludge: a bug-workaround; |
3694 "/ I should not see those... |
3694 "/ I should not see those... |
3695 |
3695 |
3696 here selector == #ioInterrupt ifTrue:[ |
3696 here selector == #ioInterrupt ifTrue:[ |
3697 DebuggingDebugger2 == true ifTrue:[ |
3697 DebuggingDebugger2 == true ifTrue:[ |
3698 'oops - should not get that one' printCR. |
3698 'oops - should not get that one' printCR. |
3699 ]. |
3699 ]. |
3700 Processor ioInterrupt. |
3700 Processor ioInterrupt. |
3701 StepInterruptPending := 1. |
3701 StepInterruptPending := 1. |
3702 InterruptPending := 1. |
3702 InterruptPending := 1. |
3703 where := nil. here := nil. |
3703 where := nil. here := nil. |
3704 InStepInterrupt := nil. |
3704 InStepInterrupt := nil. |
3705 ^ self |
3705 ^ self |
3706 ]. |
3706 ]. |
3707 |
3707 |
3708 stepUntilEntering notNil ifTrue:[ |
3708 stepUntilEntering notNil ifTrue:[ |
3709 DebuggingDebugger2 == true ifTrue:[ |
3709 DebuggingDebugger2 == true ifTrue:[ |
3710 'check if entering ' print. stepUntilEntering printCR. |
3710 'check if entering ' print. stepUntilEntering printCR. |
3711 ]. |
3711 ]. |
3712 (stepUntilEntering match:here selector) ifTrue:[ |
3712 (stepUntilEntering match:here selector) ifTrue:[ |
3713 DebuggingDebugger2 == true ifTrue:[ |
3713 DebuggingDebugger2 == true ifTrue:[ |
3714 'entering...' printCR. |
3714 'entering...' printCR. |
3715 ]. |
3715 ]. |
3716 self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
3716 self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
3717 |
3717 |
3718 lastStepUntilEntering := stepUntilEntering. |
3718 lastStepUntilEntering := stepUntilEntering. |
3719 stepUntilEntering := nil. |
3719 stepUntilEntering := nil. |
3720 self enter:here select:nil. |
3720 self enter:here select:nil. |
3721 con := nil. |
3721 con := nil. |
3722 ^ self |
3722 ^ self |
3723 ]. |
3723 ]. |
3724 "/ see if stepping context is still active ... |
3724 "/ see if stepping context is still active ... |
3725 |
3725 |
3726 con := here. |
3726 con := here. |
3727 |
3727 |
3728 DebuggingDebugger2 == true ifTrue:[ |
3728 DebuggingDebugger2 == true ifTrue:[ |
3729 'start searching at: ' print. |
3729 'start searching at: ' print. |
3730 con fullPrint. |
3730 con fullPrint. |
3731 ]. |
3731 ]. |
3732 [con notNil and:[con ~~ steppedContext]] whileTrue:[ |
3732 [con notNil and:[con ~~ steppedContext]] whileTrue:[ |
3733 con := con sender |
3733 con := con sender |
3734 ]. |
3734 ]. |
3735 con notNil ifTrue:[ |
3735 con notNil ifTrue:[ |
3736 DebuggingDebugger2 == true ifTrue:[ |
3736 DebuggingDebugger2 == true ifTrue:[ |
3737 'steppingContext still active - continue stepping' printCR. |
3737 'steppingContext still active - continue stepping' printCR. |
3738 ]. |
3738 ]. |
3739 con := nil. |
3739 con := nil. |
3740 where := nil. here := nil. |
3740 where := nil. here := nil. |
3741 StepInterruptPending := 1. |
3741 StepInterruptPending := 1. |
3742 InterruptPending := 1. |
3742 InterruptPending := 1. |
3743 InStepInterrupt := nil. |
3743 InStepInterrupt := nil. |
3744 ^ self |
3744 ^ self |
3745 ]. |
3745 ]. |
3746 stepUntilEntering := nil. |
3746 stepUntilEntering := nil. |
3747 ]. |
3747 ]. |
3748 |
3748 |
3749 " |
3749 " |
3750 kludge to hide breakpoint wrappers in the context list and when single stepping: |
3750 kludge to hide breakpoint wrappers in the context list and when single stepping: |
3751 check if we are in a wrapper method's hidden setup-sequence |
3751 check if we are in a wrapper method's hidden setup-sequence |
3752 if so, ignore the interrupt and continue single sending. |
3752 if so, ignore the interrupt and continue single sending. |
3753 Assume we are in a wrappers setup code, if there is another context above, |
3753 Assume we are in a wrappers setup code, if there is another context above, |
3754 which is for the wrapper method (i.e. if there is context with an originalmethod |
3754 which is for the wrapper method (i.e. if there is context with an originalmethod |
3755 of some other context higher in the caller chain |
3755 of some other context higher in the caller chain |
3756 " |
3756 " |
3757 isWrap := false. |
3757 isWrap := false. |
3758 subBlockLeft := false. |
3758 subBlockLeft := false. |
3759 leftWrap := enteredWrap := false. |
3759 leftWrap := enteredWrap := false. |
3760 |
3760 |
3761 inWrap ifTrue:[ |
3761 inWrap ifTrue:[ |
3762 "/ situation1: |
3762 "/ situation1: |
3763 "/ valueWithReceiver or other |
3763 "/ valueWithReceiver or other |
3764 "/ foo (wrapped) <- wrapContext |
3764 "/ foo (wrapped) <- wrapContext |
3765 "/ |
3765 "/ |
3766 "/ situation2: |
3766 "/ situation2: |
3767 "/ foo (original) <- originalMethodsContext |
3767 "/ foo (original) <- originalMethodsContext |
3768 "/ valueWithReceiver |
3768 "/ valueWithReceiver |
3769 "/ foo (wrapped) <- wrapContext |
3769 "/ foo (wrapped) <- wrapContext |
3770 "/ |
3770 "/ |
3771 "/ situation3: |
3771 "/ situation3: |
3772 "/ other |
3772 "/ other |
3773 "/ foo (original) <- originalMethodsContext |
3773 "/ foo (original) <- originalMethodsContext |
3774 "/ valueWithReceiver |
3774 "/ valueWithReceiver |
3775 "/ foo (wrapped) <- wrapContext |
3775 "/ foo (wrapped) <- wrapContext |
3776 "/ |
3776 "/ |
3777 "/ situation4: |
3777 "/ situation4: |
3778 "/ ... many-contexts ... (more than 8) |
3778 "/ ... many-contexts ... (more than 8) |
3779 "/ possibly foo (original) |
3779 "/ possibly foo (original) |
3780 "/ valueWithReceiver or other |
3780 "/ valueWithReceiver or other |
3781 "/ foo (wrapped) |
3781 "/ foo (wrapped) |
3782 "/ |
3782 "/ |
3783 |
3783 |
3784 "/ search for the wrapped method's context and extract the original method |
3784 "/ search for the wrapped method's context and extract the original method |
3785 where := here. |
3785 where := here. |
3786 8 timesRepeat:[ |
3786 8 timesRepeat:[ |
3787 wrapContext isNil ifTrue:[ |
3787 wrapContext isNil ifTrue:[ |
3788 where notNil ifTrue:[ |
3788 where notNil ifTrue:[ |
3789 DebuggingDebugger2 == true ifTrue:[ |
3789 DebuggingDebugger2 == true ifTrue:[ |
3790 ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
3790 ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
3791 where printCR |
3791 where printCR |
3792 ]. |
3792 ]. |
3793 where isBlockContext ifFalse:[ |
3793 where isBlockContext ifFalse:[ |
3794 method := where method. |
3794 method := where method. |
3795 (method notNil and:[method isWrapped]) ifTrue:[ |
3795 (method notNil and:[method isWrapped]) ifTrue:[ |
3796 originalMethodOfWrappedMethod := method originalMethod. |
3796 originalMethodOfWrappedMethod := method originalMethod. |
3797 wrappedMethod := method. |
3797 wrappedMethod := method. |
3798 wrapContext := where. |
3798 wrapContext := where. |
3799 ]. |
3799 ]. |
3800 ]. |
3800 ]. |
3801 where := where sender |
3801 where := where sender |
3802 ] |
3802 ] |
3803 ] |
3803 ] |
3804 ]. |
3804 ]. |
3805 DebuggingDebugger2 == true ifTrue:[ |
3805 DebuggingDebugger2 == true ifTrue:[ |
3806 'wrap-context is: ' print. |
3806 'wrap-context is: ' print. |
3807 wrapContext notNil ifTrue:[ |
3807 wrapContext notNil ifTrue:[ |
3808 ((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print. |
3808 ((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print. |
3809 ]. |
3809 ]. |
3810 wrapContext printCR |
3810 wrapContext printCR |
3811 ]. |
3811 ]. |
3812 originalMethodOfWrappedMethod isNil ifTrue:[ |
3812 originalMethodOfWrappedMethod isNil ifTrue:[ |
3813 'oops no wrap?' errorPrintCR. |
3813 'oops no wrap?' errorPrintCR. |
3814 ]. |
3814 ]. |
3815 ]. |
3815 ]. |
3816 |
3816 |
3817 (inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[ |
3817 (inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[ |
3818 isWrap := false. |
3818 isWrap := false. |
3819 "/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ]. |
3819 "/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ]. |
3820 where := here. |
3820 where := here. |
3821 8 timesRepeat:[ |
3821 8 timesRepeat:[ |
3822 originalMethodsContext isNil ifTrue:[ |
3822 originalMethodsContext isNil ifTrue:[ |
3823 where notNil ifTrue:[ |
3823 where notNil ifTrue:[ |
3824 DebuggingDebugger2 ifTrue:[ |
3824 DebuggingDebugger2 ifTrue:[ |
3825 ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
3825 ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
3826 where printCR |
3826 where printCR |
3827 ]. |
3827 ]. |
3828 where isBlockContext ifFalse:[ |
3828 where isBlockContext ifFalse:[ |
3829 method := where method. |
3829 method := where method. |
3830 method == originalMethodOfWrappedMethod ifTrue:[ |
3830 method == originalMethodOfWrappedMethod ifTrue:[ |
3831 originalMethodsContext := here. |
3831 originalMethodsContext := here. |
3832 where == here ifTrue:[ |
3832 where == here ifTrue:[ |
3833 "/ situation2 |
3833 "/ situation2 |
3834 DebuggingDebugger2 ifTrue:[ 's2' printCR ]. |
3834 DebuggingDebugger2 ifTrue:[ 's2' printCR ]. |
3835 isWrap := true. |
3835 isWrap := true. |
3836 "/ here setSender:(wrapContext sender). --- leads to a crash |
3836 "/ here setSender:(wrapContext sender). --- leads to a crash |
3837 ] ifFalse: [ |
3837 ] ifFalse: [ |
3838 "/ situation3 |
3838 "/ situation3 |
3839 DebuggingDebugger2 ifTrue:[ 's3' printCR ]. |
3839 DebuggingDebugger2 ifTrue:[ 's3' printCR ]. |
3840 inWrap := false. |
3840 inWrap := false. |
3841 isWrap := false. |
3841 isWrap := false. |
3842 ]. |
3842 ]. |
3843 steppedContext := where |
3843 steppedContext := where |
3844 "/ ] ifFalse:[ |
3844 "/ ] ifFalse:[ |
3845 "/ where selector == wrapContext selector ifTrue:[ |
3845 "/ where selector == wrapContext selector ifTrue:[ |
3846 "/ where receiver == wrapContext receiver ifTrue:[ |
3846 "/ where receiver == wrapContext receiver ifTrue:[ |
3847 "/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
3847 "/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
3848 "/ method printCR. |
3848 "/ method printCR. |
3849 "/ method originalMethod printCR. |
3849 "/ method originalMethod printCR. |
3850 "/ originalMethodOfWrappedMethod printCR. |
3850 "/ originalMethodOfWrappedMethod printCR. |
3851 "/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
3851 "/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
3852 "/ ]. |
3852 "/ ]. |
3853 "/ ]. |
3853 "/ ]. |
3854 ]. |
3854 ]. |
3855 where := where sender |
3855 where := where sender |
3856 ]. |
3856 ]. |
3857 ]. |
3857 ]. |
3858 ]. |
3858 ]. |
3859 ]. |
3859 ]. |
3860 DebuggingDebugger2 ifTrue:[ |
3860 DebuggingDebugger2 ifTrue:[ |
3861 'original method-context is: ' print. |
3861 'original method-context is: ' print. |
3862 originalMethodsContext notNil ifTrue:[ |
3862 originalMethodsContext notNil ifTrue:[ |
3863 ((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print. |
3863 ((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print. |
3864 ]. |
3864 ]. |
3865 originalMethodsContext printCR |
3865 originalMethodsContext printCR |
3866 ]. |
3866 ]. |
3867 originalMethodsContext isNil ifTrue:[ |
3867 originalMethodsContext isNil ifTrue:[ |
3868 originalMethodOfWrappedMethod isNil ifTrue:[ |
3868 originalMethodOfWrappedMethod isNil ifTrue:[ |
3869 "/ situation4 |
3869 "/ situation4 |
3870 DebuggingDebugger2 ifTrue:[ 's4' printCR ]. |
3870 DebuggingDebugger2 ifTrue:[ 's4' printCR ]. |
3871 DebuggingDebugger2 ifTrue:[ steppedContext printCR ]. |
3871 DebuggingDebugger2 ifTrue:[ steppedContext printCR ]. |
3872 isWrap := false. |
3872 isWrap := false. |
3873 ] ifFalse:[ |
3873 ] ifFalse:[ |
3874 "/ situation1 |
3874 "/ situation1 |
3875 DebuggingDebugger2 ifTrue:[ 's1' printCR ]. |
3875 DebuggingDebugger2 ifTrue:[ 's1' printCR ]. |
3876 isWrap := true. |
3876 isWrap := true. |
3877 "/ steppedContext := wrapContext |
3877 "/ steppedContext := wrapContext |
3878 ]. |
3878 ]. |
3879 ]. |
3879 ]. |
3880 ]. |
3880 ]. |
3881 |
3881 |
3882 isWrap ifTrue:[ |
3882 isWrap ifTrue:[ |
3883 DebuggingDebugger2 == true ifTrue:[ |
3883 DebuggingDebugger2 == true ifTrue:[ |
3884 'ignore wrap' printCR. |
3884 'ignore wrap' printCR. |
3885 ]. |
3885 ]. |
3886 |
3886 |
3887 "/ |
3887 "/ |
3888 "/ ignore, while in wrappers hidden setup |
3888 "/ ignore, while in wrappers hidden setup |
3889 "/ |
3889 "/ |
3890 where := nil. here := nil. |
3890 where := nil. here := nil. |
3891 ObjectMemory flushInlineCaches. |
3891 ObjectMemory flushInlineCaches. |
3892 |
3892 |
3893 DebuggingDebugger2 == true ifTrue:[ |
3893 DebuggingDebugger2 == true ifTrue:[ |
3894 skipLineNr == #return ifTrue:[ |
3894 skipLineNr == #return ifTrue:[ |
3895 'skipRet in wrap' printCR. |
3895 'skipRet in wrap' printCR. |
3896 ] |
3896 ] |
3897 ]. |
3897 ]. |
3898 |
3898 |
3899 StepInterruptPending := 1. |
3899 StepInterruptPending := 1. |
3900 InterruptPending := 1. |
3900 InterruptPending := 1. |
3901 InStepInterrupt := nil. |
3901 InStepInterrupt := nil. |
3902 ^ self |
3902 ^ self |
3903 ]. |
3903 ]. |
3904 |
3904 |
3905 inBlock := inBlockBelow := anyStepBlocks := false. |
3905 inBlock := inBlockBelow := anyStepBlocks := false. |
3906 |
3906 |
3907 DebuggingDebugger2 == true ifTrue:[ |
3907 DebuggingDebugger2 == true ifTrue:[ |
3908 'bigStep is: ' print. bigStep printCR. |
3908 'bigStep is: ' print. bigStep printCR. |
3909 'steppedContext is: ' print. steppedContext printCR. |
3909 'steppedContext is: ' print. steppedContext printCR. |
3910 ]. |
3910 ]. |
3911 |
3911 |
3912 "/ |
3912 "/ |
3913 "/ is this for a send or a step/next ? |
3913 "/ is this for a send or a step/next ? |
3914 "/ |
3914 "/ |
3915 (bigStep |
3915 (bigStep |
3916 and:[steppedContext notNil]) ifTrue:[ |
3916 and:[steppedContext notNil]) ifTrue:[ |
3917 " |
3917 " |
3918 a step or next - ignore all contexts below the interesting one |
3918 a step or next - ignore all contexts below the interesting one |
3919 " |
3919 " |
3920 where := here. "the interrupted context" |
3920 where := here. "the interrupted context" |
3921 contextBelow := nil. |
3921 contextBelow := nil. |
3922 |
3922 |
3923 where home notNil ifTrue:[ |
3923 where home notNil ifTrue:[ |
3924 "/ |
3924 "/ |
3925 "/ in a block called by 'our' context ? |
3925 "/ in a block called by 'our' context ? |
3926 "/ |
3926 "/ |
3927 where home == steppedContext ifTrue:[ |
3927 where home == steppedContext ifTrue:[ |
3928 "/ '*block*' printCR. |
3928 "/ '*block*' printCR. |
3929 inBlock := true |
3929 inBlock := true |
3930 ] |
3930 ] |
3931 ]. |
3931 ]. |
3932 |
3932 |
3933 where == steppedContext ifFalse:[ |
3933 where == steppedContext ifFalse:[ |
3934 where := where sender. |
3934 where := where sender. |
3935 |
3935 |
3936 where notNil ifTrue:[ |
3936 where notNil ifTrue:[ |
3937 where home == steppedContext ifTrue:[ |
3937 where home == steppedContext ifTrue:[ |
3938 "/ '*block*' printCR. |
3938 "/ '*block*' printCR. |
3939 inBlock := true. |
3939 inBlock := true. |
3940 ] |
3940 ] |
3941 ]. |
3941 ]. |
3942 |
3942 |
3943 "/ 'looking for ' print. |
3943 "/ 'looking for ' print. |
3944 "/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
3944 "/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
3945 |
3945 |
3946 "/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR. |
3946 "/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR. |
3947 "/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR. |
3947 "/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR. |
3948 |
3948 |
3949 where == steppedContext ifFalse:[ |
3949 where == steppedContext ifFalse:[ |
3950 |
3950 |
3951 "/ check if we are in a context below steppedContext |
3951 "/ check if we are in a context below steppedContext |
3952 "/ (i.e. if steppedContext can be reached from |
3952 "/ (i.e. if steppedContext can be reached from |
3953 "/ interrupted context. Not using context-ref but its |
3953 "/ interrupted context. Not using context-ref but its |
3954 "/ address to avoid creation of many useless contexts.) |
3954 "/ address to avoid creation of many useless contexts.) |
3955 |
3955 |
3956 inBlock ifFalse:[ |
3956 inBlock ifFalse:[ |
3957 [where notNil] whileTrue:[ |
3957 [where notNil] whileTrue:[ |
3958 |
3958 |
3959 "/ if either the receiver or any arg of this context |
3959 "/ if either the receiver or any arg of this context |
3960 "/ is a block of the steppedContext, we must really |
3960 "/ is a block of the steppedContext, we must really |
3961 "/ do a single step. Otherwise, stepping through a |
3961 "/ do a single step. Otherwise, stepping through a |
3962 "/ do:-loop would be very difficult. |
3962 "/ do:-loop would be very difficult. |
3963 receiver := where receiver. |
3963 receiver := where receiver. |
3964 where selector == #critical: ifTrue:[ |
3964 where selector == #critical: ifTrue:[ |
3965 anyStepBlocks := true. |
3965 anyStepBlocks := true. |
3966 ] ifFalse:[ |
3966 ] ifFalse:[ |
3967 (receiver isBlock |
3967 (receiver isBlock |
3968 and:[(receiver isKindOf:Block) |
3968 and:[(receiver isKindOf:Block) |
3969 and:[receiver homeMethod == steppedContext method |
3969 and:[receiver homeMethod == steppedContext method |
3970 "receiver home == steppedContext"]]) |
3970 "receiver home == steppedContext"]]) |
3971 ifTrue:[ |
3971 ifTrue:[ |
3972 anyStepBlocks := true. |
3972 anyStepBlocks := true. |
3973 ] ifFalse:[ |
3973 ] ifFalse:[ |
3974 where args do:[:arg | |
3974 where args do:[:arg | |
3975 (arg isBlock |
3975 (arg isBlock |
3976 and:[(arg isKindOf:Block) |
3976 and:[(arg isKindOf:Block) |
3977 and:[arg homeMethod == steppedContext method |
3977 and:[arg homeMethod == steppedContext method |
3978 "arg home == steppedContext"]]) |
3978 "arg home == steppedContext"]]) |
3979 ifTrue:[ |
3979 ifTrue:[ |
3980 anyStepBlocks := true. |
3980 anyStepBlocks := true. |
3981 ] ifFalse:[ |
3981 ] ifFalse:[ |
3982 (where methodHome notNil |
3982 (where methodHome notNil |
3983 and:[where methodHome receiver isBlock |
3983 and:[where methodHome receiver isBlock |
3984 and:[(where methodHome receiver isKindOf:Block) |
3984 and:[(where methodHome receiver isKindOf:Block) |
3985 and:[where methodHome receiver homeMethod == steppedContext method |
3985 and:[where methodHome receiver homeMethod == steppedContext method |
3986 "where methodHome receiver home == steppedContext"]]]) |
3986 "where methodHome receiver home == steppedContext"]]]) |
3987 ifTrue:[ |
3987 ifTrue:[ |
3988 anyStepBlocks := true. |
3988 anyStepBlocks := true. |
3989 ] |
3989 ] |
3990 ]. |
3990 ]. |
3991 ] |
3991 ] |
3992 ]. |
3992 ]. |
3993 ]. |
3993 ]. |
3994 DebuggingDebugger2 == true ifTrue:[ |
3994 DebuggingDebugger2 == true ifTrue:[ |
3995 ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
3995 ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
3996 where selector printCR. |
3996 where selector printCR. |
3997 ]. |
3997 ]. |
3998 |
3998 |
3999 where == steppedContext ifTrue:[ |
3999 where == steppedContext ifTrue:[ |
4000 "/ 'found it - below; ignore' printCR. |
4000 "/ 'found it - below; ignore' printCR. |
4001 " |
4001 " |
4002 found the interesting context somwehere up in the |
4002 found the interesting context somwehere up in the |
4003 chain. We seem to be still below the interesting one ... |
4003 chain. We seem to be still below the interesting one ... |
4004 " |
4004 " |
4005 tracing == true ifTrue:[ |
4005 tracing == true ifTrue:[ |
4006 here printString printCR |
4006 here printString printCR |
4007 ]. |
4007 ]. |
4008 " |
4008 " |
4009 yes, a context below |
4009 yes, a context below |
4010 - continue and schedule another stepInterrupt. |
4010 - continue and schedule another stepInterrupt. |
4011 Must flush caches since optimized methods not always |
4011 Must flush caches since optimized methods not always |
4012 look for pending interrupts |
4012 look for pending interrupts |
4013 " |
4013 " |
4014 |
4014 |
4015 contextBelow notNil ifTrue:[ |
4015 contextBelow notNil ifTrue:[ |
4016 "/ 'prepare for unwind-catch' printCR. |
4016 "/ 'prepare for unwind-catch' printCR. |
4017 "/ 'con= ' print. contextBelow printCR. |
4017 "/ 'con= ' print. contextBelow printCR. |
4018 "/ contextBelow selector notNil ifTrue:[ |
4018 "/ contextBelow selector notNil ifTrue:[ |
4019 "/ self label:'single stepping - please wait ...(' , contextBelow selector , ')'. |
4019 "/ self label:'single stepping - please wait ...(' , contextBelow selector , ')'. |
4020 "/ ]. |
4020 "/ ]. |
4021 |
4021 |
4022 DebuggingDebugger2 == true ifTrue:[ |
4022 DebuggingDebugger2 == true ifTrue:[ |
4023 'below stepCon; continue until unwind of: ' print. |
4023 'below stepCon; continue until unwind of: ' print. |
4024 contextBelow printCR. |
4024 contextBelow printCR. |
4025 ]. |
4025 ]. |
4026 Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
4026 Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
4027 StepInterruptPending := nil. |
4027 StepInterruptPending := nil. |
4028 ] ifFalse:[ |
4028 ] ifFalse:[ |
4029 ObjectMemory flushInlineCaches. |
4029 ObjectMemory flushInlineCaches. |
4030 |
4030 |
4031 "/ here selector notNil ifTrue:[ |
4031 "/ here selector notNil ifTrue:[ |
4032 "/ self label:'single stepping - please wait ...(' , here selector , ')'. |
4032 "/ self label:'single stepping - please wait ...(' , here selector , ')'. |
4033 "/ ]. |
4033 "/ ]. |
4034 |
4034 |
4035 DebuggingDebugger2 == true ifTrue:[ |
4035 DebuggingDebugger2 == true ifTrue:[ |
4036 'in stepCon; continue single stepping' printCR. |
4036 'in stepCon; continue single stepping' printCR. |
4037 ]. |
4037 ]. |
4038 StepInterruptPending := 1. |
4038 StepInterruptPending := 1. |
4039 InterruptPending := 1. |
4039 InterruptPending := 1. |
4040 ]. |
4040 ]. |
4041 where := nil. here := nil. |
4041 where := nil. here := nil. |
4042 InStepInterrupt := nil. |
4042 InStepInterrupt := nil. |
4043 |
4043 |
4044 ^ self |
4044 ^ self |
4045 ]. |
4045 ]. |
4046 |
4046 |
4047 (steppedContext notNil and:[ |
4047 (steppedContext notNil and:[ |
4048 where methodHome == steppedContext methodHome]) ifTrue:[ |
4048 where methodHome == steppedContext methodHome]) ifTrue:[ |
4049 inBlockBelow := true. |
4049 inBlockBelow := true. |
4050 ]. |
4050 ]. |
4051 |
4051 |
4052 anyStepBlocks ifFalse:[ |
4052 anyStepBlocks ifFalse:[ |
4053 inBlock ifFalse:[ |
4053 inBlock ifFalse:[ |
4054 "/ workaround a VM bug, |
4054 "/ workaround a VM bug, |
4055 "/ which does not honor interrupt-on-return of block contexts |
4055 "/ which does not honor interrupt-on-return of block contexts |
4056 "/ sigh |
4056 "/ sigh |
4057 where isBlockContext ifFalse:[ |
4057 where isBlockContext ifFalse:[ |
4058 contextBelow := where |
4058 contextBelow := where |
4059 ]. |
4059 ]. |
4060 ] |
4060 ] |
4061 ]. |
4061 ]. |
4062 where := where sender |
4062 where := where sender |
4063 ]. |
4063 ]. |
4064 s := 'Debugger: context returned'. |
4064 s := 'Debugger: context returned'. |
4065 subBlockLeft := true. |
4065 subBlockLeft := true. |
4066 ]. |
4066 ]. |
4067 ] ifTrue:[ |
4067 ] ifTrue:[ |
4068 "/ 'found it right in sender' printCR. |
4068 "/ 'found it right in sender' printCR. |
4069 s := 'Debugger: after step' |
4069 s := 'Debugger: after step' |
4070 ]. |
4070 ]. |
4071 ] ifTrue:[ |
4071 ] ifTrue:[ |
4072 "/ 'found it right away' printCR. |
4072 "/ 'found it right away' printCR. |
4073 s := 'Debugger: after step' |
4073 s := 'Debugger: after step' |
4074 ]. |
4074 ]. |
4075 ] ifFalse:[ |
4075 ] ifFalse:[ |
4076 "/ ' send' printCR. |
4076 "/ ' send' printCR. |
4077 " |
4077 " |
4078 a send |
4078 a send |
4079 " |
4079 " |
4080 DebuggingDebugger2 == true ifTrue:[ |
4080 DebuggingDebugger2 == true ifTrue:[ |
4081 'clear steppedContext' printCR. |
4081 'clear steppedContext' printCR. |
4082 ]. |
4082 ]. |
4083 steppedContext := nil. |
4083 steppedContext := nil. |
4084 s := 'Debugger: after send' |
4084 s := 'Debugger: after send' |
4085 ]. |
4085 ]. |
4086 |
4086 |
4087 ignore := false. |
4087 ignore := false. |
4088 (inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
4088 (inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
4089 ignore := true. |
4089 ignore := true. |
4090 ]. |
4090 ]. |
4091 |
4091 |
4092 "/ handle the case, when a subBlock leaves; |
4092 "/ handle the case, when a subBlock leaves; |
4093 "/ continue stepping in the home context. |
4093 "/ continue stepping in the home context. |
4094 |
4094 |
4095 subBlockLeft ifTrue:[ |
4095 subBlockLeft ifTrue:[ |
4096 steppedContext home notNil ifTrue:[ |
4096 steppedContext home notNil ifTrue:[ |
4097 steppedContext := steppedContext home. |
4097 steppedContext := steppedContext home. |
4098 s := 'Debugger: after step'. |
4098 s := 'Debugger: after step'. |
4099 subBlockLeft := false. |
4099 subBlockLeft := false. |
4100 "/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
4100 "/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
4101 |
4101 |
4102 ] |
4102 ] |
4103 ]. |
4103 ]. |
4104 |
4104 |
4105 " |
4105 " |
4106 kludge to hide breakpoint wrappers in the context list: |
4106 kludge to hide breakpoint wrappers in the context list: |
4107 check if we are in a wrapper methods hidden exit-sequence |
4107 check if we are in a wrapper methods hidden exit-sequence |
4108 if so, ignore the interrupt and continue single sending |
4108 if so, ignore the interrupt and continue single sending |
4109 " |
4109 " |
4110 (where isNil |
4110 (where isNil |
4111 and:[wrapperContext notNil]) |
4111 and:[wrapperContext notNil]) |
4112 ifTrue:[ |
4112 ifTrue:[ |
4113 "/ did not find our steppedContext along the chain; |
4113 "/ did not find our steppedContext along the chain; |
4114 "/ could be in a wrappedMethods exitBlock ... |
4114 "/ could be in a wrappedMethods exitBlock ... |
4115 |
4115 |
4116 leftWrap ifFalse:[ |
4116 leftWrap ifFalse:[ |
4117 where := here. |
4117 where := here. |
4118 wrappedMethod := nil. |
4118 wrappedMethod := nil. |
4119 5 timesRepeat:[ |
4119 5 timesRepeat:[ |
4120 where notNil ifTrue:[ |
4120 where notNil ifTrue:[ |
4121 where isBlockContext ifFalse:[ |
4121 where isBlockContext ifFalse:[ |
4122 method := where method. |
4122 method := where method. |
4123 (method notNil and:[method isWrapped]) ifTrue:[ |
4123 (method notNil and:[method isWrapped]) ifTrue:[ |
4124 where == wrapperContext ifTrue:[ |
4124 where == wrapperContext ifTrue:[ |
4125 DebuggingDebugger2 == true ifTrue:[ |
4125 DebuggingDebugger2 == true ifTrue:[ |
4126 'change stepCon fromWrapped: ' print. |
4126 'change stepCon fromWrapped: ' print. |
4127 steppedContext print. |
4127 steppedContext print. |
4128 ' to: ' print. |
4128 ' to: ' print. |
4129 wrapperContext printCR. |
4129 wrapperContext printCR. |
4130 ]. |
4130 ]. |
4131 |
4131 |
4132 inWrap := true. |
4132 inWrap := true. |
4133 enteredWrap := true. |
4133 enteredWrap := true. |
4134 steppedContext := wrapperContext. |
4134 steppedContext := wrapperContext. |
4135 wrapperContext := nil. |
4135 wrapperContext := nil. |
4136 ] |
4136 ] |
4137 ]. |
4137 ]. |
4138 ]. |
4138 ]. |
4139 where := where sender |
4139 where := where sender |
4140 ] |
4140 ] |
4141 ]. |
4141 ]. |
4142 ]. |
4142 ]. |
4143 enteredWrap ifTrue:[ |
4143 enteredWrap ifTrue:[ |
4144 ignore := true |
4144 ignore := true |
4145 ] |
4145 ] |
4146 ]. |
4146 ]. |
4147 |
4147 |
4148 "/ |
4148 "/ |
4149 |
4149 |
4150 subBlockLeft ifTrue:[ |
4150 subBlockLeft ifTrue:[ |
4151 "/ special care for stepInterrupt in send, |
4151 "/ special care for stepInterrupt in send, |
4152 "/ when created a dummy context (lineNr == 1) |
4152 "/ when created a dummy context (lineNr == 1) |
4153 |
4153 |
4154 steppedContext lineNumber isNil ifTrue:[ |
4154 steppedContext lineNumber isNil ifTrue:[ |
4155 steppedContext selector == here sender selector ifTrue:[ |
4155 steppedContext selector == here sender selector ifTrue:[ |
4156 subBlockLeft := false. |
4156 subBlockLeft := false. |
4157 s := 'Debugger: after step'. |
4157 s := 'Debugger: after step'. |
4158 steppedContext := here sender. |
4158 steppedContext := here sender. |
4159 ]. |
4159 ]. |
4160 ]. |
4160 ]. |
4161 oneMore := true |
4161 oneMore := true |
4162 ]. |
4162 ]. |
4163 |
4163 |
4164 inBlock ifTrue:[ |
4164 inBlock ifTrue:[ |
4165 DebuggingDebugger2 == true ifTrue:[ |
4165 DebuggingDebugger2 == true ifTrue:[ |
4166 'inBlock' printCR. |
4166 'inBlock' printCR. |
4167 ]. |
4167 ]. |
4168 s := 'Debugger: in block'. |
4168 s := 'Debugger: in block'. |
4169 ]. |
4169 ]. |
4170 inBlockBelow ifTrue:[ |
4170 inBlockBelow ifTrue:[ |
4171 DebuggingDebugger2 == true ifTrue:[ |
4171 DebuggingDebugger2 == true ifTrue:[ |
4172 'inBlockBelow' printCR. |
4172 'inBlockBelow' printCR. |
4173 ]. |
4173 ]. |
4174 ignore := true |
4174 ignore := true |
4175 ]. |
4175 ]. |
4176 |
4176 |
4177 DebuggingDebugger2 == true ifTrue:[ |
4177 DebuggingDebugger2 == true ifTrue:[ |
4178 where notNil ifTrue:[ |
4178 where notNil ifTrue:[ |
4179 '(' print. steppedContextLineno print. ') ' print. |
4179 '(' print. steppedContextLineno print. ') ' print. |
4180 where printCR. |
4180 where printCR. |
4181 ]. |
4181 ]. |
4182 ]. |
4182 ]. |
4183 |
4183 |
4184 ignore ifFalse:[ |
4184 ignore ifFalse:[ |
4185 (bigStep |
4185 (bigStep |
4186 and:[steppedContextLineno notNil |
4186 and:[steppedContextLineno notNil |
4187 and:[where notNil |
4187 and:[where notNil |
4188 and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
4188 and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
4189 (here isBlockContext |
4189 (here isBlockContext |
4190 and:[(here methodHome == steppedContext) |
4190 and:[(here methodHome == steppedContext) |
4191 or:[here home == steppedContext]]) ifTrue:[ |
4191 or:[here home == steppedContext]]) ifTrue:[ |
4192 DebuggingDebugger2 == true ifTrue:[ |
4192 DebuggingDebugger2 == true ifTrue:[ |
4193 'same line but in block' printCR. |
4193 'same line but in block' printCR. |
4194 ]. |
4194 ]. |
4195 |
4195 |
4196 steppedContext := actualContext := here. |
4196 steppedContext := actualContext := here. |
4197 steppedContextLineno := here lineNumber. |
4197 steppedContextLineno := here lineNumber. |
4198 ] ifFalse:[ |
4198 ] ifFalse:[ |
4199 "/ kludge - I only have the info for up to 255 lines |
4199 "/ kludge - I only have the info for up to 255 lines |
4200 steppedContextLineno ~~ 255 ifTrue:[ |
4200 steppedContextLineno ~~ 255 ifTrue:[ |
4201 DebuggingDebugger2 == true ifTrue:[ |
4201 DebuggingDebugger2 == true ifTrue:[ |
4202 'same line - ignored' printCR. |
4202 'same line - ignored' printCR. |
4203 ]. |
4203 ]. |
4204 ignore := true |
4204 ignore := true |
4205 ]. |
4205 ]. |
4206 ]. |
4206 ]. |
4207 ]. |
4207 ]. |
4208 |
4208 |
4209 (subBlockLeft not |
4209 (subBlockLeft not |
4210 and:[skipLineNr notNil |
4210 and:[skipLineNr notNil |
4211 and:[where notNil |
4211 and:[where notNil |
4212 and:[where lineNumber notNil |
4212 and:[where lineNumber notNil |
4213 and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
4213 and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
4214 DebuggingDebugger2 == true ifTrue:[ |
4214 DebuggingDebugger2 == true ifTrue:[ |
4215 'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
4215 'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
4216 ]. |
4216 ]. |
4217 ignore := true |
4217 ignore := true |
4218 ]. |
4218 ]. |
4219 |
4219 |
4220 (steppedContextLineno isNil |
4220 (steppedContextLineno isNil |
4221 and:[skipLineNr isNil |
4221 and:[skipLineNr isNil |
4222 and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
4222 and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
4223 DebuggingDebugger2 == true ifTrue:[ |
4223 DebuggingDebugger2 == true ifTrue:[ |
4224 'same line2 (after conIRQ) - ignored' printCR. |
4224 'same line2 (after conIRQ) - ignored' printCR. |
4225 ]. |
4225 ]. |
4226 ignore := true |
4226 ignore := true |
4227 ]. |
4227 ]. |
4228 ]. |
4228 ]. |
4229 |
4229 |
4230 ignore ifTrue:[ |
4230 ignore ifTrue:[ |
4231 "/' ' printCR. |
4231 "/' ' printCR. |
4232 where := nil. here := nil. |
4232 where := nil. here := nil. |
4233 " |
4233 " |
4234 yes, a context below |
4234 yes, a context below |
4235 - continue and schedule another stepInterrupt. |
4235 - continue and schedule another stepInterrupt. |
4236 Must flush caches since optimized methods not always |
4236 Must flush caches since optimized methods not always |
4237 look for pending interrupts |
4237 look for pending interrupts |
4238 " |
4238 " |
4239 ObjectMemory flushInlineCaches. |
4239 ObjectMemory flushInlineCaches. |
4240 StepInterruptPending := 1. |
4240 StepInterruptPending := 1. |
4241 InterruptPending := 1. |
4241 InterruptPending := 1. |
4242 InStepInterrupt := nil. |
4242 InStepInterrupt := nil. |
4243 ^ self |
4243 ^ self |
4244 ]. |
4244 ]. |
4245 |
4245 |
4246 "/ ' ' printCR. |
4246 "/ ' ' printCR. |
4247 |
4247 |
4248 self label:(s , ' (process: ' , processName , ')'). |
4248 self label:(s , ' (process: ' , processName , ')'). |
4253 "release refs to context" |
4253 "release refs to context" |
4254 where := nil. here := nil. |
4254 where := nil. here := nil. |
4255 "/'enter' printCR. |
4255 "/'enter' printCR. |
4256 |
4256 |
4257 DebuggingDebugger2 == true ifTrue:[ |
4257 DebuggingDebugger2 == true ifTrue:[ |
4258 '==> enter on: ' print. thisContext sender sender printCR. |
4258 '==> enter on: ' print. thisContext sender sender printCR. |
4259 ]. |
4259 ]. |
4260 |
4260 |
4261 initiallyShown := nil. |
4261 initiallyShown := nil. |
4262 (oneMore == true) ifTrue:[ |
4262 (oneMore == true) ifTrue:[ |
4263 (thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
4263 (thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
4264 initiallyShown := 2 |
4264 initiallyShown := 2 |
4265 ] ifFalse:[ |
4265 ] ifFalse:[ |
4266 initiallyShown := 1 |
4266 initiallyShown := 1 |
4267 ] |
4267 ] |
4268 ]. |
4268 ]. |
4269 con := thisContext sender sender. |
4269 con := thisContext sender sender. |
4270 |
4270 |
4271 HaltInterrupt handle:[:ex | |
4271 HaltInterrupt handle:[:ex | |
4272 'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
4272 'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
4273 ex proceed |
4273 ex proceed |
4274 ] do:[ |
4274 ] do:[ |
4275 self enter:con select:initiallyShown |
4275 self enter:con select:initiallyShown |
4276 ]. |
4276 ]. |
4277 con := nil |
4277 con := nil |
4278 |
4278 |
4279 "Created: / 14-10-1996 / 12:53:39 / cg" |
4279 "Created: / 14-10-1996 / 12:53:39 / cg" |
4280 "Modified: / 20-07-2012 / 15:26:26 / cg" |
4280 "Modified: / 20-07-2012 / 15:26:26 / cg" |
4290 selectedContext isNil ifTrue:[^ self]. |
4290 selectedContext isNil ifTrue:[^ self]. |
4291 |
4291 |
4292 cls := selectedContext receiver class. |
4292 cls := selectedContext receiver class. |
4293 sel := selectedContext selector. |
4293 sel := selectedContext selector. |
4294 (cls includesSelector:sel) ifFalse:[ |
4294 (cls includesSelector:sel) ifFalse:[ |
4295 sel := nil |
4295 sel := nil |
4296 ]. |
4296 ]. |
4297 Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
4297 Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
4298 ! |
4298 ! |
4299 |
4299 |
4300 autoRaiseView |
4300 autoRaiseView |
4311 |
4311 |
4312 autoUpdateOff |
4312 autoUpdateOff |
4313 "stop the update process" |
4313 "stop the update process" |
4314 |
4314 |
4315 updateProcess notNil ifTrue:[ |
4315 updateProcess notNil ifTrue:[ |
4316 monitorToggle lampColor:(Color yellow). |
4316 monitorToggle lampColor:(Color yellow). |
4317 updateProcess terminate. |
4317 updateProcess terminate. |
4318 updateProcess := nil |
4318 updateProcess := nil |
4319 ] |
4319 ] |
4320 ! |
4320 ! |
4321 |
4321 |
4322 autoUpdateOn |
4322 autoUpdateOn |
4323 "fork a subprocess which updates the contextList in regular intervals" |
4323 "fork a subprocess which updates the contextList in regular intervals" |
4324 |
4324 |
4325 updateProcess isNil ifTrue:[ |
4325 updateProcess isNil ifTrue:[ |
4326 updateProcess := |
4326 updateProcess := |
4327 [ |
4327 [ |
4328 [true] whileTrue:[ |
4328 [true] whileTrue:[ |
4329 monitorToggle showLamp ifTrue:[ |
4329 monitorToggle showLamp ifTrue:[ |
4330 monitorToggle lampColor:(Color yellow). |
4330 monitorToggle lampColor:(Color yellow). |
4331 ] ifFalse:[ |
4331 ] ifFalse:[ |
4332 monitorToggle activeForegroundColor:Color black. |
4332 monitorToggle activeForegroundColor:Color black. |
4333 ]. |
4333 ]. |
4334 (Delay forSeconds:0.25) wait. |
4334 (Delay forSeconds:0.25) wait. |
4335 self updateContext. |
4335 self updateContext. |
4336 monitorToggle showLamp ifTrue:[ |
4336 monitorToggle showLamp ifTrue:[ |
4337 monitorToggle lampColor:(Color red). |
4337 monitorToggle lampColor:(Color red). |
4338 ] ifFalse:[ |
4338 ] ifFalse:[ |
4339 monitorToggle activeForegroundColor:Color red. |
4339 monitorToggle activeForegroundColor:Color red. |
4340 ]. |
4340 ]. |
4341 (Delay forSeconds:0.25) wait. |
4341 (Delay forSeconds:0.25) wait. |
4342 self updateContext. |
4342 self updateContext. |
4343 ] |
4343 ] |
4344 ] forkAt:(Processor activePriority - 1) |
4344 ] forkAt:(Processor activePriority - 1) |
4345 ] |
4345 ] |
4346 |
4346 |
4347 ! |
4347 ! |
4348 |
4348 |
4349 browseBlocksHome |
4349 browseBlocksHome |
4357 mthd := block method. |
4357 mthd := block method. |
4358 cls := mthd mclass. |
4358 cls := mthd mclass. |
4359 sel := mthd selector. |
4359 sel := mthd selector. |
4360 |
4360 |
4361 (cls notNil and:[(cls includesSelector:sel)]) ifTrue:[ |
4361 (cls notNil and:[(cls includesSelector:sel)]) ifTrue:[ |
4362 cls browserClass openInClass:cls selector:sel. |
4362 cls browserClass openInClass:cls selector:sel. |
4363 ^ self |
4363 ^ self |
4364 ]. |
4364 ]. |
4365 |
4365 |
4366 mthd source notEmptyOrNil ifTrue:[ |
4366 mthd source notEmptyOrNil ifTrue:[ |
4367 (Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs) |
4367 (Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs) |
4368 ifTrue:[ |
4368 ifTrue:[ |
4369 UserPreferences current systemBrowserClass |
4369 UserPreferences current systemBrowserClass |
4370 browseMethods:{ mthd } title:'Unbound Method' sort:false |
4370 browseMethods:{ mthd } title:'Unbound Method' sort:false |
4371 "/ TextView openWith:mthd source title:'Unbound Method''s Source'. |
4371 "/ TextView openWith:mthd source title:'Unbound Method''s Source'. |
4372 ]. |
4372 ]. |
4373 ^ self |
4373 ^ self |
4374 ]. |
4374 ]. |
4375 cls notNil ifTrue:[ |
4375 cls notNil ifTrue:[ |
4376 (Dialog confirm:'Block''s home method is (no longer) present in any class and no source can be shown.\Do you want to browse the method''s last class instead?' withCRs) |
4376 (Dialog confirm:'Block''s home method is (no longer) present in any class and no source can be shown.\Do you want to browse the method''s last class instead?' withCRs) |
4377 ifTrue:[ |
4377 ifTrue:[ |
4378 cls browserClass openInClass:cls selector:nil. |
4378 cls browserClass openInClass:cls selector:nil. |
4379 ]. |
4379 ]. |
4380 ^ self |
4380 ^ self |
4381 ]. |
4381 ]. |
4382 Dialog information:'Block''s home method is (no longer) present in any class.'. |
4382 Dialog information:'Block''s home method is (no longer) present in any class.'. |
4383 ! |
4383 ! |
4384 |
4384 |
4385 browseClass |
4385 browseClass |
4390 selectedContext isNil ifTrue:[^ self]. |
4390 selectedContext isNil ifTrue:[^ self]. |
4391 |
4391 |
4392 cls := selectedContext receiver class. |
4392 cls := selectedContext receiver class. |
4393 sel := selectedContext selector. |
4393 sel := selectedContext selector. |
4394 (cls includesSelector:sel) ifFalse:[ |
4394 (cls includesSelector:sel) ifFalse:[ |
4395 sel := nil |
4395 sel := nil |
4396 ]. |
4396 ]. |
4397 cls browserClass openInClass:cls selector:sel. |
4397 cls browserClass openInClass:cls selector:sel. |
4398 |
4398 |
4399 "Modified: / 3.2.1998 / 20:23:36 / cg" |
4399 "Modified: / 3.2.1998 / 20:23:36 / cg" |
4400 ! |
4400 ! |
4406 |
4406 |
4407 selectedContext isNil ifTrue:[^ self]. |
4407 selectedContext isNil ifTrue:[^ self]. |
4408 |
4408 |
4409 mthd := selectedContext method. |
4409 mthd := selectedContext method. |
4410 mthd notNil ifTrue:[ |
4410 mthd notNil ifTrue:[ |
4411 cls := mthd containingClass. |
4411 cls := mthd containingClass. |
4412 "/ still nil if unbound - then use receivers class |
4412 "/ still nil if unbound - then use receivers class |
4413 ]. |
4413 ]. |
4414 cls isNil ifTrue:[ |
4414 cls isNil ifTrue:[ |
4415 cls := selectedContext receiver class |
4415 cls := selectedContext receiver class |
4416 ]. |
4416 ]. |
4417 cls browserClass browseClassHierarchy:cls. |
4417 cls browserClass browseClassHierarchy:cls. |
4418 |
4418 |
4419 "Modified: / 17.11.2001 / 19:43:06 / cg" |
4419 "Modified: / 17.11.2001 / 19:43:06 / cg" |
4420 ! |
4420 ! |
4426 |
4426 |
4427 selectedContext isNil ifTrue:[^ self]. |
4427 selectedContext isNil ifTrue:[^ self]. |
4428 |
4428 |
4429 mthd := selectedContext method. |
4429 mthd := selectedContext method. |
4430 mthd notNil ifTrue:[ |
4430 mthd notNil ifTrue:[ |
4431 cls := mthd containingClass. |
4431 cls := mthd containingClass. |
4432 "/ still nil if unbound - then use receivers class |
4432 "/ still nil if unbound - then use receivers class |
4433 ]. |
4433 ]. |
4434 cls isNil ifTrue:[ |
4434 cls isNil ifTrue:[ |
4435 cls := selectedContext receiver class |
4435 cls := selectedContext receiver class |
4436 ]. |
4436 ]. |
4437 cls browserClass browseFullClassProtocol:cls. |
4437 cls browserClass browseFullClassProtocol:cls. |
4438 |
4438 |
4439 "Modified: / 17.11.2001 / 19:43:43 / cg" |
4439 "Modified: / 17.11.2001 / 19:43:43 / cg" |
4440 ! |
4440 ! |
4447 con := selectedContext ? actualContext. |
4447 con := selectedContext ? actualContext. |
4448 con isNil ifTrue:[^ self]. |
4448 con isNil ifTrue:[^ self]. |
4449 |
4449 |
4450 mthd := con method. |
4450 mthd := con method. |
4451 mthd notNil ifTrue:[ |
4451 mthd notNil ifTrue:[ |
4452 who := mthd who. |
4452 who := mthd who. |
4453 who notNil ifTrue:[ |
4453 who notNil ifTrue:[ |
4454 cls := who methodClass. |
4454 cls := who methodClass. |
4455 sel := who methodSelector. |
4455 sel := who methodSelector. |
4456 ] ifFalse:[ |
4456 ] ifFalse:[ |
4457 "might have been re-accepted" |
4457 "might have been re-accepted" |
4458 (home := con methodHome) notNil ifTrue:[ |
4458 (home := con methodHome) notNil ifTrue:[ |
4459 (sel := home selector) notNil ifTrue:[ |
4459 (sel := home selector) notNil ifTrue:[ |
4460 cls := home receiver class |
4460 cls := home receiver class |
4461 whichClassImplements:selectedContext selector. |
4461 whichClassImplements:selectedContext selector. |
4462 cls notNil ifTrue:[ |
4462 cls notNil ifTrue:[ |
4463 Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
4463 Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
4464 ]. |
4464 ]. |
4465 ] |
4465 ] |
4466 ]. |
4466 ]. |
4467 ]. |
4467 ]. |
4468 ]. |
4468 ]. |
4469 cls isNil ifTrue:[ |
4469 cls isNil ifTrue:[ |
4470 "/ class not found - try receiver |
4470 "/ class not found - try receiver |
4471 cls := con receiver class |
4471 cls := con receiver class |
4472 ]. |
4472 ]. |
4473 |
4473 |
4474 cls browserClass openInClass:cls selector:sel. |
4474 cls browserClass openInClass:cls selector:sel. |
4475 |
4475 |
4476 "Created: / 22-11-1995 / 21:27:01 / cg" |
4476 "Created: / 22-11-1995 / 21:27:01 / cg" |
4479 |
4479 |
4480 browseImplementors |
4480 browseImplementors |
4481 "open a browser on the implementors of the selected method's selector" |
4481 "open a browser on the implementors of the selected method's selector" |
4482 |
4482 |
4483 selectedContext isNil ifTrue:[ |
4483 selectedContext isNil ifTrue:[ |
4484 ^ self showError:'** select a context first **' |
4484 ^ self showError:'** select a context first **' |
4485 ]. |
4485 ]. |
4486 "/ selectedContext receiver class browserClass |
4486 "/ selectedContext receiver class browserClass |
4487 self withWaitCursorDo:[ |
4487 self withWaitCursorDo:[ |
4488 UserPreferences systemBrowserClass |
4488 UserPreferences systemBrowserClass |
4489 browseImplementorsOf:selectedContext selector. |
4489 browseImplementorsOf:selectedContext selector. |
4490 ] |
4490 ] |
4491 |
4491 |
4492 "Modified: / 19-07-2012 / 11:44:03 / cg" |
4492 "Modified: / 19-07-2012 / 11:44:03 / cg" |
4493 ! |
4493 ! |
4494 |
4494 |
4496 "open a browser on the implementors of some selector" |
4496 "open a browser on the implementors of some selector" |
4497 |
4497 |
4498 |initial selector sel| |
4498 |initial selector sel| |
4499 |
4499 |
4500 (sel := codeView selection) notNil ifTrue:[ |
4500 (sel := codeView selection) notNil ifTrue:[ |
4501 initial := SystemBrowser extractSelectorFrom:sel |
4501 initial := SystemBrowser extractSelectorFrom:sel |
4502 ]. |
4502 ]. |
4503 initial isNil ifTrue:[ |
4503 initial isNil ifTrue:[ |
4504 initial := selectedContext isNil |
4504 initial := selectedContext isNil |
4505 ifTrue:[nil] |
4505 ifTrue:[nil] |
4506 ifFalse:[selectedContext selector]. |
4506 ifFalse:[selectedContext selector]. |
4507 ]. |
4507 ]. |
4508 selector := Dialog |
4508 selector := Dialog |
4509 requestSelector:'Selector to browse implementors of:' |
4509 requestSelector:'Selector to browse implementors of:' |
4510 initialAnswer:initial. |
4510 initialAnswer:initial. |
4511 |
4511 |
4512 selector notEmptyOrNil ifTrue:[ |
4512 selector notEmptyOrNil ifTrue:[ |
4513 self withWaitCursorDo:[ |
4513 self withWaitCursorDo:[ |
4514 UserPreferences systemBrowserClass |
4514 UserPreferences systemBrowserClass |
4515 browseImplementorsMatching:selector. |
4515 browseImplementorsMatching:selector. |
4516 ] |
4516 ] |
4517 ] |
4517 ] |
4518 |
4518 |
4519 "Modified: / 19-07-2012 / 11:43:52 / cg" |
4519 "Modified: / 19-07-2012 / 11:43:52 / cg" |
4520 ! |
4520 ! |
4521 |
4521 |
4523 "browse the application class (of the process, if it is a GUI process)" |
4523 "browse the application class (of the process, if it is a GUI process)" |
4524 |
4524 |
4525 |app appClass| |
4525 |app appClass| |
4526 |
4526 |
4527 (app := self processesApplication) notNil ifTrue:[ |
4527 (app := self processesApplication) notNil ifTrue:[ |
4528 appClass := app class. |
4528 appClass := app class. |
4529 appClass browserClass openInClass:appClass selector:nil. |
4529 appClass browserClass openInClass:appClass selector:nil. |
4530 ^ self |
4530 ^ self |
4531 ]. |
4531 ]. |
4532 ! |
4532 ! |
4533 |
4533 |
4534 browseReceiversClass |
4534 browseReceiversClass |
4535 "browse the receiver's class (of the selected context's message)" |
4535 "browse the receiver's class (of the selected context's message)" |
4537 |cls sel| |
4537 |cls sel| |
4538 |
4538 |
4539 selectedContext isNil ifTrue:[^ self]. |
4539 selectedContext isNil ifTrue:[^ self]. |
4540 |
4540 |
4541 selectedContext isCheapBlockContext ifTrue:[ |
4541 selectedContext isCheapBlockContext ifTrue:[ |
4542 cls := selectedContext method mclass. |
4542 cls := selectedContext method mclass. |
4543 sel := selectedContext method selector. |
4543 sel := selectedContext method selector. |
4544 ] ifFalse:[ |
4544 ] ifFalse:[ |
4545 cls := selectedContext receiver class. |
4545 cls := selectedContext receiver class. |
4546 sel := selectedContext selector. |
4546 sel := selectedContext selector. |
4547 ]. |
4547 ]. |
4548 (cls includesSelector:sel) ifFalse:[ |
4548 (cls includesSelector:sel) ifFalse:[ |
4549 sel := nil |
4549 sel := nil |
4550 ]. |
4550 ]. |
4551 cls browserClass openInClass:cls selector:sel. |
4551 cls browserClass openInClass:cls selector:sel. |
4552 |
4552 |
4553 "Modified: / 19-07-2012 / 11:29:48 / cg" |
4553 "Modified: / 19-07-2012 / 11:29:48 / cg" |
4554 ! |
4554 ! |
4555 |
4555 |
4556 browseSenders |
4556 browseSenders |
4557 "open a browser on the senders of the selected method's selector" |
4557 "open a browser on the senders of the selected method's selector" |
4558 |
4558 |
4559 selectedContext isNil ifTrue:[ |
4559 selectedContext isNil ifTrue:[ |
4560 ^ self showError:'** select a context first **' |
4560 ^ self showError:'** select a context first **' |
4561 ]. |
4561 ]. |
4562 self withWaitCursorDo:[ |
4562 self withWaitCursorDo:[ |
4563 UserPreferences systemBrowserClass |
4563 UserPreferences systemBrowserClass |
4564 browseAllCallsOn:selectedContext selector. |
4564 browseAllCallsOn:selectedContext selector. |
4565 ] |
4565 ] |
4566 |
4566 |
4567 "Modified: / 19-07-2012 / 11:43:02 / cg" |
4567 "Modified: / 19-07-2012 / 11:43:02 / cg" |
4568 ! |
4568 ! |
4569 |
4569 |
4571 "open a browser on the senders of some selector" |
4571 "open a browser on the senders of some selector" |
4572 |
4572 |
4573 |initial selector sel| |
4573 |initial selector sel| |
4574 |
4574 |
4575 (sel := codeView selection) notNil ifTrue:[ |
4575 (sel := codeView selection) notNil ifTrue:[ |
4576 initial := SystemBrowser extractSelectorFrom:sel |
4576 initial := SystemBrowser extractSelectorFrom:sel |
4577 ]. |
4577 ]. |
4578 initial isNil ifTrue:[ |
4578 initial isNil ifTrue:[ |
4579 initial := selectedContext isNil |
4579 initial := selectedContext isNil |
4580 ifTrue:[nil] |
4580 ifTrue:[nil] |
4581 ifFalse:[selectedContext selector]. |
4581 ifFalse:[selectedContext selector]. |
4582 ]. |
4582 ]. |
4583 selector := Dialog |
4583 selector := Dialog |
4584 requestSelector:'Selector to browse senders of:' |
4584 requestSelector:'Selector to browse senders of:' |
4585 initialAnswer:initial. |
4585 initialAnswer:initial. |
4586 |
4586 |
4587 selector notEmptyOrNil ifTrue:[ |
4587 selector notEmptyOrNil ifTrue:[ |
4588 self withWaitCursorDo:[ |
4588 self withWaitCursorDo:[ |
4589 UserPreferences systemBrowserClass |
4589 UserPreferences systemBrowserClass |
4590 browseAllCallsOn:selector asSymbol. |
4590 browseAllCallsOn:selector asSymbol. |
4591 ] |
4591 ] |
4592 ] |
4592 ] |
4593 |
4593 |
4594 "Modified: / 19-07-2012 / 11:43:29 / cg" |
4594 "Modified: / 19-07-2012 / 11:43:29 / cg" |
4595 ! |
4595 ! |
4596 |
4596 |
4603 ! |
4603 ! |
4604 |
4604 |
4605 closeAllDebuggers |
4605 closeAllDebuggers |
4606 (Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?') |
4606 (Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?') |
4607 ifFalse:[ |
4607 ifFalse:[ |
4608 ^ self |
4608 ^ self |
4609 ]. |
4609 ]. |
4610 |
4610 |
4611 self class allInstancesDo:[:debugger | |
4611 self class allInstancesDo:[:debugger | |
4612 debugger ~~ self ifTrue:[ |
4612 debugger ~~ self ifTrue:[ |
4613 debugger busy ifTrue:[ |
4613 debugger busy ifTrue:[ |
4614 debugger destroyWithConfirmation:true. |
4614 debugger destroyWithConfirmation:true. |
4615 ]. |
4615 ]. |
4616 ]. |
4616 ]. |
4617 ]. |
4617 ]. |
4618 self closeRequest. |
4618 self closeRequest. |
4619 |
4619 |
4620 "Created: / 23-03-2012 / 12:40:22 / cg" |
4620 "Created: / 23-03-2012 / 12:40:22 / cg" |
4621 ! |
4621 ! |
4635 Show the full verbose context without filtering." |
4635 Show the full verbose context without filtering." |
4636 |
4636 |
4637 |infoText| |
4637 |infoText| |
4638 |
4638 |
4639 firstContext isNil ifTrue:[ |
4639 firstContext isNil ifTrue:[ |
4640 infoText := 'No context, no walkback'. |
4640 infoText := 'No context, no walkback'. |
4641 ] ifFalse:[ |
4641 ] ifFalse:[ |
4642 exceptionInfoLabel notNil ifTrue:[ |
4642 exceptionInfoLabel notNil ifTrue:[ |
4643 infoText := exceptionInfoLabel label , '\\' withCRs. |
4643 infoText := exceptionInfoLabel label , '\\' withCRs. |
4644 ] ifFalse:[ |
4644 ] ifFalse:[ |
4645 infoText := '' |
4645 infoText := '' |
4646 ]. |
4646 ]. |
4647 infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection. |
4647 infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection. |
4648 ]. |
4648 ]. |
4649 |
4649 |
4650 self setClipboardText:infoText |
4650 self setClipboardText:infoText |
4651 |
4651 |
4652 "Modified: 28.8.1995 / 15:31:59 / claus" |
4652 "Modified: 28.8.1995 / 15:31:59 / claus" |
4656 "abort - send Object>>abortSignal, which is usually caught |
4656 "abort - send Object>>abortSignal, which is usually caught |
4657 at save places (for example: in the event loop) and returns back |
4657 at save places (for example: in the event loop) and returns back |
4658 from whatever the process is doing, but does not terminate it." |
4658 from whatever the process is doing, but does not terminate it." |
4659 |
4659 |
4660 self checkIfCodeIsReallyModified ifTrue:[ |
4660 self checkIfCodeIsReallyModified ifTrue:[ |
4661 (self confirm:('Code modified - abort anyway ?')) |
4661 (self confirm:('Code modified - abort anyway ?')) |
4662 ifFalse:[ |
4662 ifFalse:[ |
4663 ^ self |
4663 ^ self |
4664 ] |
4664 ] |
4665 ]. |
4665 ]. |
4666 |
4666 |
4667 inspecting ifTrue:[ |
4667 inspecting ifTrue:[ |
4668 inspectedProcess isDead ifTrue:[ |
4668 inspectedProcess isDead ifTrue:[ |
4669 self showTerminated. |
4669 self showTerminated. |
4670 ^ self |
4670 ^ self |
4671 ]. |
4671 ]. |
4672 (AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
4672 (AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
4673 self showError:'** the process does not handle the abort signal **' |
4673 self showError:'** the process does not handle the abort signal **' |
4674 ] ifTrue:[ |
4674 ] ifTrue:[ |
4675 self interruptProcessWith:[AbortOperationRequest raise]. |
4675 self interruptProcessWith:[AbortOperationRequest raise]. |
4676 ]. |
4676 ]. |
4677 ^ self |
4677 ^ self |
4678 ]. |
4678 ]. |
4679 |
4679 |
4680 steppedContext := wrapperContext := nil. |
4680 steppedContext := wrapperContext := nil. |
4681 haveControl := false. |
4681 haveControl := false. |
4682 exitAction := #abort. |
4682 exitAction := #abort. |
4683 |
4683 |
4684 "exit private event-loop" |
4684 "exit private event-loop" |
4685 catchBlock notNil ifTrue:[ |
4685 catchBlock notNil ifTrue:[ |
4686 abortButton turnOff. |
4686 abortButton turnOff. |
4687 catchBlock value. |
4687 catchBlock value. |
4688 |
4688 |
4689 "/ not reached |
4689 "/ not reached |
4690 'DebugView [warning]: abort failed' errorPrintCR. |
4690 'DebugView [warning]: abort failed' errorPrintCR. |
4691 ]. |
4691 ]. |
4692 |
4692 |
4693 ^ self. |
4693 ^ self. |
4694 |
4694 |
4695 "Modified: / 17.11.2001 / 22:53:22 / cg" |
4695 "Modified: / 17.11.2001 / 22:53:22 / cg" |
4699 "abortAll - send Object>>abortAllSignal, which is usually caught |
4699 "abortAll - send Object>>abortAllSignal, which is usually caught |
4700 at save places (for example: in the event loop) and returns back |
4700 at save places (for example: in the event loop) and returns back |
4701 from whatever the process is doing, but does not terminate it." |
4701 from whatever the process is doing, but does not terminate it." |
4702 |
4702 |
4703 self checkIfCodeIsReallyModified ifTrue:[ |
4703 self checkIfCodeIsReallyModified ifTrue:[ |
4704 (self confirm:('Code modified - abort anyway ?')) |
4704 (self confirm:('Code modified - abort anyway ?')) |
4705 ifFalse:[ |
4705 ifFalse:[ |
4706 ^ self |
4706 ^ self |
4707 ] |
4707 ] |
4708 ]. |
4708 ]. |
4709 |
4709 |
4710 inspecting ifTrue:[ |
4710 inspecting ifTrue:[ |
4711 inspectedProcess isDead ifTrue:[ |
4711 inspectedProcess isDead ifTrue:[ |
4712 self showTerminated. |
4712 self showTerminated. |
4713 ^ self |
4713 ^ self |
4714 ]. |
4714 ]. |
4715 (AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
4715 (AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
4716 self showError:'** the process does not handle the abort signal **' |
4716 self showError:'** the process does not handle the abort signal **' |
4717 ] ifTrue:[ |
4717 ] ifTrue:[ |
4718 self interruptProcessWith:[AbortAllOperationRequest raise]. |
4718 self interruptProcessWith:[AbortAllOperationRequest raise]. |
4719 ]. |
4719 ]. |
4720 ^ self |
4720 ^ self |
4721 ]. |
4721 ]. |
4722 |
4722 |
4723 steppedContext := wrapperContext := nil. |
4723 steppedContext := wrapperContext := nil. |
4724 haveControl := false. |
4724 haveControl := false. |
4725 exitAction := #abortAll. |
4725 exitAction := #abortAll. |
4726 |
4726 |
4727 "exit private event-loop" |
4727 "exit private event-loop" |
4728 catchBlock notNil ifTrue:[ |
4728 catchBlock notNil ifTrue:[ |
4729 abortButton turnOff. |
4729 abortButton turnOff. |
4730 catchBlock value. |
4730 catchBlock value. |
4731 |
4731 |
4732 "/ not reached |
4732 "/ not reached |
4733 'DebugView [warning]: abort failed' errorPrintCR. |
4733 'DebugView [warning]: abort failed' errorPrintCR. |
4734 ]. |
4734 ]. |
4735 |
4735 |
4736 ^ self. |
4736 ^ self. |
4737 |
4737 |
4738 "Modified: / 17.11.2001 / 22:53:22 / cg" |
4738 "Modified: / 17.11.2001 / 22:53:22 / cg" |
4744 |oldPrio newPrio s| |
4744 |oldPrio newPrio s| |
4745 |
4745 |
4746 oldPrio := (inspectedProcess ? Processor activeProcess) priority. |
4746 oldPrio := (inspectedProcess ? Processor activeProcess) priority. |
4747 |
4747 |
4748 [ |
4748 [ |
4749 s := Dialog |
4749 s := Dialog |
4750 request:(resources stringWithCRs:'Change the processes priority to (proceed with prio):\\ 2 - system background\ 4 - user background\ 8 - normal\ 9 - high\ 16 - I/O (danger alert)\') |
4750 request:(resources stringWithCRs:'Change the processes priority to (proceed with prio):\\ 2 - system background\ 4 - user background\ 8 - normal\ 9 - high\ 16 - I/O (danger alert)\') |
4751 initialAnswer:oldPrio printString. |
4751 initialAnswer:oldPrio printString. |
4752 s isEmptyOrNil ifTrue:[^ self]. |
4752 s isEmptyOrNil ifTrue:[^ self]. |
4753 newPrio := Integer readFrom:s onError:nil. |
4753 newPrio := Integer readFrom:s onError:nil. |
4754 newPrio isNil |
4754 newPrio isNil |
4755 ] whileTrue. |
4755 ] whileTrue. |
4756 |
4756 |
4757 newPrio := newPrio max:(Processor lowestPriority). |
4757 newPrio := newPrio max:(Processor lowestPriority). |
4758 newPrio := newPrio min:(Processor highestPriority). |
4758 newPrio := newPrio min:(Processor highestPriority). |
4759 newPrio >= Processor highIOPriority ifTrue:[ |
4759 newPrio >= Processor highIOPriority ifTrue:[ |
4760 (Dialog |
4760 (Dialog |
4761 confirm:(resources |
4761 confirm:(resources |
4762 stringWithCRs:'Attention: event handling takes place at prio 16.\An ever running high priority process\could block the system and make the UI unusable.\\Proceed?')) |
4762 stringWithCRs:'Attention: event handling takes place at prio 16.\An ever running high priority process\could block the system and make the UI unusable.\\Proceed?')) |
4763 ifFalse:[^ self]. |
4763 ifFalse:[^ self]. |
4764 ]. |
4764 ]. |
4765 (inspectedProcess ? Processor activeProcess) priority:newPrio. |
4765 (inspectedProcess ? Processor activeProcess) priority:newPrio. |
4766 |
4766 |
4767 "Created: / 07-03-2012 / 14:15:09 / cg" |
4767 "Created: / 07-03-2012 / 14:15:09 / cg" |
4768 ! |
4768 ! |
4771 "continue from menu" |
4771 "continue from menu" |
4772 |
4772 |
4773 |proc exContext ex answer| |
4773 |proc exContext ex answer| |
4774 |
4774 |
4775 self checkIfCodeIsReallyModified ifTrue:[ |
4775 self checkIfCodeIsReallyModified ifTrue:[ |
4776 (self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
4776 (self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
4777 ^ self |
4777 ^ self |
4778 ] |
4778 ] |
4779 ]. |
4779 ]. |
4780 |
4780 |
4781 inspecting ifTrue:[ |
4781 inspecting ifTrue:[ |
4782 self graphicsDevice hasColors ifTrue:[ |
4782 self graphicsDevice hasColors ifTrue:[ |
4783 continueButton foregroundColor:Color red darkened. |
4783 continueButton foregroundColor:Color red darkened. |
4784 ]. |
4784 ]. |
4785 continueButton label:(resources string:'Stop'). |
4785 continueButton label:(resources string:'Stop'). |
4786 continueButton action:[self doStop]. |
4786 continueButton action:[self doStop]. |
4787 |
4787 |
4788 self processPerform:#resume. |
4788 self processPerform:#resume. |
4789 |
4789 |
4790 ^ self |
4790 ^ self |
4791 ]. |
4791 ]. |
4792 canContinue ifTrue:[ |
4792 canContinue ifTrue:[ |
4793 exContext := thisContext findSpecialHandle:false raise:true. |
4793 exContext := thisContext findSpecialHandle:false raise:true. |
4794 |
4794 |
4795 (exContext notNil |
4795 (exContext notNil |
4796 and:[ (ex := exContext receiver) isLazyValue not |
4796 and:[ (ex := exContext receiver) isLazyValue not |
4797 and:[ ex isException |
4797 and:[ ex isException |
4798 and:[ ex creator == NoHandlerError |
4798 and:[ ex creator == NoHandlerError |
4799 and:[ ex exception creator == RecursionError]]]]) |
4799 and:[ ex exception creator == RecursionError]]]]) |
4800 ifTrue:[ |
4800 ifTrue:[ |
4801 "/ debug due to unhandled recursionInterrupt. |
4801 "/ debug due to unhandled recursionInterrupt. |
4802 "/ ask if we should proceed with more stack. |
4802 "/ ask if we should proceed with more stack. |
4803 |
4803 |
4804 answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
4804 answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
4805 answer == true ifTrue:[ |
4805 answer == true ifTrue:[ |
4806 proc := Processor activeProcess. |
4806 proc := Processor activeProcess. |
4807 proc setMaximumStackSize:(proc maximumStackSize * 2). |
4807 proc setMaximumStackSize:(proc maximumStackSize * 2). |
4808 ]. |
4808 ]. |
4809 ]. |
4809 ]. |
4810 |
4810 |
4811 steppedContext := wrapperContext := nil. |
4811 steppedContext := wrapperContext := nil. |
4812 tracing := false. |
4812 tracing := false. |
4813 haveControl := false. |
4813 haveControl := false. |
4814 exitAction := #continue. |
4814 exitAction := #continue. |
4815 |
4815 |
4816 "exit private event-loop" |
4816 "exit private event-loop" |
4817 catchBlock value. |
4817 catchBlock value. |
4818 |
4818 |
4819 "/ not reached. |
4819 "/ not reached. |
4820 'DebugView [warning]: continue failed' errorPrintCR. |
4820 'DebugView [warning]: continue failed' errorPrintCR. |
4821 continueButton turnOff. |
4821 continueButton turnOff. |
4822 |
4822 |
4823 ] ifFalse:[ |
4823 ] ifFalse:[ |
4824 inspecting ifFalse:[ |
4824 inspecting ifFalse:[ |
4825 'DebugView [info]: resuming top context' infoPrintCR. |
4825 'DebugView [info]: resuming top context' infoPrintCR. |
4826 self showSelection:1. |
4826 self showSelection:1. |
4827 self doReturn |
4827 self doReturn |
4828 ] |
4828 ] |
4829 ] |
4829 ] |
4830 |
4830 |
4831 "Modified: / 5.10.1998 / 13:03:47 / cg" |
4831 "Modified: / 5.10.1998 / 13:03:47 / cg" |
4832 "Modified: / 26.7.1999 / 15:38:45 / stefan" |
4832 "Modified: / 26.7.1999 / 15:38:45 / stefan" |
4833 ! |
4833 ! |
4843 |
4843 |
4844 selectionIndex := contextView selection. |
4844 selectionIndex := contextView selection. |
4845 restart := true. |
4845 restart := true. |
4846 |
4846 |
4847 selectorToDefine notNil ifTrue:[ |
4847 selectorToDefine notNil ifTrue:[ |
4848 selector := selectorToDefine. |
4848 selector := selectorToDefine. |
4849 receiversClass := classToDefineIn. |
4849 receiversClass := classToDefineIn. |
4850 ] ifFalse:[ |
4850 ] ifFalse:[ |
4851 selector := actualContext selector. |
4851 selector := actualContext selector. |
4852 receiversClass := actualContext receiver class. |
4852 receiversClass := actualContext receiver class. |
4853 ]. |
4853 ]. |
4854 |
4854 |
4855 implClass := actualContext receiver class whichClassIncludesSelector:selector. |
4855 implClass := actualContext receiver class whichClassIncludesSelector:selector. |
4856 implClass notNil ifTrue:[ |
4856 implClass notNil ifTrue:[ |
4857 "/ must be a subclassResponsibility |
4857 "/ must be a subclassResponsibility |
4858 |
4858 |
4859 idx := contextArray identityIndexOf:actualContext. |
4859 idx := contextArray identityIndexOf:actualContext. |
4860 idx > 1 ifTrue:[ |
4860 idx > 1 ifTrue:[ |
4861 callee := contextArray at:idx-1. |
4861 callee := contextArray at:idx-1. |
4862 |
4862 |
4863 callee selector == #subclassResponsibility ifTrue:[ |
4863 callee selector == #subclassResponsibility ifTrue:[ |
4864 restart := false. |
4864 restart := false. |
4865 ] |
4865 ] |
4866 ]. |
4866 ]. |
4867 ]. |
4867 ]. |
4868 |
4868 |
4869 "generate nice argument names" |
4869 "generate nice argument names" |
4870 bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
4870 bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
4871 bagOfUsedClassNames := Bag new. |
4871 bagOfUsedClassNames := Bag new. |
4872 argNames := actualContext args |
4872 argNames := actualContext args |
4873 collect: |
4873 collect: |
4874 [:eachArg | |
4874 [:eachArg | |
4875 |nm| |
4875 |nm| |
4876 |
4876 |
4877 nm := eachArg class nameWithoutPrefix. |
4877 nm := eachArg class nameWithoutPrefix. |
4878 (bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
4878 (bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
4879 nm article , nm |
4879 nm article , nm |
4880 ] ifFalse:[ |
4880 ] ifFalse:[ |
4881 bagOfUsedClassNames add:nm. |
4881 bagOfUsedClassNames add:nm. |
4882 nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
4882 nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
4883 ]. |
4883 ]. |
4884 ]. |
4884 ]. |
4885 |
4885 |
4886 proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
4886 proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
4887 |
4887 |
4888 haltStmtDef := ' self halt:''please define %2 here''.'. |
4888 haltStmtDef := ' self halt:''please define %2 here''.'. |
4889 haltStmtFix := ' self halt:''please change %2 as required''.'. |
4889 haltStmtFix := ' self halt:''please change %2 as required''.'. |
4890 |
4890 |
4891 |
4891 |
4892 ( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[ |
4892 ( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[ |
4893 (self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?') |
4893 (self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?') |
4894 ifFalse:[ |
4894 ifFalse:[ |
4895 ^ self |
4895 ^ self |
4896 ] |
4896 ] |
4897 ]. |
4897 ]. |
4898 |
4898 |
4899 |
4899 |
4900 "/ code for a getter |
4900 "/ code for a getter |
4901 (receiversClass instVarNames includes:selector) ifTrue:[ |
4901 (receiversClass instVarNames includes:selector) ifTrue:[ |
4902 code := '%1\' , haltStmtFix , '\ ^ %2'. |
4902 code := '%1\' , haltStmtFix , '\ ^ %2'. |
4903 cat := 'accessing'. |
4903 cat := 'accessing'. |
4904 ]. |
4904 ]. |
4905 |
4905 |
4906 "/ code for a setter |
4906 "/ code for a setter |
4907 (selector numArgs == 1 |
4907 (selector numArgs == 1 |
4908 and:[(selector endsWith:':') |
4908 and:[(selector endsWith:':') |
4909 and:[receiversClass instVarNames includes:(selector copyButLast:1)]]) |
4909 and:[receiversClass instVarNames includes:(selector copyButLast:1)]]) |
4910 ifTrue:[ |
4910 ifTrue:[ |
4911 varName := selector copyButLast:1. |
4911 varName := selector copyButLast:1. |
4912 argName := argNames first. |
4912 argName := argNames first. |
4913 code := '%1\' , haltStmtFix , '\ %3 := %4.'. |
4913 code := '%1\' , haltStmtFix , '\ %3 := %4.'. |
4914 cat := 'accessing'. |
4914 cat := 'accessing'. |
4915 ]. |
4915 ]. |
4916 |
4916 |
4917 "/ code for a tester |
4917 "/ code for a tester |
4918 (selector numArgs == 0 |
4918 (selector numArgs == 0 |
4919 and:[(selector startsWith:'is') |
4919 and:[(selector startsWith:'is') |
4920 and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]]) |
4920 and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]]) |
4921 ifTrue:[ |
4921 ifTrue:[ |
4922 (receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[ |
4922 (receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[ |
4923 code := '%1\' , haltStmtFix , '\ ^ true.'. |
4923 code := '%1\' , haltStmtFix , '\ ^ true.'. |
4924 ] ifFalse:[ |
4924 ] ifFalse:[ |
4925 code := '%1\' , haltStmtFix , '\ ^ false.'. |
4925 code := '%1\' , haltStmtFix , '\ ^ false.'. |
4926 ]. |
4926 ]. |
4927 cat := 'testing'. |
4927 cat := 'testing'. |
4928 ]. |
4928 ]. |
4929 |
4929 |
4930 "/ actualContext receiver isClass ifTrue:[ |
4930 "/ actualContext receiver isClass ifTrue:[ |
4931 "/ selector == #new ifTrue:[ |
4931 "/ selector == #new ifTrue:[ |
4932 "/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
4932 "/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
4934 "/ selector == #'new:' ifTrue:[ |
4934 "/ selector == #'new:' ifTrue:[ |
4935 "/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
4935 "/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
4936 "/ ]. |
4936 "/ ]. |
4937 "/ ]. |
4937 "/ ]. |
4938 code isNil ifTrue:[ |
4938 code isNil ifTrue:[ |
4939 code := '%1\' , haltStmtDef |
4939 code := '%1\' , haltStmtDef |
4940 ]. |
4940 ]. |
4941 |
4941 |
4942 self |
4942 self |
4943 codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs |
4943 codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs |
4944 inClass:receiversClass |
4944 inClass:receiversClass |
4945 unwind:false |
4945 unwind:false |
4946 category:cat |
4946 category:cat |
4947 onCancel:[^ self]. |
4947 onCancel:[^ self]. |
4948 |
4948 |
4949 self doShowSelection:selectionIndex. |
4949 self doShowSelection:selectionIndex. |
4950 restart ifTrue:[ |
4950 restart ifTrue:[ |
4951 self doRestart |
4951 self doRestart |
4952 ] |
4952 ] |
4953 |
4953 |
4954 "Modified: / 23-03-2012 / 09:49:31 / cg" |
4954 "Modified: / 23-03-2012 / 09:49:31 / cg" |
4955 ! |
4955 ! |
4956 |
4956 |
4958 "select the first application-model context. |
4958 "select the first application-model context. |
4959 This is another great helper, when you hit an exception, |
4959 This is another great helper, when you hit an exception, |
4960 to quickly navigate to the responsible code of you application" |
4960 to quickly navigate to the responsible code of you application" |
4961 |
4961 |
4962 contextArray keysAndValuesDo:[:i :c | |
4962 contextArray keysAndValuesDo:[:i :c | |
4963 |nextCon nextRcvr dialog| |
4963 |nextCon nextRcvr dialog| |
4964 |
4964 |
4965 "/ find the first appModel context |
4965 "/ find the first appModel context |
4966 nextCon := contextArray at:i+1. |
4966 nextCon := contextArray at:i+1. |
4967 "/ |
4967 "/ |
4968 "/ while not in the appModel |
4968 "/ while not in the appModel |
4969 "/ |
4969 "/ |
4970 [ |
4970 [ |
4971 nextRcvr := nextCon receiver. |
4971 nextRcvr := nextCon receiver. |
4972 (nextRcvr isKindOf:ApplicationModel) |
4972 (nextRcvr isKindOf:ApplicationModel) |
4973 ] whileFalse:[ |
4973 ] whileFalse:[ |
4974 nextCon := nextCon sender |
4974 nextCon := nextCon sender |
4975 ]. |
4975 ]. |
4976 self selectContext:nextCon. |
4976 self selectContext:nextCon. |
4977 ^ self. |
4977 ^ self. |
4978 ]. |
4978 ]. |
4979 "/ not found |
4979 "/ not found |
4980 gotoApplicationActionMethodButton disable. |
4980 gotoApplicationActionMethodButton disable. |
4981 ! |
4981 ! |
4982 |
4982 |
4984 "select the context where the dialog was opened. |
4984 "select the context where the dialog was opened. |
4985 This is a great helper, when you press interrupt while a modal dialog |
4985 This is a great helper, when you press interrupt while a modal dialog |
4986 is open, to quickly navigate to the corresponding opening code of you application" |
4986 is open, to quickly navigate to the corresponding opening code of you application" |
4987 |
4987 |
4988 contextArray keysAndValuesDo:[:i :c | |
4988 contextArray keysAndValuesDo:[:i :c | |
4989 |nextCon nextRcvr dialog| |
4989 |nextCon nextRcvr dialog| |
4990 |
4990 |
4991 "/ find the openModal, then walk upward |
4991 "/ find the openModal, then walk upward |
4992 ((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[ |
4992 ((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[ |
4993 dialog := c receiver. |
4993 dialog := c receiver. |
4994 nextCon := contextArray at:i+1. |
4994 nextCon := contextArray at:i+1. |
4995 "/ |
4995 "/ |
4996 "/ while still in dialog code |
4996 "/ while still in dialog code |
4997 "/ |
4997 "/ |
4998 [ |
4998 [ |
4999 nextRcvr := nextCon receiver. |
4999 nextRcvr := nextCon receiver. |
5000 (nextRcvr == dialog) |
5000 (nextRcvr == dialog) |
5001 or:[ nextRcvr == dialog class |
5001 or:[ nextRcvr == dialog class |
5002 or:[ nextRcvr == DialogBox ]] |
5002 or:[ nextRcvr == DialogBox ]] |
5003 ] whileTrue:[ |
5003 ] whileTrue:[ |
5004 (nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ |
5004 (nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ |
5005 nextCon := nextCon methodHome |
5005 nextCon := nextCon methodHome |
5006 ]. |
5006 ]. |
5007 nextCon := nextCon sender. |
5007 nextCon := nextCon sender. |
5008 ]. |
5008 ]. |
5009 "/ |
5009 "/ |
5010 "/ while still in a Notification |
5010 "/ while still in a Notification |
5011 "/ |
5011 "/ |
5012 [ |
5012 [ |
5013 nextRcvr := nextCon receiver. |
5013 nextRcvr := nextCon receiver. |
5014 (nextRcvr isKindOf:UserInformation) |
5014 (nextRcvr isKindOf:UserInformation) |
5015 or:[ nextRcvr isBehavior |
5015 or:[ nextRcvr isBehavior |
5016 and:[nextRcvr includesBehavior:UserInformation]] |
5016 and:[nextRcvr includesBehavior:UserInformation]] |
5017 ] whileTrue:[ |
5017 ] whileTrue:[ |
5018 nextCon := nextCon sender |
5018 nextCon := nextCon sender |
5019 ]. |
5019 ]. |
5020 "/ |
5020 "/ |
5021 "/ while still in UIBuilder |
5021 "/ while still in UIBuilder |
5022 "/ |
5022 "/ |
5023 [ |
5023 [ |
5024 nextRcvr := nextCon receiver. |
5024 nextRcvr := nextCon receiver. |
5025 (nextRcvr isKindOf:WindowBuilder) |
5025 (nextRcvr isKindOf:WindowBuilder) |
5026 ] whileTrue:[ |
5026 ] whileTrue:[ |
5027 nextCon := nextCon sender |
5027 nextCon := nextCon sender |
5028 ]. |
5028 ]. |
5029 "/ |
5029 "/ |
5030 "/ while still in SimpleDialog |
5030 "/ while still in SimpleDialog |
5031 "/ |
5031 "/ |
5032 [ |
5032 [ |
5033 nextRcvr := nextCon receiver. |
5033 nextRcvr := nextCon receiver. |
5034 (nextRcvr class == SimpleDialog) |
5034 (nextRcvr class == SimpleDialog) |
5035 ] whileTrue:[ |
5035 ] whileTrue:[ |
5036 nextCon := nextCon sender |
5036 nextCon := nextCon sender |
5037 ]. |
5037 ]. |
5038 "/ |
5038 "/ |
5039 "/ while still in applicationModel support code |
5039 "/ while still in applicationModel support code |
5040 "/ |
5040 "/ |
5041 [ |
5041 [ |
5042 (nextCon selector startsWith:'openDialogSpec'). |
5042 (nextCon selector startsWith:'openDialogSpec'). |
5043 ] whileTrue:[ |
5043 ] whileTrue:[ |
5044 nextCon := nextCon sender |
5044 nextCon := nextCon sender |
5045 ]. |
5045 ]. |
5046 self selectContext:nextCon. |
5046 self selectContext:nextCon. |
5047 ^ self. |
5047 ^ self. |
5048 ] |
5048 ] |
5049 ]. |
5049 ]. |
5050 "/ not found |
5050 "/ not found |
5051 gotoDialogOpenerButton disable. |
5051 gotoDialogOpenerButton disable. |
5052 ! |
5052 ! |
5053 |
5053 |
5059 "single send; reenter with next message send" |
5059 "single send; reenter with next message send" |
5060 |
5060 |
5061 inspecting ifTrue:[^ self]. |
5061 inspecting ifTrue:[^ self]. |
5062 |
5062 |
5063 self checkIfCodeIsReallyModified ifTrue:[ |
5063 self checkIfCodeIsReallyModified ifTrue:[ |
5064 (self confirm:('Code modified - step anyway ?')) |
5064 (self confirm:('Code modified - step anyway ?')) |
5065 ifFalse:[ |
5065 ifFalse:[ |
5066 ^ self |
5066 ^ self |
5067 ] |
5067 ] |
5068 ]. |
5068 ]. |
5069 |
5069 |
5070 canContinue ifTrue:[ |
5070 canContinue ifTrue:[ |
5071 steppedContext := wrapperContext := nil. |
5071 steppedContext := wrapperContext := nil. |
5072 haveControl := false. |
5072 haveControl := false. |
5073 exitAction := #step. |
5073 exitAction := #step. |
5074 |
5074 |
5075 "exit private event-loop" |
5075 "exit private event-loop" |
5076 catchBlock value. |
5076 catchBlock value. |
5077 |
5077 |
5078 "/ not reached |
5078 "/ not reached |
5079 'DebugView [warning]: send failed' errorPrintCR. |
5079 'DebugView [warning]: send failed' errorPrintCR. |
5080 sendButton turnOff. |
5080 sendButton turnOff. |
5081 ] |
5081 ] |
5082 |
5082 |
5083 "Created: / 6.3.1997 / 21:09:36 / cg" |
5083 "Created: / 6.3.1997 / 21:09:36 / cg" |
5084 "Modified: / 29.7.1998 / 21:49:29 / cg" |
5084 "Modified: / 29.7.1998 / 21:49:29 / cg" |
5085 ! |
5085 ! |
5118 "Modified: 7.3.1997 / 18:39:00 / cg" |
5118 "Modified: 7.3.1997 / 18:39:00 / cg" |
5119 ! |
5119 ! |
5120 |
5120 |
5121 doNoTrace |
5121 doNoTrace |
5122 traceView notNil ifTrue:[ |
5122 traceView notNil ifTrue:[ |
5123 traceView topView destroy. |
5123 traceView topView destroy. |
5124 traceView := nil. |
5124 traceView := nil. |
5125 ]. |
5125 ]. |
5126 tracing := false |
5126 tracing := false |
5127 ! |
5127 ! |
5128 |
5128 |
5129 doOpenReportMailApp |
5129 doOpenReportMailApp |
5132 | str | |
5132 | str | |
5133 |
5133 |
5134 str := '' writeStream. |
5134 str := '' writeStream. |
5135 |
5135 |
5136 str nextPutLine:('Error notification from ' |
5136 str nextPutLine:('Error notification from ' |
5137 , OperatingSystem getLoginName |
5137 , OperatingSystem getLoginName |
5138 , '@' |
5138 , '@' |
5139 , OperatingSystem getHostName). |
5139 , OperatingSystem getHostName). |
5140 str cr. |
5140 str cr. |
5141 |
5141 |
5142 str nextPutLine:('Time: ' , Timestamp now printString). |
5142 str nextPutLine:('Time: ' , Timestamp now printString). |
5143 str nextPutLine:('STX Version: ' , Smalltalk versionString). |
5143 str nextPutLine:('STX Version: ' , Smalltalk versionString). |
5144 str nextPutLine:('Description: ' , self label). |
5144 str nextPutLine:('Description: ' , self label). |
5147 "/ str nextPutLine:('Parameter: ', printedException parameter printString). |
5147 "/ str nextPutLine:('Parameter: ', printedException parameter printString). |
5148 str nextPutLine:'Backtrace:'. |
5148 str nextPutLine:'Backtrace:'. |
5149 str cr. |
5149 str cr. |
5150 |
5150 |
5151 firstContext notNil ifTrue:[ |
5151 firstContext notNil ifTrue:[ |
5152 firstContext fullPrintAllOn:str. |
5152 firstContext fullPrintAllOn:str. |
5153 ]. |
5153 ]. |
5154 str cr;cr. |
5154 str cr;cr. |
5155 |
5155 |
5156 SendMailTool |
5156 SendMailTool |
5157 openForMessage:(str contents) |
5157 openForMessage:(str contents) |
5158 withSubject:('STX Error:[', self label, ']') |
5158 withSubject:('STX Error:[', self label, ']') |
5159 preOpenBlock:[:inst| |
5159 preOpenBlock:[:inst| |
5160 inst recipientEntryField value:'error@exept.de' |
5160 inst recipientEntryField value:'error@exept.de' |
5161 ]. |
5161 ]. |
5162 |
5162 |
5163 "Modified: / 20-09-2007 / 12:40:40 / cg" |
5163 "Modified: / 20-09-2007 / 12:40:40 / cg" |
5164 ! |
5164 ! |
5165 |
5165 |
5166 doResend |
5166 doResend |
5167 "resend - the selected context is unwound and its message resent. |
5167 "resend - the selected context is unwound and its message resent. |
5168 To be done after a cde change, to get nto the new method" |
5168 To be done after a cde change, to get nto the new method" |
5169 |
5169 |
5170 self checkIfCodeIsReallyModified ifTrue:[ |
5170 self checkIfCodeIsReallyModified ifTrue:[ |
5171 (self confirm:('Code modified - resend anyway ?')) ifFalse:[ |
5171 (self confirm:('Code modified - resend anyway ?')) ifFalse:[ |
5172 ^ self |
5172 ^ self |
5173 ] |
5173 ] |
5174 ]. |
5174 ]. |
5175 inspecting ifTrue:[ |
5175 inspecting ifTrue:[ |
5176 ^ self showError:'** not avail in inspecting debugger **' |
5176 ^ self showError:'** not avail in inspecting debugger **' |
5177 ]. |
5177 ]. |
5178 steppedContext := wrapperContext := nil. |
5178 steppedContext := wrapperContext := nil. |
5179 haveControl := false. |
5179 haveControl := false. |
5180 exitAction := #resend. "exit private event-loop" |
5180 exitAction := #resend. "exit private event-loop" |
5181 |
5181 |
5189 |
5189 |
5190 doRestart |
5190 doRestart |
5191 "restart - the selected context will be restarted" |
5191 "restart - the selected context will be restarted" |
5192 |
5192 |
5193 self checkIfCodeIsReallyModified ifTrue:[ |
5193 self checkIfCodeIsReallyModified ifTrue:[ |
5194 (self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
5194 (self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
5195 ^ self |
5195 ^ self |
5196 ] |
5196 ] |
5197 ]. |
5197 ]. |
5198 inspecting ifTrue:[ |
5198 inspecting ifTrue:[ |
5199 selectedContext isNil ifTrue:[ |
5199 selectedContext isNil ifTrue:[ |
5200 ^ self showError:'** select a context first **' |
5200 ^ self showError:'** select a context first **' |
5201 ]. |
5201 ]. |
5202 self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
5202 self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
5203 ^ self |
5203 ^ self |
5204 ]. |
5204 ]. |
5205 steppedContext := wrapperContext := nil. |
5205 steppedContext := wrapperContext := nil. |
5206 haveControl := false. |
5206 haveControl := false. |
5207 exitAction := #restart. "exit private event-loop" |
5207 exitAction := #restart. "exit private event-loop" |
5208 |
5208 |
5218 |
5218 |
5219 doReturn |
5219 doReturn |
5220 "return - the selected context will do a ^nil" |
5220 "return - the selected context will do a ^nil" |
5221 |
5221 |
5222 self checkIfCodeIsReallyModified ifTrue:[ |
5222 self checkIfCodeIsReallyModified ifTrue:[ |
5223 (self confirm:('Code modified - return anyway ?')) |
5223 (self confirm:('Code modified - return anyway ?')) |
5224 ifFalse:[ |
5224 ifFalse:[ |
5225 ^ self |
5225 ^ self |
5226 ] |
5226 ] |
5227 ]. |
5227 ]. |
5228 |
5228 |
5229 inspecting ifTrue:[ |
5229 inspecting ifTrue:[ |
5230 selectedContext isNil ifTrue:[ |
5230 selectedContext isNil ifTrue:[ |
5231 ^ self showError:'** select a context first **' |
5231 ^ self showError:'** select a context first **' |
5232 ]. |
5232 ]. |
5233 self interruptProcessWith:[selectedContext unwind:nil]. |
5233 self interruptProcessWith:[selectedContext unwind:nil]. |
5234 ^ self |
5234 ^ self |
5235 ]. |
5235 ]. |
5236 |
5236 |
5237 steppedContext := wrapperContext := nil. |
5237 steppedContext := wrapperContext := nil. |
5238 haveControl := false. |
5238 haveControl := false. |
5239 exitAction := #return. |
5239 exitAction := #return. |
5289 |con method| |
5289 |con method| |
5290 |
5290 |
5291 inspecting ifTrue:[^ self]. |
5291 inspecting ifTrue:[^ self]. |
5292 |
5292 |
5293 self checkIfCodeIsReallyModified ifTrue:[ |
5293 self checkIfCodeIsReallyModified ifTrue:[ |
5294 (self confirm:('Code modified - step anyway ?')) |
5294 (self confirm:('Code modified - step anyway ?')) |
5295 ifFalse:[ |
5295 ifFalse:[ |
5296 ^ self |
5296 ^ self |
5297 ] |
5297 ] |
5298 ]. |
5298 ]. |
5299 |
5299 |
5300 canContinue ifTrue:[ |
5300 canContinue ifTrue:[ |
5301 selectedContext notNil ifTrue:[ |
5301 selectedContext notNil ifTrue:[ |
5302 con := actualContext. "/ selectedContext. |
5302 con := actualContext. "/ selectedContext. |
5303 steppedContextLineno := actualContext lineNumber. |
5303 steppedContextLineno := actualContext lineNumber. |
5304 ] ifFalse:[ |
5304 ] ifFalse:[ |
5305 con := contextArray at:2. |
5305 con := contextArray at:2. |
5306 steppedContextLineno := con lineNumber. |
5306 steppedContextLineno := con lineNumber. |
5307 ]. |
5307 ]. |
5308 |
5308 |
5309 skipLineNr := lineNrOrNilOrMinus1. |
5309 skipLineNr := lineNrOrNilOrMinus1. |
5310 |
5310 |
5311 lineNrOrNilOrMinus1 == -1 ifTrue:[ |
5311 lineNrOrNilOrMinus1 == -1 ifTrue:[ |
5312 steppedContextLineno := skipLineNr := nil. |
5312 steppedContextLineno := skipLineNr := nil. |
5313 ]. |
5313 ]. |
5314 |
5314 |
5315 (stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
5315 (stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
5316 steppedContext := contextArray at:1. |
5316 steppedContext := contextArray at:1. |
5317 stepHow := #nextIn. |
5317 stepHow := #nextIn. |
5318 ] ifFalse:[ |
5318 ] ifFalse:[ |
5319 stepHow == #nextOut ifTrue:[ |
5319 stepHow == #nextOut ifTrue:[ |
5320 steppedContext := con home. |
5320 steppedContext := con home. |
5321 ] ifFalse:[ |
5321 ] ifFalse:[ |
5322 steppedContext := con. |
5322 steppedContext := con. |
5323 ]. |
5323 ]. |
5324 ]. |
5324 ]. |
5325 |
5325 |
5326 wrapperContext := nil. |
5326 wrapperContext := nil. |
5327 |
5327 |
5328 "/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR. |
5328 "/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR. |
5329 |
5329 |
5330 " |
5330 " |
5331 if we step in a wrapped method, |
5331 if we step in a wrapped method, |
5332 prepare to skip the prolog ... |
5332 prepare to skip the prolog ... |
5333 " |
5333 " |
5334 |
5334 |
5335 inWrap := false. |
5335 inWrap := false. |
5336 method := con method. |
5336 method := con method. |
5337 (method notNil |
5337 (method notNil |
5338 and:[method isWrapped |
5338 and:[method isWrapped |
5339 and:[method originalMethod ~~ method]]) ifTrue:[ |
5339 and:[method originalMethod ~~ method]]) ifTrue:[ |
5340 inWrap := true |
5340 inWrap := true |
5341 ]. |
5341 ]. |
5342 |
5342 |
5343 lineNrOrNilOrMinus1 == #return ifTrue:[ |
5343 lineNrOrNilOrMinus1 == #return ifTrue:[ |
5344 Processor activeProcess forceInterruptOnReturnOf:con. |
5344 Processor activeProcess forceInterruptOnReturnOf:con. |
5345 ]. |
5345 ]. |
5346 |
5346 |
5347 con := nil. |
5347 con := nil. |
5348 bigStep := true. |
5348 bigStep := true. |
5349 haveControl := false. |
5349 haveControl := false. |
5350 exitAction := #step. |
5350 exitAction := #step. |
5351 |
5351 |
5352 "exit private event-loop" |
5352 "exit private event-loop" |
5353 catchBlock value. |
5353 catchBlock value. |
5354 |
5354 |
5355 "/ not reached |
5355 "/ not reached |
5356 'DebugView [warning]: step failed' errorPrintCR. |
5356 'DebugView [warning]: step failed' errorPrintCR. |
5357 stepButton turnOff. nextButton turnOff. sendButton turnOff. |
5357 stepButton turnOff. nextButton turnOff. sendButton turnOff. |
5358 ] |
5358 ] |
5359 |
5359 |
5360 "Modified: / 29.7.1998 / 21:50:16 / cg" |
5360 "Modified: / 29.7.1998 / 21:50:16 / cg" |
5361 ! |
5361 ! |
5362 |
5362 |
5367 |
5367 |
5368 doStop |
5368 doStop |
5369 "stop the process (if its running, otherwise this is a no-op)" |
5369 "stop the process (if its running, otherwise this is a no-op)" |
5370 |
5370 |
5371 inspecting ifTrue:[ |
5371 inspecting ifTrue:[ |
5372 self graphicsDevice hasColors ifTrue:[ |
5372 self graphicsDevice hasColors ifTrue:[ |
5373 continueButton foregroundColor:Color green darkened darkened. |
5373 continueButton foregroundColor:Color green darkened darkened. |
5374 ]. |
5374 ]. |
5375 continueButton label:(resources string:'Continue'). |
5375 continueButton label:(resources string:'Continue'). |
5376 continueButton action:[self doContinue]. |
5376 continueButton action:[self doContinue]. |
5377 |
5377 |
5378 self processPerform:#stop. |
5378 self processPerform:#stop. |
5379 |
5379 |
5380 ^ self |
5380 ^ self |
5381 ]. |
5381 ]. |
5382 |
5382 |
5383 "Modified: 20.10.1996 / 18:30:48 / cg" |
5383 "Modified: 20.10.1996 / 18:30:48 / cg" |
5384 ! |
5384 ! |
5385 |
5385 |
5386 doTerminate |
5386 doTerminate |
5387 "terminate - the process has a chance for cleanup" |
5387 "terminate - the process has a chance for cleanup" |
5388 |
5388 |
5389 self checkIfCodeIsReallyModified ifTrue:[ |
5389 self checkIfCodeIsReallyModified ifTrue:[ |
5390 (self confirm:('Code modified - terminate anyway ?')) |
5390 (self confirm:('Code modified - terminate anyway ?')) |
5391 ifFalse:[ |
5391 ifFalse:[ |
5392 ^ self |
5392 ^ self |
5393 ] |
5393 ] |
5394 ]. |
5394 ]. |
5395 |
5395 |
5396 inspecting ifTrue:[ |
5396 inspecting ifTrue:[ |
5397 self processPerform:#terminate. |
5397 self processPerform:#terminate. |
5398 ^ self |
5398 ^ self |
5399 ]. |
5399 ]. |
5400 |
5400 |
5401 steppedContext := wrapperContext := nil. |
5401 steppedContext := wrapperContext := nil. |
5402 haveControl := false. |
5402 haveControl := false. |
5403 exitAction := #terminate. |
5403 exitAction := #terminate. |
5405 "exit private event-loop" |
5405 "exit private event-loop" |
5406 catchBlock value. |
5406 catchBlock value. |
5407 |
5407 |
5408 "/ not reached (normally) |
5408 "/ not reached (normally) |
5409 inspecting ifFalse:[ |
5409 inspecting ifFalse:[ |
5410 'DebugView [warning]: terminate failed' errorPrintCR. |
5410 'DebugView [warning]: terminate failed' errorPrintCR. |
5411 (self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
5411 (self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
5412 Debugger newDebugger. |
5412 Debugger newDebugger. |
5413 Processor activeProcess terminate. |
5413 Processor activeProcess terminate. |
5414 ] |
5414 ] |
5415 ]. |
5415 ]. |
5416 terminateButton turnOff. |
5416 terminateButton turnOff. |
5417 |
5417 |
5418 "Modified: / 29.7.1998 / 21:50:35 / cg" |
5418 "Modified: / 29.7.1998 / 21:50:35 / cg" |
5419 ! |
5419 ! |
5449 |
5449 |
5450 doTraceStep |
5450 doTraceStep |
5451 "tracestep - not implemented yet" |
5451 "tracestep - not implemented yet" |
5452 |
5452 |
5453 canContinue ifTrue:[ |
5453 canContinue ifTrue:[ |
5454 tracing := true. |
5454 tracing := true. |
5455 self doStep |
5455 self doStep |
5456 ] |
5456 ] |
5457 ! |
5457 ! |
5458 |
5458 |
5459 exit |
5459 exit |
5460 "exit from menu: immediate exit from smalltalk" |
5460 "exit from menu: immediate exit from smalltalk" |
5468 con := self selectedContext. |
5468 con := self selectedContext. |
5469 con isNil ifTrue:[^ self]. |
5469 con isNil ifTrue:[^ self]. |
5470 |
5470 |
5471 con := con sender. |
5471 con := con sender. |
5472 [con notNil] whileTrue:[ |
5472 [con notNil] whileTrue:[ |
5473 (aBlock value:con) ifTrue:[ |
5473 (aBlock value:con) ifTrue:[ |
5474 (self selectContext:con) ifTrue:[ |
5474 (self selectContext:con) ifTrue:[ |
5475 additionalAction value:con. |
5475 additionalAction value:con. |
5476 ^ self. |
5476 ^ self. |
5477 ] |
5477 ] |
5478 ]. |
5478 ]. |
5479 con := con sender. |
5479 con := con sender. |
5480 ]. |
5480 ]. |
5481 |
5481 |
5482 Dialog information:'None found'. |
5482 Dialog information:'None found'. |
5483 ! |
5483 ! |
5484 |
5484 |
5486 |stringToSearch source| |
5486 |stringToSearch source| |
5487 |
5487 |
5488 stringToSearch := Dialog request:'Search what:'. |
5488 stringToSearch := Dialog request:'Search what:'. |
5489 stringToSearch isEmptyOrNil ifTrue:[^ self]. |
5489 stringToSearch isEmptyOrNil ifTrue:[^ self]. |
5490 |
5490 |
5491 self |
5491 self |
5492 findContextForWhich:[:con | |
5492 findContextForWhich:[:con | |
5493 con method notNil |
5493 con method notNil |
5494 and:[ (source := con method source) notNil |
5494 and:[ (source := con method source) notNil |
5495 and:[ (source includesString:stringToSearch) ]] |
5495 and:[ (source includesString:stringToSearch) ]] |
5496 ] |
5496 ] |
5497 thenDo:[:con | |
5497 thenDo:[:con | |
5498 codeView searchFwd:stringToSearch. |
5498 codeView searchFwd:stringToSearch. |
5499 ] |
5499 ] |
5500 ! |
5500 ! |
5501 |
5501 |
5502 findContextWithValueInVariable |
5502 findContextWithValueInVariable |
5503 |valueStringToSearch| |
5503 |valueStringToSearch| |
5504 |
5504 |
5505 valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'. |
5505 valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'. |
5506 valueStringToSearch isEmptyOrNil ifTrue:[^ self]. |
5506 valueStringToSearch isEmptyOrNil ifTrue:[^ self]. |
5507 |
5507 |
5508 self |
5508 self |
5509 findContextForWhich:[:con | |
5509 findContextForWhich:[:con | |
5510 con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase] |
5510 con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase] |
5511 ] |
5511 ] |
5512 thenDo:[:con | ] |
5512 thenDo:[:con | ] |
5513 ! |
5513 ! |
5514 |
5514 |
5515 findHandlerFor |
5515 findHandlerFor |
5516 |exClass con| |
5516 |exClass con| |
5517 |
5517 |
5518 (con := self selectedContext) isNil ifTrue:[ |
5518 (con := self selectedContext) isNil ifTrue:[ |
5519 con := contextArray at:1 |
5519 con := contextArray at:1 |
5520 ]. |
5520 ]. |
5521 con sender isNil ifTrue:[ |
5521 con sender isNil ifTrue:[ |
5522 self information:'Context has already returned'. |
5522 self information:'Context has already returned'. |
5523 ^ self |
5523 ^ self |
5524 ]. |
5524 ]. |
5525 |
5525 |
5526 exClass := Dialog |
5526 exClass := Dialog |
5527 choose:'Exception class:' |
5527 choose:'Exception class:' |
5528 fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name]) |
5528 fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name]) |
5529 lines:25 |
5529 lines:25 |
5530 title:'Choose Exception class'. |
5530 title:'Choose Exception class'. |
5531 exClass isNil ifTrue:[^ self]. |
5531 exClass isNil ifTrue:[^ self]. |
5532 |
5532 |
5533 self |
5533 self |
5534 findContextForWhich:[:con | |
5534 findContextForWhich:[:con | |
5535 con isHandleContext |
5535 con isHandleContext |
5536 and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] |
5536 and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] |
5537 ] |
5537 ] |
5538 thenDo:[:con | |
5538 thenDo:[:con | |
5539 self selectContext:con sender. |
5539 self selectContext:con sender. |
5540 ] |
5540 ] |
5541 ! |
5541 ! |
5542 |
5542 |
5543 findHomeContext |
5543 findHomeContext |
5544 |con home| |
5544 |con home| |
5545 |
5545 |
5546 (con := self selectedContext) isNil ifTrue:[ |
5546 (con := self selectedContext) isNil ifTrue:[ |
5547 self beep. |
5547 self beep. |
5548 ^ self. |
5548 ^ self. |
5549 ]. |
5549 ]. |
5550 (home := con home) isNil ifTrue:[ |
5550 (home := con home) isNil ifTrue:[ |
5551 self beep. |
5551 self beep. |
5552 ^ self. |
5552 ^ self. |
5553 ]. |
5553 ]. |
5554 |
5554 |
5555 "/ still have to find it - home could be elsewhere (another process) |
5555 "/ still have to find it - home could be elsewhere (another process) |
5556 "/ (i.e. cannot simply select it) |
5556 "/ (i.e. cannot simply select it) |
5557 |
5557 |
5558 self |
5558 self |
5559 findContextForWhich:[:con | |
5559 findContextForWhich:[:con | |
5560 con == home |
5560 con == home |
5561 ] |
5561 ] |
5562 thenDo:[:con | |
5562 thenDo:[:con | |
5563 self selectContext:con. |
5563 self selectContext:con. |
5564 ] |
5564 ] |
5565 ! |
5565 ! |
5566 |
5566 |
5567 findNextExceptionHandlerContext |
5567 findNextExceptionHandlerContext |
5568 self |
5568 self |
5569 findContextForWhich:[:con | |
5569 findContextForWhich:[:con | |
5570 con isHandleContext |
5570 con isHandleContext |
5571 ] |
5571 ] |
5572 thenDo:[:con | |
5572 thenDo:[:con | |
5573 self selectContext:con sender. |
5573 self selectContext:con sender. |
5574 ] |
5574 ] |
5575 ! |
5575 ! |
5576 |
5576 |
5577 inspectContext |
5577 inspectContext |
5578 "launch an inspector on the currently selected context" |
5578 "launch an inspector on the currently selected context" |
5579 |
5579 |
5580 |con| |
5580 |con| |
5581 |
5581 |
5582 (con := self selectedContext) notNil ifTrue:[ |
5582 (con := self selectedContext) notNil ifTrue:[ |
5583 con inspect. |
5583 con inspect. |
5584 ] |
5584 ] |
5585 |
5585 |
5586 "Modified: / 17-07-2012 / 12:52:34 / cg" |
5586 "Modified: / 17-07-2012 / 12:52:34 / cg" |
5587 ! |
5587 ! |
5588 |
5588 |
5590 "launch an inspector on the currently selected context's method" |
5590 "launch an inspector on the currently selected context's method" |
5591 |
5591 |
5592 |con| |
5592 |con| |
5593 |
5593 |
5594 (con := self selectedContext) notNil ifTrue:[ |
5594 (con := self selectedContext) notNil ifTrue:[ |
5595 con method inspect. |
5595 con method inspect. |
5596 ] |
5596 ] |
5597 ! |
5597 ! |
5598 |
5598 |
5599 inspectWidgetHierarchy |
5599 inspectWidgetHierarchy |
5600 |rcvr view| |
5600 |rcvr view| |
5601 |
5601 |
5602 selectedContext isNil ifTrue:[ ^ self ]. |
5602 selectedContext isNil ifTrue:[ ^ self ]. |
5603 Tools::ViewTreeInspectorApplication isNil ifTrue:[ |
5603 Tools::ViewTreeInspectorApplication isNil ifTrue:[ |
5604 Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'. |
5604 Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'. |
5605 ^ self. |
5605 ^ self. |
5606 ]. |
5606 ]. |
5607 |
5607 |
5608 rcvr := selectedContext receiver. |
5608 rcvr := selectedContext receiver. |
5609 rcvr isView ifTrue:[ |
5609 rcvr isView ifTrue:[ |
5610 view := rcvr |
5610 view := rcvr |
5611 ] ifFalse:[ |
5611 ] ifFalse:[ |
5612 view := rcvr window |
5612 view := rcvr window |
5613 ]. |
5613 ]. |
5614 Tools::ViewTreeInspectorApplication openOn:view |
5614 Tools::ViewTreeInspectorApplication openOn:view |
5615 ! |
5615 ! |
5616 |
5616 |
5617 middleButtonMenu |
5617 middleButtonMenu |
5618 <resource: #programMenu > |
5618 <resource: #programMenu > |
5619 |
5619 |
5620 |items m nameOfExecutable| |
5620 |items m nameOfExecutable| |
5621 |
5621 |
5622 exclusive ifTrue:[ |
5622 exclusive ifTrue:[ |
5623 items := #( |
5623 items := #( |
5624 ('Show More WalkBack' showMore ) |
5624 ('Show More WalkBack' showMore ) |
5625 ('-' ) |
5625 ('-' ) |
5626 ('Add Breakpoint' addBreakpoint ) |
5626 ('Add Breakpoint' addBreakpoint ) |
5627 ('Remove Breakpoint' removeBreakpoint ) |
5627 ('Remove Breakpoint' removeBreakpoint ) |
5628 ('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
5628 ('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
5629 ('-' ) |
5629 ('-' ) |
5630 ). |
5630 ). |
5631 ] ifFalse:[ |
5631 ] ifFalse:[ |
5632 items := #( |
5632 items := #( |
5633 ('Show More WalkBack' showMore ) |
5633 ('Show More WalkBack' showMore ) |
5634 ('-' ) |
5634 ('-' ) |
5635 ('Skip' skip ) |
5635 ('Skip' skip ) |
5636 ('Step Out' skipForReturn ) |
5636 ('Step Out' skipForReturn ) |
5637 ('Skip until Entering...' skipUntilEntering ) |
5637 ('Skip until Entering...' skipUntilEntering ) |
5638 ('-' ) |
5638 ('-' ) |
5639 " |
5639 " |
5640 ('Continue' doContinue ) |
5640 ('Continue' doContinue ) |
5641 ('Terminate' doTerminate ) |
5641 ('Terminate' doTerminate ) |
5642 ('Abort' doAbort ) |
5642 ('Abort' doAbort ) |
5643 ('-' ) |
5643 ('-' ) |
5644 ('Step' doStep ) |
5644 ('Step' doStep ) |
5645 ('Send' doSend ) |
5645 ('Send' doSend ) |
5646 ('-' ) |
5646 ('-' ) |
5647 ('Return' doReturn ) |
5647 ('Return' doReturn ) |
5648 ('Restart' doRestart ) |
5648 ('Restart' doRestart ) |
5649 ('-' ) |
5649 ('-' ) |
5650 " |
5650 " |
5651 ('Add Breakpoint' addBreakpoint ) |
5651 ('Add Breakpoint' addBreakpoint ) |
5652 ('Remove Breakpoint' removeBreakpoint ) |
5652 ('Remove Breakpoint' removeBreakpoint ) |
5653 ('Remove all Break- & Tracepoints' removeAllBreakpoints ) |
5653 ('Remove all Break- & Tracepoints' removeAllBreakpoints ) |
5654 ). |
5654 ). |
5655 |
5655 |
5656 "/ self allowBreakPointsInDebugger ifFalse:[ |
5656 "/ self allowBreakPointsInDebugger ifFalse:[ |
5657 "/ items := items , #( |
5657 "/ items := items , #( |
5658 "/ ('Allow Breakpoints & halt in Debugger' doNotIgnoreBreakpoints ) |
5658 "/ ('Allow Breakpoints & halt in Debugger' doNotIgnoreBreakpoints ) |
5659 "/ ). |
5659 "/ ). |
5661 "/ items := items , #( |
5661 "/ items := items , #( |
5662 "/ ('Ignore Breakpoints & halt in Debugger' doIgnoreBreakpoints ) |
5662 "/ ('Ignore Breakpoints & halt in Debugger' doIgnoreBreakpoints ) |
5663 "/ ). |
5663 "/ ). |
5664 "/ ]. |
5664 "/ ]. |
5665 |
5665 |
5666 items := items , #( |
5666 items := items , #( |
5667 ('-' ) |
5667 ('-' ) |
5668 ('Browse Implementing Class' browseImplementingClass ) |
5668 ('Browse Implementing Class' browseImplementingClass ) |
5669 ('Browse Receiver''s Class' browseReceiversClass ) |
5669 ('Browse Receiver''s Class' browseReceiversClass ) |
5670 ('Browse Blocks''s Home' browseBlocksHome ) |
5670 ('Browse Blocks''s Home' browseBlocksHome ) |
5671 "/ ('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
5671 "/ ('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
5672 "/ ('Browse Receivers Full Protocol' browseFullClassProtocol ) |
5672 "/ ('Browse Receivers Full Protocol' browseFullClassProtocol ) |
5673 ('Implementors' browseImplementors ) |
5673 ('Implementors' browseImplementors ) |
5674 ('Implementors Of...' browseImplementorsOf ) |
5674 ('Implementors Of...' browseImplementorsOf ) |
5675 ('Senders' browseSenders ) |
5675 ('Senders' browseSenders ) |
5676 ('Senders Of...' browseSendersOf ) |
5676 ('Senders Of...' browseSendersOf ) |
5677 ('-' ) |
5677 ('-' ) |
5678 ('Inspect Context' inspectContext ) |
5678 ('Inspect Context' inspectContext ) |
5679 ). |
5679 ). |
5680 ]. |
5680 ]. |
5681 |
5681 |
5682 items := items , #( |
5682 items := items , #( |
5683 ('Copy WalkBack Text' copyWalkbackText ) |
5683 ('Copy WalkBack Text' copyWalkbackText ) |
5684 ('-' ) |
5684 ('-' ) |
5685 ('Hard Terminate (Danger)' quickTerminate ) |
5685 ('Hard Terminate (Danger)' quickTerminate ) |
5686 ('=' )). |
5686 ('=' )). |
5687 |
5687 |
5688 nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
5688 nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
5689 nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
5689 nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
5690 |
5690 |
5691 items := items , { |
5691 items := items , { |
5692 { 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
5692 { 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
5693 |
5693 |
5694 m := PopUpMenu |
5694 m := PopUpMenu |
5695 itemList:items |
5695 itemList:items |
5696 resources:resources |
5696 resources:resources |
5697 receiver:self |
5697 receiver:self |
5698 for:contextView. |
5698 for:contextView. |
5699 |
5699 |
5700 inspecting ifTrue:[ |
5700 inspecting ifTrue:[ |
5701 m notNil ifTrue:[ |
5701 m notNil ifTrue:[ |
5702 m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
5702 m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
5703 browseClassHierarchy browseFullClassProtocol |
5703 browseClassHierarchy browseFullClassProtocol |
5704 browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut). |
5704 browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut). |
5705 ]. |
5705 ]. |
5706 ]. |
5706 ]. |
5707 self updateMenuItems. |
5707 self updateMenuItems. |
5708 |
5708 |
5709 ^ m. |
5709 ^ m. |
5710 |
5710 |
5731 |
5731 |
5732 openSettingsDialog |
5732 openSettingsDialog |
5733 |settingsList| |
5733 |settingsList| |
5734 |
5734 |
5735 settingsList := |
5735 settingsList := |
5736 #( |
5736 #( |
5737 #('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
5737 #('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
5738 #('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
5738 #('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
5739 #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
5739 #('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
5740 #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
5740 #('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
5741 ). |
5741 ). |
5742 |
5742 |
5743 SettingsDialog |
5743 SettingsDialog |
5744 openWithList:settingsList |
5744 openWithList:settingsList |
5745 label:(resources string:'Debugger Settings'). |
5745 label:(resources string:'Debugger Settings'). |
5746 ! |
5746 ! |
5747 |
5747 |
5748 processesApplication |
5748 processesApplication |
5749 "if the debugged process is a GUI process, |
5749 "if the debugged process is a GUI process, |
5750 AND it has an applicaiton, return it. |
5750 AND it has an applicaiton, return it. |
5752 |
5752 |
5753 |p wgs app nonModalWGs| |
5753 |p wgs app nonModalWGs| |
5754 |
5754 |
5755 p := inspectedProcess ? Processor activeProcess. |
5755 p := inspectedProcess ? Processor activeProcess. |
5756 (p notNil and:[p isGUIProcess]) ifTrue:[ |
5756 (p notNil and:[p isGUIProcess]) ifTrue:[ |
5757 wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p]. |
5757 wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p]. |
5758 nonModalWGs := wgs reject:[:wg | wg isModal]. |
5758 nonModalWGs := wgs reject:[:wg | wg isModal]. |
5759 nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application]. |
5759 nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application]. |
5760 |
5760 |
5761 wgs do:[:wg | |
5761 wgs do:[:wg | |
5762 |wgi| |
5762 |wgi| |
5763 |
5763 |
5764 wgi := wg. |
5764 wgi := wg. |
5765 [wgi notNil] whileTrue:[ |
5765 [wgi notNil] whileTrue:[ |
5766 (app := wgi application) notNil ifTrue:[^ app]. |
5766 (app := wgi application) notNil ifTrue:[^ app]. |
5767 wgi isModal ifTrue:[ |
5767 wgi isModal ifTrue:[ |
5768 wgi := wgi previousGroup |
5768 wgi := wgi previousGroup |
5769 ] ifFalse:[ |
5769 ] ifFalse:[ |
5770 wgi := nil. |
5770 wgi := nil. |
5771 ] |
5771 ] |
5772 ] |
5772 ] |
5773 ] |
5773 ] |
5774 ]. |
5774 ]. |
5775 ^ nil |
5775 ^ nil |
5776 ! |
5776 ! |
5777 |
5777 |
5778 quickTerminate |
5778 quickTerminate |
5779 "quick terminate - the process will get no chance for cleanup actions" |
5779 "quick terminate - the process will get no chance for cleanup actions" |
5780 |
5780 |
5781 inspecting ifTrue:[ |
5781 inspecting ifTrue:[ |
5782 self processPerform:#terminateNoSignal. |
5782 self processPerform:#terminateNoSignal. |
5783 ^ self |
5783 ^ self |
5784 ]. |
5784 ]. |
5785 |
5785 |
5786 steppedContext := wrapperContext := nil. |
5786 steppedContext := wrapperContext := nil. |
5787 haveControl := false. |
5787 haveControl := false. |
5788 exitAction := #quickTerminate. |
5788 exitAction := #quickTerminate. |
5790 "exit private event-loop" |
5790 "exit private event-loop" |
5791 catchBlock value. |
5791 catchBlock value. |
5792 |
5792 |
5793 "/ not reached (normally) |
5793 "/ not reached (normally) |
5794 inspecting ifFalse:[ |
5794 inspecting ifFalse:[ |
5795 'DebugView [warning]: quick terminate failed' errorPrintCR. |
5795 'DebugView [warning]: quick terminate failed' errorPrintCR. |
5796 (self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
5796 (self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
5797 Debugger newDebugger. |
5797 Debugger newDebugger. |
5798 Processor activeProcess terminateNoSignal. |
5798 Processor activeProcess terminateNoSignal. |
5799 ] |
5799 ] |
5800 ]. |
5800 ]. |
5801 terminateButton turnOff. |
5801 terminateButton turnOff. |
5802 |
5802 |
5803 "Modified: 10.1.1997 / 17:42:10 / cg" |
5803 "Modified: 10.1.1997 / 17:42:10 / cg" |
5804 ! |
5804 ! |
5817 selectContext:aContext |
5817 selectContext:aContext |
5818 |idx| |
5818 |idx| |
5819 |
5819 |
5820 idx := contextArray identityIndexOf:aContext. |
5820 idx := contextArray identityIndexOf:aContext. |
5821 idx == 0 ifTrue:[ |
5821 idx == 0 ifTrue:[ |
5822 "/ some contexts hidden? |
5822 "/ some contexts hidden? |
5823 (self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[ |
5823 (self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[ |
5824 Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'. |
5824 Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'. |
5825 self showFullWalkback. |
5825 self showFullWalkback. |
5826 self showingDenseWalkback:false. |
5826 self showingDenseWalkback:false. |
5827 self showingSupportCode:true. |
5827 self showingSupportCode:true. |
5828 ]. |
5828 ]. |
5829 idx := contextArray identityIndexOf:aContext. |
5829 idx := contextArray identityIndexOf:aContext. |
5830 ]. |
5830 ]. |
5831 idx ~~ 0 ifTrue:[ |
5831 idx ~~ 0 ifTrue:[ |
5832 self selectContextWithIndex:idx. |
5832 self selectContextWithIndex:idx. |
5833 ^ true. |
5833 ^ true. |
5834 ]. |
5834 ]. |
5835 ^ false |
5835 ^ false |
5836 ! |
5836 ! |
5837 |
5837 |
5838 selectedContext |
5838 selectedContext |
5839 contextView selection notNil ifTrue:[ |
5839 contextView selection notNil ifTrue:[ |
5840 (contextView selectionValue startsWith:'**') ifFalse:[ |
5840 (contextView selectionValue startsWith:'**') ifFalse:[ |
5841 ^ (contextArray at:(contextView selection)). |
5841 ^ (contextArray at:(contextView selection)). |
5842 ] |
5842 ] |
5843 ]. |
5843 ]. |
5844 ^ nil |
5844 ^ nil |
5845 |
5845 |
5846 "Created: / 17-07-2012 / 12:52:10 / cg" |
5846 "Created: / 17-07-2012 / 12:52:10 / cg" |
5847 ! |
5847 ! |
5848 |
5848 |
5849 showFullWalkback |
5849 showFullWalkback |
5850 "double the number of contexts shown" |
5850 "double the number of contexts shown" |
5851 |
5851 |
5852 contextArray notNil ifTrue:[ |
5852 contextArray notNil ifTrue:[ |
5853 nChainShown := 9999. |
5853 nChainShown := 9999. |
5854 self redisplayBacktrace. |
5854 self redisplayBacktrace. |
5855 ] |
5855 ] |
5856 |
5856 |
5857 "Created: / 23-07-2012 / 12:24:02 / cg" |
5857 "Created: / 23-07-2012 / 12:24:02 / cg" |
5858 ! |
5858 ! |
5859 |
5859 |
5860 showMore |
5860 showMore |
5861 "double the number of contexts shown" |
5861 "double the number of contexts shown" |
5862 |
5862 |
5863 contextArray notNil ifTrue:[ |
5863 contextArray notNil ifTrue:[ |
5864 nChainShown := nChainShown * 2. |
5864 nChainShown := nChainShown * 2. |
5865 self redisplayBacktrace. |
5865 self redisplayBacktrace. |
5866 ] |
5866 ] |
5867 |
5867 |
5868 "Modified: / 17.11.2001 / 20:14:31 / cg" |
5868 "Modified: / 17.11.2001 / 20:14:31 / cg" |
5869 ! |
5869 ! |
5870 |
5870 |
5940 "skip until some particular method is invoked." |
5940 "skip until some particular method is invoked." |
5941 |
5941 |
5942 |selector| |
5942 |selector| |
5943 |
5943 |
5944 selector := Dialog |
5944 selector := Dialog |
5945 request:'Skip until entering what (matchpattern):' |
5945 request:'Skip until entering what (matchpattern):' |
5946 initialAnswer:self goodSkipUntilSelector. |
5946 initialAnswer:self goodSkipUntilSelector. |
5947 selector size == 0 ifTrue:[^ self]. |
5947 selector size == 0 ifTrue:[^ self]. |
5948 |
5948 |
5949 stepUntilEntering := selector asSymbol. |
5949 stepUntilEntering := selector asSymbol. |
5950 stepHow := #send. |
5950 stepHow := #send. |
5951 self doStep:-1. |
5951 self doStep:-1. |
5953 "Modified: 3.3.1997 / 20:56:32 / cg" |
5953 "Modified: 3.3.1997 / 20:56:32 / cg" |
5954 ! |
5954 ! |
5955 |
5955 |
5956 toggleShowSupportCode |
5956 toggleShowSupportCode |
5957 hideSupportCode ifTrue:[ |
5957 hideSupportCode ifTrue:[ |
5958 self showSupportCode |
5958 self showSupportCode |
5959 ] ifFalse:[ |
5959 ] ifFalse:[ |
5960 self hideSupportCode |
5960 self hideSupportCode |
5961 ]. |
5961 ]. |
5962 |
5962 |
5963 "Modified: / 17-11-2001 / 20:07:45 / cg" |
5963 "Modified: / 17-11-2001 / 20:07:45 / cg" |
5964 "Created: / 10-06-2012 / 21:28:17 / cg" |
5964 "Created: / 10-06-2012 / 21:28:17 / cg" |
5965 ! |
5965 ! |
5975 |
5975 |
5976 |m mthd cls mCls rCls| |
5976 |m mthd cls mCls rCls| |
5977 |
5977 |
5978 m := contextView middleButtonMenu. |
5978 m := contextView middleButtonMenu. |
5979 m notNil ifTrue:[ |
5979 m notNil ifTrue:[ |
5980 m disable:#removeBreakpoint. |
5980 m disable:#removeBreakpoint. |
5981 m disable:#addBreakpoint. |
5981 m disable:#addBreakpoint. |
5982 canShowMore ifFalse:[ |
5982 canShowMore ifFalse:[ |
5983 m disable:#showMore |
5983 m disable:#showMore |
5984 ]. |
5984 ]. |
5985 |
5985 |
5986 selectedContext notNil ifTrue:[ |
5986 selectedContext notNil ifTrue:[ |
5987 m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
5987 m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
5988 |
5988 |
5989 mthd := selectedContext method. |
5989 mthd := selectedContext method. |
5990 mthd notNil ifTrue:[ |
5990 mthd notNil ifTrue:[ |
5991 cls := mCls := mthd containingClass. |
5991 cls := mCls := mthd containingClass. |
5992 mthd isBreakpointed ifTrue:[ |
5992 mthd isBreakpointed ifTrue:[ |
5993 m enable:#removeBreakpoint. |
5993 m enable:#removeBreakpoint. |
5994 ] ifFalse:[ |
5994 ] ifFalse:[ |
5995 m enable:#addBreakpoint. |
5995 m enable:#addBreakpoint. |
5996 ] |
5996 ] |
5997 ]. |
5997 ]. |
5998 (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[ |
5998 (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[ |
5999 "/ a cheap block's context |
5999 "/ a cheap block's context |
6000 ] ifFalse:[ |
6000 ] ifFalse:[ |
6001 rCls := selectedContext receiver class. |
6001 rCls := selectedContext receiver class. |
6002 cls isNil ifTrue:[ |
6002 cls isNil ifTrue:[ |
6003 cls := rCls |
6003 cls := rCls |
6004 ]. |
6004 ]. |
6005 ]. |
6005 ]. |
6006 cls notNil ifTrue:[ |
6006 cls notNil ifTrue:[ |
6007 m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
6007 m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
6008 rCls == mCls ifTrue:[ |
6008 rCls == mCls ifTrue:[ |
6009 m disable:#browseReceiversClass |
6009 m disable:#browseReceiversClass |
6010 ]. |
6010 ]. |
6011 mCls isNil ifTrue:[ |
6011 mCls isNil ifTrue:[ |
6012 m disable:#browseImplementingClass |
6012 m disable:#browseImplementingClass |
6013 ] |
6013 ] |
6014 |
6014 |
6015 ] ifFalse:[ |
6015 ] ifFalse:[ |
6016 m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
6016 m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
6017 ]. |
6017 ]. |
6018 mthd notNil ifTrue:[ |
6018 mthd notNil ifTrue:[ |
6019 m enableAll:#(browseImplementingClass). |
6019 m enableAll:#(browseImplementingClass). |
6020 ]. |
6020 ]. |
6021 selectedContext isCheapBlockContext ifTrue:[ |
6021 selectedContext isCheapBlockContext ifTrue:[ |
6022 m disableAll:#(browseReceiversClass). |
6022 m disableAll:#(browseReceiversClass). |
6023 ]. |
6023 ]. |
6024 selectedContext receiver isBlock ifTrue:[ |
6024 selectedContext receiver isBlock ifTrue:[ |
6025 m enableAll:#(browseBlocksHome). |
6025 m enableAll:#(browseBlocksHome). |
6026 ] ifFalse:[ |
6026 ] ifFalse:[ |
6027 m disableAll:#(browseBlocksHome). |
6027 m disableAll:#(browseBlocksHome). |
6028 ]. |
6028 ]. |
6029 ] ifFalse:[ |
6029 ] ifFalse:[ |
6030 m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy |
6030 m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy |
6031 browseBlocksHome browseFullClassProtocol). |
6031 browseBlocksHome browseFullClassProtocol). |
6032 ] |
6032 ] |
6033 ] |
6033 ] |
6034 |
6034 |
6035 "Modified: / 19-07-2012 / 11:53:30 / cg" |
6035 "Modified: / 19-07-2012 / 11:53:30 / cg" |
6036 ! ! |
6036 ! ! |
6037 |
6037 |
6041 "add a breakpoint on the selected contexts method - if any" |
6041 "add a breakpoint on the selected contexts method - if any" |
6042 |
6042 |
6043 |implementorClass method| |
6043 |implementorClass method| |
6044 |
6044 |
6045 selectedContext isNil ifTrue:[ |
6045 selectedContext isNil ifTrue:[ |
6046 ^ self showError:'** select a context first **' |
6046 ^ self showError:'** select a context first **' |
6047 ]. |
6047 ]. |
6048 (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
6048 (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
6049 ^ self |
6049 ^ self |
6050 ]. |
6050 ]. |
6051 |
6051 |
6052 implementorClass := selectedContext methodClass. |
6052 implementorClass := selectedContext methodClass. |
6053 implementorClass notNil ifTrue:[ |
6053 implementorClass notNil ifTrue:[ |
6054 method := implementorClass compiledMethodAt:selectedContext selector. |
6054 method := implementorClass compiledMethodAt:selectedContext selector. |
6055 (method notNil and:[method isBreakpointed not]) ifTrue:[ |
6055 (method notNil and:[method isBreakpointed not]) ifTrue:[ |
6056 method setBreakPoint |
6056 method setBreakPoint |
6057 ] |
6057 ] |
6058 ]. |
6058 ]. |
6059 contextView middleButtonMenu disable:#addBreakpoint. |
6059 contextView middleButtonMenu disable:#addBreakpoint. |
6060 contextView middleButtonMenu enable:#removeBreakpoint. |
6060 contextView middleButtonMenu enable:#removeBreakpoint. |
6061 |
6061 |
6062 "Modified: / 13.1.1998 / 00:24:47 / cg" |
6062 "Modified: / 13.1.1998 / 00:24:47 / cg" |
6079 doNotIgnoreBreakpoints |
6079 doNotIgnoreBreakpoints |
6080 self allowBreakPointsInDebugger:true |
6080 self allowBreakPointsInDebugger:true |
6081 ! |
6081 ! |
6082 |
6082 |
6083 ignoreAllHaltsForCurrentProcess |
6083 ignoreAllHaltsForCurrentProcess |
6084 self |
6084 self |
6085 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6085 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6086 orThisReceiverClass:false orCurrentProcess:true |
6086 orThisReceiverClass:false orCurrentProcess:true |
6087 orIfCalledFromMethod:nil |
6087 orIfCalledFromMethod:nil |
6088 forAll:true. |
6088 forAll:true. |
6089 |
6089 |
6090 "Created: / 27-01-2012 / 11:32:14 / cg" |
6090 "Created: / 27-01-2012 / 11:32:14 / cg" |
6091 ! |
6091 ! |
6092 |
6092 |
6093 ignoreAllHaltsForThisReceiverClass |
6093 ignoreAllHaltsForThisReceiverClass |
6094 self |
6094 self |
6095 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6095 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6096 orThisReceiverClass:true orCurrentProcess:false |
6096 orThisReceiverClass:true orCurrentProcess:false |
6097 orIfCalledFromMethod:nil |
6097 orIfCalledFromMethod:nil |
6098 forAll:true. |
6098 forAll:true. |
6099 |
6099 |
6100 "Created: / 27-01-2012 / 11:32:14 / cg" |
6100 "Created: / 27-01-2012 / 11:32:14 / cg" |
6101 ! |
6101 ! |
6102 |
6102 |
6103 ignoreAllHaltsForever |
6103 ignoreAllHaltsForever |
6104 self |
6104 self |
6105 addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
6105 addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
6106 orThisReceiverClass:false orCurrentProcess:false |
6106 orThisReceiverClass:false orCurrentProcess:false |
6107 orIfCalledFromMethod:nil |
6107 orIfCalledFromMethod:nil |
6108 forAll:true. |
6108 forAll:true. |
6109 |
6109 |
6110 "Created: / 08-05-2011 / 10:19:56 / cg" |
6110 "Created: / 08-05-2011 / 10:19:56 / cg" |
6111 ! |
6111 ! |
6112 |
6112 |
6113 ignoreAllHaltsIfCalledFromMethod:aMethod |
6113 ignoreAllHaltsIfCalledFromMethod:aMethod |
6114 self |
6114 self |
6115 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6115 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6116 orThisReceiverClass:false orCurrentProcess:false |
6116 orThisReceiverClass:false orCurrentProcess:false |
6117 orIfCalledFromMethod:aMethod |
6117 orIfCalledFromMethod:aMethod |
6118 forAll:true. |
6118 forAll:true. |
6119 ! |
6119 ! |
6120 |
6120 |
6121 ignoreAllHaltsUntilShiftKeyIsPressed |
6121 ignoreAllHaltsUntilShiftKeyIsPressed |
6122 self |
6122 self |
6123 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6123 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6124 orThisReceiverClass:false orCurrentProcess:false |
6124 orThisReceiverClass:false orCurrentProcess:false |
6125 orIfCalledFromMethod:nil |
6125 orIfCalledFromMethod:nil |
6126 forAll:true. |
6126 forAll:true. |
6127 |
6127 |
6128 "Created: / 27-01-2012 / 11:32:14 / cg" |
6128 "Created: / 27-01-2012 / 11:32:14 / cg" |
6129 ! |
6129 ! |
6130 |
6130 |
6131 ignoreBreakpointsWithThisParameterForever |
6131 ignoreBreakpointsWithThisParameterForever |
6134 |
6134 |
6135 "Created: / 06-03-2012 / 12:35:48 / cg" |
6135 "Created: / 06-03-2012 / 12:35:48 / cg" |
6136 ! |
6136 ! |
6137 |
6137 |
6138 ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
6138 ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
6139 self |
6139 self |
6140 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6140 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6141 orThisReceiverClass:false orCurrentProcess:false |
6141 orThisReceiverClass:false orCurrentProcess:false |
6142 orIfCalledFromMethod:nil |
6142 orIfCalledFromMethod:nil |
6143 forAll:false. |
6143 forAll:false. |
6144 |
6144 |
6145 "Created: / 06-03-2012 / 12:35:22 / cg" |
6145 "Created: / 06-03-2012 / 12:35:22 / cg" |
6146 ! |
6146 ! |
6147 |
6147 |
6148 ignoreHaltForCurrentProcess |
6148 ignoreHaltForCurrentProcess |
6149 self |
6149 self |
6150 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6150 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6151 orThisReceiverClass:false orCurrentProcess:true |
6151 orThisReceiverClass:false orCurrentProcess:true |
6152 orIfCalledFromMethod:nil |
6152 orIfCalledFromMethod:nil |
6153 forAll:false. |
6153 forAll:false. |
6154 |
6154 |
6155 "Created: / 27-01-2012 / 11:32:14 / cg" |
6155 "Created: / 27-01-2012 / 11:32:14 / cg" |
6156 ! |
6156 ! |
6157 |
6157 |
6158 ignoreHaltForThisReceiverClass |
6158 ignoreHaltForThisReceiverClass |
6159 self |
6159 self |
6160 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6160 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6161 orThisReceiverClass:true orCurrentProcess:false |
6161 orThisReceiverClass:true orCurrentProcess:false |
6162 orIfCalledFromMethod:nil |
6162 orIfCalledFromMethod:nil |
6163 forAll:false. |
6163 forAll:false. |
6164 |
6164 |
6165 "Created: / 27-01-2012 / 11:32:14 / cg" |
6165 "Created: / 27-01-2012 / 11:32:14 / cg" |
6166 ! |
6166 ! |
6167 |
6167 |
6168 ignoreHaltForever |
6168 ignoreHaltForever |
6169 self |
6169 self |
6170 addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
6170 addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
6171 orThisReceiverClass:false orCurrentProcess:false |
6171 orThisReceiverClass:false orCurrentProcess:false |
6172 orIfCalledFromMethod:nil |
6172 orIfCalledFromMethod:nil |
6173 forAll:false. |
6173 forAll:false. |
6174 |
6174 |
6175 "Modified: / 27-01-2012 / 11:31:37 / cg" |
6175 "Modified: / 27-01-2012 / 11:31:37 / cg" |
6176 ! |
6176 ! |
6177 |
6177 |
6178 ignoreHaltIfCalledFromMethod:aMethod |
6178 ignoreHaltIfCalledFromMethod:aMethod |
6179 self |
6179 self |
6180 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6180 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6181 orThisReceiverClass:false orCurrentProcess:false |
6181 orThisReceiverClass:false orCurrentProcess:false |
6182 orIfCalledFromMethod:aMethod |
6182 orIfCalledFromMethod:aMethod |
6183 forAll:false. |
6183 forAll:false. |
6184 ! |
6184 ! |
6185 |
6185 |
6186 ignoreHaltUntilShiftKeyIsPressed |
6186 ignoreHaltUntilShiftKeyIsPressed |
6187 self |
6187 self |
6188 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6188 addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6189 orThisReceiverClass:false orCurrentProcess:false |
6189 orThisReceiverClass:false orCurrentProcess:false |
6190 orIfCalledFromMethod:nil |
6190 orIfCalledFromMethod:nil |
6191 forAll:false. |
6191 forAll:false. |
6192 |
6192 |
6193 "Created: / 27-01-2012 / 11:36:54 / cg" |
6193 "Created: / 27-01-2012 / 11:36:54 / cg" |
6194 ! |
6194 ! |
6195 |
6195 |
6196 menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
6196 menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
6213 m := Menu new. |
6213 m := Menu new. |
6214 count := 0. |
6214 count := 0. |
6215 already := IdentitySet new. |
6215 already := IdentitySet new. |
6216 |
6216 |
6217 contextArray do:[:con | |
6217 contextArray do:[:con | |
6218 |mthd cls sel| |
6218 |mthd cls sel| |
6219 |
6219 |
6220 mthd := con method. |
6220 mthd := con method. |
6221 mthd notNil ifTrue:[ |
6221 mthd notNil ifTrue:[ |
6222 mthd isWrapped ifFalse:[ |
6222 mthd isWrapped ifFalse:[ |
6223 (already includes:already) ifFalse:[ |
6223 (already includes:already) ifFalse:[ |
6224 already add:mthd. |
6224 already add:mthd. |
6225 m addItem:(MenuItem |
6225 m addItem:(MenuItem |
6226 label: (mthd whoString) |
6226 label: (mthd whoString) |
6227 itemValue: [ forAllHaltsBoolean |
6227 itemValue: [ forAllHaltsBoolean |
6228 ifTrue:[self ignoreHaltIfCalledFromMethod:mthd] |
6228 ifTrue:[self ignoreHaltIfCalledFromMethod:mthd] |
6229 ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd] |
6229 ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd] |
6230 ] |
6230 ] |
6231 translateLabel: false). |
6231 translateLabel: false). |
6232 count := count + 1. |
6232 count := count + 1. |
6233 (count > 20) ifTrue:[ |
6233 (count > 20) ifTrue:[ |
6234 ^ m |
6234 ^ m |
6235 ]. |
6235 ]. |
6236 ] |
6236 ] |
6237 ] |
6237 ] |
6238 ] |
6238 ] |
6239 ]. |
6239 ]. |
6240 ^ m |
6240 ^ m |
6241 ! |
6241 ! |
6242 |
6242 |
6243 openBreakPointBrowser |
6243 openBreakPointBrowser |
6248 |
6248 |
6249 openIgnoreAllHaltsUntilTimeElapsedDialog |
6249 openIgnoreAllHaltsUntilTimeElapsedDialog |
6250 |answer dT| |
6250 |answer dT| |
6251 |
6251 |
6252 [ |
6252 [ |
6253 answer := Dialog |
6253 answer := Dialog |
6254 request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
6254 request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
6255 initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
6255 initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
6256 answer isEmptyOrNil ifTrue:[^ self]. |
6256 answer isEmptyOrNil ifTrue:[^ self]. |
6257 |
6257 |
6258 dT := TimeDuration readFrom:answer onError:[ nil ]. |
6258 dT := TimeDuration readFrom:answer onError:[ nil ]. |
6259 dT notNil ifTrue:[ |
6259 dT notNil ifTrue:[ |
6260 LastIgnoreHaltDuration := dT. |
6260 LastIgnoreHaltDuration := dT. |
6261 self |
6261 self |
6262 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
6262 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
6263 orThisReceiverClass:false orCurrentProcess:false |
6263 orThisReceiverClass:false orCurrentProcess:false |
6264 orIfCalledFromMethod:nil |
6264 orIfCalledFromMethod:nil |
6265 forAll:true. |
6265 forAll:true. |
6266 ^ self. |
6266 ^ self. |
6267 ]. |
6267 ]. |
6268 ] loop |
6268 ] loop |
6269 |
6269 |
6270 "Created: / 08-05-2011 / 10:19:20 / cg" |
6270 "Created: / 08-05-2011 / 10:19:20 / cg" |
6271 ! |
6271 ! |
6272 |
6272 |
6273 openIgnoreBreakpointsWithThisParameterNTimesDialog |
6273 openIgnoreBreakpointsWithThisParameterNTimesDialog |
6274 |answer n| |
6274 |answer n| |
6275 |
6275 |
6276 [ |
6276 [ |
6277 answer := Dialog |
6277 answer := Dialog |
6278 request:(resources |
6278 request:(resources |
6279 string:'How often should breakpoints with parameter "%1" be ignored ?' |
6279 string:'How often should breakpoints with parameter "%1" be ignored ?' |
6280 with:breakPointParameter) |
6280 with:breakPointParameter) |
6281 initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
6281 initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
6282 answer isEmptyOrNil ifTrue:[^ self]. |
6282 answer isEmptyOrNil ifTrue:[^ self]. |
6283 |
6283 |
6284 n := Integer readFrom:answer onError:nil. |
6284 n := Integer readFrom:answer onError:nil. |
6285 n notNil ifTrue:[ |
6285 n notNil ifTrue:[ |
6286 LastIgnoreHaltNTimes := n. |
6286 LastIgnoreHaltNTimes := n. |
6287 self |
6287 self |
6288 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
6288 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
6289 orThisReceiverClass:false orCurrentProcess:false |
6289 orThisReceiverClass:false orCurrentProcess:false |
6290 orIfCalledFromMethod:nil |
6290 orIfCalledFromMethod:nil |
6291 forAll:false. |
6291 forAll:false. |
6292 ^ self. |
6292 ^ self. |
6293 ]. |
6293 ]. |
6294 ] loop. |
6294 ] loop. |
6295 |
6295 |
6296 "Modified: / 27-01-2012 / 11:31:44 / cg" |
6296 "Modified: / 27-01-2012 / 11:31:44 / cg" |
6297 "Created: / 06-03-2012 / 12:28:51 / cg" |
6297 "Created: / 06-03-2012 / 12:28:51 / cg" |
6298 ! |
6298 ! |
6299 |
6299 |
6300 openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
6300 openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
6301 |answer dT| |
6301 |answer dT| |
6302 |
6302 |
6303 [ |
6303 [ |
6304 answer := Dialog |
6304 answer := Dialog |
6305 request:(resources |
6305 request:(resources |
6306 string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?' |
6306 string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?' |
6307 with:breakPointParameter) |
6307 with:breakPointParameter) |
6308 initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
6308 initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
6309 answer isEmptyOrNil ifTrue:[^ self]. |
6309 answer isEmptyOrNil ifTrue:[^ self]. |
6310 |
6310 |
6311 dT := TimeDuration readFrom:answer onError:[ nil ]. |
6311 dT := TimeDuration readFrom:answer onError:[ nil ]. |
6312 dT notNil ifTrue:[ |
6312 dT notNil ifTrue:[ |
6313 LastIgnoreHaltDuration := dT. |
6313 LastIgnoreHaltDuration := dT. |
6314 self |
6314 self |
6315 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
6315 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
6316 orThisReceiverClass:false orCurrentProcess:false |
6316 orThisReceiverClass:false orCurrentProcess:false |
6317 orIfCalledFromMethod:nil |
6317 orIfCalledFromMethod:nil |
6318 forAll:false. |
6318 forAll:false. |
6319 ^ self. |
6319 ^ self. |
6320 ]. |
6320 ]. |
6321 ] loop |
6321 ] loop |
6322 |
6322 |
6323 "Created: / 06-03-2012 / 12:03:36 / cg" |
6323 "Created: / 06-03-2012 / 12:03:36 / cg" |
6324 ! |
6324 ! |
6325 |
6325 |
6326 openIgnoreHaltNTimesDialog |
6326 openIgnoreHaltNTimesDialog |
6327 |answer n| |
6327 |answer n| |
6328 |
6328 |
6329 [ |
6329 [ |
6330 answer := Dialog |
6330 answer := Dialog |
6331 request:(resources string:'How often should this halt be ignored ?') |
6331 request:(resources string:'How often should this halt be ignored ?') |
6332 initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
6332 initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
6333 answer isEmptyOrNil ifTrue:[^ self]. |
6333 answer isEmptyOrNil ifTrue:[^ self]. |
6334 |
6334 |
6335 n := Integer readFrom:answer onError:nil. |
6335 n := Integer readFrom:answer onError:nil. |
6336 n notNil ifTrue:[ |
6336 n notNil ifTrue:[ |
6337 LastIgnoreHaltNTimes := n. |
6337 LastIgnoreHaltNTimes := n. |
6338 self |
6338 self |
6339 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
6339 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
6340 orThisReceiverClass:false orCurrentProcess:false |
6340 orThisReceiverClass:false orCurrentProcess:false |
6341 orIfCalledFromMethod:nil |
6341 orIfCalledFromMethod:nil |
6342 forAll:false. |
6342 forAll:false. |
6343 ^ self. |
6343 ^ self. |
6344 ]. |
6344 ]. |
6345 ] loop. |
6345 ] loop. |
6346 |
6346 |
6347 "Modified: / 27-01-2012 / 11:31:44 / cg" |
6347 "Modified: / 27-01-2012 / 11:31:44 / cg" |
6348 ! |
6348 ! |
6349 |
6349 |
6350 openIgnoreHaltUntilTimeElapsedDialog |
6350 openIgnoreHaltUntilTimeElapsedDialog |
6351 |answer dT| |
6351 |answer dT| |
6352 |
6352 |
6353 [ |
6353 [ |
6354 answer := Dialog |
6354 answer := Dialog |
6355 request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
6355 request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
6356 initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
6356 initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
6357 answer isEmptyOrNil ifTrue:[^ self]. |
6357 answer isEmptyOrNil ifTrue:[^ self]. |
6358 |
6358 |
6359 dT := TimeDuration readFrom:answer onError:[ nil ]. |
6359 dT := TimeDuration readFrom:answer onError:[ nil ]. |
6360 dT notNil ifTrue:[ |
6360 dT notNil ifTrue:[ |
6361 LastIgnoreHaltDuration := dT. |
6361 LastIgnoreHaltDuration := dT. |
6362 self |
6362 self |
6363 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
6363 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
6364 orThisReceiverClass:false orCurrentProcess:false |
6364 orThisReceiverClass:false orCurrentProcess:false |
6365 orIfCalledFromMethod:nil |
6365 orIfCalledFromMethod:nil |
6366 forAll:false. |
6366 forAll:false. |
6367 ^ self. |
6367 ^ self. |
6368 ]. |
6368 ]. |
6369 ] loop |
6369 ] loop |
6370 |
6370 |
6371 "Modified: / 27-01-2012 / 11:31:47 / cg" |
6371 "Modified: / 27-01-2012 / 11:31:47 / cg" |
6372 ! |
6372 ! |
6373 |
6373 |
6374 removeAllBreakpoints |
6374 removeAllBreakpoints |
6375 "remove all trace & breakpoints - if any" |
6375 "remove all trace & breakpoints - if any" |
6376 |
6376 |
6377 self withExecuteCursorDo:[ |
6377 self withExecuteCursorDo:[ |
6378 (MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
6378 (MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
6379 MessageTracer unwrapAllMethods |
6379 MessageTracer unwrapAllMethods |
6380 ]. |
6380 ]. |
6381 (MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[ |
6381 (MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[ |
6382 MethodWithBreakpoints removeAllBreakpoints |
6382 MethodWithBreakpoints removeAllBreakpoints |
6383 ]. |
6383 ]. |
6384 ] |
6384 ] |
6385 |
6385 |
6386 "Modified: / 21.5.1998 / 01:44:43 / cg" |
6386 "Modified: / 21.5.1998 / 01:44:43 / cg" |
6387 ! |
6387 ! |
6388 |
6388 |
6390 "remove breakpoint on the selected contexts method - if any" |
6390 "remove breakpoint on the selected contexts method - if any" |
6391 |
6391 |
6392 |implementorClass method| |
6392 |implementorClass method| |
6393 |
6393 |
6394 selectedContext isNil ifTrue:[ |
6394 selectedContext isNil ifTrue:[ |
6395 ^ self showError:'** select a context first **' |
6395 ^ self showError:'** select a context first **' |
6396 ]. |
6396 ]. |
6397 (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
6397 (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
6398 ^ self |
6398 ^ self |
6399 ]. |
6399 ]. |
6400 |
6400 |
6401 implementorClass := selectedContext methodClass. |
6401 implementorClass := selectedContext methodClass. |
6402 implementorClass notNil ifTrue:[ |
6402 implementorClass notNil ifTrue:[ |
6403 method := implementorClass compiledMethodAt:selectedContext selector. |
6403 method := implementorClass compiledMethodAt:selectedContext selector. |
6404 (method notNil and:[method isBreakpointed]) ifTrue:[ |
6404 (method notNil and:[method isBreakpointed]) ifTrue:[ |
6405 method clearBreakPoint |
6405 method clearBreakPoint |
6406 ] |
6406 ] |
6407 ]. |
6407 ]. |
6408 contextView middleButtonMenu disable:#removeBreakpoint. |
6408 contextView middleButtonMenu disable:#removeBreakpoint. |
6409 contextView middleButtonMenu enable:#addBreakpoint. |
6409 contextView middleButtonMenu enable:#addBreakpoint. |
6410 |
6410 |
6411 "Modified: / 13.1.1998 / 00:24:47 / cg" |
6411 "Modified: / 13.1.1998 / 00:24:47 / cg" |
6434 explainSelection |
6434 explainSelection |
6435 |interval crsrPos| |
6435 |interval crsrPos| |
6436 |
6436 |
6437 interval := self selectedInterval. |
6437 interval := self selectedInterval. |
6438 interval isEmpty ifTrue:[ |
6438 interval isEmpty ifTrue:[ |
6439 crsrPos := codeView characterPositionOfCursor. |
6439 crsrPos := codeView characterPositionOfCursor. |
6440 codeView characterUnderCursor isSeparator ifTrue:[ |
6440 codeView characterUnderCursor isSeparator ifTrue:[ |
6441 crsrPos := (crsrPos - 1) max:1 |
6441 crsrPos := (crsrPos - 1) max:1 |
6442 ]. |
6442 ]. |
6443 interval := crsrPos to:crsrPos. |
6443 interval := crsrPos to:crsrPos. |
6444 ]. |
6444 ]. |
6445 self |
6445 self |
6446 withNodeValueAtInterval:interval |
6446 withNodeValueAtInterval:interval |
6447 do:[:value :description | |
6447 do:[:value :description | |
6448 self showValue:value |
6448 self showValue:value |
6449 ]. |
6449 ]. |
6450 ! |
6450 ! |
6451 |
6451 |
6452 findNodeForInterval:interval |
6452 findNodeForInterval:interval |
6453 |source| |
6453 |source| |
6454 |
6454 |
6470 |node| |
6470 |node| |
6471 |
6471 |
6472 self obsoleteMethodWarning. |
6472 self obsoleteMethodWarning. |
6473 node := nil. |
6473 node := nil. |
6474 tree nodesDo:[:each | |
6474 tree nodesDo:[:each | |
6475 (each intersectsInterval:interval) ifTrue:[ |
6475 (each intersectsInterval:interval) ifTrue:[ |
6476 (node isNil or:[node == each parent]) ifTrue:[ |
6476 (node isNil or:[node == each parent]) ifTrue:[ |
6477 node := each |
6477 node := each |
6478 ] ifFalse:[ |
6478 ] ifFalse:[ |
6479 (node parent notNil |
6479 (node parent notNil |
6480 and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
6480 and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
6481 ] |
6481 ] |
6482 ] |
6482 ] |
6483 ]. |
6483 ]. |
6484 ^ node |
6484 ^ node |
6485 ! |
6485 ! |
6486 |
6486 |
6487 goodSkipUntilSelector |
6487 goodSkipUntilSelector |
6490 lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
6490 lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
6491 selectedContext isNil ifTrue:[^ nil]. |
6491 selectedContext isNil ifTrue:[^ nil]. |
6492 current := selectedContext selector. |
6492 current := selectedContext selector. |
6493 current isNil ifTrue:[^ nil]. |
6493 current isNil ifTrue:[^ nil]. |
6494 ('change:*' match:current) ifTrue:[ |
6494 ('change:*' match:current) ifTrue:[ |
6495 ^ 'update:*' |
6495 ^ 'update:*' |
6496 ]. |
6496 ]. |
6497 ^ nil |
6497 ^ nil |
6498 ! |
6498 ! |
6499 |
6499 |
6500 haltSelectors |
6500 haltSelectors |
6505 |
6505 |
6506 interruptProcessWith:aBlock |
6506 interruptProcessWith:aBlock |
6507 "let inspected process do something, then update the context list" |
6507 "let inspected process do something, then update the context list" |
6508 |
6508 |
6509 inspectedProcess isDead ifTrue:[ |
6509 inspectedProcess isDead ifTrue:[ |
6510 self showTerminated. |
6510 self showTerminated. |
6511 ^ self |
6511 ^ self |
6512 ]. |
6512 ]. |
6513 inspectedProcess interruptWith:aBlock. |
6513 inspectedProcess interruptWith:aBlock. |
6514 " |
6514 " |
6515 give the process a chance to run, then update |
6515 give the process a chance to run, then update |
6516 " |
6516 " |
6530 |
6530 |
6531 processPerform:aMessage |
6531 processPerform:aMessage |
6532 "do something, then update the context list" |
6532 "do something, then update the context list" |
6533 |
6533 |
6534 inspectedProcess isDead ifTrue:[ |
6534 inspectedProcess isDead ifTrue:[ |
6535 self showTerminated. |
6535 self showTerminated. |
6536 ^ self |
6536 ^ self |
6537 ]. |
6537 ]. |
6538 inspectedProcess perform:aMessage. |
6538 inspectedProcess perform:aMessage. |
6539 |
6539 |
6540 " |
6540 " |
6541 give the process a chance to run, then update |
6541 give the process a chance to run, then update |
6549 verbose-flag setting is changed" |
6549 verbose-flag setting is changed" |
6550 |
6550 |
6551 |oldSelection oldContext con idx| |
6551 |oldSelection oldContext con idx| |
6552 |
6552 |
6553 contextArray notNil ifTrue:[ |
6553 contextArray notNil ifTrue:[ |
6554 self withExecuteCursorDo:[ |
6554 self withExecuteCursorDo:[ |
6555 oldSelection := contextView selection. |
6555 oldSelection := contextView selection. |
6556 oldSelection notNil ifTrue:[ |
6556 oldSelection notNil ifTrue:[ |
6557 oldContext := contextArray at:oldSelection ifAbsent:nil. |
6557 oldContext := contextArray at:oldSelection ifAbsent:nil. |
6558 ]. |
6558 ]. |
6559 |
6559 |
6560 con := firstContext. |
6560 con := firstContext. |
6561 "/ con := contextArray at:1. |
6561 "/ con := contextArray at:1. |
6562 "/ force redeisplay, even if same by changing the first entry |
6562 "/ force redeisplay, even if same by changing the first entry |
6563 contextArray size > 0 ifTrue:[ |
6563 contextArray size > 0 ifTrue:[ |
6564 contextArray at:1 put:nil. |
6564 contextArray at:1 put:nil. |
6565 ]. |
6565 ]. |
6566 self setContext:con. |
6566 self setContext:con. |
6567 |
6567 |
6568 oldContext isNil ifTrue:[ |
6568 oldContext isNil ifTrue:[ |
6569 idx := oldSelection |
6569 idx := oldSelection |
6570 ] ifFalse:[ |
6570 ] ifFalse:[ |
6571 idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
6571 idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
6572 ]. |
6572 ]. |
6573 contextView setSelection:idx. |
6573 contextView setSelection:idx. |
6574 idx notNil ifTrue:[ |
6574 idx notNil ifTrue:[ |
6575 self showSelection:idx |
6575 self showSelection:idx |
6576 ] |
6576 ] |
6577 ] |
6577 ] |
6578 ] |
6578 ] |
6579 |
6579 |
6580 "Created: / 10.1.1997 / 21:36:46 / cg" |
6580 "Created: / 10.1.1997 / 21:36:46 / cg" |
6581 "Modified: / 21.5.1998 / 01:47:07 / cg" |
6581 "Modified: / 21.5.1998 / 01:47:07 / cg" |
6582 ! |
6582 ! |
6586 ! |
6586 ! |
6587 |
6587 |
6588 showError:message |
6588 showError:message |
6589 codeView contents:(resources string:message). |
6589 codeView contents:(resources string:message). |
6590 shown ifTrue:[ |
6590 shown ifTrue:[ |
6591 exclusive ifTrue:[ |
6591 exclusive ifTrue:[ |
6592 "/ consider this a kludge: |
6592 "/ consider this a kludge: |
6593 "/ if exclusive, cannot use flash, since it suspends |
6593 "/ if exclusive, cannot use flash, since it suspends |
6594 "/ (but we cannot suspend here ...) |
6594 "/ (but we cannot suspend here ...) |
6595 codeView redrawInverted. self flush. |
6595 codeView redrawInverted. self flush. |
6596 OperatingSystem millisecondDelay:200. |
6596 OperatingSystem millisecondDelay:200. |
6597 codeView redraw |
6597 codeView redraw |
6598 ] ifFalse:[ |
6598 ] ifFalse:[ |
6599 codeView flash |
6599 codeView flash |
6600 ] |
6600 ] |
6601 ] |
6601 ] |
6602 |
6602 |
6603 "Modified: / 18.11.2001 / 00:01:13 / cg" |
6603 "Modified: / 18.11.2001 / 00:01:13 / cg" |
6604 ! |
6604 ! |
6605 |
6605 |
6628 updateButtonsAndMenuItemsForContext:aContext |
6628 updateButtonsAndMenuItemsForContext:aContext |
6629 |m| |
6629 |m| |
6630 |
6630 |
6631 m := contextView middleButtonMenu. |
6631 m := contextView middleButtonMenu. |
6632 m notNil ifTrue:[ |
6632 m notNil ifTrue:[ |
6633 self updateMenuItems. |
6633 self updateMenuItems. |
6634 |
6634 |
6635 (inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
6635 (inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
6636 abortButton enable. |
6636 abortButton enable. |
6637 m enable:#doAbort. |
6637 m enable:#doAbort. |
6638 ] ifFalse:[ |
6638 ] ifFalse:[ |
6639 abortButton disable. |
6639 abortButton disable. |
6640 m disable:#doAbort. |
6640 m disable:#doAbort. |
6641 ]. |
6641 ]. |
6642 exclusive ifTrue:[ |
6642 exclusive ifTrue:[ |
6643 terminateButton disable. |
6643 terminateButton disable. |
6644 m disable:#doTerminate. |
6644 m disable:#doTerminate. |
6645 ] ifFalse:[ |
6645 ] ifFalse:[ |
6646 terminateButton enable. |
6646 terminateButton enable. |
6647 m enable:#doTerminate. |
6647 m enable:#doTerminate. |
6648 ]. |
6648 ]. |
6649 ]. |
6649 ]. |
6650 |
6650 |
6651 mayProceed == false ifTrue:[ |
6651 mayProceed == false ifTrue:[ |
6652 continueButton disable. |
6652 continueButton disable. |
6653 m notNil ifTrue:[m disable:#doContinue]. |
6653 m notNil ifTrue:[m disable:#doContinue]. |
6654 ] ifFalse:[ |
6654 ] ifFalse:[ |
6655 continueButton enable. |
6655 continueButton enable. |
6656 m notNil ifTrue:[m enable:#doContinue] |
6656 m notNil ifTrue:[m enable:#doContinue] |
6657 ]. |
6657 ]. |
6658 |
6658 |
6659 isStoppedInModalDialog ifTrue:[ |
6659 isStoppedInModalDialog ifTrue:[ |
6660 gotoDialogOpenerButton enable. |
6660 gotoDialogOpenerButton enable. |
6661 gotoDialogOpenerButton beVisible. |
6661 gotoDialogOpenerButton beVisible. |
6662 ] ifFalse:[ |
6662 ] ifFalse:[ |
6663 gotoDialogOpenerButton beInvisible. |
6663 gotoDialogOpenerButton beInvisible. |
6664 ]. |
6664 ]. |
6665 |
6665 |
6666 (isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[ |
6666 (isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[ |
6667 gotoApplicationActionMethodButton enable. |
6667 gotoApplicationActionMethodButton enable. |
6668 gotoApplicationActionMethodButton beVisible. |
6668 gotoApplicationActionMethodButton beVisible. |
6669 ] ifFalse:[ |
6669 ] ifFalse:[ |
6670 gotoApplicationActionMethodButton beInvisible. |
6670 gotoApplicationActionMethodButton beInvisible. |
6671 ]. |
6671 ]. |
6672 |
6672 |
6673 "Created: / 06-07-2011 / 12:24:53 / cg" |
6673 "Created: / 06-07-2011 / 12:24:53 / cg" |
6674 ! |
6674 ! |
6675 |
6675 |
6676 updateContext |
6676 updateContext |
6677 |oldContext idx| |
6677 |oldContext idx| |
6678 |
6678 |
6679 inspectedProcess state == #dead ifTrue:[ |
6679 inspectedProcess state == #dead ifTrue:[ |
6680 self showTerminated. |
6680 self showTerminated. |
6681 ^ self |
6681 ^ self |
6682 ]. |
6682 ]. |
6683 |
6683 |
6684 oldContext := selectedContext. |
6684 oldContext := selectedContext. |
6685 [ |
6685 [ |
6686 (self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
6686 (self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
6687 oldContext notNil ifTrue:[ |
6687 oldContext notNil ifTrue:[ |
6688 contextArray notNil ifTrue:[ |
6688 contextArray notNil ifTrue:[ |
6689 idx := contextArray identityIndexOf:oldContext. |
6689 idx := contextArray identityIndexOf:oldContext. |
6690 idx ~~ 0 ifTrue:[ |
6690 idx ~~ 0 ifTrue:[ |
6691 self showSelection:idx |
6691 self showSelection:idx |
6692 ] ifFalse:[ |
6692 ] ifFalse:[ |
6693 codeView contents:('** context returned **') |
6693 codeView contents:('** context returned **') |
6694 ] |
6694 ] |
6695 ] |
6695 ] |
6696 ] |
6696 ] |
6697 ]. |
6697 ]. |
6698 ] valueUninterruptably. |
6698 ] valueUninterruptably. |
6699 |
6699 |
6700 "Modified: 20.10.1996 / 18:11:24 / cg" |
6700 "Modified: 20.10.1996 / 18:11:24 / cg" |
6701 ! |
6701 ! |
6702 |
6702 |
6703 withNodeValueAtInterval:interval do:aBlock |
6703 withNodeValueAtInterval:interval do:aBlock |
6704 "helper for flyByHelp and explan-selection" |
6704 "helper for flyByHelp and explan-selection" |
6705 |
6705 |
6706 |node definingNode nm nmBold nameSymbol |
6706 |node definingNode nm nmBold nameSymbol |
6707 varIdx parentNode receiver con receiversNonMetaClass| |
6707 varIdx parentNode receiver con receiversNonMetaClass| |
6708 |
6708 |
6709 "/ interval printCR. |
6709 "/ interval printCR. |
6710 Error |
6710 Error |
6711 handle:[:ex | ] |
6711 handle:[:ex | ] |
6712 do:[ |
6712 do:[ |
6713 [ |
6713 [ |
6714 node := self findNodeForInterval:interval |
6714 node := self findNodeForInterval:interval |
6715 ] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
6715 ] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
6716 ]. |
6716 ]. |
6717 |
6717 |
6718 node isNil ifTrue:[ ^ self ]. |
6718 node isNil ifTrue:[ ^ self ]. |
6719 node isVariable ifFalse:[ |
6719 node isVariable ifFalse:[ |
6720 "/ Transcript showCR:node. |
6720 "/ Transcript showCR:node. |
6721 ^ self |
6721 ^ self |
6722 ]. |
6722 ]. |
6723 |
6723 |
6724 nm := node name. |
6724 nm := node name. |
6725 nmBold := nm allBold. |
6725 nmBold := nm allBold. |
6726 actualContext isNil ifTrue:[^ self ]. |
6726 actualContext isNil ifTrue:[^ self ]. |
6727 actualContext methodHome isNil ifTrue:[^ self ]. |
6727 actualContext methodHome isNil ifTrue:[^ self ]. |
6728 receiver := actualContext methodHome receiver. |
6728 receiver := actualContext methodHome receiver. |
6729 |
6729 |
6730 (nm = 'self') ifTrue:[ |
6730 (nm = 'self') ifTrue:[ |
6731 aBlock value:receiver value:'receiver' allBold. |
6731 aBlock value:receiver value:'receiver' allBold. |
6732 ^ self |
6732 ^ self |
6733 ]. |
6733 ]. |
6734 (nm = 'super') ifTrue:[ |
6734 (nm = 'super') ifTrue:[ |
6735 aBlock value:receiver value:'receiver' allBold. |
6735 aBlock value:receiver value:'receiver' allBold. |
6736 ^ self |
6736 ^ self |
6737 ]. |
6737 ]. |
6738 (nm = 'thisContext') ifTrue:[ |
6738 (nm = 'thisContext') ifTrue:[ |
6739 aBlock value:actualContext value:'context' allBold. |
6739 aBlock value:actualContext value:'context' allBold. |
6740 ^ self |
6740 ^ self |
6741 ]. |
6741 ]. |
6742 |
6742 |
6743 definingNode := node whoDefines:nm. |
6743 definingNode := node whoDefines:nm. |
6744 definingNode isNil ifTrue:[ |
6744 definingNode isNil ifTrue:[ |
6745 (receiver class allInstVarNames includes:nm) ifTrue:[ |
6745 (receiver class allInstVarNames includes:nm) ifTrue:[ |
6746 "/aBlock value:'xIII' value:'instVar'. |
6746 "/aBlock value:'xIII' value:'instVar'. |
6747 receiver class isMetaclass ifTrue:[ |
6747 receiver class isMetaclass ifTrue:[ |
6748 aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
6748 aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
6749 ] ifFalse:[ |
6749 ] ifFalse:[ |
6750 aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
6750 aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
6751 ]. |
6751 ]. |
6752 ^ self |
6752 ^ self |
6753 ]. |
6753 ]. |
6754 |
6754 |
6755 receiversNonMetaClass := receiver class theNonMetaclass. |
6755 receiversNonMetaClass := receiver class theNonMetaclass. |
6756 (receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
6756 (receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
6757 aBlock value:'' value:'private class ',nmBold. |
6757 aBlock value:'' value:'private class ',nmBold. |
6758 ^ self |
6758 ^ self |
6759 ]. |
6759 ]. |
6760 (receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
6760 (receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
6761 aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
6761 aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
6762 ^ self |
6762 ^ self |
6763 ]. |
6763 ]. |
6764 receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
6764 receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
6765 |pool| |
6765 |pool| |
6766 |
6766 |
6767 pool := Smalltalk at:eachPoolName. |
6767 pool := Smalltalk at:eachPoolName. |
6768 pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
6768 pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
6769 (pool classVarNames includes:nm) ifTrue:[ |
6769 (pool classVarNames includes:nm) ifTrue:[ |
6770 aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
6770 aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
6771 ^ self |
6771 ^ self |
6772 ]. |
6772 ]. |
6773 ]. |
6773 ]. |
6774 nameSymbol := nm asSymbolIfInterned. |
6774 nameSymbol := nm asSymbolIfInterned. |
6775 nameSymbol notNil ifTrue:[ |
6775 nameSymbol notNil ifTrue:[ |
6776 (Smalltalk includesKey:nameSymbol) ifTrue:[ |
6776 (Smalltalk includesKey:nameSymbol) ifTrue:[ |
6777 (Smalltalk at:nameSymbol) isClass ifTrue:[ |
6777 (Smalltalk at:nameSymbol) isClass ifTrue:[ |
6778 aBlock value:'class: ',nmBold value:nil. |
6778 aBlock value:'class: ',nmBold value:nil. |
6779 ] ifFalse:[ |
6779 ] ifFalse:[ |
6780 aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold. |
6780 aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold. |
6781 ]. |
6781 ]. |
6782 ^ self |
6782 ^ self |
6783 ]. |
6783 ]. |
6784 ]. |
6784 ]. |
6785 aBlock value:'' value:'unknown'. |
6785 aBlock value:'' value:'unknown'. |
6786 ^ self |
6786 ^ self |
6787 ]. |
6787 ]. |
6788 "/definingNode printCR. |
6788 "/definingNode printCR. |
6789 |
6789 |
6790 definingNode isMethod ifTrue:[ |
6790 definingNode isMethod ifTrue:[ |
6791 varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
6791 varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
6792 varIdx ~~ 0 ifTrue:[ |
6792 varIdx ~~ 0 ifTrue:[ |
6793 Error |
6793 Error |
6794 handle:[:ex | ] |
6794 handle:[:ex | ] |
6795 do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
6795 do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
6796 ^ self |
6796 ^ self |
6797 ]. |
6797 ]. |
6798 varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
6798 varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
6799 varIdx ~~ 0 ifTrue:[ |
6799 varIdx ~~ 0 ifTrue:[ |
6800 actualContext methodHome numVars >= varIdx ifTrue:[ |
6800 actualContext methodHome numVars >= varIdx ifTrue:[ |
6801 Error |
6801 Error |
6802 handle:[:ex | ] |
6802 handle:[:ex | ] |
6803 do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
6803 do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
6804 ^ self |
6804 ^ self |
6805 ] |
6805 ] |
6806 ]. |
6806 ]. |
6807 ]. |
6807 ]. |
6808 |
6808 |
6809 definingNode isBlock ifTrue:[ |
6809 definingNode isBlock ifTrue:[ |
6810 varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
6810 varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
6811 (definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
6811 (definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
6812 varIdx ~~ 0 ifTrue:[ |
6812 varIdx ~~ 0 ifTrue:[ |
6813 "/ am I in this block ? |
6813 "/ am I in this block ? |
6814 (actualContext lineNumber notNil |
6814 (actualContext lineNumber notNil |
6815 and:[ definingNode lastLineNumber notNil |
6815 and:[ definingNode lastLineNumber notNil |
6816 and:[ (actualContext lineNumber |
6816 and:[ (actualContext lineNumber |
6817 between:definingNode firstLineNumber |
6817 between:definingNode firstLineNumber |
6818 and:definingNode lastLineNumber) |
6818 and:definingNode lastLineNumber) |
6819 and:[ varIdx <= actualContext numArgs ] ]]) |
6819 and:[ varIdx <= actualContext numArgs ] ]]) |
6820 ifTrue:[ |
6820 ifTrue:[ |
6821 aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
6821 aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
6822 ^ self |
6822 ^ self |
6823 ]. |
6823 ]. |
6824 aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
6824 aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
6825 ^ self |
6825 ^ self |
6826 ] |
6826 ] |
6827 ]. |
6827 ]. |
6828 ]. |
6828 ]. |
6829 |
6829 |
6830 parentNode := definingNode parent. |
6830 parentNode := definingNode parent. |
6831 |
6831 |
6832 [parentNode notNil] whileTrue:[ |
6832 [parentNode notNil] whileTrue:[ |
6833 "/'isMethod ' print. parentNode isMethod printCR. |
6833 "/'isMethod ' print. parentNode isMethod printCR. |
6834 parentNode isMethod ifTrue:[ |
6834 parentNode isMethod ifTrue:[ |
6835 varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
6835 varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
6836 varIdx ~~ 0 ifTrue:[ |
6836 varIdx ~~ 0 ifTrue:[ |
6837 actualContext methodHome numVars >= varIdx ifTrue:[ |
6837 actualContext methodHome numVars >= varIdx ifTrue:[ |
6838 Error |
6838 Error |
6839 handle:[:ex | ] |
6839 handle:[:ex | ] |
6840 do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
6840 do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
6841 ^ self |
6841 ^ self |
6842 ] |
6842 ] |
6843 ]. |
6843 ]. |
6844 ]. |
6844 ]. |
6845 "/'isBlock ' print. parentNode isBlock printCR. |
6845 "/'isBlock ' print. parentNode isBlock printCR. |
6846 parentNode isBlock ifTrue:[ |
6846 parentNode isBlock ifTrue:[ |
6847 "/ we don't have any information on the inlineability |
6847 "/ we don't have any information on the inlineability |
6848 "/ of this block here (RBParser does not know what |
6848 "/ of this block here (RBParser does not know what |
6849 "/ the compiler does). |
6849 "/ the compiler does). |
6850 "/ therefore, it is questionable if we can use the |
6850 "/ therefore, it is questionable if we can use the |
6851 "/ context's home context here. |
6851 "/ context's home context here. |
6852 "/ am I in this block ? |
6852 "/ am I in this block ? |
6853 con := actualContext. |
6853 con := actualContext. |
6854 [con notNil |
6854 [con notNil |
6855 and:[ parentNode lastLineNumber notNil |
6855 and:[ parentNode lastLineNumber notNil |
6856 and:[ con lineNumber notNil |
6856 and:[ con lineNumber notNil |
6857 and:[ con lineNumber |
6857 and:[ con lineNumber |
6858 between:parentNode firstLineNumber |
6858 between:parentNode firstLineNumber |
6859 and:parentNode lastLineNumber ]]]] whileTrue:[ |
6859 and:parentNode lastLineNumber ]]]] whileTrue:[ |
6860 con := con sender. |
6860 con := con sender. |
6861 ]. |
6861 ]. |
6862 con notNil ifTrue:[ |
6862 con notNil ifTrue:[ |
6863 varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
6863 varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
6864 varIdx ~~ 0 ifTrue:[ |
6864 varIdx ~~ 0 ifTrue:[ |
6865 Error |
6865 Error |
6866 handle:[:ex | ] |
6866 handle:[:ex | ] |
6867 do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
6867 do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
6868 ^ self |
6868 ^ self |
6869 ]. |
6869 ]. |
6870 varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
6870 varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
6871 varIdx ~~ 0 ifTrue:[ |
6871 varIdx ~~ 0 ifTrue:[ |
6872 Error |
6872 Error |
6873 handle:[:ex | ] |
6873 handle:[:ex | ] |
6874 do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
6874 do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
6875 ^ self |
6875 ^ self |
6876 ]. |
6876 ]. |
6877 ]. |
6877 ]. |
6878 ]. |
6878 ]. |
6879 parentNode := parentNode parent. |
6879 parentNode := parentNode parent. |
6880 ]. |
6880 ]. |
6881 aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
6881 aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
6882 |
6882 |
6883 "Modified: / 18-01-2011 / 17:57:34 / cg" |
6883 "Modified: / 18-01-2011 / 17:57:34 / cg" |
6884 ! ! |
6884 ! ! |
6920 m := contextView middleButtonMenu. |
6920 m := contextView middleButtonMenu. |
6921 ^ m notNil and:[m isEnabled:#browseReceiversClass] |
6921 ^ m notNil and:[m isEnabled:#browseReceiversClass] |
6922 ! |
6922 ! |
6923 |
6923 |
6924 canCloseAllDebuggers |
6924 canCloseAllDebuggers |
6925 self class allInstancesDo:[:debugger | |
6925 self class allInstancesDo:[:debugger | |
6926 debugger ~~ self ifTrue:[ |
6926 debugger ~~ self ifTrue:[ |
6927 debugger busy ifTrue:[^ true]. |
6927 debugger busy ifTrue:[^ true]. |
6928 ] |
6928 ] |
6929 ]. |
6929 ]. |
6930 ^ false |
6930 ^ false |
6931 |
6931 |
6932 "Created: / 23-03-2012 / 12:40:18 / cg" |
6932 "Created: / 23-03-2012 / 12:40:18 / cg" |
6933 ! |
6933 ! |
6939 canInspectWidgetHierarchy |
6939 canInspectWidgetHierarchy |
6940 |rcvr| |
6940 |rcvr| |
6941 |
6941 |
6942 ^ selectedContext notNil |
6942 ^ selectedContext notNil |
6943 and:[ (rcvr := selectedContext receiver) isView |
6943 and:[ (rcvr := selectedContext receiver) isView |
6944 or:[ rcvr isKindOf: ApplicationModel ]] |
6944 or:[ rcvr isKindOf: ApplicationModel ]] |
6945 ! |
6945 ! |
6946 |
6946 |
6947 canRestart |
6947 canRestart |
6948 ^ restartButton isEnabled |
6948 ^ restartButton isEnabled |
6949 |
6949 |
7001 |
7001 |
7002 selectedContextIsWrapped |
7002 selectedContextIsWrapped |
7003 |con mthd| |
7003 |con mthd| |
7004 |
7004 |
7005 (con := self selectedContext) notNil ifTrue:[ |
7005 (con := self selectedContext) notNil ifTrue:[ |
7006 mthd := con method. |
7006 mthd := con method. |
7007 ^ mthd notNil and:[mthd isWrapped] |
7007 ^ mthd notNil and:[mthd isWrapped] |
7008 ]. |
7008 ]. |
7009 ^ false. |
7009 ^ false. |
7010 |
7010 |
7011 "Modified: / 19-07-2012 / 11:36:28 / cg" |
7011 "Modified: / 19-07-2012 / 11:36:28 / cg" |
7012 ! |
7012 ! |
7019 setOfHiddenCallingSelectors := aCollectionOfSymbols |
7019 setOfHiddenCallingSelectors := aCollectionOfSymbols |
7020 ! ! |
7020 ! ! |
7021 |
7021 |
7022 !DebugView methodsFor:'private-breakpoints'! |
7022 !DebugView methodsFor:'private-breakpoints'! |
7023 |
7023 |
7024 addIgnoredHaltForCount:countOrNil |
7024 addIgnoredHaltForCount:countOrNil |
7025 orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
7025 orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
7026 orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess |
7026 orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess |
7027 orIfCalledFromMethod:ifCalledForMethodOrNil |
7027 orIfCalledFromMethod:ifCalledForMethodOrNil |
7028 forAll:aBoolean |
7028 forAll:aBoolean |
7029 |
7029 |
7030 |haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil| |
7030 |haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil| |
7031 |
7031 |
7032 aBoolean ifTrue:[ |
7032 aBoolean ifTrue:[ |
7033 haltingMethod := #all |
7033 haltingMethod := #all |
7034 ] ifFalse:[ |
7034 ] ifFalse:[ |
7035 haltingContext := self findHaltingContext. |
7035 haltingContext := self findHaltingContext. |
7036 haltingContext isNil ifTrue:[ |
7036 haltingContext isNil ifTrue:[ |
7037 Transcript showCR:'no halting context found'. |
7037 Transcript showCR:'no halting context found'. |
7038 ^ self |
7038 ^ self |
7039 ]. |
7039 ]. |
7040 |
7040 |
7041 haltingMethod := haltingContext method. |
7041 haltingMethod := haltingContext method. |
7042 lineNrOfHalt := haltingContext lineNumber. |
7042 lineNrOfHalt := haltingContext lineNumber. |
7043 (lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ |
7043 (lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ |
7044 Transcript showCR:'no halt lineNr found'. |
7044 Transcript showCR:'no halt lineNr found'. |
7045 ^ self |
7045 ^ self |
7046 ]. |
7046 ]. |
7047 forThisReceiverClass ifTrue:[ |
7047 forThisReceiverClass ifTrue:[ |
7048 receiverClassOrNil := haltingContext receiver class |
7048 receiverClassOrNil := haltingContext receiver class |
7049 ]. |
7049 ]. |
7050 forCurrentProcess ifTrue:[ |
7050 forCurrentProcess ifTrue:[ |
7051 processOrNil := Processor activeProcess |
7051 processOrNil := Processor activeProcess |
7052 ]. |
7052 ]. |
7053 ]. |
7053 ]. |
7054 |
7054 |
7055 self class |
7055 self class |
7056 ignoreHaltIn:haltingMethod at:lineNrOfHalt |
7056 ignoreHaltIn:haltingMethod at:lineNrOfHalt |
7057 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
7057 forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
7058 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
7058 orReceiverClass:receiverClassOrNil orProcess:processOrNil |
7059 orIfCalledFromMethod:ifCalledForMethodOrNil |
7059 orIfCalledFromMethod:ifCalledForMethodOrNil |
7060 |
7060 |
7061 "Created: / 27-01-2012 / 11:31:12 / cg" |
7061 "Created: / 27-01-2012 / 11:31:12 / cg" |
7062 ! |
7062 ! |
7063 |
7063 |
7064 canAddBreakpoint |
7064 canAddBreakpoint |
7079 |haltSelectors| |
7079 |haltSelectors| |
7080 |
7080 |
7081 haltSelectors := self haltSelectors. |
7081 haltSelectors := self haltSelectors. |
7082 |
7082 |
7083 contextArray keysAndValuesDo:[:idx :con | |
7083 contextArray keysAndValuesDo:[:idx :con | |
7084 |sel con2 sel2 method| |
7084 |sel con2 sel2 method| |
7085 |
7085 |
7086 sel := con selector. |
7086 sel := con selector. |
7087 (haltSelectors includes:sel) ifTrue:[ |
7087 (haltSelectors includes:sel) ifTrue:[ |
7088 (method := con method) notNil ifTrue:[ |
7088 (method := con method) notNil ifTrue:[ |
7089 method mclass == Object ifTrue:[ |
7089 method mclass == Object ifTrue:[ |
7090 con2 := contextArray at:idx+1. |
7090 con2 := contextArray at:idx+1. |
7091 sel2 := con2 selector. |
7091 sel2 := con2 selector. |
7092 (haltSelectors includes:sel2) ifTrue:[ |
7092 (haltSelectors includes:sel2) ifTrue:[ |
7093 con2 method mclass == Object ifTrue:[ |
7093 con2 method mclass == Object ifTrue:[ |
7094 ^ contextArray at:idx+2. |
7094 ^ contextArray at:idx+2. |
7095 ] |
7095 ] |
7096 ]. |
7096 ]. |
7097 ^ contextArray at:idx+1 |
7097 ^ contextArray at:idx+1 |
7098 ]. |
7098 ]. |
7099 method mclass == Breakpoint ifTrue:[ |
7099 method mclass == Breakpoint ifTrue:[ |
7100 (contextArray at:idx+1) infoPrintCR. |
7100 (contextArray at:idx+1) infoPrintCR. |
7101 ^ contextArray at:idx+1 |
7101 ^ contextArray at:idx+1 |
7102 ]. |
7102 ]. |
7103 ]. |
7103 ]. |
7104 ]. |
7104 ]. |
7105 con method isWrapped ifTrue:[ |
7105 con method isWrapped ifTrue:[ |
7106 ^ con |
7106 ^ con |
7107 ]. |
7107 ]. |
7108 ]. |
7108 ]. |
7109 ^ nil |
7109 ^ nil |
7110 |
7110 |
7111 "Modified: / 27-01-2012 / 11:06:02 / cg" |
7111 "Modified: / 27-01-2012 / 11:06:02 / cg" |
7112 ! |
7112 ! |
7126 faster, since no resources have to be allocated in the display. |
7126 faster, since no resources have to be allocated in the display. |
7127 We have to be careful to release all refs to the debuggee, though. |
7127 We have to be careful to release all refs to the debuggee, though. |
7128 Otherwise, the GC will not be able to release it." |
7128 Otherwise, the GC will not be able to release it." |
7129 |
7129 |
7130 windowGroup notNil ifTrue:[ |
7130 windowGroup notNil ifTrue:[ |
7131 windowGroup setProcess:nil. |
7131 windowGroup setProcess:nil. |
7132 ]. |
7132 ]. |
7133 |
7133 |
7134 self releaseDebuggee. |
7134 self releaseDebuggee. |
7135 |
7135 |
7136 cachable ~~ true ifTrue:[^ self]. |
7136 cachable ~~ true ifTrue:[^ self]. |
7137 |
7137 |
7138 "/ |
7138 "/ |
7139 "/ only cache if I am on the Display (i.e. the default screen) |
7139 "/ only cache if I am on the Display (i.e. the default screen) |
7140 "/ |
7140 "/ |
7141 self graphicsDevice == Display ifTrue:[ |
7141 self graphicsDevice == Display ifTrue:[ |
7142 exclusive ifTrue:[ |
7142 exclusive ifTrue:[ |
7143 CachedExclusive := self |
7143 CachedExclusive := self |
7144 ] ifFalse:[ |
7144 ] ifFalse:[ |
7145 CachedDebugger := self |
7145 CachedDebugger := self |
7146 ]. |
7146 ]. |
7147 ]. |
7147 ]. |
7148 |
7148 |
7149 ObjectMemory stepInterruptHandler == self ifTrue:[ |
7149 ObjectMemory stepInterruptHandler == self ifTrue:[ |
7150 ObjectMemory stepInterruptHandler:nil |
7150 ObjectMemory stepInterruptHandler:nil |
7151 ]. |
7151 ]. |
7152 |
7152 |
7153 "Modified: 10.7.1997 / 15:50:46 / stefan" |
7153 "Modified: 10.7.1997 / 15:50:46 / stefan" |
7154 "Modified: 31.7.1997 / 21:20:14 / cg" |
7154 "Modified: 31.7.1997 / 21:20:14 / cg" |
7155 ! |
7155 ! |
7156 |
7156 |
7157 isCached |
7157 isCached |
7158 "tell whether we are a cached debugger" |
7158 "tell whether we are a cached debugger" |
7159 |
7159 |
7160 CachedExclusive == self ifTrue:[ |
7160 CachedExclusive == self ifTrue:[ |
7161 ^ true. |
7161 ^ true. |
7162 ]. |
7162 ]. |
7163 CachedDebugger == self ifTrue:[ |
7163 CachedDebugger == self ifTrue:[ |
7164 ^ true. |
7164 ^ true. |
7165 ]. |
7165 ]. |
7166 |
7166 |
7167 ^ false. |
7167 ^ false. |
7168 |
7168 |
7169 "Created: / 10-07-1997 / 15:22:43 / stefan" |
7169 "Created: / 10-07-1997 / 15:22:43 / stefan" |
7174 "do not remember myself any longer for next debug session" |
7174 "do not remember myself any longer for next debug session" |
7175 |
7175 |
7176 cachable := false. |
7176 cachable := false. |
7177 |
7177 |
7178 CachedExclusive == self ifTrue:[ |
7178 CachedExclusive == self ifTrue:[ |
7179 CachedExclusive := nil. |
7179 CachedExclusive := nil. |
7180 ]. |
7180 ]. |
7181 CachedDebugger == self ifTrue:[ |
7181 CachedDebugger == self ifTrue:[ |
7182 CachedDebugger := nil. |
7182 CachedDebugger := nil. |
7183 ]. |
7183 ]. |
7184 OpenDebuggers notNil ifTrue:[ |
7184 OpenDebuggers notNil ifTrue:[ |
7185 OpenDebuggers remove:self ifAbsent:[]. |
7185 OpenDebuggers remove:self ifAbsent:[]. |
7186 ]. |
7186 ]. |
7187 |
7187 |
7188 "Modified: 31.7.1997 / 21:20:11 / cg" |
7188 "Modified: 31.7.1997 / 21:20:11 / cg" |
7189 ! ! |
7189 ! ! |
7190 |
7190 |
7199 |
7199 |
7200 !DebugView methodsFor:'private-context handling'! |
7200 !DebugView methodsFor:'private-context handling'! |
7201 |
7201 |
7202 contextListEntryFor:aContext |
7202 contextListEntryFor:aContext |
7203 ^ Error |
7203 ^ Error |
7204 handle:[:ex | '???' ] |
7204 handle:[:ex | '???' ] |
7205 do:[ |
7205 do:[ |
7206 |s| |
7206 |s| |
7207 |
7207 |
7208 aContext selector == #doIt ifTrue:[ |
7208 aContext selector == #doIt ifTrue:[ |
7209 aContext receiver isNil ifTrue:[ |
7209 aContext receiver isNil ifTrue:[ |
7210 s := 'doIt' allBold |
7210 s := 'doIt' allBold |
7211 ] |
7211 ] |
7212 ]. |
7212 ]. |
7213 |
7213 |
7214 s := Text streamContents:[:s | aContext printOn:s ]. |
7214 s := Text streamContents:[:s | aContext printOn:s ]. |
7215 RememberedCallChain notNil ifTrue:[ |
7215 RememberedCallChain notNil ifTrue:[ |
7216 (RememberedCallChain includesIdentical:aContext) ifTrue:[ |
7216 (RememberedCallChain includesIdentical:aContext) ifTrue:[ |
7217 s := s colorizeAllWith:(Color red). |
7217 s := s colorizeAllWith:(Color red). |
7218 ]. |
7218 ]. |
7219 ]. |
7219 ]. |
7220 s |
7220 s |
7221 ]. |
7221 ]. |
7222 |
7222 |
7223 "Created: / 21-05-2007 / 13:30:24 / cg" |
7223 "Created: / 21-05-2007 / 13:30:24 / cg" |
7224 ! |
7224 ! |
7225 |
7225 |
7226 is:aHomeContext inCallingChainOf:aContext |
7226 is:aHomeContext inCallingChainOf:aContext |
7227 |con| |
7227 |con| |
7228 |
7228 |
7229 con := aContext. |
7229 con := aContext. |
7230 [con notNil and:[con ~~ aHomeContext]] whileTrue:[ |
7230 [con notNil and:[con ~~ aHomeContext]] whileTrue:[ |
7231 con := con sender |
7231 con := con sender |
7232 ]. |
7232 ]. |
7233 ^ con notNil |
7233 ^ con notNil |
7234 |
7234 |
7235 "Created: / 10-06-2012 / 18:46:29 / cg" |
7235 "Created: / 10-06-2012 / 18:46:29 / cg" |
7236 ! |
7236 ! |
7241 |c cReceiver| |
7241 |c cReceiver| |
7242 |
7242 |
7243 "/ look for a breakpoint-wrapper's context |
7243 "/ look for a breakpoint-wrapper's context |
7244 c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil. |
7244 c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil. |
7245 c isNil ifTrue:[ |
7245 c isNil ifTrue:[ |
7246 ^ true. |
7246 ^ true. |
7247 ]. |
7247 ]. |
7248 cReceiver := c receiver. |
7248 cReceiver := c receiver. |
7249 ^ cReceiver == BreakPointInterrupt |
7249 ^ cReceiver == BreakPointInterrupt |
7250 |
7250 |
7251 "Modified: / 01-08-2013 / 23:34:01 / cg" |
7251 "Modified: / 01-08-2013 / 23:34:01 / cg" |
7261 IgnoredHalts isNil ifTrue:[^ false]. |
7261 IgnoredHalts isNil ifTrue:[^ false]. |
7262 |
7262 |
7263 "/ look for a method breakpoint-wrapper's context |
7263 "/ look for a method breakpoint-wrapper's context |
7264 c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
7264 c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
7265 c notNil ifTrue:[ |
7265 c notNil ifTrue:[ |
7266 ((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[ |
7266 ((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[ |
7267 c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
7267 c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
7268 cReceiver := c receiver. |
7268 cReceiver := c receiver. |
7269 ]. |
7269 ]. |
7270 (cReceiver isKindOf:BreakPointInterrupt) ifFalse:[ |
7270 (cReceiver isKindOf:BreakPointInterrupt) ifFalse:[ |
7271 c := nil |
7271 c := nil |
7272 ] ifTrue:[ |
7272 ] ifTrue:[ |
7273 [ |
7273 [ |
7274 sender := c sender. |
7274 sender := c sender. |
7275 ((sReceiver := sender receiver) isKindOf:BreakPointInterrupt) |
7275 ((sReceiver := sender receiver) isKindOf:BreakPointInterrupt) |
7276 or:[ sReceiver == BreakPointInterrupt ] |
7276 or:[ sReceiver == BreakPointInterrupt ] |
7277 ] whileTrue:[ |
7277 ] whileTrue:[ |
7278 c := sender |
7278 c := sender |
7279 ]. |
7279 ]. |
7280 [ (sender := c sender) isBlockContext ] whileTrue:[ |
7280 [ (sender := c sender) isBlockContext ] whileTrue:[ |
7281 c := sender |
7281 c := sender |
7282 ]. |
7282 ]. |
7283 sender := nil. "/ avoid keeping a reference to this context |
7283 sender := nil. "/ avoid keeping a reference to this context |
7284 ]. |
7284 ]. |
7285 ]. |
7285 ]. |
7286 "/ Transcript showCR:c. |
7286 "/ Transcript showCR:c. |
7287 c isNil ifTrue:[ |
7287 c isNil ifTrue:[ |
7288 "/ look for halts or explicit breakpoints |
7288 "/ look for halts or explicit breakpoints |
7289 c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
7289 c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
7290 c isNil ifTrue:[ |
7290 c isNil ifTrue:[ |
7291 c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
7291 c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
7292 c isNil ifTrue:[ |
7292 c isNil ifTrue:[ |
7293 ^ false |
7293 ^ false |
7294 ]. |
7294 ]. |
7295 breakpointParameter := c argAt:1. |
7295 breakpointParameter := c argAt:1. |
7296 (self class |
7296 (self class |
7297 isBreakpointToBeIgnoredForParameter:breakpointParameter |
7297 isBreakpointToBeIgnoredForParameter:breakpointParameter |
7298 context:(c sender) |
7298 context:(c sender) |
7299 modifyEntryCount:true |
7299 modifyEntryCount:true |
7300 ) ifTrue:[ |
7300 ) ifTrue:[ |
7301 ^ true. |
7301 ^ true. |
7302 ]. |
7302 ]. |
7303 ]. |
7303 ]. |
7304 ]. |
7304 ]. |
7305 |
7305 |
7306 c := c sender. |
7306 c := c sender. |
7307 "/ a code-breakpoint ? |
7307 "/ a code-breakpoint ? |
7308 (c receiver isKindOf:Breakpoint) ifTrue:[ |
7308 (c receiver isKindOf:Breakpoint) ifTrue:[ |
7309 c := c sender. |
7309 c := c sender. |
7310 ]. |
7310 ]. |
7311 haltingMethod := c method. |
7311 haltingMethod := c method. |
7312 |
7312 |
7313 haltingMethod isWrapped ifTrue:[ |
7313 haltingMethod isWrapped ifTrue:[ |
7314 lineNrInHaltingMethod := 1. |
7314 lineNrInHaltingMethod := 1. |
7315 ] ifFalse:[ |
7315 ] ifFalse:[ |
7316 lineNrInHaltingMethod := c lineNumber. |
7316 lineNrInHaltingMethod := c lineNumber. |
7317 "/ Transcript showCR:c. |
7317 "/ Transcript showCR:c. |
7318 ]. |
7318 ]. |
7319 |
7319 |
7320 ^ self class |
7320 ^ self class |
7321 isHaltToBeIgnoredIn:haltingMethod |
7321 isHaltToBeIgnoredIn:haltingMethod |
7322 atLineNr:lineNrInHaltingMethod |
7322 atLineNr:lineNrInHaltingMethod |
7323 context:c |
7323 context:c |
7324 modifyEntryCount:true. |
7324 modifyEntryCount:true. |
7325 |
7325 |
7326 "Created: / 22-10-2010 / 12:09:53 / cg" |
7326 "Created: / 22-10-2010 / 12:09:53 / cg" |
7327 "Modified: / 06-03-2012 / 12:54:09 / cg" |
7327 "Modified: / 06-03-2012 / 12:54:09 / cg" |
7328 ! |
7328 ! |
7329 |
7329 |
7337 |
7337 |
7338 setContext:aContext releaseInspectors:releaseInspectors |
7338 setContext:aContext releaseInspectors:releaseInspectors |
7339 "show calling chain from aContext in the walk-back listview. |
7339 "show calling chain from aContext in the walk-back listview. |
7340 Most complications here arise from filtering less-interesting contexts |
7340 Most complications here arise from filtering less-interesting contexts |
7341 if not in verbose-context mode or when hiding implementation contexts. |
7341 if not in verbose-context mode or when hiding implementation contexts. |
7342 There is a lot of heuristic magic here, to make the debugger as useful |
7342 There is a lot of heuristic magic here, to make the debugger as useful |
7343 as possible for the user (but not particularly for the debugger-developer)" |
7343 as possible for the user (but not particularly for the debugger-developer)" |
7344 |
7344 |
7345 |con sel text method caller caller2 called called2 m count c cc sndr |
7345 |con sel text method caller caller2 called called2 m count c cc sndr |
7346 suspendContext calledBySuspendContext nm h calledContext show2 |
7346 suspendContext calledBySuspendContext nm h calledContext show2 |
7347 alreadyInApplicationCode verboseBacktrace| |
7347 alreadyInApplicationCode verboseBacktrace| |
7357 firstContext := aContext. |
7357 firstContext := aContext. |
7358 verboseBacktrace := self verboseBacktraceHolder value. |
7358 verboseBacktrace := self verboseBacktraceHolder value. |
7359 |
7359 |
7360 m := contextView middleButtonMenu. |
7360 m := contextView middleButtonMenu. |
7361 m notNil ifTrue:[ |
7361 m notNil ifTrue:[ |
7362 m disable:#showMore. |
7362 m disable:#showMore. |
7363 ]. |
7363 ]. |
7364 canShowMore := false. |
7364 canShowMore := false. |
7365 |
7365 |
7366 aContext isNil ifTrue:[ |
7366 aContext isNil ifTrue:[ |
7367 text := Array with:'** no context **'. |
7367 text := Array with:'** no context **'. |
7368 contextArray := nil. |
7368 contextArray := nil. |
7369 ] ifFalse:[ |
7369 ] ifFalse:[ |
7370 text := OrderedCollection new:nChainShown. |
7370 text := OrderedCollection new:nChainShown. |
7371 contextArray := OrderedCollection new:nChainShown. |
7371 contextArray := OrderedCollection new:nChainShown. |
7372 |
7372 |
7373 con := aContext. |
7373 con := aContext. |
7374 calledContext := nil. |
7374 calledContext := nil. |
7375 |
7375 |
7376 '======================================' print. con printCR. |
7376 '======================================' print. con printCR. |
7377 alreadyInApplicationCode := |
7377 alreadyInApplicationCode := |
7378 con receiver isLazyValue not "/ careful to not force futures/lazy values |
7378 con receiver isLazyValue not "/ careful to not force futures/lazy values |
7379 and:[con receiver isKindOf:ApplicationModel]. |
7379 and:[con receiver isKindOf:ApplicationModel]. |
7380 |
7380 |
7381 verboseBacktrace ~~ true ifTrue:[ |
7381 verboseBacktrace ~~ true ifTrue:[ |
7382 "/ with dense backtrace, hide the ProcessorScheduler |
7382 "/ with dense backtrace, hide the ProcessorScheduler |
7383 "/ contexts at the top; look for a Process>>suspend* |
7383 "/ contexts at the top; look for a Process>>suspend* |
7384 "/ context within the first 10 contexts |
7384 "/ context within the first 10 contexts |
7385 |
7385 |
7386 suspendContext := nil. |
7386 suspendContext := nil. |
7387 c := con. |
7387 c := con. |
7388 1 to:10 do:[:i | |
7388 1 to:10 do:[:i | |
7389 |selector| |
7389 |selector| |
7390 |
7390 |
7391 c notNil ifTrue:[ |
7391 c notNil ifTrue:[ |
7392 selector := c selector. |
7392 selector := c selector. |
7393 selector notNil ifTrue:[ |
7393 selector notNil ifTrue:[ |
7394 (selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[ |
7394 (selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[ |
7395 suspendContext := c. |
7395 suspendContext := c. |
7396 calledBySuspendContext := cc. |
7396 calledBySuspendContext := cc. |
7397 ]. |
7397 ]. |
7398 ]. |
7398 ]. |
7399 cc := c. |
7399 cc := c. |
7400 c := c sender. |
7400 c := c sender. |
7401 ] |
7401 ] |
7402 ]. |
7402 ]. |
7403 suspendContext notNil ifTrue:[ |
7403 suspendContext notNil ifTrue:[ |
7404 con := suspendContext. |
7404 con := suspendContext. |
7405 calledContext := calledBySuspendContext. |
7405 calledContext := calledBySuspendContext. |
7406 suspendContext := nil |
7406 suspendContext := nil |
7407 ]. |
7407 ]. |
7408 ]. |
7408 ]. |
7409 "/ Transcript show:'1 '; showCR:con. |
7409 "/ Transcript show:'1 '; showCR:con. |
7410 con notNil ifTrue:[ |
7410 con notNil ifTrue:[ |
7411 "/ hide the halt implementation |
7411 "/ hide the halt implementation |
7412 sel := con selector. |
7412 sel := con selector. |
7413 (self haltSelectors includes:sel) ifTrue:[ |
7413 (self haltSelectors includes:sel) ifTrue:[ |
7414 (method := con method) notNil ifTrue:[ |
7414 (method := con method) notNil ifTrue:[ |
7415 method mclass == Object ifTrue:[ |
7415 method mclass == Object ifTrue:[ |
7416 (sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[ |
7416 (sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[ |
7417 isStoppedAtBreakPointWithParameter := true. |
7417 isStoppedAtBreakPointWithParameter := true. |
7418 breakPointParameter := con argAt:1. |
7418 breakPointParameter := con argAt:1. |
7419 ]. |
7419 ]. |
7420 isStoppedAtHaltOrBreakPoint := true. |
7420 isStoppedAtHaltOrBreakPoint := true. |
7421 verboseBacktrace ~~ true ifTrue:[ |
7421 verboseBacktrace ~~ true ifTrue:[ |
7422 calledContext := con. |
7422 calledContext := con. |
7423 con := con sender. |
7423 con := con sender. |
7424 ] |
7424 ] |
7425 ] ifFalse:[ |
7425 ] ifFalse:[ |
7426 method mclass == Breakpoint ifTrue:[ |
7426 method mclass == Breakpoint ifTrue:[ |
7427 isStoppedAtHaltOrBreakPoint := true. |
7427 isStoppedAtHaltOrBreakPoint := true. |
7428 isStoppedAtStatementBreakpoint := true. |
7428 isStoppedAtStatementBreakpoint := true. |
7429 verboseBacktrace ~~ true ifTrue:[ |
7429 verboseBacktrace ~~ true ifTrue:[ |
7430 calledContext := con. |
7430 calledContext := con. |
7431 con := con sender. |
7431 con := con sender. |
7432 ]. |
7432 ]. |
7433 "/ Transcript show:'2 '; showCR:con. |
7433 "/ Transcript show:'2 '; showCR:con. |
7434 ]. |
7434 ]. |
7435 ]. |
7435 ]. |
7436 ]. |
7436 ]. |
7437 ]. |
7437 ]. |
7438 ]. |
7438 ]. |
7439 |
7439 |
7440 (verboseBacktrace not or:[ hideSupportCode]) ifTrue:[ |
7440 (verboseBacktrace not or:[ hideSupportCode]) ifTrue:[ |
7441 [ |
7441 [ |
7442 con notNil |
7442 con notNil |
7443 and:[ con isBlockContext not |
7443 and:[ con isBlockContext not |
7444 and:[ con method notNil |
7444 and:[ con method notNil |
7445 and:[ (con method shouldBeSkippedInDebuggersWalkBack) |
7445 and:[ (con method shouldBeSkippedInDebuggersWalkBack) |
7446 and:[ (self haltSelectors includes: con selector) not]]]] |
7446 and:[ (self haltSelectors includes: con selector) not]]]] |
7447 ] whileTrue:[ |
7447 ] whileTrue:[ |
7448 "/ Transcript show:'xx '; showCR:con. |
7448 "/ Transcript show:'xx '; showCR:con. |
7449 calledContext := con. |
7449 calledContext := con. |
7450 con := con sender |
7450 con := con sender |
7451 ]. |
7451 ]. |
7452 ]. |
7452 ]. |
7453 |
7453 |
7454 " |
7454 " |
7455 get them all, by walking along the caller chain. |
7455 get them all, by walking along the caller chain. |
7456 depending on the settings, skip some intermediate contexts |
7456 depending on the settings, skip some intermediate contexts |
7457 (such as collection enumeration implementations), which are usually not |
7457 (such as collection enumeration implementations), which are usually not |
7458 of interest when debugging an application. |
7458 of interest when debugging an application. |
7459 On the fly, gather some additional information |
7459 On the fly, gather some additional information |
7460 such as: are we at a halt/breakpoint, are we in a modal dialog opened, |
7460 such as: are we at a halt/breakpoint, are we in a modal dialog opened, |
7461 are we coming from an application model's action etc. |
7461 are we coming from an application model's action etc. |
7462 " |
7462 " |
7463 count := 0. |
7463 count := 0. |
7464 [con notNil and:[count <= nChainShown]] whileTrue:[ |
7464 [con notNil and:[count <= nChainShown]] whileTrue:[ |
7465 "/ remember any halt/breakpoint or openModal on the fly |
7465 "/ remember any halt/breakpoint or openModal on the fly |
7466 '---' print. con printCR. |
7466 '---' print. con printCR. |
7467 sel := con selector. |
7467 sel := con selector. |
7468 (self haltSelectors includes:sel) ifTrue:[ |
7468 (self haltSelectors includes:sel) ifTrue:[ |
7469 (method := con method) notNil ifTrue:[ |
7469 (method := con method) notNil ifTrue:[ |
7470 method mclass == Object ifTrue:[ |
7470 method mclass == Object ifTrue:[ |
7471 (sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[ |
7471 (sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[ |
7472 isStoppedAtBreakPointWithParameter := true. |
7472 isStoppedAtBreakPointWithParameter := true. |
7473 breakPointParameter := con argAt:1. |
7473 breakPointParameter := con argAt:1. |
7474 ]. |
7474 ]. |
7475 isStoppedAtHaltOrBreakPoint := true. |
7475 isStoppedAtHaltOrBreakPoint := true. |
7476 ] ifFalse:[ |
7476 ] ifFalse:[ |
7477 method mclass == Breakpoint ifTrue:[ |
7477 method mclass == Breakpoint ifTrue:[ |
7478 isStoppedAtHaltOrBreakPoint := true. |
7478 isStoppedAtHaltOrBreakPoint := true. |
7479 ]. |
7479 ]. |
7480 ] |
7480 ] |
7481 ] |
7481 ] |
7482 ] ifFalse:[ |
7482 ] ifFalse:[ |
7483 ((sel == #openModal) or:[sel == #openModal:]) ifTrue:[ |
7483 ((sel == #openModal) or:[sel == #openModal:]) ifTrue:[ |
7484 isStoppedInModalDialog := true. |
7484 isStoppedInModalDialog := true. |
7485 ] ifFalse:[ |
7485 ] ifFalse:[ |
7486 alreadyInApplicationCode ifFalse:[ |
7486 alreadyInApplicationCode ifFalse:[ |
7487 (con receiver isLazyValue not "/ careful to not force futures/lazy values |
7487 (con receiver isLazyValue not "/ careful to not force futures/lazy values |
7488 and:[con receiver isKindOf:ApplicationModel]) ifTrue:[ |
7488 and:[con receiver isKindOf:ApplicationModel]) ifTrue:[ |
7489 isStoppedInApplicationAction := true. |
7489 isStoppedInApplicationAction := true. |
7490 ] |
7490 ] |
7491 ] |
7491 ] |
7492 ] |
7492 ] |
7493 ]. |
7493 ]. |
7494 |
7494 |
7495 [ |
7495 [ |
7496 |show1| |
7496 |show1| |
7497 |
7497 |
7498 show1 := self showingContext1:con calling:calledContext. |
7498 show1 := self showingContext1:con calling:calledContext. |
7499 DebuggingDebugger3 := true== true ifTrue:[ |
7499 DebuggingDebugger3 == true ifTrue:[ |
7500 'showingContext1: (' print. con print. ') --> ' print. show1 printCR. |
7500 'showingContext1: (' print. con print. ') --> ' print. show1 printCR. |
7501 ]. |
7501 ]. |
7502 show1 |
7502 show1 |
7503 ] whileFalse:[ |
7503 ] whileFalse:[ |
7504 calledContext := con. |
7504 calledContext := con. |
7505 con := con sender. |
7505 con := con sender. |
7506 ]. |
7506 ]. |
7507 |
7507 |
7508 show2 := self showingContext2:con nesting:count. |
7508 show2 := self showingContext2:con nesting:count. |
7509 DebuggingDebugger3 == true ifTrue:[ |
7509 DebuggingDebugger3 == true ifTrue:[ |
7510 'showingContext2: (' print. con print. ') --> ' print. show2 printCR. |
7510 'showingContext2: (' print. con print. ') --> ' print. show2 printCR. |
7511 ]. |
7511 ]. |
7512 |
7512 |
7513 show2 ifTrue:[ |
7513 show2 ifTrue:[ |
7514 contextArray add:con. |
7514 contextArray add:con. |
7515 |
7515 |
7516 (MoreDebuggingDetail == true) ifTrue:[ |
7516 (MoreDebuggingDetail == true) ifTrue:[ |
7517 nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
7517 nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
7518 ] ifFalse:[ |
7518 ] ifFalse:[ |
7519 nm := self contextListEntryFor:con. |
7519 nm := self contextListEntryFor:con. |
7520 ]. |
7520 ]. |
7521 text add:nm. |
7521 text add:nm. |
7522 count := count + 1. |
7522 count := count + 1. |
7523 ]. |
7523 ]. |
7524 |
7524 |
7525 "/ with hidden support code, skip over internals of exceptions |
7525 "/ with hidden support code, skip over internals of exceptions |
7526 hideSupportCode == true ifTrue:[ |
7526 hideSupportCode == true ifTrue:[ |
7527 "/ Transcript showCR:'x'. |
7527 "/ Transcript showCR:'x'. |
7528 (con isBlockContext |
7528 (con isBlockContext |
7529 and:[ (h := con home) notNil |
7529 and:[ (h := con home) notNil |
7530 and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[ |
7530 and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[ |
7531 |blocksReceiver| |
7531 |blocksReceiver| |
7532 blocksReceiver := con receiver. |
7532 blocksReceiver := con receiver. |
7533 c := con sender. |
7533 c := con sender. |
7534 [ |
7534 [ |
7535 c notNil |
7535 c notNil |
7536 and:[ |
7536 and:[ |
7537 sndr := c sender. |
7537 sndr := c sender. |
7538 (sndr ~= h) |
7538 (sndr ~= h) |
7539 and:[ |
7539 and:[ |
7540 blocksReceiver isCollection "/ skip collection implementations |
7540 blocksReceiver isCollection "/ skip collection implementations |
7541 or:[ ( #( #'handle:do:' "/ skip exception implementations |
7541 or:[ ( #( #'handle:do:' "/ skip exception implementations |
7542 #'handleDo:' |
7542 #'handleDo:' |
7543 #'answer:do:' |
7543 #'answer:do:' |
7544 #'ensure:' ) includes: c selector ) |
7544 #'ensure:' ) includes: c selector ) |
7545 or:[ #'perform:*' "/ skip perform implementations |
7545 or:[ #'perform:*' "/ skip perform implementations |
7546 match: c selector ]] |
7546 match: c selector ]] |
7547 ] |
7547 ] |
7548 ] |
7548 ] |
7549 ] whileTrue:[ |
7549 ] whileTrue:[ |
7550 c := sndr |
7550 c := sndr |
7551 ]. |
7551 ]. |
7552 c notNil ifTrue:[ |
7552 c notNil ifTrue:[ |
7553 con := c "sender". |
7553 con := c "sender". |
7554 ]. |
7554 ]. |
7555 ]. |
7555 ]. |
7556 ]. |
7556 ]. |
7557 |
7557 |
7558 "/ |
7558 "/ |
7559 "/ kludge: if it's a wrapped method, then hide the wrap-call |
7559 "/ kludge: if it's a wrapped method, then hide the wrap-call |
7560 "/ |
7560 "/ |
7561 method := con method. |
7561 method := con method. |
7562 method notNil ifTrue:[ |
7562 method notNil ifTrue:[ |
7563 called := con. |
7563 called := con. |
7564 caller := con sender. |
7564 caller := con sender. |
7565 (caller notNil and:[caller receiver == method]) ifTrue:[ |
7565 (caller notNil and:[caller receiver == method]) ifTrue:[ |
7566 called2 := caller. |
7566 called2 := caller. |
7567 caller2 := caller sender. |
7567 caller2 := caller sender. |
7568 caller2 notNil ifTrue:[ |
7568 caller2 notNil ifTrue:[ |
7569 (caller2 method isWrapped |
7569 (caller2 method isWrapped |
7570 and:[ caller2 method originalMethod == method ]) ifTrue:[ |
7570 and:[ caller2 method originalMethod == method ]) ifTrue:[ |
7571 calledContext := called2. |
7571 calledContext := called2. |
7572 con := caller2 |
7572 con := caller2 |
7573 ]. |
7573 ]. |
7574 ]. |
7574 ]. |
7575 |
7575 |
7576 ]. |
7576 ]. |
7577 caller := caller2 := nil |
7577 caller := caller2 := nil |
7578 ]. |
7578 ]. |
7579 |
7579 |
7580 "/ with dense backtrace, skip the doIt method's context |
7580 "/ with dense backtrace, skip the doIt method's context |
7581 "/ (its dummy anyway) and fake that context's name |
7581 "/ (its dummy anyway) and fake that context's name |
7582 |
7582 |
7583 verboseBacktrace ~~ true ifTrue:[ |
7583 verboseBacktrace ~~ true ifTrue:[ |
7584 (con isBlockContext |
7584 (con isBlockContext |
7585 and:[(h := con home) == con sender |
7585 and:[(h := con home) == con sender |
7586 and:[h notNil |
7586 and:[h notNil |
7587 and:[(self setOfHiddenCallingSelectors includes:h selector) |
7587 and:[(self setOfHiddenCallingSelectors includes:h selector) |
7588 and:[h method who isNil]]]]) ifTrue:[ |
7588 and:[h method who isNil]]]]) ifTrue:[ |
7589 calledContext := con. |
7589 calledContext := con. |
7590 con := con sender. |
7590 con := con sender. |
7591 text removeLast. |
7591 text removeLast. |
7592 |
7592 |
7593 text add:(self contextListEntryFor:con methodHome). |
7593 text add:(self contextListEntryFor:con methodHome). |
7594 ]. |
7594 ]. |
7595 h := nil. "/ never keep refs to contexts unless you really need them ... |
7595 h := nil. "/ never keep refs to contexts unless you really need them ... |
7596 ]. |
7596 ]. |
7597 |
7597 |
7598 "/ with dense backtrace, don't show contexts below the doIt |
7598 "/ with dense backtrace, don't show contexts below the doIt |
7599 ( verboseBacktrace ~~ true |
7599 ( verboseBacktrace ~~ true |
7600 and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
7600 and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
7601 con := nil. |
7601 con := nil. |
7602 ] ifFalse:[ |
7602 ] ifFalse:[ |
7603 calledContext := con. |
7603 calledContext := con. |
7604 con := con sender |
7604 con := con sender |
7605 ]. |
7605 ]. |
7606 ]. |
7606 ]. |
7607 |
7607 |
7608 " |
7608 " |
7609 did we reach the end ? |
7609 did we reach the end ? |
7610 " |
7610 " |
7611 (con isNil or:[con sender isNil]) ifTrue:[ |
7611 (con isNil or:[con sender isNil]) ifTrue:[ |
7612 |
7612 |
7613 "/ the very last one is the startup context |
7613 "/ the very last one is the startup context |
7614 "/ (in main) - it has nil as receiver and nil as selector |
7614 "/ (in main) - it has nil as receiver and nil as selector |
7615 |
7615 |
7616 (contextArray notEmpty |
7616 (contextArray notEmpty |
7617 and:[contextArray last selector isNil]) ifTrue:[ |
7617 and:[contextArray last selector isNil]) ifTrue:[ |
7618 contextArray removeLast. |
7618 contextArray removeLast. |
7619 text removeLast |
7619 text removeLast |
7620 ]. |
7620 ]. |
7621 |
7621 |
7622 verboseBacktrace ~~ true ifTrue:[ |
7622 verboseBacktrace ~~ true ifTrue:[ |
7623 "/ in dense mode, remove process startup contexts (if any) |
7623 "/ in dense mode, remove process startup contexts (if any) |
7624 |
7624 |
7625 (contextArray size > 0 |
7625 (contextArray size > 0 |
7626 and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
7626 and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
7627 con selector == #start ifTrue:[ |
7627 con selector == #start ifTrue:[ |
7628 contextArray removeLast. |
7628 contextArray removeLast. |
7629 text removeLast. |
7629 text removeLast. |
7630 |
7630 |
7631 [contextArray size > 0 |
7631 [contextArray size > 0 |
7632 and:[contextArray last methodHome == con]] whileTrue:[ |
7632 and:[contextArray last methodHome == con]] whileTrue:[ |
7633 contextArray removeLast. |
7633 contextArray removeLast. |
7634 text removeLast. |
7634 text removeLast. |
7635 ] |
7635 ] |
7636 ] |
7636 ] |
7637 ] |
7637 ] |
7638 ] |
7638 ] |
7639 ] ifFalse:[ |
7639 ] ifFalse:[ |
7640 m notNil ifTrue:[ |
7640 m notNil ifTrue:[ |
7641 m enable:#showMore. |
7641 m enable:#showMore. |
7642 ]. |
7642 ]. |
7643 canShowMore := true. |
7643 canShowMore := true. |
7644 text add:(resources string:'*** more walkback follows - click here to see them ***') |
7644 text add:(resources string:'*** more walkback follows - click here to see them ***') |
7645 ]. |
7645 ]. |
7646 ]. |
7646 ]. |
7647 |
7647 |
7648 contextView setList:text. |
7648 contextView setList:text. |
7649 |
7649 |
7650 releaseInspectors ifTrue:[ |
7650 releaseInspectors ifTrue:[ |
7651 receiverInspector release. |
7651 receiverInspector release. |
7652 contextInspector release. |
7652 contextInspector release. |
7653 ]. |
7653 ]. |
7654 |
7654 |
7655 m notNil ifTrue:[ |
7655 m notNil ifTrue:[ |
7656 m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
7656 m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
7657 ]. |
7657 ]. |
7658 self updateMenuItems. |
7658 self updateMenuItems. |
7659 ^ true |
7659 ^ true |
7660 |
7660 |
7661 "Created: / 14-12-1995 / 19:10:31 / cg" |
7661 "Created: / 14-12-1995 / 19:10:31 / cg" |
7668 |
7668 |
7669 |con| |
7669 |con| |
7670 |
7670 |
7671 con := aContext. |
7671 con := aContext. |
7672 self verboseBacktraceHolder value ifFalse:[ |
7672 self verboseBacktraceHolder value ifFalse:[ |
7673 (con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
7673 (con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
7674 con := con sender. |
7674 con := con sender. |
7675 (con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
7675 (con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
7676 con := con sender. |
7676 con := con sender. |
7677 ]. |
7677 ]. |
7678 ]. |
7678 ]. |
7679 ]. |
7679 ]. |
7680 ^ self setContext:con releaseInspectors:true |
7680 ^ self setContext:con releaseInspectors:true |
7681 |
7681 |
7682 "Created: / 20.10.1996 / 18:10:21 / cg" |
7682 "Created: / 20.10.1996 / 18:10:21 / cg" |
7683 "Modified: / 17.1.1998 / 12:43:19 / cg" |
7683 "Modified: / 17.1.1998 / 12:43:19 / cg" |
7699 mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
7699 mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
7700 |
7700 |
7701 "/ to avoid firing/waiting the lazy or future |
7701 "/ to avoid firing/waiting the lazy or future |
7702 recIsException := (rec isLazyValue not) and:[rec isException]. |
7702 recIsException := (rec isLazyValue not) and:[rec isException]. |
7703 aContext sender notNil ifTrue:[ |
7703 aContext sender notNil ifTrue:[ |
7704 senderRec := aContext sender receiver |
7704 senderRec := aContext sender receiver |
7705 ]. |
7705 ]. |
7706 |
7706 |
7707 DebuggingDebugger3 == true ifTrue:[ |
7707 DebuggingDebugger3 == true ifTrue:[ |
7708 'showingContext1: (' print. aContext print. |
7708 'showingContext1: (' print. aContext print. |
7709 ') calling: (' print. calledContext print. |
7709 ') calling: (' print. calledContext print. |
7710 ')' printCR. |
7710 ')' printCR. |
7711 ]. |
7711 ]. |
7712 |
7712 |
7713 (#(doCallHandler: doRaise |
7713 (#(doCallHandler: doRaise |
7714 ) includes:sel) |
7714 ) includes:sel) |
7715 ifTrue:[ |
7715 ifTrue:[ |
7716 recIsException ifTrue:[ ^ false]. |
7716 recIsException ifTrue:[ ^ false]. |
7717 ]. |
7717 ]. |
7718 |
7718 |
7719 (#(raise raiseRequest |
7719 (#(raise raiseRequest |
7720 ) includes:sel) |
7720 ) includes:sel) |
7721 ifTrue:[ |
7721 ifTrue:[ |
7722 recIsException ifTrue:[ |
7722 recIsException ifTrue:[ |
7723 (senderRec isLazyValue not |
7723 (senderRec isLazyValue not |
7724 and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
7724 and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
7725 ]. |
7725 ]. |
7726 ]. |
7726 ]. |
7727 |
7727 |
7728 (#(doWhile: |
7728 (#(doWhile: |
7729 ) includes:sel) |
7729 ) includes:sel) |
7730 ifTrue:[ |
7730 ifTrue:[ |
7731 rec isBlock ifTrue:[ |
7731 rec isBlock ifTrue:[ |
7732 true "aContext sender isBlockContext" ifTrue:[^ false]. |
7732 true "aContext sender isBlockContext" ifTrue:[^ false]. |
7733 ]. |
7733 ]. |
7734 ]. |
7734 ]. |
7735 |
7735 |
7736 calledContext notNil ifTrue:[ |
7736 calledContext notNil ifTrue:[ |
7737 calledSel := calledContext selector. |
7737 calledSel := calledContext selector. |
7738 calledRec := calledContext receiver. |
7738 calledRec := calledContext receiver. |
7739 |
7739 |
7740 calledRec isBlock ifTrue:[ |
7740 calledRec isBlock ifTrue:[ |
7741 (calledSel == #ensure:) ifTrue:[^ false]. |
7741 (calledSel == #ensure:) ifTrue:[^ false]. |
7742 (calledSel == #ifCurtailed:) ifTrue:[^ false]. |
7742 (calledSel == #ifCurtailed:) ifTrue:[^ false]. |
7743 ]. |
7743 ]. |
7744 (calledSel == #handle:do:) ifTrue:[^ false]. |
7744 (calledSel == #handle:do:) ifTrue:[^ false]. |
7745 (calledSel == #answer:do:) ifTrue:[^ false]. |
7745 (calledSel == #answer:do:) ifTrue:[^ false]. |
7746 |
7746 |
7747 "/ calledRec isLazyValue ifFalse:[ |
7747 "/ calledRec isLazyValue ifFalse:[ |
7748 "/ ((calledSel == #doWhile:) |
7748 "/ ((calledSel == #doWhile:) |
7749 "/ and:[calledRec isBlock]) |
7749 "/ and:[calledRec isBlock]) |
7750 "/ ifTrue:[^ false]. |
7750 "/ ifTrue:[^ false]. |
7759 "/ ifTrue:[^ false]. |
7759 "/ ifTrue:[^ false]. |
7760 "/ ]. |
7760 "/ ]. |
7761 ]. |
7761 ]. |
7762 |
7762 |
7763 (#(handleDo:) includes:sel) |
7763 (#(handleDo:) includes:sel) |
7764 ifTrue:[ |
7764 ifTrue:[ |
7765 (calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
7765 (calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
7766 ]. |
7766 ]. |
7767 (#( |
7767 (#( |
7768 withCursor:do: |
7768 withCursor:do: |
7769 withWaitCursorDo: |
7769 withWaitCursorDo: |
7770 withReadCursorDo: |
7770 withReadCursorDo: |
7771 withWriteCursorDo: |
7771 withWriteCursorDo: |
7772 withSearchCursorDo: |
7772 withSearchCursorDo: |
7773 ) includes:sel) |
7773 ) includes:sel) |
7774 ifTrue:[ |
7774 ifTrue:[ |
7775 (mthdClass == TopView) ifTrue:[^ false]. |
7775 (mthdClass == TopView) ifTrue:[^ false]. |
7776 (mthdClass == ApplicationModel) ifTrue:[^ false]. |
7776 (mthdClass == ApplicationModel) ifTrue:[^ false]. |
7777 (mthdClass == WindowGroup) ifTrue:[^ false]. |
7777 (mthdClass == WindowGroup) ifTrue:[^ false]. |
7778 ]. |
7778 ]. |
7779 |
7779 |
7780 (#( |
7780 (#( |
7781 wait |
7781 wait |
7782 waitWithTimeout: |
7782 waitWithTimeout: |
7783 waitWithTimeoutMs: |
7783 waitWithTimeoutMs: |
7784 ) includes:sel) |
7784 ) includes:sel) |
7785 ifTrue:[ |
7785 ifTrue:[ |
7786 (mthdClass == Semaphore) ifTrue:[^ false]. |
7786 (mthdClass == Semaphore) ifTrue:[^ false]. |
7787 (mthdClass == SemaphoreSet) ifTrue:[^ false]. |
7787 (mthdClass == SemaphoreSet) ifTrue:[^ false]. |
7788 ]. |
7788 ]. |
7789 |
7789 |
7790 ^ true |
7790 ^ true |
7791 |
7791 |
7792 "Created: / 17-11-2001 / 22:24:06 / cg" |
7792 "Created: / 17-11-2001 / 22:24:06 / cg" |
7793 "Modified: / 27-07-2012 / 17:30:18 / cg" |
7793 "Modified: / 27-07-2012 / 17:30:18 / cg" |
7808 sel := aContext selector. |
7808 sel := aContext selector. |
7809 mClass := aContext methodClass. |
7809 mClass := aContext methodClass. |
7810 |
7810 |
7811 sender := aContext sender. |
7811 sender := aContext sender. |
7812 sender notNil ifTrue:[ |
7812 sender notNil ifTrue:[ |
7813 senderSelector := sender selector. |
7813 senderSelector := sender selector. |
7814 senderReceiver := sender receiver. |
7814 senderReceiver := sender receiver. |
7815 senderReceiverClass := senderReceiver class. |
7815 senderReceiverClass := senderReceiver class. |
7816 ]. |
7816 ]. |
7817 |
7817 |
7818 sel == #withCursor:do: ifTrue:[ |
7818 sel == #withCursor:do: ifTrue:[ |
7819 (mClass == WindowGroup) ifTrue:[^ false]. |
7819 (mClass == WindowGroup) ifTrue:[^ false]. |
7820 (mClass == TopView) ifTrue:[^ false]. |
7820 (mClass == TopView) ifTrue:[^ false]. |
7821 ]. |
7821 ]. |
7822 (sel == #withExecuteCursorDo: |
7822 (sel == #withExecuteCursorDo: |
7823 or:[sel == #withWaitCursorDo:]) ifTrue:[ |
7823 or:[sel == #withWaitCursorDo:]) ifTrue:[ |
7824 (mClass == DisplaySurface) ifTrue:[^ false]. |
7824 (mClass == DisplaySurface) ifTrue:[^ false]. |
7825 ]. |
7825 ]. |
7826 |
7826 |
7827 (sel == #do: |
7827 (sel == #do: |
7828 or:[sel == #from:to:do: |
7828 or:[sel == #from:to:do: |
7829 or:[sel == #keysAndValuesDo: |
7829 or:[sel == #keysAndValuesDo: |
7830 or:[sel == #doWithIndex:]]]) ifTrue:[ |
7830 or:[sel == #doWithIndex:]]]) ifTrue:[ |
7831 mClass == Array ifTrue:[^ false]. |
7831 mClass == Array ifTrue:[^ false]. |
7832 mClass == OrderedCollection ifTrue:[^ false]. |
7832 mClass == OrderedCollection ifTrue:[^ false]. |
7833 mClass == Set ifTrue:[^ false]. |
7833 mClass == Set ifTrue:[^ false]. |
7834 mClass == Dictionary ifTrue:[^ false]. |
7834 mClass == Dictionary ifTrue:[^ false]. |
7835 mClass == Interval ifTrue:[^ false]. |
7835 mClass == Interval ifTrue:[^ false]. |
7836 ]. |
7836 ]. |
7837 (sel == #perform: |
7837 (sel == #perform: |
7838 or:[sel == #perform:with: |
7838 or:[sel == #perform:with: |
7839 or:[sel == #perform:with:with: |
7839 or:[sel == #perform:with:with: |
7840 or:[sel == #perform:with:with:with: |
7840 or:[sel == #perform:with:with:with: |
7841 or:[sel == #perform:with:with:with:with: |
7841 or:[sel == #perform:with:with:with:with: |
7842 or:[sel == #perform:withArguments: |
7842 or:[sel == #perform:withArguments: |
7843 or:[sel == #perform:with:ifNotUnderstood: |
7843 or:[sel == #perform:with:ifNotUnderstood: |
7844 or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]) |
7844 or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]) |
7845 ifTrue:[ |
7845 ifTrue:[ |
7846 hideSupportCode == true ifTrue:[ |
7846 hideSupportCode == true ifTrue:[ |
7847 "/ 'x' printCR. |
7847 "/ 'x' printCR. |
7848 mClass == Object ifTrue:[^ false] |
7848 mClass == Object ifTrue:[^ false] |
7849 ]. |
7849 ]. |
7850 nesting == 0 ifTrue:[^ true]. |
7850 nesting == 0 ifTrue:[^ true]. |
7851 mClass == Array ifTrue:[^ false]. |
7851 mClass == Array ifTrue:[^ false]. |
7852 mClass == OrderedCollection ifTrue:[^ false]. |
7852 mClass == OrderedCollection ifTrue:[^ false]. |
7853 ]. |
7853 ]. |
7854 |
7854 |
7855 sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
7855 sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
7856 |
7856 |
7857 (mClass == Object) ifTrue:[ |
7857 (mClass == Object) ifTrue:[ |
7858 (sel startsWith:'perform:') ifTrue:[^ false] |
7858 (sel startsWith:'perform:') ifTrue:[^ false] |
7859 ]. |
7859 ]. |
7860 |
7860 |
7861 (mClass == Method) ifTrue:[ |
7861 (mClass == Method) ifTrue:[ |
7862 (sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
7862 (sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
7863 ]. |
7863 ]. |
7864 |
7864 |
7865 (mClass == SmallInteger) ifTrue:[ |
7865 (mClass == SmallInteger) ifTrue:[ |
7866 (sel == #to:do:) ifTrue:[^ false]. |
7866 (sel == #to:do:) ifTrue:[^ false]. |
7867 (sel == #to:by:do:) ifTrue:[^ false]. |
7867 (sel == #to:by:do:) ifTrue:[^ false]. |
7868 ]. |
7868 ]. |
7869 |
7869 |
7870 (mClass == Block) ifTrue:[ |
7870 (mClass == Block) ifTrue:[ |
7871 sel == #ensure: ifTrue:[^ false]. |
7871 sel == #ensure: ifTrue:[^ false]. |
7872 sel == #ifCurtailed: ifTrue:[^ false]. |
7872 sel == #ifCurtailed: ifTrue:[^ false]. |
7873 sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
7873 sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
7874 sel == #valueOnUnwindDo: ifTrue:[^ false]. |
7874 sel == #valueOnUnwindDo: ifTrue:[^ false]. |
7875 sel == #on:do: ifTrue:[^ false]. |
7875 sel == #on:do: ifTrue:[^ false]. |
7876 |
7876 |
7877 sel == #value ifTrue:[^ false]. |
7877 sel == #value ifTrue:[^ false]. |
7878 sel == #value: ifTrue:[^ false]. |
7878 sel == #value: ifTrue:[^ false]. |
7879 sel == #value:value: ifTrue:[^ false]. |
7879 sel == #value:value: ifTrue:[^ false]. |
7880 sel == #value:value:value: ifTrue:[^ false]. |
7880 sel == #value:value:value: ifTrue:[^ false]. |
7881 sel == #value:value:value:value: ifTrue:[^ false]. |
7881 sel == #value:value:value:value: ifTrue:[^ false]. |
7882 sel == #value:value:value:value:Value: ifTrue:[^ false]. |
7882 sel == #value:value:value:value:Value: ifTrue:[^ false]. |
7883 sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
7883 sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
7884 ]. |
7884 ]. |
7885 |
7885 |
7886 aContext isBlockContext ifTrue:[ |
7886 aContext isBlockContext ifTrue:[ |
7887 "/ sel == #value ifTrue:[^ false]. |
7887 "/ sel == #value ifTrue:[^ false]. |
7888 "/ sel == #value: ifTrue:[^ false]. |
7888 "/ sel == #value: ifTrue:[^ false]. |
7896 "/ senderReceiverClass == QuerySignal ifTrue:[ |
7896 "/ senderReceiverClass == QuerySignal ifTrue:[ |
7897 "/ ^ false |
7897 "/ ^ false |
7898 "/ ] |
7898 "/ ] |
7899 "/ ] |
7899 "/ ] |
7900 |
7900 |
7901 aContext home notNil ifTrue:[ |
7901 aContext home notNil ifTrue:[ |
7902 aContext home receiver isLazyValue ifFalse:[ |
7902 aContext home receiver isLazyValue ifFalse:[ |
7903 (aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
7903 (aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
7904 (aContext home selector == #wait) ifTrue:[^ false]. |
7904 (aContext home selector == #wait) ifTrue:[^ false]. |
7905 (aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
7905 (aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
7906 ] |
7906 ] |
7907 ] |
7907 ] |
7908 ] |
7908 ] |
7909 ]. |
7909 ]. |
7910 |
7910 |
7911 (rec isExceptionHandler) ifTrue:[ |
7911 (rec isExceptionHandler) ifTrue:[ |
7912 sel == #handle:do: ifTrue:[^ false]. |
7912 sel == #handle:do: ifTrue:[^ false]. |
7913 sel == #handleDo: ifTrue:[^ false]. |
7913 sel == #handleDo: ifTrue:[^ false]. |
7914 (sel startsWith:#raise) ifTrue:[^ false]. |
7914 (sel startsWith:#raise) ifTrue:[^ false]. |
7915 sel == #answer:do: ifTrue:[^ false]. |
7915 sel == #answer:do: ifTrue:[^ false]. |
7916 ]. |
7916 ]. |
7917 (rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
7917 (rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
7918 sel == #doRaise ifTrue:[^ false]. |
7918 sel == #doRaise ifTrue:[^ false]. |
7919 sel == #doCallHandler: ifTrue:[^ false]. |
7919 sel == #doCallHandler: ifTrue:[^ false]. |
7920 (sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
7920 (sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
7921 senderReceiverClass == Signal ifTrue:[^ false]. |
7921 senderReceiverClass == Signal ifTrue:[^ false]. |
7922 ] |
7922 ] |
7923 ]. |
7923 ]. |
7924 (mClass == Context) ifTrue:[ |
7924 (mClass == Context) ifTrue:[ |
7925 sel == #unwind ifTrue:[^ false]. |
7925 sel == #unwind ifTrue:[^ false]. |
7926 sel == #unwind: ifTrue:[^ false]. |
7926 sel == #unwind: ifTrue:[^ false]. |
7927 ]. |
7927 ]. |
7928 (mClass == ProcessorScheduler) ifTrue:[ |
7928 (mClass == ProcessorScheduler) ifTrue:[ |
7929 sel == #interruptActive ifTrue:[^ false]. |
7929 sel == #interruptActive ifTrue:[^ false]. |
7930 sel == #threadSwitch: ifTrue:[^ false]. |
7930 sel == #threadSwitch: ifTrue:[^ false]. |
7931 sel == #suspend: ifTrue:[^ false]. |
7931 sel == #suspend: ifTrue:[^ false]. |
7932 ]. |
7932 ]. |
7933 mClass == Process ifTrue:[ |
7933 mClass == Process ifTrue:[ |
7934 sel == #suspendWithState: ifTrue:[^ false]. |
7934 sel == #suspendWithState: ifTrue:[^ false]. |
7935 ]. |
7935 ]. |
7936 (sel == #break) ifTrue:[ |
7936 (sel == #break) ifTrue:[ |
7937 (mClass == Breakpoint) ifTrue:[^ false]. |
7937 (mClass == Breakpoint) ifTrue:[^ false]. |
7938 ]. |
7938 ]. |
7939 ^ true. |
7939 ^ true. |
7940 |
7940 |
7941 "Created: / 17-11-2001 / 19:34:20 / cg" |
7941 "Created: / 17-11-2001 / 19:34:20 / cg" |
7942 "Modified: / 27-07-2012 / 17:26:54 / cg" |
7942 "Modified: / 27-07-2012 / 17:26:54 / cg" |
7944 |
7944 |
7945 !DebugView methodsFor:'private-control loop'! |
7945 !DebugView methodsFor:'private-control loop'! |
7946 |
7946 |
7947 controlLoop |
7947 controlLoop |
7948 "this is a kludge: |
7948 "this is a kludge: |
7949 start a dispatchloop which exits when |
7949 start a dispatchloop which exits when |
7950 either continue, return or step is pressed |
7950 either continue, return or step is pressed |
7951 " |
7951 " |
7952 |
7952 |
7953 haveControl := true. |
7953 haveControl := true. |
7954 [ |
7954 [ |
7955 [haveControl] whileTrue:[ |
7955 [haveControl] whileTrue:[ |
7956 AbortOperationRequest handle:[:ex | |
7956 AbortOperationRequest handle:[:ex | |
7957 ] do:[ |
7957 ] do:[ |
7958 self controlLoopCatchingErrors |
7958 self controlLoopCatchingErrors |
7959 ] |
7959 ] |
7960 ]. |
7960 ]. |
7961 ] ensure:[ |
7961 ] ensure:[ |
7962 catchBlock := nil. |
7962 catchBlock := nil. |
7963 haveControl := false |
7963 haveControl := false |
7964 ]. |
7964 ]. |
7965 |
7965 |
7966 "Modified: 9.7.1996 / 18:29:09 / cg" |
7966 "Modified: 9.7.1996 / 18:29:09 / cg" |
7967 ! |
7967 ! |
7968 |
7968 |
7972 |
7972 |
7973 "setup a self removing catch-block" |
7973 "setup a self removing catch-block" |
7974 catchBlock := [catchBlock := nil. ^ nil]. |
7974 catchBlock := [catchBlock := nil. ^ nil]. |
7975 |
7975 |
7976 (exclusive or:[windowGroup isNil]) ifTrue:[ |
7976 (exclusive or:[windowGroup isNil]) ifTrue:[ |
7977 "if we do not have multiple processes or its a system process |
7977 "if we do not have multiple processes or its a system process |
7978 we start another dispatch loop, which exits when |
7978 we start another dispatch loop, which exits when |
7979 either continue, return or step is pressed |
7979 either continue, return or step is pressed |
7980 or (via the catchBlock) if an error occurs. |
7980 or (via the catchBlock) if an error occurs. |
7981 Since our display is an extra exclusive one, |
7981 Since our display is an extra exclusive one, |
7982 all processing for normal views stops here ... |
7982 all processing for normal views stops here ... |
7983 " |
7983 " |
7984 |
7984 |
7985 WindowGroup setActiveGroup:windowGroup. |
7985 WindowGroup setActiveGroup:windowGroup. |
7986 SignalSet anySignal handle:[:ex | |
7986 SignalSet anySignal handle:[:ex | |
7987 |signal| |
7987 |signal| |
7988 |
7988 |
7989 signal := ex creator. |
7989 signal := ex creator. |
7990 (UserInterruptSignal accepts:signal) ifTrue:[ |
7990 (UserInterruptSignal accepts:signal) ifTrue:[ |
7991 Transcript showCR:'UserInterruptSignal'. |
7991 Transcript showCR:'UserInterruptSignal'. |
7992 self topView raiseDeiconified. |
7992 self topView raiseDeiconified. |
7993 ex proceed. |
7993 ex proceed. |
7994 ]. |
7994 ]. |
7995 |
7995 |
7996 (UserNotification accepts:signal) ifTrue:[ |
7996 (UserNotification accepts:signal) ifTrue:[ |
7997 Transcript showCR:'UserNotification'. |
7997 Transcript showCR:'UserNotification'. |
7998 (signal ~~ ActivityNotificationSignal) ifTrue:[ |
7998 (signal ~~ ActivityNotificationSignal) ifTrue:[ |
7999 self showError:ex description. |
7999 self showError:ex description. |
8000 ]. |
8000 ]. |
8001 ex proceed. |
8001 ex proceed. |
8002 ]. |
8002 ]. |
8003 (HaltInterrupt accepts:signal) ifTrue:[ |
8003 (HaltInterrupt accepts:signal) ifTrue:[ |
8004 Transcript showCR:'HaltInterrupt'. |
8004 Transcript showCR:'HaltInterrupt'. |
8005 Transcript showCR:'Halt/Break in debugger ignored'. |
8005 Transcript showCR:'Halt/Break in debugger ignored'. |
8006 self topView raiseDeiconified. |
8006 self topView raiseDeiconified. |
8007 ex proceed. |
8007 ex proceed. |
8008 ]. |
8008 ]. |
8009 |
8009 |
8010 self showError:'*** Error in modal debugger: |
8010 self showError:'*** Error in modal debugger: |
8011 |
8011 |
8012 >>>> Signal: ' , signal printString , ' |
8012 >>>> Signal: ' , signal printString , ' |
8013 >>>> In: ' , ex suspendedContext printString , ' |
8013 >>>> In: ' , ex suspendedContext printString , ' |
8014 >>>> From: ' , ex suspendedContext sender printString , ' |
8014 >>>> From: ' , ex suspendedContext sender printString , ' |
8015 >>>> : ' , ex suspendedContext sender sender printString , ' |
8015 >>>> : ' , ex suspendedContext sender sender printString , ' |
8026 >>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
8026 >>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
8027 >>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
8027 >>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
8028 >>>> Message: ' , ex description , ' |
8028 >>>> Message: ' , ex description , ' |
8029 |
8029 |
8030 caught & ignored.'. |
8030 caught & ignored.'. |
8031 ex return. |
8031 ex return. |
8032 ] do:[ |
8032 ] do:[ |
8033 "/ UserNotification handle:[:ex | |
8033 "/ UserNotification handle:[:ex | |
8034 "/ (ex signal == ActivityNotificationSignal) ifTrue:[ |
8034 "/ (ex signal == ActivityNotificationSignal) ifTrue:[ |
8035 "/ ex proceed |
8035 "/ ex proceed |
8036 "/ ]. |
8036 "/ ]. |
8037 "/ self showError:ex description. |
8037 "/ self showError:ex description. |
8038 "/ ex proceed. |
8038 "/ ex proceed. |
8039 "/ ] do:[ |
8039 "/ ] do:[ |
8040 self graphicsDevice |
8040 self graphicsDevice |
8041 dispatchModalWhile:[ |
8041 dispatchModalWhile:[ |
8042 Processor activeProcess state:#debug. |
8042 Processor activeProcess state:#debug. |
8043 haveControl]. |
8043 haveControl]. |
8044 "/ ] |
8044 "/ ] |
8045 ]. |
8045 ]. |
8046 WindowGroup setActiveGroup:nil. |
8046 WindowGroup setActiveGroup:nil. |
8047 ] ifFalse:[ |
8047 ] ifFalse:[ |
8048 "we do have multiple processes - |
8048 "we do have multiple processes - |
8049 simply enter the DebugViews-Windowgroup event loop. |
8049 simply enter the DebugViews-Windowgroup event loop. |
8050 effectively suspending event processing for the currently |
8050 effectively suspending event processing for the currently |
8051 active group. |
8051 active group. |
8052 " |
8052 " |
8053 SignalSet anySignal handle:[:ex | |
8053 SignalSet anySignal handle:[:ex | |
8054 |answer signal eMsg| |
8054 |answer signal eMsg| |
8055 |
8055 |
8056 signal := ex creator. |
8056 signal := ex creator. |
8057 |
8057 |
8058 DebuggingDebugger ~~ true ifTrue:[ |
8058 DebuggingDebugger ~~ true ifTrue:[ |
8059 (signal == ActivityNotification) ifTrue:[ |
8059 (signal == ActivityNotification) ifTrue:[ |
8060 ex proceed |
8060 ex proceed |
8061 ]. |
8061 ]. |
8062 "/ |
8062 "/ |
8063 "/ ignore exceptions which say they explicitly have to be ignored |
8063 "/ ignore exceptions which say they explicitly have to be ignored |
8064 "/ |
8064 "/ |
8065 ex catchInDebugger ifTrue:[ |
8065 ex catchInDebugger ifTrue:[ |
8066 'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR. |
8066 'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR. |
8067 self destroy. |
8067 self destroy. |
8068 ex reject |
8068 ex reject |
8069 ]. |
8069 ]. |
8070 |
8070 |
8071 "/ |
8071 "/ |
8072 "/ ignore recursive breakpoints |
8072 "/ ignore recursive breakpoints |
8073 "/ |
8073 "/ |
8074 (signal isControlInterrupt) ifTrue:[ |
8074 (signal isControlInterrupt) ifTrue:[ |
8075 ignoreBreakpoints == true ifTrue:[ |
8075 ignoreBreakpoints == true ifTrue:[ |
8076 'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
8076 'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
8077 ('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
8077 ('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
8078 self topView raiseDeiconified. |
8078 self topView raiseDeiconified. |
8079 ex proceed |
8079 ex proceed |
8080 ]. |
8080 ]. |
8081 ]. |
8081 ]. |
8082 (signal == TerminateProcessRequest) ifTrue:[ |
8082 (signal == TerminateProcessRequest) ifTrue:[ |
8083 "/ mhm - someone wants to shoot me down while debugging ... |
8083 "/ mhm - someone wants to shoot me down while debugging ... |
8084 answer := Dialog |
8084 answer := Dialog |
8085 choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
8085 choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
8086 labels:#( 'Ignore' 'Close & terminate' ) |
8086 labels:#( 'Ignore' 'Close & terminate' ) |
8087 values:#( #proceed #close ) |
8087 values:#( #proceed #close ) |
8088 default:#close. |
8088 default:#close. |
8089 answer == #close ifTrue:[ |
8089 answer == #close ifTrue:[ |
8090 self destroy. |
8090 self destroy. |
8091 ex reject |
8091 ex reject |
8092 ]. |
8092 ]. |
8093 ex return. |
8093 ex return. |
8094 ]. |
8094 ]. |
8095 signal == RecursiveExceptionError ifTrue:[ |
8095 signal == RecursiveExceptionError ifTrue:[ |
8096 (ex exception creator == BreakPointInterrupt) |
8096 (ex exception creator == BreakPointInterrupt) |
8097 ifTrue:[ |
8097 ifTrue:[ |
8098 'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
8098 'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
8099 ex proceed. |
8099 ex proceed. |
8100 ]. |
8100 ]. |
8101 |
8101 |
8102 self showError:'*** Recursive error in debugger: |
8102 self showError:'*** Recursive error in debugger: |
8103 |
8103 |
8104 >>>> Signal: ' , ex creator printString , ' |
8104 >>>> Signal: ' , ex creator printString , ' |
8105 >>>> ' , ex parameter creator printString , ' |
8105 >>>> ' , ex parameter creator printString , ' |
8106 >>>> In: ' , ex suspendedContext printString , ' |
8106 >>>> In: ' , ex suspendedContext printString , ' |
8107 >>>> From: ' , ex suspendedContext sender printString , ' |
8107 >>>> From: ' , ex suspendedContext sender printString , ' |
8109 >>>> : ' , ex suspendedContext sender sender sender printString , ' |
8109 >>>> : ' , ex suspendedContext sender sender sender printString , ' |
8110 >>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
8110 >>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
8111 >>>> Message: ' , ex description , ' |
8111 >>>> Message: ' , ex description , ' |
8112 |
8112 |
8113 caught & ignored.'. |
8113 caught & ignored.'. |
8114 ex return |
8114 ex return |
8115 ]. |
8115 ]. |
8116 ]. |
8116 ]. |
8117 |
8117 |
8118 self topView raiseDeiconified. |
8118 self topView raiseDeiconified. |
8119 |
8119 |
8120 eMsg := ex description. |
8120 eMsg := ex description. |
8121 (signal isControlInterrupt) ifTrue:[ |
8121 (signal isControlInterrupt) ifTrue:[ |
8122 eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
8122 eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
8123 ]. |
8123 ]. |
8124 Dialog aboutToOpenBoxNotificationSignal |
8124 Dialog aboutToOpenBoxNotificationSignal |
8125 handle:[:ex | ex proceed ] |
8125 handle:[:ex | ex proceed ] |
8126 do:[ |
8126 do:[ |
8127 answer := Dialog |
8127 answer := Dialog |
8128 choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
8128 choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
8129 labels:#( 'Proceed' 'Cancel' 'Debug' ) |
8129 labels:#( 'Proceed' 'Cancel' 'Debug' ) |
8130 values:#( #proceed #cancel #debug ) |
8130 values:#( #proceed #cancel #debug ) |
8131 default:#cancel. |
8131 default:#cancel. |
8132 ]. |
8132 ]. |
8133 answer == #debug ifTrue:[ |
8133 answer == #debug ifTrue:[ |
8134 'DebugView [info]: caught exception - debugging' infoPrintCR. |
8134 'DebugView [info]: caught exception - debugging' infoPrintCR. |
8135 Debugger |
8135 Debugger |
8136 enterUnconditional:(ex suspendedContext) |
8136 enterUnconditional:(ex suspendedContext) |
8137 withMessage:(ex creator class name,' in debugger: ' , eMsg) |
8137 withMessage:(ex creator class name,' in debugger: ' , eMsg) |
8138 mayProceed:true. |
8138 mayProceed:true. |
8139 ex proceed. |
8139 ex proceed. |
8140 ]. |
8140 ]. |
8141 answer == #proceed ifTrue:[ |
8141 answer == #proceed ifTrue:[ |
8142 'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
8142 'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
8143 ex proceed. |
8143 ex proceed. |
8144 ]. |
8144 ]. |
8145 'DebugView [info]: caught exception - returning' infoPrintCR. |
8145 'DebugView [info]: caught exception - returning' infoPrintCR. |
8146 ex return. |
8146 ex return. |
8147 ] do:[ |
8147 ] do:[ |
8148 "/ make certain that sub-debuggers, inspectors etc. |
8148 "/ make certain that sub-debuggers, inspectors etc. |
8149 "/ come up on my device. |
8149 "/ come up on my device. |
8150 Screen currentScreenQuerySignal answer:self graphicsDevice |
8150 Screen currentScreenQuerySignal answer:self graphicsDevice |
8151 do:[ |
8151 do:[ |
8152 Dialog aboutToOpenBoxNotificationSignal |
8152 Dialog aboutToOpenBoxNotificationSignal |
8153 handle:[:ex | ex proceed ] |
8153 handle:[:ex | ex proceed ] |
8154 do:[ |
8154 do:[ |
8155 windowGroup |
8155 windowGroup |
8156 eventLoopWhile:[Processor activeProcess state:#debug. |
8156 eventLoopWhile:[Processor activeProcess state:#debug. |
8157 true] |
8157 true] |
8158 onLeave:[] |
8158 onLeave:[] |
8159 ] |
8159 ] |
8160 ] |
8160 ] |
8161 ]. |
8161 ]. |
8162 ]. |
8162 ]. |
8163 catchBlock := nil. |
8163 catchBlock := nil. |
8164 |
8164 |
8165 "Created: / 24-11-1995 / 20:33:45 / cg" |
8165 "Created: / 24-11-1995 / 20:33:45 / cg" |
8166 "Modified: / 26-09-2012 / 15:03:39 / cg" |
8166 "Modified: / 26-09-2012 / 15:03:39 / cg" |
8174 |mthd app heuristic selector| |
8174 |mthd app heuristic selector| |
8175 |
8175 |
8176 classToDefineIn := selectorToDefine := nil. "/ sorry - left as info to define action |
8176 classToDefineIn := selectorToDefine := nil. "/ sorry - left as info to define action |
8177 |
8177 |
8178 callee notNil ifTrue:[ |
8178 callee notNil ifTrue:[ |
8179 "/ clicked on an unimplemented method ? |
8179 "/ clicked on an unimplemented method ? |
8180 callee sender notNil ifTrue:[ |
8180 callee sender notNil ifTrue:[ |
8181 mthd := callee sender method. |
8181 mthd := callee sender method. |
8182 mthd isNil ifTrue:[ |
8182 mthd isNil ifTrue:[ |
8183 callee sender isBlockContext ifFalse:[ |
8183 callee sender isBlockContext ifFalse:[ |
8184 "/ an unimplemented method |
8184 "/ an unimplemented method |
8185 selector := callee sender selector. |
8185 selector := callee sender selector. |
8186 (callee sender receiver class canUnderstand:selector) ifFalse:[ |
8186 (callee sender receiver class canUnderstand:selector) ifFalse:[ |
8187 classToDefineIn := callee sender receiver class. |
8187 classToDefineIn := callee sender receiver class. |
8188 selectorToDefine := selector. |
8188 selectorToDefine := selector. |
8189 ^ true |
8189 ^ true |
8190 ] |
8190 ] |
8191 ] |
8191 ] |
8192 ]. |
8192 ]. |
8193 ]. |
8193 ]. |
8194 |
8194 |
8195 mthd := callee method. |
8195 mthd := callee method. |
8196 mthd notNil ifTrue:[ |
8196 mthd notNil ifTrue:[ |
8197 (mthd selector == #subclassResponsibility) ifTrue:[ |
8197 (mthd selector == #subclassResponsibility) ifTrue:[ |
8198 classToDefineIn := callee sender receiver class. |
8198 classToDefineIn := callee sender receiver class. |
8199 selectorToDefine := callee sender selector. |
8199 selectorToDefine := callee sender selector. |
8200 ^ true. |
8200 ^ true. |
8201 ]. |
8201 ]. |
8202 |
8202 |
8203 "/ that's a big hack, but I am tired of navigating to find the missing menu message... |
8203 "/ that's a big hack, but I am tired of navigating to find the missing menu message... |
8204 "/ you will thank me!! |
8204 "/ you will thank me!! |
8205 mthd selector == #error:mayProceed: ifTrue:[ |
8205 mthd selector == #error:mayProceed: ifTrue:[ |
8206 (callee receiver isKindOf:MenuPanel) ifTrue:[ |
8206 (callee receiver isKindOf:MenuPanel) ifTrue:[ |
8207 callee sender home notNil ifTrue:[ |
8207 callee sender home notNil ifTrue:[ |
8208 (callee sender home selector startsWith:'accept:') ifTrue:[ |
8208 (callee sender home selector startsWith:'accept:') ifTrue:[ |
8209 (inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[ |
8209 (inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[ |
8210 (app := self processesApplication) notNil ifTrue:[ |
8210 (app := self processesApplication) notNil ifTrue:[ |
8211 heuristic := callee sender home argsAndVars select:[:o | o isSymbol]. |
8211 heuristic := callee sender home argsAndVars select:[:o | o isSymbol]. |
8212 heuristic size == 1 ifTrue:[ |
8212 heuristic size == 1 ifTrue:[ |
8213 classToDefineIn := app class. |
8213 classToDefineIn := app class. |
8214 selectorToDefine := heuristic first. |
8214 selectorToDefine := heuristic first. |
8215 ^ true |
8215 ^ true |
8216 ]. |
8216 ]. |
8217 ]. |
8217 ]. |
8218 ]. |
8218 ]. |
8219 ]. |
8219 ]. |
8220 ]. |
8220 ]. |
8221 ]. |
8221 ]. |
8222 ] |
8222 ] |
8223 ] |
8223 ] |
8224 ]. |
8224 ]. |
8225 ^ false |
8225 ^ false |
8226 ! |
8226 ! |
8227 |
8227 |
8228 showingAlreadyModifiedCode |
8228 showingAlreadyModifiedCode |
8236 |source| |
8236 |source| |
8237 |
8237 |
8238 codeView modified ifFalse:[^ false]. |
8238 codeView modified ifFalse:[^ false]. |
8239 |
8239 |
8240 currentMethod isNil ifTrue:[ |
8240 currentMethod isNil ifTrue:[ |
8241 ^ false |
8241 ^ false |
8242 ]. |
8242 ]. |
8243 source := currentMethod source. |
8243 source := currentMethod source. |
8244 source notNil ifTrue:[ |
8244 source notNil ifTrue:[ |
8245 source string = codeView contents string ifTrue:[ |
8245 source string = codeView contents string ifTrue:[ |
8246 ^ false |
8246 ^ false |
8247 ]. |
8247 ]. |
8248 (source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
8248 (source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
8249 ^ false |
8249 ^ false |
8250 ]. |
8250 ]. |
8251 ]. |
8251 ]. |
8252 ^ true |
8252 ^ true |
8253 ! |
8253 ! |
8254 |
8254 |
8255 checkSelectionChangeAllowed |
8255 checkSelectionChangeAllowed |
8261 |
8261 |
8262 self checkIfCodeIsReallyModified ifFalse:[^ true]. |
8262 self checkIfCodeIsReallyModified ifFalse:[^ true]. |
8263 |
8263 |
8264 (newSelection notNil |
8264 (newSelection notNil |
8265 and:[newSelection = contextView selection]) ifTrue:[ |
8265 and:[newSelection = contextView selection]) ifTrue:[ |
8266 ^ true |
8266 ^ true |
8267 ]. |
8267 ]. |
8268 |
8268 |
8269 answer := Dialog |
8269 answer := Dialog |
8270 confirmWithCancel:('Code modified - change selection anyway ?') |
8270 confirmWithCancel:('Code modified - change selection anyway ?') |
8271 labels:#('No' 'No, Show Diffs' 'Yes'). |
8271 labels:#('No' 'No, Show Diffs' 'Yes'). |
8272 answer isNil ifTrue:[^ false]. |
8272 answer isNil ifTrue:[^ false]. |
8273 answer == false ifTrue:[ |
8273 answer == false ifTrue:[ |
8274 v := DiffCodeView |
8274 v := DiffCodeView |
8275 openOn:codeView contents |
8275 openOn:codeView contents |
8276 label:(resources string:'Changed code (to be accepted ?)') |
8276 label:(resources string:'Changed code (to be accepted ?)') |
8277 and:currentMethod source |
8277 and:currentMethod source |
8278 label:(resources string:'Method''s actual (maybe original) code'). |
8278 label:(resources string:'Method''s actual (maybe original) code'). |
8279 v label:(resources string:'Comparing method''s code'). |
8279 v label:(resources string:'Comparing method''s code'). |
8280 v waitUntilVisible. |
8280 v waitUntilVisible. |
8281 ^ false |
8281 ^ false |
8282 ]. |
8282 ]. |
8283 |
8283 |
8284 codeView modified:false. |
8284 codeView modified:false. |
8285 ^ true |
8285 ^ true |
8286 ! |
8286 ! |
8287 |
8287 |
8288 codeAccept:someCode |
8288 codeAccept:someCode |
8289 "user wants some code to be recompiled" |
8289 "user wants some code to be recompiled" |
8290 |
8290 |
8291 ParseError handle:[:ex | |
8291 ParseError handle:[:ex | |
8292 ex lineNumber notNil ifTrue:[ |
8292 ex lineNumber notNil ifTrue:[ |
8293 codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition. |
8293 codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition. |
8294 ]. |
8294 ]. |
8295 Dialog information:ex description. |
8295 Dialog information:ex description. |
8296 "/ ParseError new |
8296 "/ ParseError new |
8297 "/ errorMessage:aMessage startPosition:position endPosition:endPos; |
8297 "/ errorMessage:aMessage startPosition:position endPosition:endPos; |
8298 "/ parameter:self; |
8298 "/ parameter:self; |
8299 "/ lineNumber:tokenLineNr; "lineNr" |
8299 "/ lineNumber:tokenLineNr; "lineNr" |
8300 "/ raiseRequest. |
8300 "/ raiseRequest. |
8301 ] do:[ |
8301 ] do:[ |
8302 ^ self codeAccept:someCode unwind:false category:nil onCancel:nil |
8302 ^ self codeAccept:someCode unwind:false category:nil onCancel:nil |
8303 ]. |
8303 ]. |
8304 |
8304 |
8305 "Modified: / 28-11-2006 / 19:49:04 / cg" |
8305 "Modified: / 28-11-2006 / 19:49:04 / cg" |
8306 ! |
8306 ! |
8307 |
8307 |
8308 codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
8308 codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
8309 "user wants some code to be recompiled. |
8309 "user wants some code to be recompiled. |
8310 Optionally unwind stack to right above the changed method. |
8310 Optionally unwind stack to right above the changed method. |
8311 This undwind option is a leftover from times, when the debugger had no chance to |
8311 This undwind option is a leftover from times, when the debugger had no chance to |
8312 show the original code. |
8312 show the original code. |
8313 Now, it can, and got a choice-field to select between original and changed code. |
8313 Now, it can, and got a choice-field to select between original and changed code. |
8314 So the undwind option is not longer used and probably completely obsolete now |
8314 So the undwind option is not longer used and probably completely obsolete now |
8315 (aka: this method is always called with doUnwind==false, these days)" |
8315 (aka: this method is always called with doUnwind==false, these days)" |
8316 |
8316 |
8317 |con newMethod| |
8317 |con newMethod| |
8318 |
8318 |
8319 codeView withWaitCursorDo:[ |
8319 codeView withWaitCursorDo:[ |
8320 " |
8320 " |
8321 find the method-home context for this one |
8321 find the method-home context for this one |
8322 " |
8322 " |
8323 doUnwind ifTrue:[ |
8323 doUnwind ifTrue:[ |
8324 con := selectedContext. |
8324 con := selectedContext. |
8325 top := con. |
8325 top := con. |
8326 [con notNil] whileTrue:[ |
8326 [con notNil] whileTrue:[ |
8327 (con methodHome == selectedContext) ifTrue:[ |
8327 (con methodHome == selectedContext) ifTrue:[ |
8328 top := con |
8328 top := con |
8329 ]. |
8329 ]. |
8330 con := con sender |
8330 con := con sender |
8331 ]. |
8331 ]. |
8332 ]. |
8332 ]. |
8333 |
8333 |
8334 "/ |
8334 "/ |
8335 "/ provide the classes nameSpace and changefile-update answers; |
8335 "/ provide the classes nameSpace and changefile-update answers; |
8336 "/ in case we accept while in another context, to not capture these settings again |
8336 "/ in case we accept while in another context, to not capture these settings again |
8337 "/ |
8337 "/ |
8338 (Class updateChangeFileQuerySignal, |
8338 (Class updateChangeFileQuerySignal, |
8339 Class updateChangeListQuerySignal, |
8339 Class updateChangeListQuerySignal, |
8340 Class updateHistoryLineQuerySignal) answer:true |
8340 Class updateHistoryLineQuerySignal) answer:true |
8341 do:[ |
8341 do:[ |
8342 Class nameSpaceQuerySignal answer:(aClass nameSpace) |
8342 Class nameSpaceQuerySignal answer:(aClass nameSpace) |
8343 do:[ |
8343 do:[ |
8344 "/ the compiler nowadays already cares for the package... |
8344 "/ the compiler nowadays already cares for the package... |
8345 "/ no, actually, it does not in case we are in the middle of a fileIn, |
8345 "/ no, actually, it does not in case we are in the middle of a fileIn, |
8346 "/ and packageQuery is already answered by someone else. |
8346 "/ and packageQuery is already answered by someone else. |
8347 "/ Better make it unpackaged, in case the user makes changes to other |
8347 "/ Better make it unpackaged, in case the user makes changes to other |
8348 "/ classes here (actually, I often change compiler, debugger, inspector here) |
8348 "/ classes here (actually, I often change compiler, debugger, inspector here) |
8349 Class packageQuerySignal |
8349 Class packageQuerySignal |
8350 answer:nil |
8350 answer:nil |
8351 do:[ |
8351 do:[ |
8352 codeView contents:someCode. |
8352 codeView contents:someCode. |
8353 Class methodRedefinitionNotification |
8353 Class methodRedefinitionNotification |
8354 answer:#keep |
8354 answer:#keep |
8355 do:[ |
8355 do:[ |
8356 | breakpoints | |
8356 | breakpoints | |
8357 |
8357 |
8358 breakpoints := nil. |
8358 breakpoints := nil. |
8359 codeView isCodeView2 ifTrue:[ |
8359 codeView isCodeView2 ifTrue:[ |
8360 breakpoints := codeView breakpoints. |
8360 breakpoints := codeView breakpoints. |
8361 ]. |
8361 ]. |
8362 |
8362 |
8363 BreakpointQuery answer: breakpoints do:[ |
8363 BreakpointQuery answer: breakpoints do:[ |
8364 "/ Use original method's programming language instead of class's one. |
8364 "/ Use original method's programming language instead of class's one. |
8365 "/ In most cases it's the same, but it may be that the method edited |
8365 "/ In most cases it's the same, but it may be that the method edited |
8366 "/ and accepted was an extension method written in another languages |
8366 "/ and accepted was an extension method written in another languages |
8367 "/ (such as Smalltalk extension to Java class or Ruby extension to |
8367 "/ (such as Smalltalk extension to Java class or Ruby extension to |
8368 "/ Smalltalk class. |
8368 "/ Smalltalk class. |
8369 newMethod := selectedContext programmingLanguage compilerClassForInteractiveTools |
8369 newMethod := selectedContext programmingLanguage compilerClassForInteractiveTools |
8370 compile:someCode |
8370 compile:someCode |
8371 forClass:aClass |
8371 forClass:aClass |
8372 inCategory:category |
8372 inCategory:category |
8373 notifying:codeView. |
8373 notifying:codeView. |
8374 "/ Kludge for accepting Java code in a debugger. The Java compiler |
8374 "/ Kludge for accepting Java code in a debugger. The Java compiler |
8375 "/ does not compile single classes by always a full class and returns |
8375 "/ does not compile single classes by always a full class and returns |
8376 "/ the compiled class(es) rather than a method. However, we need to update |
8376 "/ the compiled class(es) rather than a method. However, we need to update |
8377 "/ method holder of a codeView. |
8377 "/ method holder of a codeView. |
8378 "/ |
8378 "/ |
8379 "/ So, here we check whether the retuned `newMethod` is really a method, |
8379 "/ So, here we check whether the retuned `newMethod` is really a method, |
8380 "/ if it's a class, try to search that class for a method with the |
8380 "/ if it's a class, try to search that class for a method with the |
8381 "/ same selector as selector of currently selected context. If found, |
8381 "/ same selector as selector of currently selected context. If found, |
8382 "/ thet's the 'new' method we are going to show. |
8382 "/ thet's the 'new' method we are going to show. |
8383 newMethod isBehavior ifTrue:[ |
8383 newMethod isBehavior ifTrue:[ |
8384 | selector | |
8384 | selector | |
8385 |
8385 |
8386 selector := selectedContext selector. |
8386 selector := selectedContext selector. |
8387 newMethod := newMethod"actually a class" compiledMethodAt: selector ifAbsent: nil. |
8387 newMethod := newMethod"actually a class" compiledMethodAt: selector ifAbsent: nil. |
8388 ]. |
8388 ]. |
8389 ]. |
8389 ]. |
8390 ]. |
8390 ]. |
8391 ]. |
8391 ]. |
8392 ]. |
8392 ]. |
8393 ]. |
8393 ]. |
8394 |
8394 |
8395 methodCodeToggleSelectionHolder value:2. "/ showing current code |
8395 methodCodeToggleSelectionHolder value:2. "/ showing current code |
8396 methodCodeToggle beVisible. |
8396 methodCodeToggle beVisible. |
8397 |
8397 |
8398 inspecting ifFalse:[ |
8398 inspecting ifFalse:[ |
8399 (newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
8399 (newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
8400 codeView modified:false. |
8400 codeView modified:false. |
8401 codeView isCodeView2 ifTrue:[ |
8401 codeView isCodeView2 ifTrue:[ |
8402 codeView methodHolder value: newMethod. |
8402 codeView methodHolder value: newMethod. |
8403 ]. |
8403 ]. |
8404 |
8404 |
8405 doUnwind ifTrue:[ |
8405 doUnwind ifTrue:[ |
8406 "/ if it worked, and doUnwind is true, |
8406 "/ if it worked, and doUnwind is true, |
8407 "/ remove everything up to and including top |
8407 "/ remove everything up to and including top |
8408 "/ from the context chain |
8408 "/ from the context chain |
8409 |
8409 |
8410 selectedContext canReturn ifTrue:[ |
8410 selectedContext canReturn ifTrue:[ |
8411 self setContext:(top "sender"). |
8411 self setContext:(top "sender"). |
8412 exitAction := #restart. |
8412 exitAction := #restart. |
8413 selectedContext setLineNumber:1. |
8413 selectedContext setLineNumber:1. |
8414 self doRestart. |
8414 self doRestart. |
8415 ] ifFalse:[ |
8415 ] ifFalse:[ |
8416 self setContext:(top sender). |
8416 self setContext:(top sender). |
8417 exitAction := #return. |
8417 exitAction := #return. |
8418 ]. |
8418 ]. |
8419 ]. |
8419 ]. |
8420 ] ifFalse:[ |
8420 ] ifFalse:[ |
8421 ^ cancelAction value |
8421 ^ cancelAction value |
8422 ] |
8422 ] |
8423 ]. |
8423 ]. |
8424 ]. |
8424 ]. |
8425 |
8425 |
8426 "Created: / 17-11-2001 / 21:50:55 / cg" |
8426 "Created: / 17-11-2001 / 21:50:55 / cg" |
8427 "Modified: / 29-08-2006 / 14:22:22 / cg" |
8427 "Modified: / 29-08-2006 / 14:22:22 / cg" |
8428 "Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8428 "Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8444 "/ top := con |
8444 "/ top := con |
8445 "/ ]. |
8445 "/ ]. |
8446 "/ con := con sender |
8446 "/ con := con sender |
8447 "/ ]. |
8447 "/ ]. |
8448 |
8448 |
8449 " |
8449 " |
8450 use class&selector to find the method for the compilation |
8450 use class&selector to find the method for the compilation |
8451 and compile. |
8451 and compile. |
8452 " |
8452 " |
8453 category := givenCategoryOrNil. |
8453 category := givenCategoryOrNil. |
8454 sel := selectedContext selector. |
8454 sel := selectedContext selector. |
8455 implementorClass := selectedContext methodClass. |
8455 implementorClass := selectedContext methodClass. |
8456 method := selectedContext method. |
8456 method := selectedContext method. |
8457 |
8457 |
8458 implementorClass isNil ifTrue:[ |
8458 implementorClass isNil ifTrue:[ |
8459 (method notNil and:[method mclass isNil and:[method wrapper notNil]]) ifTrue:[ |
8459 (method notNil and:[method mclass isNil and:[method wrapper notNil]]) ifTrue:[ |
8460 method := method wrapper. |
8460 method := method wrapper. |
8461 ]. |
8461 ]. |
8462 method notNil ifTrue:[ |
8462 method notNil ifTrue:[ |
8463 implementorClass := method mclass. |
8463 implementorClass := method mclass. |
8464 implementorClass isNil ifTrue:[ |
8464 implementorClass isNil ifTrue:[ |
8465 implementorClass := method getMclass |
8465 implementorClass := method getMclass |
8466 ]. |
8466 ]. |
8467 ]. |
8467 ]. |
8468 ]. |
8468 ]. |
8469 implementorClass notNil ifTrue:[ |
8469 implementorClass notNil ifTrue:[ |
8470 category isNil ifTrue:[ |
8470 category isNil ifTrue:[ |
8471 method isNil ifTrue:[ |
8471 method isNil ifTrue:[ |
8472 method := implementorClass compiledMethodAt:sel. |
8472 method := implementorClass compiledMethodAt:sel. |
8473 ]. |
8473 ]. |
8474 category := method category |
8474 category := method category |
8475 ] |
8475 ] |
8476 ] ifFalse:[ |
8476 ] ifFalse:[ |
8477 receiverClass := selectedContext receiver class. |
8477 receiverClass := selectedContext receiver class. |
8478 implementorClass := receiverClass whichClassImplements:sel. |
8478 implementorClass := receiverClass whichClassImplements:sel. |
8479 implementorClass := implementorClass ? receiverClass. |
8479 implementorClass := implementorClass ? receiverClass. |
8480 implementorClass ~~ Object ifTrue:[ |
8480 implementorClass ~~ Object ifTrue:[ |
8481 implementorClass := Dialog |
8481 implementorClass := Dialog |
8482 request:('Define ''%1'' in class:' bindWith:sel allBold) |
8482 request:('Define ''%1'' in class:' bindWith:sel allBold) |
8483 initialAnswer:implementorClass name |
8483 initialAnswer:implementorClass name |
8484 list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
8484 list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
8485 implementorClass size == 0 ifTrue:[ |
8485 implementorClass size == 0 ifTrue:[ |
8486 ^ cancelAction value "/ cancelled |
8486 ^ cancelAction value "/ cancelled |
8487 ]. |
8487 ]. |
8488 implementorClass := Smalltalk classNamed:implementorClass. |
8488 implementorClass := Smalltalk classNamed:implementorClass. |
8489 implementorClass isNil ifTrue:[ |
8489 implementorClass isNil ifTrue:[ |
8490 Dialog warn:'No such class'. |
8490 Dialog warn:'No such class'. |
8491 ^ cancelAction value "/ cancelled |
8491 ^ cancelAction value "/ cancelled |
8492 ]. |
8492 ]. |
8493 ]. |
8493 ]. |
8494 ]. |
8494 ]. |
8495 |
8495 |
8496 self |
8496 self |
8497 codeAccept:someCode |
8497 codeAccept:someCode |
8498 inClass:implementorClass |
8498 inClass:implementorClass |
8499 unwind:doUnwind |
8499 unwind:doUnwind |
8500 category:category |
8500 category:category |
8501 onCancel:cancelAction. |
8501 onCancel:cancelAction. |
8502 ]. |
8502 ]. |
8503 |
8503 |
8504 "Created: / 17-11-2001 / 21:50:55 / cg" |
8504 "Created: / 17-11-2001 / 21:50:55 / cg" |
8505 "Modified: / 29-08-2006 / 14:22:22 / cg" |
8505 "Modified: / 29-08-2006 / 14:22:22 / cg" |
8506 ! |
8506 ! |
8507 |
8507 |
8508 codeCompletion |
8508 codeCompletion |
8509 "/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
8509 "/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
8510 "/ (can we move that to a utility - probably DoWhatIMeanSupport) |
8510 "/ (can we move that to a utility - probably DoWhatIMeanSupport) |
8511 |
8511 |
8512 |cls language| |
8512 |cls language| |
8513 |
8513 |
8514 currentMethod isNil ifTrue:[ ^ self ]. |
8514 currentMethod isNil ifTrue:[ ^ self ]. |
8515 |
8515 |
8516 cls := currentMethod mclass. |
8516 cls := currentMethod mclass. |
8517 cls notNil ifTrue:[ |
8517 cls notNil ifTrue:[ |
8518 language := cls programmingLanguage. |
8518 language := cls programmingLanguage. |
8519 ]. |
8519 ]. |
8520 |
8520 |
8521 UserInformation handle:[:ex | |
8521 UserInformation handle:[:ex | |
8522 ex proceed. |
8522 ex proceed. |
8523 ] do:[ |
8523 ] do:[ |
8524 DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:selectedContext codeView:codeView. |
8524 DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:selectedContext codeView:codeView. |
8525 ]. |
8525 ]. |
8526 |
8526 |
8527 "Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8527 "Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8528 ! |
8528 ! |
8529 |
8529 |
8530 confirm:aString |
8530 confirm:aString |
8531 "open a modal yes-no dialog. |
8531 "open a modal yes-no dialog. |
8532 Redefined here, to answer true, if exclusice Debugger, which cannot handle popup boxes" |
8532 Redefined here, to answer true, if exclusice Debugger, which cannot handle popup boxes" |
8533 |
8533 |
8534 (exclusive or:[windowGroup isNil]) ifTrue:[ |
8534 (exclusive or:[windowGroup isNil]) ifTrue:[ |
8535 ^ true |
8535 ^ true |
8536 ]. |
8536 ]. |
8537 ^ super confirm:aString. |
8537 ^ super confirm:aString. |
8538 ! |
8538 ! |
8539 |
8539 |
8540 doShowSelection:lineNr |
8540 doShowSelection:lineNr |
8541 "user clicked on a header line - show selected code in textView. |
8541 "user clicked on a header line - show selected code in textView. |
8542 Also sent to autoselect an interesting context on entry." |
8542 Also sent to autoselect an interesting context on entry." |
8543 |
8543 |
8544 HaltInterrupt handle:[:ex | |
8544 HaltInterrupt handle:[:ex | |
8545 ignoreBreakpoints ifFalse:[ex reject]. |
8545 ignoreBreakpoints ifFalse:[ex reject]. |
8546 ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
8546 ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
8547 ex proceed |
8547 ex proceed |
8548 ] do:[ |
8548 ] do:[ |
8549 self updateForContext:lineNr |
8549 self updateForContext:lineNr |
8550 ]. |
8550 ]. |
8551 self updateMenuItems |
8551 self updateMenuItems |
8552 |
8552 |
8553 "Modified: / 17.11.2001 / 22:12:16 / cg" |
8553 "Modified: / 17.11.2001 / 22:12:16 / cg" |
8554 ! |
8554 ! |
8555 |
8555 |
8556 hideStackInspector |
8556 hideStackInspector |
8557 stackInspector notNil ifTrue:[ |
8557 stackInspector notNil ifTrue:[ |
8558 stackInspector destroy. |
8558 stackInspector destroy. |
8559 stackInspector := nil. |
8559 stackInspector := nil. |
8560 receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
8560 receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
8561 contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
8561 contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
8562 ] |
8562 ] |
8563 ! |
8563 ! |
8564 |
8564 |
8565 methodCodeToggleChanged |
8565 methodCodeToggleChanged |
8566 |sel| |
8566 |sel| |
8567 |
8567 |
8568 sel := contextView selection. |
8568 sel := contextView selection. |
8569 sel notNil ifTrue:[ |
8569 sel notNil ifTrue:[ |
8570 self showSelection:sel |
8570 self showSelection:sel |
8571 ] |
8571 ] |
8572 |
8572 |
8573 "Created: / 18-06-2010 / 12:29:21 / cg" |
8573 "Created: / 18-06-2010 / 12:29:21 / cg" |
8574 ! |
8574 ! |
8575 |
8575 |
8581 |
8581 |
8582 |evView focusView key rawKey inCodeView| |
8582 |evView focusView key rawKey inCodeView| |
8583 |
8583 |
8584 evView := anEvent view. |
8584 evView := anEvent view. |
8585 evView notNil ifTrue:[ |
8585 evView notNil ifTrue:[ |
8586 focusView := evView windowGroup focusView. |
8586 focusView := evView windowGroup focusView. |
8587 focusView isNil ifTrue:[ |
8587 focusView isNil ifTrue:[ |
8588 focusView := evView. |
8588 focusView := evView. |
8589 ]. |
8589 ]. |
8590 |
8590 |
8591 anEvent isKeyPressEvent ifTrue:[ |
8591 anEvent isKeyPressEvent ifTrue:[ |
8592 key := anEvent key. |
8592 key := anEvent key. |
8593 rawKey := anEvent rawKey. |
8593 rawKey := anEvent rawKey. |
8594 |
8594 |
8595 inCodeView := (focusView == codeView |
8595 inCodeView := (focusView == codeView |
8596 or:[focusView isComponentOf:codeView]). |
8596 or:[focusView isComponentOf:codeView]). |
8597 inCodeView ifTrue:[ |
8597 inCodeView ifTrue:[ |
8598 key == #CodeCompletion ifTrue:[ |
8598 key == #CodeCompletion ifTrue:[ |
8599 "/ complete the word before/under the cursor. |
8599 "/ complete the word before/under the cursor. |
8600 self sensor |
8600 self sensor |
8601 pushUserEvent:#codeCompletion |
8601 pushUserEvent:#codeCompletion |
8602 for:self |
8602 for:self |
8603 withArguments:#(). |
8603 withArguments:#(). |
8604 ^ true |
8604 ^ true |
8605 ]. |
8605 ]. |
8606 ]. |
8606 ]. |
8607 ]. |
8607 ]. |
8608 |
8608 |
8609 false ifTrue:[ |
8609 false ifTrue:[ |
8610 anEvent isButtonReleaseEvent ifTrue:[ |
8610 anEvent isButtonReleaseEvent ifTrue:[ |
8611 anEvent view == codeView ifTrue:[ |
8611 anEvent view == codeView ifTrue:[ |
8612 (RBParser notNil and:[RBParser isLoaded]) |
8612 (RBParser notNil and:[RBParser isLoaded]) |
8613 ifTrue:[ |
8613 ifTrue:[ |
8614 self sensor |
8614 self sensor |
8615 pushEvent:anEvent. "/ must be first in queue |
8615 pushEvent:anEvent. "/ must be first in queue |
8616 |
8616 |
8617 self sensor |
8617 self sensor |
8618 pushUserEvent:#explainSelection |
8618 pushUserEvent:#explainSelection |
8619 for:self |
8619 for:self |
8620 withArguments:nil. |
8620 withArguments:nil. |
8621 ^ true "/ eaten |
8621 ^ true "/ eaten |
8622 ] |
8622 ] |
8623 ] |
8623 ] |
8624 ]. |
8624 ]. |
8625 ]. |
8625 ]. |
8626 |
8626 |
8627 ]. |
8627 ]. |
8628 ^ false |
8628 ^ false |
8629 ! |
8629 ! |
8630 |
8630 |
8631 setCurrentMethod:aMethodOrNil |
8631 setCurrentMethod:aMethodOrNil |
8632 currentMethod := aMethodOrNil. |
8632 currentMethod := aMethodOrNil. |
8633 ! |
8633 ! |
8634 |
8634 |
8635 showSelection:lineNr |
8635 showSelection:lineNr |
8636 "user clicked on a header line - show selected code in textView. |
8636 "user clicked on a header line - show selected code in textView. |
8637 Also sent to autoselect an interesting context on entry." |
8637 Also sent to autoselect an interesting context on entry." |
8638 |
8638 |
8639 UserNotification |
8639 UserNotification |
8640 handle:[:ex | |
8640 handle:[:ex | |
8641 "/ ex suspendedContext fullPrintAll. |
8641 "/ ex suspendedContext fullPrintAll. |
8642 Transcript showCR:ex description. |
8642 Transcript showCR:ex description. |
8643 "/ Transcript showCR:ex parameter. |
8643 "/ Transcript showCR:ex parameter. |
8644 ex proceed |
8644 ex proceed |
8645 ] |
8645 ] |
8646 do:[ |
8646 do:[ |
8647 Error |
8647 Error |
8648 handle:[:ex | |
8648 handle:[:ex | |
8649 |s con| |
8649 |s con| |
8650 |
8650 |
8651 ex creator isControlInterrupt ifTrue:[ |
8651 ex creator isControlInterrupt ifTrue:[ |
8652 'DebugView [info]: halt/break ignored - while showing selection in debugger' |
8652 'DebugView [info]: halt/break ignored - while showing selection in debugger' |
8653 infoPrintCR. |
8653 infoPrintCR. |
8654 ex proceed |
8654 ex proceed |
8655 ]. |
8655 ]. |
8656 ('DebugView [info]: error at %1 when showing selection in debugger ignored' |
8656 ('DebugView [info]: error at %1 when showing selection in debugger ignored' |
8657 bindWith:ex suspendedContext) infoPrintCR. |
8657 bindWith:ex suspendedContext) infoPrintCR. |
8658 s := '' writeStream. |
8658 s := '' writeStream. |
8659 s nextPutLine:'**** error in debugger, while extracting source'. |
8659 s nextPutLine:'**** error in debugger, while extracting source'. |
8660 s nextPutLine:'****'. |
8660 s nextPutLine:'****'. |
8661 s nextPutLine:'**** ',(ex description). |
8661 s nextPutLine:'**** ',(ex description). |
8662 s nextPutLine:'****'. |
8662 s nextPutLine:'****'. |
8663 con := ex suspendedContext. |
8663 con := ex suspendedContext. |
8664 s nextPutLine:'**** ',(con printString). |
8664 s nextPutLine:'**** ',(con printString). |
8665 con := con sender. |
8665 con := con sender. |
8666 HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ]. |
8666 HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ]. |
8667 |
8667 |
8668 "/ [con notNil] whileTrue:[ |
8668 "/ [con notNil] whileTrue:[ |
8669 "/ Error catch:[:ex | |
8669 "/ Error catch:[:ex | |
8670 "/ s nextPutAll: '**** '; nextPutLine:(con printString). |
8670 "/ s nextPutAll: '**** '; nextPutLine:(con printString). |
8671 "/ ]. |
8671 "/ ]. |
8672 "/ |
8672 "/ |
8674 "/ con := nil |
8674 "/ con := nil |
8675 "/ ] ifFalse:[ |
8675 "/ ] ifFalse:[ |
8676 "/ con := con sender. |
8676 "/ con := con sender. |
8677 "/ ] |
8677 "/ ] |
8678 "/ ]. |
8678 "/ ]. |
8679 |
8679 |
8680 codeView contents:(s contents). |
8680 codeView contents:(s contents). |
8681 ex return. |
8681 ex return. |
8682 ] |
8682 ] |
8683 do:[ self doShowSelection:lineNr ] |
8683 do:[ self doShowSelection:lineNr ] |
8684 ] |
8684 ] |
8685 |
8685 |
8686 "Modified: / 19-07-2012 / 10:56:58 / cg" |
8686 "Modified: / 19-07-2012 / 10:56:58 / cg" |
8687 ! |
8687 ! |
8688 |
8688 |
8689 showStackInspectorFor:con |
8689 showStackInspectorFor:con |
8690 stackInspector isNil ifTrue:[ |
8690 stackInspector isNil ifTrue:[ |
8691 receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
8691 receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
8692 contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
8692 contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
8693 stackInspector := InspectorView |
8693 stackInspector := InspectorView |
8694 origin:(0.6 @ 0.0) |
8694 origin:(0.6 @ 0.0) |
8695 corner:(1.0 @ 1.0) |
8695 corner:(1.0 @ 1.0) |
8696 in:contextInspector superView. |
8696 in:contextInspector superView. |
8697 stackInspector realize. |
8697 stackInspector realize. |
8698 stackInspector fieldListLabel:'Stack'. |
8698 stackInspector fieldListLabel:'Stack'. |
8699 stackInspector hideReceiver:true |
8699 stackInspector hideReceiver:true |
8700 ]. |
8700 ]. |
8701 stackInspector inspect:(con stackFrame asArray). |
8701 stackInspector inspect:(con stackFrame asArray). |
8702 stackInspector showLast |
8702 stackInspector showLast |
8703 ! |
8703 ! |
8704 |
8704 |
8705 updateContextInfoFor:aContext |
8705 updateContextInfoFor:aContext |
8706 "additional info as-per selected context; |
8706 "additional info as-per selected context; |
8707 for now: |
8707 for now: |
8708 update:with:from: - show who was responsible |
8708 update:with:from: - show who was responsible |
8709 " |
8709 " |
8710 |
8710 |
8711 |whatChanged changedObject receiver| |
8711 |whatChanged changedObject receiver| |
8712 |
8712 |
8713 aContext selector == #'update:with:from:' ifTrue:[ |
8713 aContext selector == #'update:with:from:' ifTrue:[ |
8714 receiver := aContext receiver. |
8714 receiver := aContext receiver. |
8715 whatChanged := aContext argAt:1. |
8715 whatChanged := aContext argAt:1. |
8716 changedObject := aContext argAt:3. |
8716 changedObject := aContext argAt:3. |
8717 |
8717 |
8718 changedObject isBehavior ifTrue:[ |
8718 changedObject isBehavior ifTrue:[ |
8719 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold). |
8719 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold). |
8720 ^ self |
8720 ^ self |
8721 ]. |
8721 ]. |
8722 |
8722 |
8723 receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm | |
8723 receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm | |
8724 (receiver instVarAt:i) == changedObject ifTrue:[ |
8724 (receiver instVarAt:i) == changedObject ifTrue:[ |
8725 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold). |
8725 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold). |
8726 ^ self |
8726 ^ self |
8727 ] |
8727 ] |
8728 ]. |
8728 ]. |
8729 |
8729 |
8730 (receiver isKindOf:ApplicationModel) ifTrue:[ |
8730 (receiver isKindOf:ApplicationModel) ifTrue:[ |
8731 receiver builder notNil ifTrue:[ |
8731 receiver builder notNil ifTrue:[ |
8732 (receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue | |
8732 (receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue | |
8733 eachValue == changedObject ifTrue:[ |
8733 eachValue == changedObject ifTrue:[ |
8734 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold). |
8734 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold). |
8735 ^ self |
8735 ^ self |
8736 ] |
8736 ] |
8737 ] |
8737 ] |
8738 ] |
8738 ] |
8739 ]. |
8739 ]. |
8740 |
8740 |
8741 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold). |
8741 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold). |
8742 ^self. |
8742 ^self. |
8743 ]. |
8743 ]. |
8744 contextInfoLabel label:nil. |
8744 contextInfoLabel label:nil. |
8745 ! |
8745 ! |
8746 |
8746 |
8747 updateForContext:lineNr |
8747 updateForContext:lineNr |
8756 |
8756 |
8757 canDefine := cannotAcceptDueToOutdatedClass := false. |
8757 canDefine := cannotAcceptDueToOutdatedClass := false. |
8758 self setCurrentMethod:nil. |
8758 self setCurrentMethod:nil. |
8759 |
8759 |
8760 contextArray notNil ifTrue:[ |
8760 contextArray notNil ifTrue:[ |
8761 lineNr <= contextArray size ifTrue:[ |
8761 lineNr <= contextArray size ifTrue:[ |
8762 con := contextArray at:lineNr. |
8762 con := contextArray at:lineNr. |
8763 callee := contextArray at:lineNr-1 ifAbsent:nil. |
8763 callee := contextArray at:lineNr-1 ifAbsent:nil. |
8764 ]. |
8764 ]. |
8765 " |
8765 " |
8766 clicking on the '** ...'-line shows more ... |
8766 clicking on the '** ...'-line shows more ... |
8767 " |
8767 " |
8768 con isNil ifTrue:[ |
8768 con isNil ifTrue:[ |
8769 line := contextView list at:lineNr. |
8769 line := contextView list at:lineNr. |
8770 (line startsWith:'**') ifTrue:[ |
8770 (line startsWith:'**') ifTrue:[ |
8771 self showMore. |
8771 self showMore. |
8772 lineNr >= contextArray size ifTrue:[ |
8772 lineNr >= contextArray size ifTrue:[ |
8773 contextView setSelection:lineNr. |
8773 contextView setSelection:lineNr. |
8774 con := contextArray at:lineNr ifAbsent:nil |
8774 con := contextArray at:lineNr ifAbsent:nil |
8775 ] |
8775 ] |
8776 ]. |
8776 ]. |
8777 con isNil ifTrue:[ |
8777 con isNil ifTrue:[ |
8778 codeView contents:nil. |
8778 codeView contents:nil. |
8779 ^ self |
8779 ^ self |
8780 ]. |
8780 ]. |
8781 ]. |
8781 ]. |
8782 |
8782 |
8783 selectedContext := con. |
8783 selectedContext := con. |
8784 m := contextView middleButtonMenu. |
8784 m := contextView middleButtonMenu. |
8785 (m notNil and:[selectedContext notNil]) ifTrue:[ |
8785 (m notNil and:[selectedContext notNil]) ifTrue:[ |
8786 m enableAll:#(browseImplementors browseSenders inspectContext) |
8786 m enableAll:#(browseImplementors browseSenders inspectContext) |
8787 ]. |
8787 ]. |
8788 |
8788 |
8789 self withExecuteCursorDo:[ |
8789 self withExecuteCursorDo:[ |
8790 codeSet := false. |
8790 codeSet := false. |
8791 |
8791 |
8792 " |
8792 " |
8793 give it to the (lower right) inspector |
8793 give it to the (lower right) inspector |
8794 " |
8794 " |
8795 Error handle:[:ex | |
8795 Error handle:[:ex | |
8796 'DebugView [warning]: error while accessing context: ' errorPrint. |
8796 'DebugView [warning]: error while accessing context: ' errorPrint. |
8797 ex description errorPrintCR. |
8797 ex description errorPrintCR. |
8798 contextInspector inspect:nil. |
8798 contextInspector inspect:nil. |
8799 contextInspector fieldListLabel:('Context'). |
8799 contextInspector fieldListLabel:('Context'). |
8800 ex suspendedContext fullPrintAllOn: Transcript. |
8800 ex suspendedContext fullPrintAllOn: Transcript. |
8801 "/ ex reject. |
8801 "/ ex reject. |
8802 ] do:[ |
8802 ] do:[ |
8803 contextInspector inspect:con. |
8803 contextInspector inspect:con. |
8804 "/ contextInspector fieldListLabel:('Context: ',con method whoString). |
8804 "/ contextInspector fieldListLabel:('Context: ',con method whoString). |
8805 contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
8805 contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
8806 ]. |
8806 ]. |
8807 |
8807 |
8808 "/ show a stack inspector sometimes |
8808 "/ show a stack inspector sometimes |
8809 |
8809 |
8810 con hasStackToShow ifTrue:[ |
8810 con hasStackToShow ifTrue:[ |
8811 self showStackInspectorFor:con |
8811 self showStackInspectorFor:con |
8812 ] ifFalse:[ |
8812 ] ifFalse:[ |
8813 self hideStackInspector |
8813 self hideStackInspector |
8814 ]. |
8814 ]. |
8815 |
8815 |
8816 homeContext := con methodHome. |
8816 homeContext := con methodHome. |
8817 con canReturn ifTrue:[ |
8817 con canReturn ifTrue:[ |
8818 returnButton enable. restartButton enable. |
8818 returnButton enable. restartButton enable. |
8819 ] ifFalse:[ |
8819 ] ifFalse:[ |
8820 returnButton disable. restartButton disable. |
8820 returnButton disable. restartButton disable. |
8821 ]. |
8821 ]. |
8822 |
8822 |
8823 lineNrInMethod := con lineNumber. |
8823 lineNrInMethod := con lineNumber. |
8824 |
8824 |
8825 canAccept := false. |
8825 canAccept := false. |
8826 |
8826 |
8827 homeContext isNil ifTrue:[ |
8827 homeContext isNil ifTrue:[ |
8828 " |
8828 " |
8829 mhmh - an optimized block |
8829 mhmh - an optimized block |
8830 should get the block here, and get the method from |
8830 should get the block here, and get the method from |
8831 that one ... |
8831 that one ... |
8832 But in the current version, there is no easy way to get to the block |
8832 But in the current version, there is no easy way to get to the block |
8833 since that one is not in the context. |
8833 since that one is not in the context. |
8834 A future new block calling scheme will fix this |
8834 A future new block calling scheme will fix this |
8835 (passing the block instead of the home as block argument). |
8835 (passing the block instead of the home as block argument). |
8836 " |
8836 " |
8837 (method := con method) isNil ifTrue:[ |
8837 (method := con method) isNil ifTrue:[ |
8838 "temporary kludge - peek into the sender context. |
8838 "temporary kludge - peek into the sender context. |
8839 If its a do-like method and there is a single block variable |
8839 If its a do-like method and there is a single block variable |
8840 in the args or temporaries, that must be the one. |
8840 in the args or temporaries, that must be the one. |
8841 This helps in some cases. |
8841 This helps in some cases. |
8842 " |
8842 " |
8843 (sender := con sender) notNil ifTrue:[ |
8843 (sender := con sender) notNil ifTrue:[ |
8844 tryVars := false. |
8844 tryVars := false. |
8845 (selSender := sender selector) notNil ifTrue:[ |
8845 (selSender := sender selector) notNil ifTrue:[ |
8846 ((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
8846 ((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
8847 tryVars := true. |
8847 tryVars := true. |
8848 ] |
8848 ] |
8849 ]. |
8849 ]. |
8850 tryVars ifTrue:[ |
8850 tryVars ifTrue:[ |
8851 possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
8851 possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
8852 possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
8852 possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
8853 possibleBlocks size == 1 ifTrue:[ |
8853 possibleBlocks size == 1 ifTrue:[ |
8854 method := possibleBlocks first method. |
8854 method := possibleBlocks first method. |
8855 ]. |
8855 ]. |
8856 ] |
8856 ] |
8857 ]. |
8857 ]. |
8858 ] |
8858 ] |
8859 ] ifFalse:[ |
8859 ] ifFalse:[ |
8860 "fetch rec here - so we won't need context in doItAction" |
8860 "fetch rec here - so we won't need context in doItAction" |
8861 rec := homeContext receiver. |
8861 rec := homeContext receiver. |
8862 sel := homeContext selector. |
8862 sel := homeContext selector. |
8863 sel notNil ifTrue:[ |
8863 sel notNil ifTrue:[ |
8864 canAccept := true. |
8864 canAccept := true. |
8865 |
8865 |
8866 implementorClass := homeContext methodClass. |
8866 implementorClass := homeContext methodClass. |
8867 implementorClass isNil ifTrue:[ |
8867 implementorClass isNil ifTrue:[ |
8868 homeContext method notNil ifTrue:[ |
8868 homeContext method notNil ifTrue:[ |
8869 WrappedMethod allInstancesDo:[:wrapped | |
8869 WrappedMethod allInstancesDo:[:wrapped | |
8870 wrapped originalMethod == homeContext method ifTrue:[ |
8870 wrapped originalMethod == homeContext method ifTrue:[ |
8871 implementorClass := wrapped mclass |
8871 implementorClass := wrapped mclass |
8872 ] |
8872 ] |
8873 ]. |
8873 ]. |
8874 implementorClass isNil ifTrue:[ |
8874 implementorClass isNil ifTrue:[ |
8875 (homeContext searchClass notNil |
8875 (homeContext searchClass notNil |
8876 and:[homeContext searchClass isObsolete]) ifTrue:[ |
8876 and:[homeContext searchClass isObsolete]) ifTrue:[ |
8877 cannotAcceptDueToOutdatedClass := true. |
8877 cannotAcceptDueToOutdatedClass := true. |
8878 ] |
8878 ] |
8879 ]. |
8879 ]. |
8880 ]. |
8880 ]. |
8881 ]. |
8881 ]. |
8882 implementorClass isNil ifTrue:[ |
8882 implementorClass isNil ifTrue:[ |
8883 Error handle:[:ex | |
8883 Error handle:[:ex | |
8884 "/ not covered by Error, anyway |
8884 "/ not covered by Error, anyway |
8885 "/ ex signal == BreakPointInterrupt ifTrue:[ |
8885 "/ ex signal == BreakPointInterrupt ifTrue:[ |
8886 "/ ex proceed. |
8886 "/ ex proceed. |
8887 "/ ]. |
8887 "/ ]. |
8888 code := 'error while asking method for its source'. |
8888 code := 'error while asking method for its source'. |
8889 code := code , Character cr , ex creator printString. |
8889 code := code , Character cr , ex creator printString. |
8890 code := code , Character cr , 'in: ' , ex suspendedContext printString. |
8890 code := code , Character cr , 'in: ' , ex suspendedContext printString. |
8891 |
8891 |
8892 canAccept := false. |
8892 canAccept := false. |
8893 ex return. |
8893 ex return. |
8894 ] do:[ |
8894 ] do:[ |
8895 " |
8895 " |
8896 special: look if this context was created by |
8896 special: look if this context was created by |
8897 valueWithReceiver kind of method invocation; |
8897 valueWithReceiver kind of method invocation; |
8898 if so, grab the method from the sender and show it |
8898 if so, grab the method from the sender and show it |
8899 " |
8899 " |
8900 ((sender := homeContext sender) notNil |
8900 ((sender := homeContext sender) notNil |
8901 and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
8901 and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
8902 and:[sender receiver isMethod]]) ifTrue:[ |
8902 and:[sender receiver isMethod]]) ifTrue:[ |
8903 method := sender receiver. |
8903 method := sender receiver. |
8904 canAccept := false. |
8904 canAccept := false. |
8905 ] ifFalse:[ |
8905 ] ifFalse:[ |
8906 (method := con method) notNil ifTrue:[ |
8906 (method := con method) notNil ifTrue:[ |
8907 canAccept := false. |
8907 canAccept := false. |
8908 ] |
8908 ] |
8909 ]. |
8909 ]. |
8910 ] |
8910 ] |
8911 ] ifFalse:[ |
8911 ] ifFalse:[ |
8912 method := implementorClass compiledMethodAt:sel. |
8912 method := implementorClass compiledMethodAt:sel. |
8913 ]. |
8913 ]. |
8914 ] |
8914 ] |
8915 ]. |
8915 ]. |
8916 |
8916 |
8917 homeContext notNil ifTrue:[ |
8917 homeContext notNil ifTrue:[ |
8918 searchClass := homeContext searchClass ? rec class. |
8918 searchClass := homeContext searchClass ? rec class. |
8919 currentMethod := searchClass lookupMethodFor:sel. |
8919 currentMethod := searchClass lookupMethodFor:sel. |
8920 ]. |
8920 ]. |
8921 originalMethod := currentMethod. |
8921 originalMethod := currentMethod. |
8922 (currentMethod notNil |
8922 (currentMethod notNil |
8923 and:[currentMethod ~~ method |
8923 and:[currentMethod ~~ method |
8924 and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]]) ifTrue:[ |
8924 and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]]) ifTrue:[ |
8925 originalMethod := method. |
8925 originalMethod := method. |
8926 methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
8926 methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
8927 method := originalMethod. "/ the one which is suspended / was executing |
8927 method := originalMethod. "/ the one which is suspended / was executing |
8928 ] ifFalse:[ |
8928 ] ifFalse:[ |
8929 method := currentMethod. "/ the one which has already been accepted/modified. |
8929 method := currentMethod. "/ the one which has already been accepted/modified. |
8930 lineNrInMethod := nil. |
8930 lineNrInMethod := nil. |
8931 canAccept := true. |
8931 canAccept := true. |
8932 ]. |
8932 ]. |
8933 methodCodeToggle beVisible. |
8933 methodCodeToggle beVisible. |
8934 ] ifFalse:[ |
8934 ] ifFalse:[ |
8935 methodCodeToggle beInvisible. |
8935 methodCodeToggle beInvisible. |
8936 ]. |
8936 ]. |
8937 |
8937 |
8938 code isNil ifTrue:[ |
8938 code isNil ifTrue:[ |
8939 errMsg := nil. |
8939 errMsg := nil. |
8940 method isNil ifTrue:[ |
8940 method isNil ifTrue:[ |
8941 "/ fall back heuristics (see how this was called, fetch block from caller) |
8941 "/ fall back heuristics (see how this was called, fetch block from caller) |
8942 sender := con sender. |
8942 sender := con sender. |
8943 con isBlockContext ifTrue:[ |
8943 con isBlockContext ifTrue:[ |
8944 (sender notNil |
8944 (sender notNil |
8945 and:[((sender selector ? '') startsWith:'value') |
8945 and:[((sender selector ? '') startsWith:'value') |
8946 and:[sender receiver isBlock]]) ifTrue:[ |
8946 and:[sender receiver isBlock]]) ifTrue:[ |
8947 code := sender receiver source. |
8947 code := sender receiver source. |
8948 ] |
8948 ] |
8949 ] ifFalse:[ |
8949 ] ifFalse:[ |
8950 (sender notNil |
8950 (sender notNil |
8951 and:[((sender selector ? '') startsWith:'valueWith') |
8951 and:[((sender selector ? '') startsWith:'valueWith') |
8952 and:[sender receiver isMethod]]) ifTrue:[ |
8952 and:[sender receiver isMethod]]) ifTrue:[ |
8953 method := sender receiver. |
8953 method := sender receiver. |
8954 ] |
8954 ] |
8955 ] |
8955 ] |
8956 ]. |
8956 ]. |
8957 method notNil ifTrue:[ |
8957 method notNil ifTrue:[ |
8958 contextInspector fieldListLabel:(method selector "whoString"). |
8958 contextInspector fieldListLabel:(method selector "whoString"). |
8959 Error handle:[:ex | |
8959 Error handle:[:ex | |
8960 "/ not covered by Error, anyway |
8960 "/ not covered by Error, anyway |
8961 "/ ex signal isControlInterrupt ifTrue:[ |
8961 "/ ex signal isControlInterrupt ifTrue:[ |
8962 "/ ex proceed. |
8962 "/ ex proceed. |
8963 "/ ]. |
8963 "/ ]. |
8964 code := 'error while asking method for its source'. |
8964 code := 'error while asking method for its source'. |
8965 code := code , Character cr , ex creator printString. |
8965 code := code , Character cr , ex creator printString. |
8966 code := code , Character cr , 'in: ' , ex suspendedContext printString. |
8966 code := code , Character cr , 'in: ' , ex suspendedContext printString. |
8967 |
8967 |
8968 canAccept := false. |
8968 canAccept := false. |
8969 ex return. |
8969 ex return. |
8970 ] do:[ |
8970 ] do:[ |
8971 self sensor shiftDown ifTrue:[ |
8971 self sensor shiftDown ifTrue:[ |
8972 code := method decompiledSource |
8972 code := method decompiledSource |
8973 ] ifFalse:[ |
8973 ] ifFalse:[ |
8974 code := method source. |
8974 code := method source. |
8975 ]. |
8975 ]. |
8976 ]. |
8976 ]. |
8977 |
8977 |
8978 code isNil ifTrue:[ |
8978 code isNil ifTrue:[ |
8979 method sourceFilename notNil ifTrue:[ |
8979 method sourceFilename notNil ifTrue:[ |
8980 codeView contents:(resources |
8980 codeView contents:(resources |
8981 string:'** no sourcefile: %1 **' |
8981 string:'** no sourcefile: %1 **' |
8982 with:method sourceFilename). |
8982 with:method sourceFilename). |
8983 codeView realized ifTrue:[ |
8983 codeView realized ifTrue:[ |
8984 "codeView is not realized on initial startup" |
8984 "codeView is not realized on initial startup" |
8985 codeView flash:'no source'. |
8985 codeView flash:'no source'. |
8986 ]. |
8986 ]. |
8987 codeSet := true. |
8987 codeSet := true. |
8988 ] ifFalse:[ |
8988 ] ifFalse:[ |
8989 [ |
8989 [ |
8990 |src| |
8990 |src| |
8991 |
8991 |
8992 src := String streamContents:[:s | Decompiler decompile:method to:s]. |
8992 src := String streamContents:[:s | Decompiler decompile:method to:s]. |
8993 codeView contents:src. |
8993 codeView contents:src. |
8994 codeSet := true. |
8994 codeSet := true. |
8995 ] on: Error do:[ |
8995 ] on: Error do:[ |
8996 errMsg := '** no source **' |
8996 errMsg := '** no source **' |
8997 ]. |
8997 ]. |
8998 ] |
8998 ] |
8999 ]. |
8999 ]. |
9000 ] ifFalse:[ |
9000 ] ifFalse:[ |
9001 contextInspector fieldListLabel:'Context'. |
9001 contextInspector fieldListLabel:'Context'. |
9002 homeContext isNil ifTrue:[ |
9002 homeContext isNil ifTrue:[ |
9003 errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
9003 errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
9004 ] ifFalse:[ |
9004 ] ifFalse:[ |
9005 errMsg := '** no method - no source **'. |
9005 errMsg := '** no method - no source **'. |
9006 canDefine := false. "/ true. |
9006 canDefine := false. "/ true. |
9007 ] |
9007 ] |
9008 ]. |
9008 ]. |
9009 errMsg notNil ifTrue:[ |
9009 errMsg notNil ifTrue:[ |
9010 self showError:errMsg. |
9010 self showError:errMsg. |
9011 codeSet := true. |
9011 codeSet := true. |
9012 ] |
9012 ] |
9013 ]. |
9013 ]. |
9014 |
9014 |
9015 code isNil ifTrue:[ |
9015 code isNil ifTrue:[ |
9016 "/ canAccept := false. |
9016 "/ canAccept := false. |
9017 codeSet ifFalse:[ |
9017 codeSet ifFalse:[ |
9018 codeView contents:nil. |
9018 codeView contents:nil. |
9019 ] |
9019 ] |
9020 ] ifFalse:[ |
9020 ] ifFalse:[ |
9021 lineNrInMethod notNil ifTrue:[ |
9021 lineNrInMethod notNil ifTrue:[ |
9022 lineNrInMethod == 0 ifTrue:[ |
9022 lineNrInMethod == 0 ifTrue:[ |
9023 (method notNil and:[method isJavaMethod]) ifTrue:[ |
9023 (method notNil and:[method isJavaMethod]) ifTrue:[ |
9024 lineNrInMethod := method lineNumber |
9024 lineNrInMethod := method lineNumber |
9025 ]. |
9025 ]. |
9026 "/ guess lineNumber from sent-messages selector |
9026 "/ guess lineNumber from sent-messages selector |
9027 "/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
9027 "/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
9028 lineNrInMethod == 0 ifTrue:[ |
9028 lineNrInMethod == 0 ifTrue:[ |
9029 |conIdx sentContext messages| |
9029 |conIdx sentContext messages| |
9030 |
9030 |
9031 conIdx := contextArray identityIndexOf:con. |
9031 conIdx := contextArray identityIndexOf:con. |
9032 conIdx > 1 ifTrue:[ |
9032 conIdx > 1 ifTrue:[ |
9033 sentContext := contextArray at:conIdx-1. |
9033 sentContext := contextArray at:conIdx-1. |
9034 sentContext isBlockContext ifFalse:[ |
9034 sentContext isBlockContext ifFalse:[ |
9035 (method notNil and:[code notNil]) ifTrue:[ |
9035 (method notNil and:[code notNil]) ifTrue:[ |
9036 messages := method messagesSent. |
9036 messages := method messagesSent. |
9037 messages size == 1 ifTrue:[ |
9037 messages size == 1 ifTrue:[ |
9038 sentContext selector == messages first ifTrue:[ |
9038 sentContext selector == messages first ifTrue:[ |
9039 lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
9039 lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
9040 ] |
9040 ] |
9041 ] |
9041 ] |
9042 ]. |
9042 ]. |
9043 ]. |
9043 ]. |
9044 ]. |
9044 ]. |
9045 ]. |
9045 ]. |
9046 ]. |
9046 ]. |
9047 ]. |
9047 ]. |
9048 codeView isCodeView2 ifTrue:[ |
9048 codeView isCodeView2 ifTrue:[ |
9049 codeView model |
9049 codeView model |
9050 setValue: code; |
9050 setValue: code; |
9051 changed. |
9051 changed. |
9052 codeView methodHolder value: method. |
9052 codeView methodHolder value: method. |
9053 codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
9053 codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
9054 ] ifFalse:[ |
9054 ] ifFalse:[ |
9055 UserPreferences current syntaxColoring ifTrue:[ |
9055 UserPreferences current syntaxColoring ifTrue:[ |
9056 implementorClass isNil ifTrue:[ |
9056 implementorClass isNil ifTrue:[ |
9057 (con isBlockContext |
9057 (con isBlockContext |
9058 and:[con home isNil |
9058 and:[con home isNil |
9059 and:[con guessedHome notNil]]) |
9059 and:[con guessedHome notNil]]) |
9060 ifTrue:[ |
9060 ifTrue:[ |
9061 implementorClass := con guessedHome mclass |
9061 implementorClass := con guessedHome mclass |
9062 ] |
9062 ] |
9063 ]. |
9063 ]. |
9064 implementorClass notNil ifTrue:[ |
9064 implementorClass notNil ifTrue:[ |
9065 (highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
9065 (highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
9066 code size < 100000 ifTrue:[ |
9066 code size < 100000 ifTrue:[ |
9067 Error catch:[ |
9067 Error catch:[ |
9068 code := highlighter formatMethodSource:code in:implementorClass. |
9068 code := highlighter formatMethodSource:code in:implementorClass. |
9069 ] |
9069 ] |
9070 ] |
9070 ] |
9071 ] |
9071 ] |
9072 ] |
9072 ] |
9073 ]. |
9073 ]. |
9074 |
9074 |
9075 "/ code ~= (codeView contents) ifTrue:[ |
9075 "/ code ~= (codeView contents) ifTrue:[ |
9076 cannotAcceptDueToOutdatedClass ifTrue:[ |
9076 cannotAcceptDueToOutdatedClass ifTrue:[ |
9077 codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' colorizeAllWith:Color red),Character cr,Character cr,code asString). |
9077 codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' colorizeAllWith:Color red),Character cr,Character cr,code asString). |
9078 ] ifFalse:[ |
9078 ] ifFalse:[ |
9079 codeView setContents:code. |
9079 codeView setContents:code. |
9080 ]. |
9080 ]. |
9081 "/ ]. |
9081 "/ ]. |
9082 ]. |
9082 ]. |
9083 (lineNrInMethod notNil |
9083 (lineNrInMethod notNil |
9084 and:[lineNrInMethod ~~ 0 |
9084 and:[lineNrInMethod ~~ 0 |
9085 and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
9085 and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
9086 lineNrInMethod == 255 ifFalse:[ |
9086 lineNrInMethod == 255 ifFalse:[ |
9087 (lineNrInMethod == 255 |
9087 (lineNrInMethod == 255 |
9088 and:[method notNil |
9088 and:[method notNil |
9089 and:[method hasCode not]]) ifTrue:[ |
9089 and:[method hasCode not]]) ifTrue:[ |
9090 "/ means: do not really know in interpreted methods |
9090 "/ means: do not really know in interpreted methods |
9091 codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
9091 codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
9092 ] ifFalse:[ |
9092 ] ifFalse:[ |
9093 codeView selectLine:lineNrInMethod. |
9093 codeView selectLine:lineNrInMethod. |
9094 ]. |
9094 ]. |
9095 codeView makeSelectionVisible |
9095 codeView makeSelectionVisible |
9096 ]. |
9096 ]. |
9097 ] ifFalse:[ |
9097 ] ifFalse:[ |
9098 codeView unselect. |
9098 codeView unselect. |
9099 codeView scrollToTop |
9099 codeView scrollToTop |
9100 ] |
9100 ] |
9101 ]. |
9101 ]. |
9102 |
9102 |
9103 codeView acceptEnabled:canAccept. |
9103 codeView acceptEnabled:canAccept. |
9104 canAccept ifTrue:[ |
9104 canAccept ifTrue:[ |
9105 codeView acceptAction:[:code | self codeAccept:code asString] |
9105 codeView acceptAction:[:code | self codeAccept:code asString] |
9106 ] ifFalse:[ |
9106 ] ifFalse:[ |
9107 codeView acceptAction:[:code | self beep] |
9107 codeView acceptAction:[:code | self beep] |
9108 ]. |
9108 ]. |
9109 |
9109 |
9110 receiverInspector inspect:rec. |
9110 receiverInspector inspect:rec. |
9111 receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle). |
9111 receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle). |
9112 receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
9112 receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
9113 |
9113 |
9114 " |
9114 " |
9115 the one below is wrong: currently, the |
9115 the one below is wrong: currently, the |
9116 evaluator cannot handle passed contexts. |
9116 evaluator cannot handle passed contexts. |
9117 Once it does, pass con as in:-arg |
9117 Once it does, pass con as in:-arg |
9118 " |
9118 " |
9119 (rec isJavaObject |
9119 (rec isJavaObject |
9120 and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
9120 and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
9121 "/ although a java object, use the smalltalk parser here for doIts. |
9121 "/ although a java object, use the smalltalk parser here for doIts. |
9122 evaluatorClass := Parser. |
9122 evaluatorClass := Parser. |
9123 codeView commentStrings:#( '//' ( '/*' '*/' ) ). |
9123 codeView commentStrings:#( '//' ( '/*' '*/' ) ). |
9124 ] ifFalse:[ |
9124 ] ifFalse:[ |
9125 (method notNil and:[method mclass notNil]) ifTrue:[ |
9125 (method notNil and:[method mclass notNil]) ifTrue:[ |
9126 evaluatorClass := method mclass evaluatorClass. |
9126 evaluatorClass := method mclass evaluatorClass. |
9127 codeView commentStrings:method mclass programmingLanguage commentStrings. |
9127 codeView commentStrings:method mclass programmingLanguage commentStrings. |
9128 ] ifFalse:[ |
9128 ] ifFalse:[ |
9129 evaluatorClass := rec class evaluatorClass. |
9129 evaluatorClass := rec class evaluatorClass. |
9130 codeView commentStrings:rec class programmingLanguage commentStrings. |
9130 codeView commentStrings:rec class programmingLanguage commentStrings. |
9131 ]. |
9131 ]. |
9132 ]. |
9132 ]. |
9133 |
9133 |
9134 codeView |
9134 codeView |
9135 doItAction: |
9135 doItAction: |
9136 [:theCode | |
9136 [:theCode | |
9137 evaluatorClass |
9137 evaluatorClass |
9138 evaluate:theCode |
9138 evaluate:theCode |
9139 in:actualContext "/ (selectedContext ? actualContext) |
9139 in:actualContext "/ (selectedContext ? actualContext) |
9140 receiver:rec |
9140 receiver:rec |
9141 notifying:codeView |
9141 notifying:codeView |
9142 logged:true |
9142 logged:true |
9143 ifFail:nil |
9143 ifFail:nil |
9144 ]; |
9144 ]; |
9145 editedMethodOrClass:(method ? rec class). |
9145 editedMethodOrClass:(method ? rec class). |
9146 |
9146 |
9147 |
9147 |
9148 self setCurrentMethod:method. |
9148 self setCurrentMethod:method. |
9149 |
9149 |
9150 selectedContext := homeContext ? con. |
9150 selectedContext := homeContext ? con. |
9151 actualContext := con |
9151 actualContext := con |
9152 ]. |
9152 ]. |
9153 ] ifFalse:[ |
9153 ] ifFalse:[ |
9154 codeView contents:nil. |
9154 codeView contents:nil. |
9155 ]. |
9155 ]. |
9156 codeView modified:false. |
9156 codeView modified:false. |
9157 |
9157 |
9158 con isContext ifFalse:[ |
9158 con isContext ifFalse:[ |
9159 sendButton disable. |
9159 sendButton disable. |
9160 ] ifTrue:[ |
9160 ] ifTrue:[ |
9161 sendButton enable. |
9161 sendButton enable. |
9162 ]. |
9162 ]. |
9163 self updateContextInfoFor:con. |
9163 self updateContextInfoFor:con. |
9164 |
9164 |
9165 "clear out locals to prevent keeping around unneeded contexts |
9165 "clear out locals to prevent keeping around unneeded contexts |
9166 (due to the block held in codeView). |
9166 (due to the block held in codeView). |
9169 " |
9169 " |
9170 con := nil. |
9170 con := nil. |
9171 homeContext := nil. |
9171 homeContext := nil. |
9172 |
9172 |
9173 (canDefine or:[self canDefineForCallee:callee]) ifTrue:[ |
9173 (canDefine or:[self canDefineForCallee:callee]) ifTrue:[ |
9174 defineButton beVisible. |
9174 defineButton beVisible. |
9175 ] ifFalse:[ |
9175 ] ifFalse:[ |
9176 defineButton beInvisible. |
9176 defineButton beInvisible. |
9177 ]. |
9177 ]. |
9178 |
9178 |
9179 "/ enable/disable some menu items |
9179 "/ enable/disable some menu items |
9180 self updateMenuItems |
9180 self updateMenuItems |
9181 |
9181 |
9194 ignoreEndTime := something. |
9194 ignoreEndTime := something. |
9195 ! |
9195 ! |
9196 |
9196 |
9197 ignoreForProcess:aProcess |
9197 ignoreForProcess:aProcess |
9198 ignoredProcesses isNil ifTrue:[ |
9198 ignoredProcesses isNil ifTrue:[ |
9199 ignoredProcesses := WeakIdentitySet new. |
9199 ignoredProcesses := WeakIdentitySet new. |
9200 ]. |
9200 ]. |
9201 ignoredProcesses add:aProcess |
9201 ignoredProcesses add:aProcess |
9202 ! |
9202 ! |
9203 |
9203 |
9204 ignoreForReceiverClass:aClass |
9204 ignoreForReceiverClass:aClass |
9205 ignoredReceiverClasses isNil ifTrue:[ |
9205 ignoredReceiverClasses isNil ifTrue:[ |
9206 ignoredReceiverClasses := WeakIdentitySet new. |
9206 ignoredReceiverClasses := WeakIdentitySet new. |
9207 ]. |
9207 ]. |
9208 ignoredReceiverClasses add:aClass |
9208 ignoredReceiverClasses add:aClass |
9209 ! |
9209 ! |
9210 |
9210 |
9211 ignoreIfCalledFromMethod:aMethod |
9211 ignoreIfCalledFromMethod:aMethod |
9212 ignoredSendingClassAndSelectors isNil ifTrue:[ |
9212 ignoredSendingClassAndSelectors isNil ifTrue:[ |
9213 ignoredSendingClassAndSelectors := OrderedCollection new. |
9213 ignoredSendingClassAndSelectors := OrderedCollection new. |
9214 ]. |
9214 ]. |
9215 |
9215 |
9216 "/ remember the method's name, not the method. |
9216 "/ remember the method's name, not the method. |
9217 "/ so it can be recompiled and we still detect ignores |
9217 "/ so it can be recompiled and we still detect ignores |
9218 ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector } |
9218 ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector } |
9226 |
9226 |
9227 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'! |
9227 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'! |
9228 |
9228 |
9229 decrementIgnoreCount |
9229 decrementIgnoreCount |
9230 ignoreCount notNil ifTrue:[ |
9230 ignoreCount notNil ifTrue:[ |
9231 ignoreCount > 0 ifTrue:[ |
9231 ignoreCount > 0 ifTrue:[ |
9232 ignoreCount := ignoreCount - 1 |
9232 ignoreCount := ignoreCount - 1 |
9233 ] |
9233 ] |
9234 ] |
9234 ] |
9235 ! ! |
9235 ! ! |
9236 |
9236 |
9237 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'! |
9237 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'! |
9238 |
9238 |
9239 printConditionOn:aStream |
9239 printConditionOn:aStream |
9240 ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[ |
9240 ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[ |
9241 aStream nextPutAll:(' if called from %1 >> %2' |
9241 aStream nextPutAll:(' if called from %1 >> %2' |
9242 bindWith:ignoredSendingClassAndSelectors first first |
9242 bindWith:ignoredSendingClassAndSelectors first first |
9243 with:ignoredSendingClassAndSelectors first second). |
9243 with:ignoredSendingClassAndSelectors first second). |
9244 ^ self. |
9244 ^ self. |
9245 ]. |
9245 ]. |
9246 ignoredProcesses notEmptyOrNil ifTrue:[ |
9246 ignoredProcesses notEmptyOrNil ifTrue:[ |
9247 aStream nextPutAll:(' in %1 processes (%2)' |
9247 aStream nextPutAll:(' in %1 processes (%2)' |
9248 bindWith:ignoredProcesses size |
9248 bindWith:ignoredProcesses size |
9249 with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
9249 with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
9250 ^ self. |
9250 ^ self. |
9251 ]. |
9251 ]. |
9252 ignoredReceiverClasses notNil ifTrue:[ |
9252 ignoredReceiverClasses notNil ifTrue:[ |
9253 aStream nextPutAll:(' for %1 classes (%2)' |
9253 aStream nextPutAll:(' for %1 classes (%2)' |
9254 bindWith:ignoredReceiverClasses size |
9254 bindWith:ignoredReceiverClasses size |
9255 with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
9255 with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
9256 ^ self. |
9256 ^ self. |
9257 ]. |
9257 ]. |
9258 ignoreUntilShiftKeyPressed == true ifTrue:[ |
9258 ignoreUntilShiftKeyPressed == true ifTrue:[ |
9259 aStream nextPutAll:' until shiftKey pressed'. |
9259 aStream nextPutAll:' until shiftKey pressed'. |
9260 ^ self. |
9260 ^ self. |
9261 ]. |
9261 ]. |
9262 ignoreEndTime notNil ifTrue:[ |
9262 ignoreEndTime notNil ifTrue:[ |
9263 aStream nextPutAll:' until '. |
9263 aStream nextPutAll:' until '. |
9264 ignoreEndTime printOn:aStream. |
9264 ignoreEndTime printOn:aStream. |
9265 ^ self. |
9265 ^ self. |
9266 ]. |
9266 ]. |
9267 (ignoreCount notNil) ifTrue:[ |
9267 (ignoreCount notNil) ifTrue:[ |
9268 (ignoreCount > 0) ifTrue:[ |
9268 (ignoreCount > 0) ifTrue:[ |
9269 aStream nextPutAll:' for '. |
9269 aStream nextPutAll:' for '. |
9270 ignoreCount printOn:aStream. |
9270 ignoreCount printOn:aStream. |
9271 ^ self. |
9271 ^ self. |
9272 ]. |
9272 ]. |
9273 (ignoreCount < 0) ifTrue:[ |
9273 (ignoreCount < 0) ifTrue:[ |
9274 aStream nextPutAll:' forEver'. |
9274 aStream nextPutAll:' forEver'. |
9275 ^ self. |
9275 ^ self. |
9276 ]. |
9276 ]. |
9277 aStream nextPutAll:' no longer'. |
9277 aStream nextPutAll:' no longer'. |
9278 ]. |
9278 ]. |
9279 ! ! |
9279 ! ! |
9280 |
9280 |
9281 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'! |
9281 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'! |
9282 |
9282 |
9283 haltIgnoredInfoString |
9283 haltIgnoredInfoString |
9284 "some string describing why and how this halt is ignored; |
9284 "some string describing why and how this halt is ignored; |
9285 nil if not ignored" |
9285 nil if not ignored" |
9286 |
9286 |
9287 ^ String streamContents:[:s | |
9287 ^ String streamContents:[:s | |
9288 s nextPutAll:'ignored '. |
9288 s nextPutAll:'ignored '. |
9289 self printConditionOn:s |
9289 self printConditionOn:s |
9290 ]. |
9290 ]. |
9291 |
9291 |
9292 "/ ignoreCount notNil ifTrue:[ |
9292 "/ ignoreCount notNil ifTrue:[ |
9293 "/ ignoreCount > 0 ifTrue:[ |
9293 "/ ignoreCount > 0 ifTrue:[ |
9294 "/ ^ '%1 more calls ignored' bindWith:ignoreCount |
9294 "/ ^ '%1 more calls ignored' bindWith:ignoreCount |
9321 |
9321 |
9322 isActive |
9322 isActive |
9323 "true if this ignore-entry is still active" |
9323 "true if this ignore-entry is still active" |
9324 |
9324 |
9325 ignoreEndTime notNil ifTrue:[ |
9325 ignoreEndTime notNil ifTrue:[ |
9326 ^ ignoreEndTime > Timestamp now |
9326 ^ ignoreEndTime > Timestamp now |
9327 ]. |
9327 ]. |
9328 ignoreCount notNil ifTrue:[ |
9328 ignoreCount notNil ifTrue:[ |
9329 ^ ignoreCount == -1 or:[ ignoreCount > 0 ] |
9329 ^ ignoreCount == -1 or:[ ignoreCount > 0 ] |
9330 ]. |
9330 ]. |
9331 ignoredProcesses notNil ifTrue:[ |
9331 ignoredProcesses notNil ifTrue:[ |
9332 ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]]. |
9332 ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]]. |
9333 ignoredProcesses isEmpty ifTrue:[ |
9333 ignoredProcesses isEmpty ifTrue:[ |
9334 ignoredProcesses := nil. |
9334 ignoredProcesses := nil. |
9335 ^ false |
9335 ^ false |
9336 ]. |
9336 ]. |
9337 ]. |
9337 ]. |
9338 ^ true |
9338 ^ true |
9339 |
9339 |
9340 "Created: / 06-03-2012 / 12:39:46 / cg" |
9340 "Created: / 06-03-2012 / 12:39:46 / cg" |
9341 ! |
9341 ! |
9356 |
9356 |
9357 isHaltIgnored |
9357 isHaltIgnored |
9358 "true if this halt should be ignored (sometimes)" |
9358 "true if this halt should be ignored (sometimes)" |
9359 |
9359 |
9360 ignoreUntilShiftKeyPressed == true ifTrue:[ |
9360 ignoreUntilShiftKeyPressed == true ifTrue:[ |
9361 ^ Screen current shiftDown not |
9361 ^ Screen current shiftDown not |
9362 ]. |
9362 ]. |
9363 ignoreCount notNil ifTrue:[ |
9363 ignoreCount notNil ifTrue:[ |
9364 ^ ignoreCount > 0 |
9364 ^ ignoreCount > 0 |
9365 ]. |
9365 ]. |
9366 ignoreEndTime notNil ifTrue:[ |
9366 ignoreEndTime notNil ifTrue:[ |
9367 ^ ignoreEndTime > Timestamp now |
9367 ^ ignoreEndTime > Timestamp now |
9368 ]. |
9368 ]. |
9369 |
9369 |
9370 ^ true |
9370 ^ true |
9371 |
9371 |
9372 "Modified: / 27-01-2012 / 11:36:01 / cg" |
9372 "Modified: / 27-01-2012 / 11:36:01 / cg" |
9396 |
9396 |
9397 method:methodArg lineNumber:lineNumberArg |
9397 method:methodArg lineNumber:lineNumberArg |
9398 "/ self assert:(methodArg mclass notNil). |
9398 "/ self assert:(methodArg mclass notNil). |
9399 |
9399 |
9400 methodArg == #all ifTrue:[ |
9400 methodArg == #all ifTrue:[ |
9401 weakMethodHolder := methodArg |
9401 weakMethodHolder := methodArg |
9402 ] ifFalse:[ |
9402 ] ifFalse:[ |
9403 weakMethodHolder := WeakArray with:methodArg. |
9403 weakMethodHolder := WeakArray with:methodArg. |
9404 ]. |
9404 ]. |
9405 lineNumber := lineNumberArg. |
9405 lineNumber := lineNumberArg. |
9406 |
9406 |
9407 "Modified: / 08-05-2011 / 10:28:41 / cg" |
9407 "Modified: / 08-05-2011 / 10:28:41 / cg" |
9408 ! ! |
9408 ! ! |
9411 |
9411 |
9412 printOn:aStream |
9412 printOn:aStream |
9413 |method| |
9413 |method| |
9414 |
9414 |
9415 (method := self method) isNil ifTrue:[ |
9415 (method := self method) isNil ifTrue:[ |
9416 aStream nextPutAll:'an obsolete IgnoredHalt'. |
9416 aStream nextPutAll:'an obsolete IgnoredHalt'. |
9417 ^ self |
9417 ^ self |
9418 ]. |
9418 ]. |
9419 |
9419 |
9420 aStream nextPutAll:'Ignore '. |
9420 aStream nextPutAll:'Ignore '. |
9421 method isSymbol ifTrue:[ |
9421 method isSymbol ifTrue:[ |
9422 method printOn:aStream. |
9422 method printOn:aStream. |
9423 ] ifFalse:[ |
9423 ] ifFalse:[ |
9424 method whoString printOn:aStream. |
9424 method whoString printOn:aStream. |
9425 ]. |
9425 ]. |
9426 self printConditionOn:aStream. |
9426 self printConditionOn:aStream. |
9427 |
9427 |
9428 "Modified: / 27-07-2012 / 23:04:42 / cg" |
9428 "Modified: / 27-07-2012 / 23:04:42 / cg" |
9429 ! ! |
9429 ! ! |
9462 |
9462 |
9463 (self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9463 (self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9464 "/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
9464 "/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
9465 |
9465 |
9466 context notNil ifTrue:[ |
9466 context notNil ifTrue:[ |
9467 ignoredReceiverClasses notNil ifTrue:[ |
9467 ignoredReceiverClasses notNil ifTrue:[ |
9468 ^ ignoredReceiverClasses includes:(context receiver class) |
9468 ^ ignoredReceiverClasses includes:(context receiver class) |
9469 ]. |
9469 ]. |
9470 ]. |
9470 ]. |
9471 |
9471 |
9472 "/ Transcript showCR:ignoredProcesses. |
9472 "/ Transcript showCR:ignoredProcesses. |
9473 "/ Transcript showCR:Processor activeProcess. |
9473 "/ Transcript showCR:Processor activeProcess. |
9474 ignoredProcesses notNil ifTrue:[ |
9474 ignoredProcesses notNil ifTrue:[ |
9475 ^ ignoredProcesses includes:(Processor activeProcess) |
9475 ^ ignoredProcesses includes:(Processor activeProcess) |
9476 ]. |
9476 ]. |
9477 ignoredSendingClassAndSelectors notNil ifTrue:[ |
9477 ignoredSendingClassAndSelectors notNil ifTrue:[ |
9478 context withAllSendersDo:[:each | |
9478 context withAllSendersDo:[:each | |
9479 |m className selector cls| |
9479 |m className selector cls| |
9480 |
9480 |
9481 (m := each method) notNil ifTrue:[ |
9481 (m := each method) notNil ifTrue:[ |
9482 cls := m mclass. |
9482 cls := m mclass. |
9483 cls notNil ifTrue:[ |
9483 cls notNil ifTrue:[ |
9484 className := cls name. |
9484 className := cls name. |
9485 selector := m selector. |
9485 selector := m selector. |
9486 (ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]]) |
9486 (ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]]) |
9487 ifTrue:[^ true]. |
9487 ifTrue:[^ true]. |
9488 ]. |
9488 ]. |
9489 ] |
9489 ] |
9490 ] |
9490 ] |
9491 ]. |
9491 ]. |
9492 |
9492 |
9493 ^ self isHaltIgnored "/ unconditionally |
9493 ^ self isHaltIgnored "/ unconditionally |
9494 ! ! |
9494 ! ! |
9495 |
9495 |
9527 ! ! |
9527 ! ! |
9528 |
9528 |
9529 !DebugView class methodsFor:'documentation'! |
9529 !DebugView class methodsFor:'documentation'! |
9530 |
9530 |
9531 version |
9531 version |
9532 ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.687 2015-02-24 18:23:38 cg Exp $' |
9532 ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.688 2015-02-25 00:26:22 cg Exp $' |
9533 ! |
9533 ! |
9534 |
9534 |
9535 version_CVS |
9535 version_CVS |
9536 ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.687 2015-02-24 18:23:38 cg Exp $' |
9536 ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.688 2015-02-25 00:26:22 cg Exp $' |
9537 ! |
9537 ! |
9538 |
9538 |
9539 version_SVN |
9539 version_SVN |
9540 ^ '$Id: DebugView.st,v 1.687 2015-02-24 18:23:38 cg Exp $' |
9540 ^ '$Id: DebugView.st,v 1.688 2015-02-25 00:26:22 cg Exp $' |
9541 ! ! |
9541 ! ! |
9542 |
9542 |
9543 |
9543 |
9544 DebugView initialize! |
9544 DebugView initialize! |