author | vrany |
Fri, 08 Jul 2011 14:51:45 +0200 | |
changeset 10296 | 020772a7653e |
parent 10289 | cb1f8bda978e |
child 10628 | 958f33f3b28b |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
10205 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
13 |
|
0 | 14 |
StandardSystemView subclass:#DebugView |
8215 | 15 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
16 |
receiverInspector contextInspector contextArray selectedContext |
|
17 |
catchBlock grabber mayProceed traceView tracing bigStep |
|
18 |
skipLineNr steppedContextAddress abortButton terminateButton |
|
19 |
continueButton stepButton nextButton nextOverButton nextOutButton |
|
20 |
sendButton returnButton restartButton exclusive inspecting |
|
21 |
nChainShown inspectedProcess updateProcess stopButton |
|
22 |
updateButton defineButton monitorToggle stepping |
|
23 |
steppedContextLineno stepForReturn actualContext inWrap |
|
24 |
stackInspector steppedContext wrapperContext verboseBacktrace |
|
25 |
firstContext stepHow cachable currentMethod ignoreBreakpoints |
|
26 |
stepUntilEntering lastStepUntilEntering |
|
27 |
lastSelectionInReceiverInspector lastSelectionInContextInspector |
|
28 |
canShowMore exitAbort reportButton setOfHiddenCallingSelectors |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
29 |
isStoppedAtHaltOrBreakPoint exceptionInfoLabel methodCodeToggle |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
30 |
methodCodeToggleSelectionHolder' |
8215 | 31 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
32 |
DebuggingDebugger DefaultDebuggerBackgroundColor |
|
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
33 |
InitialNChainShown IgnoredHalts ShowThreadID LastIgnoreHaltNTimes |
9626 | 34 |
LastIgnoreHaltDuration LastExtent LastOrigin' |
8215 | 35 |
poolDictionaries:'' |
36 |
category:'Interface-Debugger' |
|
0 | 37 |
! |
38 |
||
8170 | 39 |
Object subclass:#IgnoredHalt |
9076 | 40 |
instanceVariableNames:'weakMethodHolder lineNumber ignoreEndTime ignoreCount' |
8215 | 41 |
classVariableNames:'' |
42 |
poolDictionaries:'' |
|
43 |
privateIn:DebugView |
|
8170 | 44 |
! |
45 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
46 |
!DebugView class methodsFor:'documentation'! |
29 | 47 |
|
48 |
copyright |
|
49 |
" |
|
50 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
10205 | 51 |
All Rights Reserved |
29 | 52 |
|
53 |
This software is furnished under a license and may be used |
|
54 |
only in accordance with the terms of that license and with the |
|
55 |
inclusion of the above copyright notice. This software may not |
|
56 |
be provided or otherwise made available to, or used by, any |
|
57 |
other person. No title to or ownership of the software is |
|
58 |
hereby transferred. |
|
59 |
" |
|
60 |
! |
|
0 | 61 |
|
29 | 62 |
documentation |
63 |
" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
64 |
This class implements a graphical debugger interface. |
29 | 65 |
The debugger usually sits on top of the faulting process, |
10205 | 66 |
taking over its event processing. |
2358 | 67 |
(this is different from other Smalltalk debuggers, which control |
68 |
the debuggee as a separate process. Consider this an historic |
|
69 |
leftover - the debugger was one of the first applications written for |
|
70 |
ST/X; however, why should we change it without a particular need ...). |
|
71 |
||
72 |
Only the 'stopped' debugged process is affected; |
|
29 | 73 |
other processes continue to respond to events. |
74 |
||
75 |
The one exception is when an error occurs within the dispatcher process |
|
76 |
or in one of the eventhandler processes - in this case, the debugger |
|
77 |
will sit on an exclusive display connection. |
|
78 |
||
79 |
The whole debugging will be changed, once the required process primitives |
|
80 |
are available, which allow control of another processes execution |
|
81 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
82 |
to have the debugger control the debuggee (i.e. two processes) |
|
35 | 83 |
|
84 |
See additional information in 'doc/misc/debugger.doc'. |
|
53 | 85 |
|
10205 | 86 |
Notice: |
87 |
the DebugView class caches the last used debugger in a class |
|
88 |
variable. It may happen, that a malfunctioning debugger (for example, |
|
89 |
a halfway destroyed one) is kept there. You will notice this, if a |
|
90 |
debugger comes up without showing any contents. In this case, close |
|
91 |
(or destroy) the broken debugView, and execute |
|
92 |
Debugger newDebugger |
|
93 |
which removes the cached debugger and forces creation of a new one the |
|
94 |
next time. This is a temporary workaround - the debugger will be fixed to |
|
95 |
avoid this problem. |
|
96 |
You also have to remove the cached debugger, if you change the debugger's |
|
97 |
initialization code (buttons, menu, etc.) and you want the new code to become |
|
98 |
effective. |
|
508 | 99 |
|
100 |
[author:] |
|
10205 | 101 |
Claus Gittinger |
508 | 102 |
|
103 |
[see also:] |
|
10205 | 104 |
Exception Signal |
105 |
Process |
|
29 | 106 |
" |
107 |
! ! |
|
0 | 108 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
109 |
!DebugView class methodsFor:'initialization'! |
243 | 110 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
111 |
initialize |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
112 |
InitialNChainShown := 50. |
8148 | 113 |
"/ DefaultDebuggerBackgroundColor := nil. |
3387 | 114 |
"/ DefaultDebuggerBackgroundColor := Color red lightened. |
115 |
"/ DefaultDebuggerBackgroundColor := Color blue lightened lightened. |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
116 |
|
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
117 |
"Created: 20.3.1997 / 16:53:37 / cg" |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
118 |
"Modified: 20.3.1997 / 16:54:32 / cg" |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
119 |
! |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
120 |
|
243 | 121 |
reinitialize |
7822 | 122 |
"reinitialize after an image-restart" |
123 |
||
243 | 124 |
self newDebugger |
125 |
! ! |
|
126 |
||
10203 | 127 |
!DebugView class methodsFor:'cleanup'! |
128 |
||
10205 | 129 |
lowSpaceCleanup |
10203 | 130 |
"in low memory situations, give up cached debuggers" |
131 |
||
132 |
CachedDebugger := nil. |
|
133 |
CachedExclusive := nil. |
|
134 |
OpenDebuggers := nil. |
|
135 |
||
136 |
" |
|
137 |
DebugView lowSpaceCleanup |
|
138 |
" |
|
139 |
||
140 |
"Modified: 18.4.1996 / 16:48:03 / cg" |
|
141 |
! |
|
142 |
||
143 |
newDebugger |
|
144 |
"force creation of a new debugger (give up cached debuggers)" |
|
145 |
||
146 |
CachedDebugger := nil. |
|
147 |
CachedExclusive := nil. |
|
148 |
OpenDebuggers := nil. |
|
149 |
||
150 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
|
10205 | 151 |
Debugger := self |
10203 | 152 |
]. |
153 |
||
154 |
" |
|
155 |
DebugView newDebugger |
|
156 |
" |
|
157 |
! ! |
|
158 |
||
159 |
!DebugView class methodsFor:'defaults'! |
|
160 |
||
161 |
defaultIcon |
|
162 |
"return the browsers default window icon" |
|
163 |
||
164 |
<resource: #programImage> |
|
165 |
||
10205 | 166 |
^ ToolbarIconLibrary debug22x22Icon |
10203 | 167 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
168 |
||
169 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
170 |
! |
|
171 |
||
172 |
defaultIconForAboutBox |
|
173 |
<resource: #programImage> |
|
174 |
||
10205 | 175 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
10203 | 176 |
! |
177 |
||
178 |
defaultVerboseBacktrace |
|
179 |
<resource: #obsolete> |
|
180 |
self obsoleteMethodWarning. |
|
181 |
^ UserPreferences current verboseBacktraceInDebugger |
|
182 |
||
183 |
"Created: 11.1.1997 / 12:14:35 / cg" |
|
184 |
! |
|
185 |
||
186 |
defaultVerboseBacktrace:aBoolean |
|
187 |
<resource: #obsolete> |
|
188 |
self obsoleteMethodWarning. |
|
189 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
190 |
! |
|
191 |
||
192 |
updateStyleCache |
|
193 |
"extract values from the styleSheet and cache them in class variables" |
|
194 |
||
195 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
196 |
||
197 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
|
198 |
||
199 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
200 |
! ! |
|
201 |
||
202 |
!DebugView class methodsFor:'ignoring halts'! |
|
203 |
||
204 |
haltIgnoreInformationFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
205 |
"the information (if any) about the ignore-state of a halt" |
|
206 |
||
207 |
IgnoredHalts isNil ifTrue:[^ nil]. |
|
208 |
||
10205 | 209 |
IgnoredHalts do:[:ign | |
210 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) ifTrue:[ |
|
211 |
^ ign |
|
212 |
]. |
|
10203 | 213 |
]. |
214 |
^ nil. |
|
215 |
! |
|
216 |
||
217 |
hasIgnoredHalts |
|
218 |
self removeInactiveIgnores. |
|
219 |
^ IgnoredHalts notEmptyOrNil |
|
220 |
! |
|
221 |
||
222 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt forCount:countOrNil orTimeDuration:dTOrNil |
|
223 |
"remember to ignore a halt in some method for some number of invocations |
|
224 |
or until some time has elapsed. |
|
225 |
With nil count and time arguments, such an ignored halt is reactivated" |
|
226 |
||
227 |
|oldEntry ign| |
|
228 |
||
229 |
IgnoredHalts notNil ifTrue:[ |
|
10205 | 230 |
self removeInactiveIgnores. |
231 |
oldEntry := IgnoredHalts |
|
232 |
detect:[:ign | ign isForMethod:haltingMethod line:lineNrOfHalt] |
|
233 |
ifNone:nil. |
|
234 |
oldEntry notNil ifTrue:[ |
|
235 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
236 |
] |
|
10203 | 237 |
]. |
238 |
||
239 |
(countOrNil notNil or:[dTOrNil notNil]) ifTrue:[ |
|
10205 | 240 |
IgnoredHalts isNil ifTrue:[ |
241 |
IgnoredHalts := OrderedCollection new. |
|
242 |
]. |
|
243 |
ign := IgnoredHalt new method:haltingMethod lineNumber:lineNrOfHalt. |
|
244 |
||
245 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
246 |
ign ignoreCount:countOrNil. |
|
247 |
]. |
|
248 |
(dTOrNil notNil) ifTrue:[ |
|
249 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
250 |
]. |
|
251 |
IgnoredHalts add:ign. |
|
10203 | 252 |
]. |
253 |
Smalltalk changed:#ignoredHalts. |
|
254 |
||
255 |
"Modified: / 22-10-2010 / 13:52:02 / cg" |
|
256 |
! |
|
257 |
||
258 |
isHaltToBeIgnored |
|
259 |
|c haltingMethod lineNrInHaltingMethod| |
|
260 |
||
261 |
"/ should a halt be ignored ? |
|
262 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
263 |
||
264 |
"/ look for a breakpoint-wrapper's context |
|
265 |
c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
|
266 |
c notNil ifTrue:[ |
|
10205 | 267 |
(c receiver isKindOf:NoHandlerError) ifTrue:[ |
268 |
c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
|
269 |
]. |
|
270 |
(c receiver isKindOf:BreakPointInterrupt) ifFalse:[ |
|
271 |
c := nil |
|
272 |
] ifTrue:[ |
|
273 |
[ (c sender receiver isKindOf:BreakPointInterrupt) |
|
274 |
or:[ c sender receiver == BreakPointInterrupt ]] whileTrue:[ |
|
275 |
c := c sender |
|
276 |
]. |
|
277 |
[ c sender isBlockContext ] whileTrue:[ |
|
278 |
c := c sender |
|
279 |
]. |
|
280 |
]. |
|
10203 | 281 |
]. |
282 |
||
283 |
c isNil ifTrue:[ |
|
10205 | 284 |
"/ look for halts or explicit breakpoints |
285 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
286 |
c isNil ifTrue:[ |
|
287 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
288 |
c isNil ifTrue:[ |
|
289 |
^ false |
|
290 |
]. |
|
291 |
]. |
|
10203 | 292 |
]. |
293 |
||
294 |
c := c sender. |
|
295 |
haltingMethod := c method. |
|
296 |
||
297 |
haltingMethod isWrapped ifTrue:[ |
|
10205 | 298 |
lineNrInHaltingMethod := 1. |
10203 | 299 |
] ifFalse:[ |
10205 | 300 |
lineNrInHaltingMethod := c lineNumber. |
301 |
"/ Transcript showCR:c. |
|
302 |
]. |
|
303 |
||
304 |
^ self |
|
305 |
isHaltToBeIgnoredIn:haltingMethod |
|
306 |
atLineNr:lineNrInHaltingMethod |
|
307 |
modifyEntryCount:true. |
|
10203 | 308 |
|
309 |
"Created: / 22-10-2010 / 12:09:53 / cg" |
|
310 |
"Modified: / 22-10-2010 / 13:51:25 / cg" |
|
311 |
! |
|
312 |
||
313 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod |
|
314 |
^ self |
|
10205 | 315 |
isHaltToBeIgnoredIn:haltingMethod |
316 |
atLineNr:lineNrInHaltingMethod |
|
317 |
modifyEntryCount:false |
|
10203 | 318 |
! |
319 |
||
320 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod modifyEntryCount:modifyCount |
|
321 |
"/ should a halt be ignored ? |
|
322 |
||
323 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
324 |
||
325 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
|
10205 | 326 |
IgnoredHalts do:[:ign | |
327 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) ifTrue:[ |
|
328 |
Transcript showCR:'Debugger [info]: halt ignored in ', haltingMethod whoString. |
|
329 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
330 |
ign isHaltIgnored ifFalse:[ |
|
331 |
Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString. |
|
332 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
333 |
]. |
|
334 |
^ true. |
|
335 |
]. |
|
336 |
]. |
|
337 |
||
338 |
IgnoredHalts := IgnoredHalts |
|
339 |
select:[:ign | |
|
340 |
ign isActive and:[ (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) not ] |
|
341 |
]. |
|
10203 | 342 |
IgnoredHalts isEmpty ifTrue:[ |
10205 | 343 |
IgnoredHalts := nil. |
10203 | 344 |
]. |
345 |
||
346 |
^ false. |
|
347 |
||
348 |
"Modified: / 22-10-2010 / 13:51:45 / cg" |
|
349 |
! |
|
350 |
||
351 |
removeInactiveIgnores |
|
352 |
IgnoredHalts notNil ifTrue:[ |
|
10205 | 353 |
IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
10203 | 354 |
]. |
355 |
! |
|
356 |
||
357 |
stopIgnoringHalts |
|
358 |
"forget about all ignored halts" |
|
359 |
||
360 |
IgnoredHalts := nil. |
|
361 |
Smalltalk changed:#ignoredHalts. |
|
362 |
! ! |
|
363 |
||
364 |
!DebugView class methodsFor:'instance creation / entering'! |
|
0 | 365 |
|
2421 | 366 |
enter |
367 |
"enter a debugger" |
|
368 |
||
5455 | 369 |
<context: #return> |
370 |
||
10205 | 371 |
^ self |
372 |
enter:thisContext sender |
|
373 |
withMessage:'debugger entered' |
|
374 |
mayProceed:true. |
|
375 |
! |
|
376 |
||
377 |
enter:aContext withMessage:aString |
|
2355 | 378 |
"enter a debugger" |
379 |
||
5455 | 380 |
<context: #return> |
381 |
||
2355 | 382 |
^ self |
10205 | 383 |
enter:aContext |
384 |
withMessage:aString |
|
385 |
mayProceed:true |
|
2355 | 386 |
! |
387 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
388 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 389 |
"enter a debugger; if this is a recursive invocation, enter |
390 |
a MiniDebugger instead. |
|
391 |
This is the standard way of entering the debugger; |
|
392 |
sent from error- and halt messages." |
|
0 | 393 |
|
3447 | 394 |
<context: #return> |
395 |
||
3702 | 396 |
|active| |
93 | 397 |
|
57 | 398 |
StepInterruptPending := nil. |
3998 | 399 |
ControlInterrupt handle:[:ex | |
10205 | 400 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
401 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
402 |
ex proceed |
|
3998 | 403 |
] do:[ |
10205 | 404 |
" |
405 |
well, it could be a stepping or sending debugger up there; |
|
406 |
in this case, return to it. This happens, when a stepping process |
|
407 |
runs into an error (for example, a halt). In this case, we want the |
|
408 |
stepping debugger to come up again instead of a new one. |
|
409 |
" |
|
410 |
OpenDebuggers notNil ifTrue:[ |
|
411 |
active := Processor activeProcess. |
|
412 |
OpenDebuggers do:[:aDebugger | |
|
413 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
|
414 |
(aDebugger inspectedProcess == active) ifTrue:[ |
|
415 |
aDebugger device isOpen ifTrue:[ |
|
416 |
"/ 'entering stepping debugger again' printNL. |
|
417 |
aDebugger unstep. |
|
418 |
aDebugger setLabelFor:aString in:active. |
|
419 |
aDebugger mayProceed:mayProceed. |
|
420 |
^ aDebugger enter:aContext select:nil. |
|
421 |
] |
|
422 |
] |
|
423 |
] |
|
424 |
] |
|
425 |
]. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
426 |
]. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
427 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
526 | 428 |
|
3447 | 429 |
"Modified: / 18.11.2001 / 00:48:03 / cg" |
53 | 430 |
! |
431 |
||
8347 | 432 |
enterException:ex |
433 |
"enter a debugger; if this is a recursive invocation, enter |
|
434 |
a MiniDebugger instead. |
|
435 |
This is the standard way of entering the debugger; |
|
436 |
sent from error- and halt messages." |
|
437 |
||
438 |
^ self |
|
10205 | 439 |
enter:ex returnableSuspendedContext |
440 |
withMessage:ex descriptionForDebugger |
|
441 |
mayProceed:(ex mayProceed). |
|
8347 | 442 |
! |
443 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
444 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 445 |
"enter a debugger - do not check for recursive invocation" |
446 |
||
5455 | 447 |
<context: #return> |
448 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
449 |
|aDebugger| |
266 | 450 |
|
451 |
StepInterruptPending := nil. |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
452 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
453 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
454 |
"/ to avoid recursive debugging ... |
3447 | 455 |
ControlInterrupt handle:[:ex | |
10205 | 456 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
457 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
458 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
459 |
] do:[ |
10205 | 460 |
aDebugger := self new. |
3447 | 461 |
]. |
462 |
||
463 |
aDebugger isNil ifTrue:[ |
|
10205 | 464 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
465 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
466 |
mayProceed ifTrue:[ |
|
467 |
(Dialog confirm:'Error/Breakpoint cought.\\Press Continue or Abort.' withCRs |
|
468 |
yesLabel:'Continue' noLabel:'Abort') |
|
469 |
ifTrue:[ |
|
470 |
^ nil |
|
471 |
]. |
|
472 |
] ifFalse:[ |
|
473 |
self information:'Error cought.\\Press OK to abort the operation.' withCRs. |
|
474 |
]. |
|
475 |
AbortOperationRequest raise. |
|
476 |
"not reached" |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
477 |
]. |
3447 | 478 |
|
479 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
480 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 481 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
482 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
483 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
484 |
" |
10205 | 485 |
nil halt |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
486 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
487 |
|
3447 | 488 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 489 |
! |
490 |
||
6430 | 491 |
enterWithMessage:message |
492 |
"enter a debugger" |
|
493 |
||
494 |
<context: #return> |
|
495 |
||
10205 | 496 |
^ self |
497 |
enter:(thisContext sender) |
|
498 |
withMessage:message |
|
499 |
mayProceed:true. |
|
6430 | 500 |
! |
501 |
||
266 | 502 |
new |
10205 | 503 |
"return a new DebugView. |
2358 | 504 |
- return a cached debugger if it already exists. |
505 |
Also, care for remote displays on which no debugger is wanted |
|
506 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
507 |
||
508 |
|debugger currentScreen debuggerDevice| |
|
509 |
||
510 |
currentScreen := Screen current. |
|
14 | 511 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
512 |
currentScreen notNil ifTrue:[ |
10205 | 513 |
(currentScreen suppressDebugger) ifTrue:[ |
514 |
"/ no debuggers with that device - show an alertBox which aborts... |
|
515 |
^ nil. |
|
516 |
]. |
|
517 |
(currentScreen mayOpenDebugger) ifFalse:[ |
|
518 |
"/ no debugger on that device - but on the main screen |
|
519 |
currentScreen := Screen default. |
|
520 |
]. |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
521 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
522 |
|
266 | 523 |
" |
10205 | 524 |
need a blocking debugger if no processes or |
525 |
or if its a timing/interrupt process |
|
266 | 526 |
(because otherwise we would not get any events here ... |
527 |
" |
|
528 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
10205 | 529 |
((debugger := CachedExclusive) isNil |
530 |
or:[debugger device ~~ currentScreen |
|
531 |
or:[currentScreen isNil |
|
532 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
|
533 |
debugger := self newExclusive |
|
534 |
]. |
|
535 |
CachedExclusive := nil. |
|
266 | 536 |
] ifFalse:[ |
10205 | 537 |
CachedDebugger notNil ifTrue:[ |
538 |
(CachedDebugger device ~~ currentScreen |
|
539 |
or:[currentScreen isNil |
|
540 |
or:[currentScreen isOpen not |
|
541 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
|
542 |
CachedDebugger := nil |
|
543 |
] |
|
544 |
]. |
|
545 |
||
546 |
(debugger := CachedDebugger) notNil ifTrue:[ |
|
547 |
CachedDebugger := nil. |
|
548 |
] ifFalse:[ |
|
549 |
debuggerDevice := currentScreen. |
|
550 |
debuggerDevice isNil ifTrue:[ |
|
551 |
"/ use the default display |
|
552 |
debuggerDevice := Screen default. |
|
553 |
]. |
|
554 |
(debuggerDevice isNil |
|
555 |
or:[debuggerDevice isOpen not |
|
556 |
"/ or:[debuggerDevice mayOpenDebugger not] |
|
557 |
]) ifTrue:[ |
|
558 |
"/ no debugger |
|
559 |
^ nil. |
|
560 |
]. |
|
561 |
||
562 |
Screen currentScreenQuerySignal answer:debuggerDevice |
|
563 |
do:[ |
|
564 |
debugger := super new. |
|
565 |
]. |
|
566 |
debugger label:'Debugger'. |
|
567 |
debugger icon:self defaultIcon. |
|
568 |
] |
|
266 | 569 |
]. |
73 | 570 |
^ debugger |
875 | 571 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
572 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 573 |
! |
0 | 574 |
|
266 | 575 |
newExclusive |
576 |
"return a debugger for exclusive display access" |
|
577 |
||
578 |
|debugger| |
|
105 | 579 |
|
266 | 580 |
debugger := super new. |
581 |
debugger label:'Debugger'. |
|
875 | 582 |
debugger icon:self defaultIcon. |
266 | 583 |
debugger exclusive:true. |
584 |
^ debugger |
|
875 | 585 |
|
586 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 587 |
! |
588 |
||
29 | 589 |
openOn:aProcess |
590 |
"start a debugger on aProcess |
|
591 |
(actually not more than a good-looking inspector)" |
|
15 | 592 |
|
52 | 593 |
|aDebugger label nm| |
15 | 594 |
|
595 |
aDebugger := super new. |
|
875 | 596 |
aDebugger icon:self defaultIcon. |
29 | 597 |
aProcess notNil ifTrue:[ |
10205 | 598 |
nm := aProcess name. |
599 |
nm notNil ifTrue:[ |
|
600 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
601 |
] ifFalse:[ |
|
602 |
nm := aProcess id printString |
|
603 |
]. |
|
604 |
label := 'Debugger [' , nm , ']'. |
|
29 | 605 |
] ifFalse:[ |
10205 | 606 |
label := 'no process' |
29 | 607 |
]. |
1114 | 608 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 609 |
aDebugger openOn:aProcess. |
610 |
^ nil |
|
875 | 611 |
|
1114 | 612 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 613 |
! ! |
614 |
||
3269 | 615 |
!DebugView class methodsFor:'menu specs'! |
616 |
||
617 |
menuSpec |
|
618 |
"This resource specification was automatically generated |
|
619 |
by the MenuEditor of ST/X." |
|
620 |
||
621 |
"Do not manually edit this!! If it is corrupted, |
|
622 |
the MenuEditor may not be able to read the specification." |
|
623 |
||
624 |
" |
|
625 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
626 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
627 |
" |
|
628 |
||
629 |
<resource: #menu> |
|
630 |
||
10205 | 631 |
^ |
5875 | 632 |
#(Menu |
10205 | 633 |
( |
634 |
(MenuItem |
|
635 |
label: 'File' |
|
636 |
translateLabel: true |
|
637 |
submenu: |
|
638 |
(Menu |
|
639 |
( |
|
640 |
(MenuItem |
|
641 |
enabled: canSendEmail |
|
642 |
label: 'Report a Bug via eMail...' |
|
643 |
itemValue: doOpenReportMailApp |
|
644 |
translateLabel: true |
|
645 |
) |
|
646 |
(MenuItem |
|
647 |
label: '-' |
|
648 |
) |
|
649 |
(MenuItem |
|
650 |
label: 'Exit' |
|
651 |
itemValue: closeRequest |
|
652 |
translateLabel: true |
|
653 |
isVisible: isInspecting |
|
654 |
) |
|
655 |
(MenuItem |
|
656 |
label: 'Close Debugger and Abort' |
|
657 |
itemValue: closeRequest |
|
658 |
translateLabel: true |
|
659 |
isVisible: isNotInspecting |
|
660 |
) |
|
661 |
) |
|
662 |
nil |
|
663 |
nil |
|
664 |
) |
|
665 |
) |
|
666 |
(MenuItem |
|
667 |
label: 'View' |
|
668 |
translateLabel: true |
|
669 |
submenu: |
|
670 |
(Menu |
|
671 |
( |
|
672 |
(MenuItem |
|
673 |
enabled: canShowMore |
|
674 |
label: 'Show More WalkBack' |
|
675 |
itemValue: showMore |
|
676 |
translateLabel: true |
|
677 |
) |
|
678 |
(MenuItem |
|
679 |
label: 'Show Verbose WalkBack' |
|
680 |
itemValue: toggleVerboseWalkback |
|
681 |
translateLabel: true |
|
682 |
isVisible: showingDenseWalkback |
|
683 |
) |
|
684 |
(MenuItem |
|
685 |
label: 'Show Dense WalkBack' |
|
686 |
itemValue: toggleVerboseWalkback |
|
687 |
translateLabel: true |
|
688 |
isVisible: showingVerboseWalkback |
|
689 |
) |
|
690 |
(MenuItem |
|
691 |
label: '-' |
|
692 |
) |
|
693 |
(MenuItem |
|
694 |
label: 'Raise Debugger when Entering' |
|
695 |
itemValue: autoRaiseView: |
|
696 |
translateLabel: true |
|
697 |
indication: autoRaiseView |
|
698 |
) |
|
699 |
(MenuItem |
|
700 |
label: '-' |
|
701 |
) |
|
702 |
(MenuItem |
|
703 |
label: 'Settings...' |
|
704 |
itemValue: openSettingsDialog |
|
705 |
translateLabel: true |
|
706 |
) |
|
707 |
) |
|
708 |
nil |
|
709 |
nil |
|
710 |
) |
|
711 |
) |
|
712 |
(MenuItem |
|
713 |
label: 'Process' |
|
714 |
translateLabel: true |
|
715 |
submenu: |
|
716 |
(Menu |
|
717 |
( |
|
718 |
(MenuItem |
|
719 |
label: 'Continue' |
|
720 |
itemValue: doContinue |
|
721 |
translateLabel: true |
|
722 |
) |
|
723 |
(MenuItem |
|
724 |
label: 'Next (Line-Step)' |
|
725 |
itemValue: doNext |
|
726 |
translateLabel: true |
|
727 |
) |
|
728 |
(MenuItem |
|
729 |
label: 'Step' |
|
730 |
itemValue: doStep |
|
731 |
translateLabel: true |
|
732 |
) |
|
733 |
(MenuItem |
|
734 |
label: '-' |
|
735 |
) |
|
736 |
(MenuItem |
|
737 |
label: 'Abort' |
|
738 |
itemValue: doAbort |
|
739 |
translateLabel: true |
|
740 |
) |
|
741 |
(MenuItem |
|
742 |
enabled: abortAllIsHandled |
|
743 |
label: 'Abort All' |
|
744 |
itemValue: doAbortAll |
|
745 |
translateLabel: true |
|
746 |
) |
|
747 |
(MenuItem |
|
748 |
label: '-' |
|
749 |
) |
|
750 |
(MenuItem |
|
751 |
label: 'Terminate' |
|
752 |
itemValue: doTerminate |
|
753 |
translateLabel: true |
|
754 |
) |
|
755 |
) |
|
756 |
nil |
|
757 |
nil |
|
758 |
) |
|
759 |
) |
|
760 |
(MenuItem |
|
761 |
label: 'Context' |
|
762 |
translateLabel: true |
|
763 |
submenu: |
|
764 |
(Menu |
|
765 |
( |
|
766 |
(MenuItem |
|
767 |
enabled: canReturn |
|
768 |
label: 'Return' |
|
769 |
itemValue: doReturn |
|
770 |
translateLabel: true |
|
771 |
) |
|
772 |
(MenuItem |
|
773 |
enabled: canRestart |
|
774 |
label: 'Restart' |
|
775 |
itemValue: doRestart |
|
776 |
translateLabel: true |
|
777 |
) |
|
778 |
(MenuItem |
|
779 |
label: '-' |
|
780 |
) |
|
781 |
(MenuItem |
|
782 |
enabled: hasContextSelected |
|
783 |
label: 'Inspect' |
|
784 |
itemValue: inspectContext |
|
785 |
translateLabel: true |
|
786 |
) |
|
787 |
(MenuItem |
|
788 |
label: 'Copy WalkBack Text' |
|
789 |
itemValue: copyWalkbackText |
|
790 |
translateLabel: true |
|
791 |
) |
|
792 |
(MenuItem |
|
793 |
label: 'Bookmark Method in SystemBrowser' |
|
794 |
itemValue: addBrowserBookmark |
|
795 |
translateLabel: true |
|
796 |
) |
|
797 |
) |
|
798 |
nil |
|
799 |
nil |
|
800 |
) |
|
801 |
) |
|
802 |
(MenuItem |
|
803 |
label: 'Class' |
|
804 |
translateLabel: true |
|
805 |
submenu: |
|
806 |
(Menu |
|
807 |
( |
|
808 |
(MenuItem |
|
809 |
enabled: canBrowseImplementingClass |
|
810 |
label: 'Browse Implementing Class' |
|
811 |
itemValue: browseImplementingClass |
|
812 |
translateLabel: true |
|
813 |
) |
|
814 |
(MenuItem |
|
815 |
enabled: canBrowseReceiversClass |
|
816 |
label: 'Browse Receivers Class' |
|
817 |
itemValue: browseReceiversClass |
|
818 |
translateLabel: true |
|
819 |
) |
|
820 |
(MenuItem |
|
821 |
label: '-' |
|
822 |
) |
|
823 |
(MenuItem |
|
824 |
enabled: canBrowseClassHierarchy |
|
825 |
label: 'Browse Receivers Class Hierarchy' |
|
826 |
itemValue: browseClassHierarchy |
|
827 |
translateLabel: true |
|
828 |
) |
|
829 |
(MenuItem |
|
830 |
enabled: canBrowseFullClassProtocol |
|
831 |
label: 'Browse Receivers Full Protocol' |
|
832 |
itemValue: browseFullClassProtocol |
|
833 |
translateLabel: true |
|
834 |
) |
|
835 |
(MenuItem |
|
836 |
label: '-' |
|
837 |
) |
|
838 |
(MenuItem |
|
839 |
enabled: canBrowseProcessesApplication |
|
840 |
label: 'Browse Application Class' |
|
841 |
itemValue: browseProcessesApplication |
|
842 |
translateLabel: true |
|
843 |
) |
|
844 |
) |
|
845 |
nil |
|
846 |
nil |
|
847 |
) |
|
848 |
) |
|
849 |
(MenuItem |
|
850 |
label: 'Selector' |
|
851 |
translateLabel: true |
|
852 |
submenu: |
|
853 |
(Menu |
|
854 |
( |
|
855 |
(MenuItem |
|
856 |
label: 'Browse Implementors...' |
|
857 |
itemValue: browseImplementorsOf |
|
858 |
translateLabel: true |
|
859 |
) |
|
860 |
(MenuItem |
|
861 |
label: 'Browse Senders...' |
|
862 |
itemValue: browseSendersOf |
|
863 |
translateLabel: true |
|
864 |
) |
|
865 |
(MenuItem |
|
866 |
label: '-' |
|
867 |
) |
|
868 |
(MenuItem |
|
869 |
enabled: canDefineMethod |
|
870 |
label: 'Define Missing Method' |
|
871 |
itemValue: doDefineMethod |
|
872 |
translateLabel: true |
|
873 |
) |
|
874 |
) |
|
875 |
nil |
|
876 |
nil |
|
877 |
) |
|
878 |
) |
|
879 |
(MenuItem |
|
880 |
label: 'Breakpoint' |
|
881 |
translateLabel: true |
|
882 |
submenu: |
|
883 |
(Menu |
|
884 |
( |
|
885 |
(MenuItem |
|
886 |
enabled: canRemoveBreakpoint |
|
887 |
label: 'Remove Breakpoint' |
|
888 |
itemValue: removeBreakpoint |
|
889 |
translateLabel: true |
|
890 |
) |
|
891 |
(MenuItem |
|
892 |
label: 'Remove all Breakpoints' |
|
893 |
itemValue: removeAllBreakpoints |
|
894 |
translateLabel: true |
|
895 |
) |
|
896 |
(MenuItem |
|
897 |
label: '-' |
|
898 |
) |
|
899 |
(MenuItem |
|
900 |
enabled: canAddBreakpoint |
|
901 |
label: 'Add Breakpoint' |
|
902 |
itemValue: addBreakpoint |
|
903 |
translateLabel: true |
|
904 |
) |
|
905 |
(MenuItem |
|
906 |
label: '-' |
|
907 |
) |
|
908 |
(MenuItem |
|
909 |
label: 'Ignore this Halt/BreakPoint' |
|
910 |
translateLabel: true |
|
911 |
submenu: |
|
912 |
(Menu |
|
913 |
( |
|
914 |
(MenuItem |
|
915 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
916 |
label: 'For Some Time...' |
|
917 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
918 |
translateLabel: true |
|
919 |
) |
|
920 |
(MenuItem |
|
921 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
922 |
label: 'For the Next N Times...' |
|
923 |
itemValue: openIgnoreHaltNTimesDialog |
|
924 |
translateLabel: true |
|
925 |
) |
|
926 |
(MenuItem |
|
927 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
928 |
label: 'Forever (Until Ignoring is Stopped)' |
|
929 |
itemValue: ignoreHaltForever |
|
930 |
translateLabel: true |
|
931 |
) |
|
932 |
) |
|
933 |
nil |
|
934 |
nil |
|
935 |
) |
|
936 |
) |
|
937 |
(MenuItem |
|
938 |
label: 'Ignore all Halts/BreakPoints' |
|
939 |
translateLabel: true |
|
940 |
submenu: |
|
941 |
(Menu |
|
942 |
( |
|
943 |
(MenuItem |
|
944 |
label: 'For Some Time...' |
|
945 |
itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
|
946 |
translateLabel: true |
|
947 |
) |
|
948 |
(MenuItem |
|
949 |
label: 'Forever (Until Ignoring is Stopped)' |
|
950 |
itemValue: ignoreAllHaltsForever |
|
951 |
translateLabel: true |
|
952 |
) |
|
953 |
) |
|
954 |
nil |
|
955 |
nil |
|
956 |
) |
|
957 |
) |
|
958 |
(MenuItem |
|
959 |
enabled: hasHaltsToIgnore |
|
960 |
label: 'Stop Ignoring' |
|
961 |
itemValue: stopIgnoringHalts |
|
962 |
translateLabel: true |
|
963 |
) |
|
964 |
(MenuItem |
|
965 |
label: '-' |
|
966 |
) |
|
967 |
(MenuItem |
|
968 |
label: 'Manage Breakpoints' |
|
969 |
itemValue: openBreakPointBrowser |
|
970 |
translateLabel: true |
|
971 |
) |
|
972 |
(MenuItem |
|
973 |
label: 'Allow Breakpoints in Debugger' |
|
974 |
itemValue: allowBreakPointsInDebugger: |
|
975 |
translateLabel: true |
|
976 |
indication: allowBreakPointsInDebugger |
|
977 |
) |
|
978 |
) |
|
979 |
nil |
|
980 |
nil |
|
981 |
) |
|
982 |
) |
|
983 |
(MenuItem |
|
984 |
label: 'Help' |
|
985 |
translateLabel: true |
|
986 |
startGroup: right |
|
987 |
submenu: |
|
988 |
(Menu |
|
989 |
( |
|
990 |
(MenuItem |
|
991 |
label: 'Debuggers Documentation' |
|
992 |
itemValue: openHTMLDocument: |
|
993 |
translateLabel: true |
|
994 |
argument: 'tools/debugger/TOP.html' |
|
995 |
) |
|
996 |
(MenuItem |
|
997 |
label: '-' |
|
998 |
) |
|
999 |
(MenuItem |
|
1000 |
label: 'About DebugView...' |
|
1001 |
itemValue: openAboutThisApplication |
|
1002 |
translateLabel: true |
|
1003 |
) |
|
1004 |
) |
|
1005 |
nil |
|
1006 |
nil |
|
1007 |
) |
|
1008 |
) |
|
1009 |
) |
|
1010 |
nil |
|
1011 |
nil |
|
3269 | 1012 |
) |
1013 |
! ! |
|
1014 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1015 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1016 |
|
4121 | 1017 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1018 |
"return an interesting context to be shown in an error notifier. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1019 |
We move up the calling chain, skipping intermediate Signal |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1020 |
and Exception contexts, to present the context in which the error |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1021 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1022 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1023 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1024 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1025 |
|
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1026 |
someContexts := Array new:25. |
2042 | 1027 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1028 |
idx := 1. |
10205 | 1029 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
1030 |
someContexts at:idx put:con. |
|
1031 |
con := con sender. |
|
1032 |
idx := idx + 1. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1033 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1034 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1035 |
^ someContexts at:idx. |
3447 | 1036 |
! |
1037 |
||
10205 | 1038 |
interestingContextIndexIn:aContextArray |
3447 | 1039 |
"return an interesting contexts offset, or nil. |
1040 |
This is the context initially shown in the walkback. |
|
1041 |
We move up the calling chain, skipping all intermediate Signal |
|
1042 |
and Exception contexts, to present the context in which the error |
|
1043 |
actually occured. |
|
1044 |
Just for your convenience :-)" |
|
1045 |
||
8152 | 1046 |
|con found offset sel prev ex rcvr nMax idx| |
3447 | 1047 |
|
7713 | 1048 |
"/ Transcript showCR:aContextArray. |
7648 | 1049 |
|
3447 | 1050 |
nMax := aContextArray size. |
1051 |
nMax <= 1 ifTrue:[^ 1]. |
|
1052 |
con := aContextArray at:1. |
|
1053 |
con isBlockContext ifTrue:[^ 1]. |
|
1054 |
||
1055 |
"/ somewhere, at the bottom, there must be a raise ... |
|
1056 |
"/ find the exception |
|
1057 |
||
1058 |
1 to:5 do:[:i | |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1059 |
con := aContextArray at:i ifAbsent:nil. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1060 |
con notNil ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1061 |
sel := con selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1062 |
(sel startsWith:'raise') ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1063 |
rcvr := con receiver. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1064 |
(rcvr isLazyValue not and:[rcvr isException]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1065 |
ex := rcvr. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1066 |
offset := i. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1067 |
found := con |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1068 |
] ifFalse:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1069 |
(rcvr isLazyValue not and:[rcvr isExceptionCreator]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1070 |
offset := i. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1071 |
found := con |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1072 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1073 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1074 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1075 |
]. |
3447 | 1076 |
]. |
1077 |
||
1078 |
" |
|
1079 |
if this is a noHandler exception, skip forward |
|
1080 |
to the erronous context |
|
1081 |
" |
|
1082 |
ex notNil ifTrue:[ |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1083 |
ex signal == Signal noHandlerSignal ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1084 |
found := ex suspendedContext |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1085 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1086 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1087 |
"/ Transcript show:'1 '; showCR:found. |
3447 | 1088 |
found isNil ifTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1089 |
"/ this is a kludge, but convenient. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1090 |
"/ show the place where the error (divisionByZero...) happend, |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1091 |
"/ not where the signal was raised. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1092 |
con := (aContextArray at:1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1093 |
sel := con methodHome selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1094 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1095 |
"/ typically a DivisionByZero - show caller of division |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1096 |
(sel == #// |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1097 |
or:[sel == #/ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1098 |
or:[sel == #\\]]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1099 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1100 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1101 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1102 |
"/ show the place of the bad message; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1103 |
(sel == #doesNotUnderstand:) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1104 |
idx := 3. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1105 |
nMax > 2 ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1106 |
sel := (aContextArray at:idx) selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1107 |
sel == #doesNotUnderstand: ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1108 |
idx := 4 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1109 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1110 |
nMax > idx ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1111 |
sel := (aContextArray at:idx) selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1112 |
"/ show the place of the perfor-send; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1113 |
((sel == #perform:) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1114 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1115 |
idx := idx + 1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1116 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1117 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1118 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1119 |
^ idx min:nMax |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1120 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1121 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1122 |
"/ show the bad method; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1123 |
(sel == #noByteCode) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1124 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1125 |
]. |
3447 | 1126 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1127 |
"/ "/ show the place of the halt; not where the HaltSignal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1128 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1129 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1130 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1131 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1132 |
"/ "/ show the place of the shouldImplement; not where the Signal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1133 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1134 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1135 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1136 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1137 |
"/ "/ show the place of error-call; not where the ErrorSignal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1138 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1139 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1140 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1141 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1142 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1143 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1144 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1145 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1146 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1147 |
"/ ]. |
7862 | 1148 |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1149 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1150 |
(sel == #signalInterrupt:) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1151 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1152 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1153 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1154 |
"/ "/ show the place of error-call; not where the ErrorSignal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1155 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1156 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1157 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1158 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1159 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1160 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1161 |
"/ "/ show the place of the send; not where the Signal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1162 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1163 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1164 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
1165 |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1166 |
"/ show the place of the bad index; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1167 |
( #(#notIndexed |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1168 |
#indexNotIntegerOrOutOfBounds: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1169 |
#subscriptBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1170 |
#elementBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1171 |
"/ #subclassResponsibility |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1172 |
) includes:sel) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1173 |
idx := 2. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1174 |
[ idx <= 3 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1175 |
and:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1176 |
sel := (aContextArray at:idx) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1177 |
#(#notIndexed |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1178 |
#indexNotIntegerOrOutOfBounds: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1179 |
#subscriptBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1180 |
#elementBoundsError: ) includes:sel |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1181 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1182 |
] whileTrue:[ idx := idx + 1 ]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1183 |
sel := (aContextArray at:idx) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1184 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1185 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1186 |
sel := (aContextArray at:idx+1) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1187 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1188 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1189 |
sel := (aContextArray at:idx+2) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1190 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1191 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1192 |
^ idx+3 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1193 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1194 |
^ idx+2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1195 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1196 |
^ idx+1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1197 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1198 |
^ idx |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1199 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1200 |
offset := 1. |
8152 | 1201 |
]. |
1202 |
||
1203 |
"/ the above is all too hard-coded; |
|
1204 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1205 |
"/ as more methods get flagged, remove code from above. |
|
1206 |
con := aContextArray at:offset ifAbsent:nil. |
|
1207 |
||
10205 | 1208 |
[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1209 |
con notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1210 |
and:[ con methodHome notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1211 |
and:[ con methodHome method notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1212 |
and:[ con methodHome method shouldBeSkippedInDebuggersWalkBack ]]] |
8152 | 1213 |
] whileTrue:[ |
1214 |
"/ Transcript showCR:con methodHome method. |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1215 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1216 |
con := aContextArray at:offset ifAbsent:nil. |
8152 | 1217 |
]. |
3447 | 1218 |
|
1219 |
" |
|
1220 |
got it; move up, skipping all intermediate Signal and |
|
1221 |
Exception contexts |
|
1222 |
" |
|
1223 |
prev := nil. |
|
1224 |
rcvr := con receiver. |
|
10205 | 1225 |
[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1226 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1227 |
] whileTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1228 |
prev := con. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1229 |
nMax > offset ifFalse:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1230 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1231 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1232 |
con := aContextArray at:offset. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1233 |
rcvr := con receiver. |
3447 | 1234 |
]. |
1235 |
||
1236 |
" |
|
1237 |
now, we are one above the raising context |
|
1238 |
" |
|
1239 |
||
1240 |
" |
|
1241 |
if the sender-method of the raise is one of objects error methods ... |
|
1242 |
" |
|
10205 | 1243 |
( #( halt halt: |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1244 |
error error: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1245 |
doesNotUnderstand: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1246 |
subclassResponsibility |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1247 |
primitiveFailed) includes:con selector) |
3447 | 1248 |
ifTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1249 |
con selector == #doesNotUnderstand: ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1250 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1251 |
one more up, to get to the originating context |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1252 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1253 |
con := aContextArray at:(offset + 1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1254 |
con isNil ifTrue:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1255 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1256 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1257 |
con := aContextArray at:(offset + 1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1258 |
con isNil ifTrue:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1259 |
offset := offset + 1. |
3447 | 1260 |
] ifFalse:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1261 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1262 |
ok, got the raise - if its a BreakPoint, look for the sender |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1263 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1264 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1265 |
offset := offset + 1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1266 |
]. |
3447 | 1267 |
]. |
1268 |
||
1269 |
^ offset |
|
1270 |
||
7713 | 1271 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1272 |
"Modified: / 08-07-2011 / 13:15:49 / cg" |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1273 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1274 |
|
73 | 1275 |
!DebugView methodsFor:'basic'! |
1276 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1277 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1278 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1279 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1280 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1281 |
m notNil ifTrue:[ |
10205 | 1282 |
self updateMenuItems. |
1283 |
||
1284 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
|
1285 |
abortButton enable. |
|
1286 |
m enable:#doAbort. |
|
1287 |
] ifFalse:[ |
|
1288 |
abortButton disable. |
|
1289 |
m disable:#doAbort. |
|
1290 |
]. |
|
1291 |
exclusive ifTrue:[ |
|
1292 |
terminateButton disable. |
|
1293 |
m disable:#doTerminate. |
|
1294 |
] ifFalse:[ |
|
1295 |
terminateButton enable. |
|
1296 |
m enable:#doTerminate. |
|
1297 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1298 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1299 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1300 |
mayProceed == false ifTrue:[ |
10205 | 1301 |
continueButton disable. |
1302 |
m notNil ifTrue:[m disable:#doContinue]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1303 |
] ifFalse:[ |
10205 | 1304 |
continueButton enable. |
1305 |
m notNil ifTrue:[m enable:#doContinue] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1306 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1307 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1308 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1309 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1310 |
|
1364 | 1311 |
enter:aContext select:initialSelectionOrNil |
73 | 1312 |
"enter the debugger - get and display the context, then start an |
1313 |
exclusive event loop on top of eveything else" |
|
1314 |
||
3447 | 1315 |
<context: #return> |
1316 |
||
9076 | 1317 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c| |
3447 | 1318 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1319 |
DebuggingDebugger == true ifTrue:[ |
10205 | 1320 |
'==> enter: (' print. aContext print. |
1321 |
') select: ' print. initialSelectionOrNil printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1322 |
]. |
3447 | 1323 |
thisContext isRecursive ifTrue:[ |
10205 | 1324 |
"/ care for the special case, were the Debugger was autoloaded. |
1325 |
"/ in this case, thisContext IS recursive, but thats no error |
|
1326 |
"/ condition. |
|
1327 |
foundNoByteCodeContext := false. |
|
1328 |
foundExitContext := false. |
|
1329 |
||
1330 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1331 |
[ |
|
1332 |
foundNoByteCodeContext not |
|
1333 |
and:[ foundExitContext not |
|
1334 |
and:[c notNil |
|
1335 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
1336 |
]]]] |
|
1337 |
whileTrue:[ |
|
1338 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
1339 |
foundExitContext := true |
|
1340 |
]. |
|
1341 |
c selector == #noByteCode ifTrue:[ |
|
1342 |
foundNoByteCodeContext := true |
|
1343 |
]. |
|
1344 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1345 |
]. |
|
1346 |
||
1347 |
(foundNoByteCodeContext not |
|
1348 |
and:[ foundExitContext not]) ifFalse:[ |
|
1349 |
('DebugView [warning]: reentered') errorPrintCR. |
|
1350 |
||
1351 |
^ MiniDebugger |
|
1352 |
enter:aContext |
|
1353 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
1354 |
mayProceed:mayProceed. |
|
1355 |
]. |
|
1356 |
foundExitContext ifTrue:[ |
|
1357 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
1358 |
^ self. |
|
1359 |
]. |
|
3447 | 1360 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1361 |
|
10203 | 1362 |
"/'entering: ' print. aContext printCR. |
1363 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 1364 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1365 |
||
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
1366 |
self class isHaltToBeIgnored ifTrue:[ |
10205 | 1367 |
^ self. |
8170 | 1368 |
]. |
1369 |
||
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1370 |
iAmNew := drawableId isNil. |
73 | 1371 |
|
8148 | 1372 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1373 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
1374 |
busy := cachable := true. |
73 | 1375 |
inspecting := false. |
1376 |
inspectedProcess := Processor activeProcess. |
|
1377 |
stepping := false. |
|
1378 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1379 |
stepHow := nil. |
8148 | 1380 |
nChainShown := InitialNChainShown. |
73 | 1381 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1382 |
"/ if debugger is entered while a box has grabbed the |
9076 | 1383 |
"/ pointer, we must ungrab - otherwise X won't talk to us here. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1384 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1385 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1386 |
"/ Q: this is good for multi-screen apps (where an error should not happen), |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1387 |
"/ but not for multi-user development, where the debugger is entered often. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1388 |
"/ What is a good solution to this dilemma ? |
1279
84ec8d33eba8
ungrab all screens in case of an error
Claus Gittinger <cg@exept.de>
parents:
1274
diff
changeset
|
1389 |
Screen allScreens do:[:aScreen | |
10205 | 1390 |
aScreen ungrabPointer. |
1391 |
aScreen ungrabKeyboard. |
|
1392 |
]. |
|
1393 |
||
1394 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1395 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
10205 | 1396 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1397 |
] ifFalse:[ |
10205 | 1398 |
terminateButton enable. |
1399 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1400 |
]. |
73 | 1401 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1402 |
iAmNew ifFalse:[ |
10205 | 1403 |
"/ not the first time - disable buttons & menus |
1404 |
"/ from the previous life |
|
1405 |
self turnOffAllButtons. |
|
1406 |
||
1407 |
m := contextView middleButtonMenu. |
|
1408 |
m notNil ifTrue:[ |
|
1409 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
1410 |
]. |
|
1411 |
verboseBacktrace |
|
1412 |
ifTrue:[self showVerboseWalkback] |
|
1413 |
ifFalse:[self showDenseWalkback]. |
|
132 | 1414 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1415 |
self iconLabel:'Debugger'. |
132 | 1416 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1417 |
windowGroup isNil ifTrue:[ |
10205 | 1418 |
self windowGroup: WindowGroup new. |
1419 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1420 |
]. |
132 | 1421 |
exclusive ifFalse:[ |
10205 | 1422 |
"/ create a (modal) windowGroup for myself |
1423 |
||
1424 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1425 |
] ifTrue:[ |
10205 | 1426 |
"/ create a windowGroup with a synchronous sensor for me |
1427 |
||
1428 |
windowGroup beSynchronous. |
|
73 | 1429 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1430 |
windowGroup setProcess:Processor activeProcess. |
73 | 1431 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1432 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 1433 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1434 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
10203 | 1435 |
"/'after setContext; first is ' print. |
1436 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1437 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
73 | 1438 |
|
10203 | 1439 |
self updateButtonsAndMenuItemsForContext:aContext. |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1440 |
|
73 | 1441 |
" |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1442 |
If this is a new debugger, do a realize. |
528
a5ba1a3d0b45
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
527
diff
changeset
|
1443 |
Otherwise, its probably better to do a map, which shows the |
73 | 1444 |
view at the previous position, without a need for the user to set the |
1445 |
position again |
|
1446 |
" |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1447 |
iAmNew ifFalse:[ |
10205 | 1448 |
self remap. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1449 |
] ifTrue:[ |
10205 | 1450 |
self realize. |
73 | 1451 |
]. |
8193
9a4febdd8202
Raise debugger to the very top when entering
Stefan Vogel <sv@exept.de>
parents:
8181
diff
changeset
|
1452 |
self setForegroundWindow. |
73 | 1453 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1454 |
exclusive ifTrue:[ |
10205 | 1455 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1456 |
Debugging system process `' , (inspectedProcess nameOrId) printString , '''. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1457 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1458 |
This is a modal debugger - all event processing is stopped.. |
10205 | 1459 |
Therefore, you cannot interact with other views or |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1460 |
open any other tools while this debugger is active. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1461 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1462 |
Also, there is no event processing (redraw) for other views.' |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1463 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1464 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1465 |
self autoRaiseView ifTrue:[ |
10205 | 1466 |
"/ self raise. |
1467 |
self raiseDeiconified. |
|
1468 |
self topView activate; setForegroundWindow; activate. |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1469 |
]. |
1486
6ae442626f20
wait until visible before starting to draw
Claus Gittinger <cg@exept.de>
parents:
1484
diff
changeset
|
1470 |
|
73 | 1471 |
canContinue := true. |
1472 |
exitAction := nil. |
|
1473 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1474 |
"/ enter private event handling loop. This is left (and we come back here again) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1475 |
"/ when any button was pressed which requires continuation of the debuggee or |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1476 |
"/ closedown of the debugger. |
3701
ef73aac8e8d5
Use #ifCurtailed: instead of #valueOnUnwindDo:
Stefan Vogel <sv@exept.de>
parents:
3694
diff
changeset
|
1477 |
[self controlLoop] ifCurtailed:[ |
10205 | 1478 |
windowGroup notNil ifTrue:[ |
1479 |
windowGroup setProcess:nil. |
|
1480 |
]. |
|
1481 |
self destroy |
|
132 | 1482 |
]. |
73 | 1483 |
|
10203 | 1484 |
"/ here after my own control loop is finished. |
1485 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1486 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1487 |
"/ This is required to avoid keeping references to the debuggees objects |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1488 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 1489 |
contextView contents:nil. |
1490 |
||
73 | 1491 |
codeView acceptAction:nil. |
942 | 1492 |
codeView doItAction:nil. |
73 | 1493 |
|
4892 | 1494 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
10205 | 1495 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 1496 |
]. |
1497 |
||
73 | 1498 |
(exitAction ~~ #step) ifTrue:[ |
10205 | 1499 |
"/ not stepping - close window |
1500 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
|
1501 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
1502 |
receiverInspector release. |
|
1503 |
contextInspector release. |
|
1504 |
||
1505 |
self unmap. |
|
1506 |
device flush. |
|
1507 |
||
1508 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
1509 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
1510 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
1511 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
1512 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
1513 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
1514 |
exitAction isBlock ifTrue:[ |
|
1515 |
self exit_unwindThenDo:exitAction. |
|
1516 |
"does not return" |
|
1517 |
]. |
|
1518 |
"not reached" |
|
1519 |
^ self |
|
73 | 1520 |
]. |
1521 |
||
3447 | 1522 |
"/ stepping - window stays open |
940 | 1523 |
selectedContext := actualContext := firstContext := nil. |
73 | 1524 |
|
2472 | 1525 |
"/ restore the previous pointer grab |
73 | 1526 |
grabber notNil ifTrue:[ |
10205 | 1527 |
device grabPointerInView:grabber. |
1528 |
grabber := nil. |
|
61 | 1529 |
]. |
73 | 1530 |
|
1531 |
(exitAction == #step) ifTrue:[ |
|
10205 | 1532 |
" |
1533 |
schedule another stepInterrupt |
|
1534 |
- must enter myself into the collection of open debuggers, |
|
1535 |
in case the stepping process comes back again via a halt or signal |
|
1536 |
before the step is finished. In this case, the stepping debugger should |
|
1537 |
come up (instead of a new one) |
|
1538 |
- must flush caches since optimized methods not always |
|
1539 |
look for pending interrupts |
|
1540 |
" |
|
1541 |
||
1542 |
"/ |
|
1543 |
"/ also must care for stepping into a return |
|
1544 |
"/ |
|
1545 |
steppedContext notNil ifTrue:[ |
|
1546 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
1547 |
]. |
|
1548 |
||
1549 |
OpenDebuggers isNil ifTrue:[ |
|
1550 |
OpenDebuggers := WeakIdentitySet new. |
|
1551 |
]. |
|
1552 |
OpenDebuggers add:self. |
|
1553 |
||
1554 |
self label:'single stepping - please wait ...'. |
|
1555 |
stepping := true. |
|
1556 |
||
1557 |
ObjectMemory stepInterruptHandler:self. |
|
1558 |
Processor activeProcess stepInterruptHandler:self. |
|
1559 |
ObjectMemory flushCaches. |
|
1560 |
||
1561 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
1562 |
Context singleStepInterruptRequest |
|
1563 |
raiseWith: |
|
1564 |
(("bigStep" steppedContextLineno notNil) |
|
1565 |
ifTrue:[#next] |
|
1566 |
ifFalse:[#step]) |
|
1567 |
] ifFalse:[ |
|
1568 |
"/ see if we came here through an interrupt-action |
|
1569 |
"/ (i.e. aProcess interruptWith:...) |
|
1570 |
||
1571 |
enteredByInterrupt := false. |
|
1572 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
1573 |
[enteredByInterrupt not |
|
1574 |
and:[con notNil |
|
1575 |
and:[con ~~ aContext]]] whileTrue:[ |
|
1576 |
((sel := con selector) == #timerInterrupt |
|
1577 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
1578 |
enteredByInterrupt := true. |
|
1579 |
] ifFalse:[ |
|
1580 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
1581 |
]. |
|
1582 |
]. |
|
1583 |
||
1584 |
ObjectMemory flushInlineCaches. |
|
1585 |
||
1586 |
DebuggingDebugger == true ifTrue:[ |
|
1587 |
enteredByInterrupt printCR. |
|
1588 |
]. |
|
1589 |
enteredByInterrupt ifTrue:[ |
|
1590 |
"/ dont want to step through all intermediate |
|
1591 |
"/ (scheduler-) contexts; place a return-trap on the |
|
1592 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1593 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1594 |
"/ 'special unwind return' printCR. |
10205 | 1595 |
con unwindThenDo:[ |
1596 |
Processor activeProcess stepInterruptHandler:self. |
|
1597 |
ObjectMemory stepInterruptHandler:self. |
|
1598 |
InStepInterrupt := nil. |
|
1599 |
StepInterruptPending := 1. |
|
1600 |
InterruptPending := 1]. |
|
1601 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1602 |
"/ 'normal step return' printCR. |
10205 | 1603 |
skipLineNr ~~ #return ifTrue:[ |
1604 |
StepInterruptPending := 1. |
|
1605 |
InterruptPending := 1. |
|
1606 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1607 |
"/ 'step for return' printCR. |
10205 | 1608 |
] |
1609 |
]. |
|
1610 |
InStepInterrupt := nil |
|
1611 |
] |
|
73 | 1612 |
] ifFalse:[ |
10205 | 1613 |
OpenDebuggers notNil ifTrue:[ |
1614 |
OpenDebuggers remove:self ifAbsent:[]. |
|
1615 |
]. |
|
1616 |
self cacheMyself. |
|
73 | 1617 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1618 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1619 |
"Modified: / 17-04-1997 / 13:01:32 / stefan" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1620 |
"Created: / 30-10-1997 / 21:08:18 / cg" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1621 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
10203 | 1622 |
"Modified (comment): / 06-07-2011 / 12:29:28 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1623 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1624 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1625 |
exit_abort |
5455 | 1626 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
1627 |
"/ that one would run on top of this context. |
|
1628 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1629 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1630 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1631 |
"/ done in the #enter:select method. |
5455 | 1632 |
"/ You are not expected to understand this. |
1633 |
||
6487 | 1634 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
1635 |
! |
|
1636 |
||
1637 |
exit_abortAll |
|
1638 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1639 |
"/ that one would run on top of this context. |
|
1640 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1641 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1642 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1643 |
"/ done in the #enter:select method. |
6487 | 1644 |
"/ You are not expected to understand this. |
1645 |
||
1646 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1647 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1648 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1649 |
exit_quickTerminate |
3447 | 1650 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1651 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1652 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1653 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 1654 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1655 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1656 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1657 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1658 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1659 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1660 |
selectedContext notNil ifTrue:[ |
10205 | 1661 |
con := selectedContext. |
1662 |
self cacheMyself. |
|
1663 |
" |
|
1664 |
have to catch errors occuring in unwind-blocks |
|
1665 |
" |
|
1666 |
Error handle:[:ex | |
|
1667 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1668 |
ex description infoPrintCR. |
|
1669 |
ex proceed |
|
1670 |
] do:[ |
|
1671 |
con unwindAndRestart. |
|
1672 |
]. |
|
1673 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1674 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1675 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1676 |
"Created: / 16.11.2001 / 17:23:17 / cg" |
3447 | 1677 |
"Modified: / 17.11.2001 / 23:37:09 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1678 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1679 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1680 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1681 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1682 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1683 |
selectedContext notNil ifTrue:[ |
10205 | 1684 |
" |
1685 |
if there is a selection in the codeView, |
|
1686 |
evaluate it and use the result as return value |
|
1687 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1688 |
"/ disabled for now, there is almost always a selection (the current line) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1689 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1690 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1691 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1692 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1693 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1694 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1695 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1696 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1697 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1698 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1699 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1700 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1701 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1702 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1703 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1704 |
|
10205 | 1705 |
con := selectedContext. |
1706 |
self cacheMyself. |
|
1707 |
" |
|
1708 |
have to catch errors occuring in unwind-blocks |
|
1709 |
" |
|
1710 |
Error handle:[:ex | |
|
1711 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1712 |
ex description infoPrintCR. |
|
1713 |
ex proceed |
|
1714 |
] do:[ |
|
1715 |
con unwind:retVal. |
|
1716 |
]. |
|
1717 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1718 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1719 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1720 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 1721 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1722 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1723 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1724 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1725 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1726 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1727 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1728 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1729 |
Error handle:[:ex | |
10205 | 1730 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
1731 |
ex description infoPrintCR. |
|
1732 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1733 |
] do:[ |
10205 | 1734 |
self cacheMyself. |
1735 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1736 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1737 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1738 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1739 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 1740 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
1741 |
! |
|
1742 |
||
6487 | 1743 |
exit_unwindThenDo:aBlock |
1744 |
|con| |
|
1745 |
||
1746 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1747 |
"/ that one would run on top of this context. |
|
1748 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1749 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1750 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1751 |
"/ done in the #enter:select method. |
6487 | 1752 |
"/ You are not expected to understand this. |
1753 |
||
1754 |
" |
|
1755 |
have to catch errors occuring in unwind-blocks |
|
1756 |
" |
|
1757 |
self cacheMyself. |
|
1758 |
||
1759 |
Error handle:[:ex | |
|
10205 | 1760 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
1761 |
ex description infoPrintCR. |
|
1762 |
||
1763 |
ex proceed |
|
6487 | 1764 |
] do:[ |
10205 | 1765 |
"/ find the enter:select context. |
1766 |
con := thisContext sender. |
|
1767 |
[ |
|
1768 |
(con selector == #enter:select:) |
|
1769 |
and:[con receiver == self] |
|
1770 |
] |
|
1771 |
whileFalse:[ con := con sender ]. |
|
1772 |
||
1773 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
1774 |
con sender receiver == self class ifTrue:[ |
|
1775 |
con := con sender. |
|
1776 |
con sender receiver == self class ifTrue:[ |
|
1777 |
con := con sender. |
|
1778 |
con isBlockContext ifTrue:[ |
|
1779 |
con := con methodHome. |
|
1780 |
] |
|
1781 |
]. |
|
1782 |
]. |
|
1783 |
||
1784 |
con unwindThenDo:aBlock. |
|
6487 | 1785 |
]. |
1786 |
'DebugView [warning]: abort failed' errorPrintCR |
|
1787 |
||
1788 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
1789 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
1790 |
! |
|
1791 |
||
3447 | 1792 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
1793 |
|selection con1 con2 h| |
|
1794 |
||
1795 |
initialSelectionOrNil notNil ifTrue:[ |
|
10205 | 1796 |
^ initialSelectionOrNil |
3447 | 1797 |
]. |
1798 |
||
1799 |
" |
|
1800 |
and find the one context to show initially |
|
1801 |
- if we came here by a send (single step), its the top context; |
|
1802 |
- if we came here by a step (i.e. bigStep), its the top context |
|
1803 |
(for ifs and whiles) or the sender (for regular sends). |
|
1804 |
- otherwise, we came here by some signal raise, and we are interested |
|
1805 |
in the context where the raise actually occured. |
|
1806 |
" |
|
1807 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
1808 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
1809 |
||
1810 |
exitAction == #step ifTrue:[ |
|
10205 | 1811 |
selection := 1. |
1812 |
steppedContext notNil ifTrue:[ |
|
1813 |
||
1814 |
" |
|
1815 |
if we came here by a big-step, show the method where we are |
|
1816 |
" |
|
1817 |
con1 == steppedContext ifTrue:[ |
|
1818 |
selection := 1 |
|
1819 |
] ifFalse:[ |
|
1820 |
con2 == steppedContext ifTrue:[ |
|
1821 |
selection := 2 |
|
1822 |
] |
|
1823 |
]. |
|
1824 |
" |
|
1825 |
for bigStep, we could also be in a block below the actual method ... |
|
1826 |
" |
|
1827 |
((h := con1 home) notNil |
|
1828 |
and:[h == steppedContext]) ifTrue:[ |
|
1829 |
selection := 1 |
|
1830 |
] ifFalse:[ |
|
1831 |
(con2 notNil |
|
1832 |
and:[(h := con2 home) notNil |
|
1833 |
and:[h == steppedContext]]) ifTrue:[ |
|
1834 |
selection := 2 |
|
1835 |
] |
|
1836 |
]. |
|
1837 |
h := nil. |
|
1838 |
] |
|
3447 | 1839 |
] ifFalse:[ |
10205 | 1840 |
steppedContext isNil ifTrue:[ |
1841 |
" |
|
1842 |
preselect a more interesting context, (where halt/raise was ...) |
|
1843 |
" |
|
1844 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
1845 |
selection := self class interestingContextIndexIn:contextArray. |
|
1846 |
selection := selection min:(contextArray size). |
|
1847 |
] ifFalse:[ |
|
1848 |
" |
|
1849 |
if we came here by a big-step, show the method where we are |
|
1850 |
" |
|
1851 |
con1 == steppedContext ifTrue:[ |
|
1852 |
selection := 1 |
|
1853 |
] ifFalse:[ |
|
1854 |
con2 == steppedContext ifTrue:[ |
|
1855 |
selection := 2. |
|
1856 |
] |
|
1857 |
] |
|
1858 |
] |
|
3447 | 1859 |
]. |
1860 |
^ selection |
|
1861 |
||
1862 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
1863 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 1864 |
! |
1865 |
||
5110 | 1866 |
isInspecting |
1867 |
^ inspecting |
|
1868 |
! |
|
1869 |
||
1870 |
isNotInspecting |
|
1871 |
^ inspecting not |
|
1872 |
! |
|
1873 |
||
73 | 1874 |
openOn:aProcess |
10205 | 1875 |
"enter the debugger on a process - |
73 | 1876 |
in this case, we are just inspecting the context chain of the process, |
1877 |
not running on top of the debugged process, but as a separate |
|
1878 |
one. (think of it as an inspector showing more detail, and offering |
|
1879 |
some more control operations)" |
|
1880 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1881 |
|bpanel dummy w| |
73 | 1882 |
|
8148 | 1883 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1884 |
|
73 | 1885 |
busy := true. |
1886 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1887 |
stepHow := nil. |
73 | 1888 |
inspecting := true. |
1889 |
inspectedProcess := aProcess. |
|
8148 | 1890 |
nChainShown := InitialNChainShown. |
73 | 1891 |
|
1892 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1893 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1894 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1895 |
"/ get the max size & freeze button |
6647 | 1896 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1897 |
w := continueButton preferredWidth. |
6647 | 1898 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1899 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1900 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1901 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1902 |
aProcess state == #run ifTrue:[ |
10205 | 1903 |
device hasColors ifTrue:[ |
1904 |
continueButton foregroundColor:Color red darkened. |
|
1905 |
]. |
|
1906 |
continueButton label:(resources string:'Stop'). |
|
1907 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1908 |
] ifFalse:[ |
10205 | 1909 |
device hasColors ifTrue:[ |
1910 |
continueButton foregroundColor:Color green darkened darkened. |
|
1911 |
]. |
|
1912 |
continueButton label:(resources string:'Continue'). |
|
1913 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1914 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1915 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 1916 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1917 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1918 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1919 |
|
92 | 1920 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 1921 |
dummy borderWidth:0; level:0. |
61 | 1922 |
|
73 | 1923 |
"/ stepButton destroy. |
1924 |
"/ sendButton destroy. |
|
1925 |
||
1926 |
updateButton := Button |
|
10205 | 1927 |
label:(resources string:'Update') |
1928 |
action:[self updateContext] |
|
1929 |
in:bpanel. |
|
73 | 1930 |
monitorToggle := Toggle in:bpanel. |
6647 | 1931 |
monitorToggle label:(resources string:'Monitor'). |
73 | 1932 |
monitorToggle pressAction:[self autoUpdateOn]. |
1933 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
1934 |
||
1935 |
"can only look into process - context chain is not active" |
|
1936 |
canContinue := true. |
|
1937 |
||
1938 |
terminateButton enable. |
|
1939 |
abortButton enable. |
|
1940 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1941 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1942 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1943 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1944 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1945 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 1946 |
|
1947 |
aProcess isNil ifTrue:[ |
|
10205 | 1948 |
terminateButton disable. |
1949 |
abortButton disable. |
|
1950 |
continueButton disable. |
|
1951 |
returnButton disable. |
|
1952 |
restartButton disable. |
|
73 | 1953 |
] ifFalse:[ |
10205 | 1954 |
(aProcess suspendedContext isNil |
1955 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
1956 |
terminateButton disable. |
|
1957 |
]. |
|
1958 |
||
1959 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
1960 |
||
1961 |
catchBlock := [ |
|
1962 |
catchBlock := nil. |
|
1963 |
contextArray := nil. |
|
1964 |
selectedContext := actualContext := firstContext := nil. |
|
1965 |
steppedContext := wrapperContext := nil. |
|
1966 |
||
1967 |
(exitAction == #terminate) ifTrue:[ |
|
1968 |
aProcess terminate. |
|
1969 |
]. |
|
1970 |
(exitAction == #quickTerminate) ifTrue:[ |
|
1971 |
aProcess terminateNoSignal. |
|
1972 |
]. |
|
1973 |
super destroy |
|
1974 |
]. |
|
73 | 1975 |
]. |
1976 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1977 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1978 |
"Modified: 20.3.1997 / 16:53:56 / cg" |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1979 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1980 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1981 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1982 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 1983 |
|selection| |
1984 |
||
1985 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1986 |
selection notNil ifTrue:[ |
10205 | 1987 |
self showSelection:selection. |
1988 |
contextView setSelection:selection. |
|
1989 |
selection > 1 ifTrue:[ |
|
1990 |
contextView scrollToLine:(selection - 1) |
|
1991 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1992 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1993 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1994 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 1995 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1996 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1997 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1998 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1999 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2000 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2001 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2002 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2003 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2004 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2005 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2006 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2007 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2008 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2009 |
! ! |
2010 |
||
2011 |
!DebugView methodsFor:'help'! |
|
2012 |
||
8212 | 2013 |
flyByHelpDependsOnPositionIn:aView |
2014 |
"subclasses where the help-text depends upon the pointer position might |
|
2015 |
want to redefine this" |
|
2016 |
||
2017 |
^ aView == codeView |
|
2018 |
! |
|
2019 |
||
3510 | 2020 |
flyByHelpTextFor:aComponent |
2021 |
|s| |
|
2022 |
||
2023 |
aComponent == abortButton ifTrue:[ |
|
10205 | 2024 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2025 |
]. |
2026 |
aComponent == terminateButton ifTrue:[ |
|
10205 | 2027 |
s := 'Terminate process (close view)' |
3510 | 2028 |
]. |
2029 |
aComponent == continueButton ifTrue:[ |
|
10205 | 2030 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2031 |
s := 'Stop' |
|
2032 |
] ifFalse:[ |
|
2033 |
s := 'Continue execution' |
|
2034 |
] |
|
3510 | 2035 |
]. |
2036 |
aComponent == stepButton ifTrue:[ |
|
10205 | 2037 |
s := 'Step to next send (don''t enter into called methods)' |
3510 | 2038 |
]. |
2039 |
aComponent == nextButton ifTrue:[ |
|
10205 | 2040 |
s := 'Step to next line (don''t enter into called methods)' |
3510 | 2041 |
]. |
2042 |
aComponent == nextOverButton ifTrue:[ |
|
10205 | 2043 |
s := 'Step over to cursor-line' |
3510 | 2044 |
]. |
2045 |
aComponent == nextOutButton ifTrue:[ |
|
10205 | 2046 |
s := 'Step out to caller' |
3510 | 2047 |
]. |
2048 |
aComponent == sendButton ifTrue:[ |
|
10205 | 2049 |
s := 'Send next message (enter into called methods)' |
3510 | 2050 |
]. |
2051 |
aComponent == returnButton ifTrue:[ |
|
10205 | 2052 |
s := 'Return from selected method' |
3510 | 2053 |
]. |
2054 |
aComponent == restartButton ifTrue:[ |
|
10205 | 2055 |
s := 'Restart selected method' |
3510 | 2056 |
]. |
2057 |
aComponent == monitorToggle ifTrue:[ |
|
10205 | 2058 |
s := 'Toggle monitoring' |
3510 | 2059 |
]. |
2060 |
aComponent == updateButton ifTrue:[ |
|
10205 | 2061 |
s := 'Update' |
3510 | 2062 |
]. |
8656 | 2063 |
aComponent == reportButton ifTrue:[ |
10205 | 2064 |
s := 'Send a defect report via eMail' |
8656 | 2065 |
]. |
3510 | 2066 |
s notNil ifTrue:[ |
10205 | 2067 |
^ resources string:s |
3510 | 2068 |
]. |
2069 |
^ nil |
|
2070 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2071 |
"Modified: / 29-08-1995 / 23:38:54 / claus" |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2072 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2073 |
! |
2074 |
||
8212 | 2075 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2076 |
|s vline line col pos interval| |
8212 | 2077 |
|
2078 |
aComponent == codeView ifFalse:[^ nil]. |
|
2079 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2080 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2081 |
|
8396 | 2082 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2083 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2084 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2085 |
|
2086 |
pos := codeView characterPositionOfLine:line col:col. |
|
2087 |
interval := pos to:pos. |
|
2088 |
||
10205 | 2089 |
self |
2090 |
withNodeValueAtInterval:interval |
|
2091 |
do:[:value :description | |
|
2092 |
|valueClassOrSizeString valueString| |
|
2093 |
||
2094 |
valueClassOrSizeString := valueString := ''. |
|
2095 |
||
2096 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2097 |
value isString ifTrue:[ |
|
2098 |
value isText ifTrue:[ |
|
2099 |
valueString := '"',(value contractTo:80),'"'. |
|
2100 |
] ifFalse:[ |
|
2101 |
valueString := value storeString contractTo:80. |
|
2102 |
]. |
|
2103 |
] ifFalse:[ |
|
2104 |
(value isBoolean |
|
2105 |
or:[ value isInteger |
|
2106 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2107 |
valueString := value printString. |
|
2108 |
] ifFalse:[ |
|
2109 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2110 |
||
2111 |
(value isArray |
|
2112 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2113 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2114 |
]. |
|
2115 |
||
2116 |
Error handle:[:ex | |
|
2117 |
valueString := '??? (',ex description,')' |
|
2118 |
] do:[ |
|
2119 |
[ |
|
2120 |
valueString := value printString contractTo:80. |
|
2121 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
|
2122 |
] |
|
2123 |
] |
|
2124 |
]. |
|
2125 |
description isEmptyOrNil ifTrue:[ |
|
2126 |
s := valueString , valueClassOrSizeString |
|
2127 |
] ifFalse:[ |
|
2128 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2129 |
]. |
|
2130 |
]. |
|
8592 | 2131 |
"/ Transcript showCR:s. |
2132 |
^ s |
|
9446 | 2133 |
|
2134 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2135 |
! |
2136 |
||
266 | 2137 |
helpTextFor:aComponent |
2138 |
|s| |
|
2139 |
||
2140 |
aComponent == abortButton ifTrue:[ |
|
10205 | 2141 |
s := 'HELP_ABORT' |
266 | 2142 |
]. |
2143 |
aComponent == terminateButton ifTrue:[ |
|
10205 | 2144 |
s := 'HELP_TERMINATE' |
266 | 2145 |
]. |
2146 |
aComponent == continueButton ifTrue:[ |
|
10205 | 2147 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2148 |
s := 'HELP_STOP' |
|
2149 |
] ifFalse:[ |
|
2150 |
s := 'HELP_CONTINUE' |
|
2151 |
] |
|
266 | 2152 |
]. |
2153 |
aComponent == stepButton ifTrue:[ |
|
10205 | 2154 |
s := 'HELP_STEP' |
266 | 2155 |
]. |
2156 |
aComponent == nextButton ifTrue:[ |
|
10205 | 2157 |
s := 'HELP_NEXT' |
266 | 2158 |
]. |
1065 | 2159 |
aComponent == nextOverButton ifTrue:[ |
10205 | 2160 |
s := 'HELP_NEXTOVER' |
1065 | 2161 |
]. |
2162 |
aComponent == nextOutButton ifTrue:[ |
|
10205 | 2163 |
s := 'HELP_NEXTOUT' |
1065 | 2164 |
]. |
266 | 2165 |
aComponent == stepButton ifTrue:[ |
10205 | 2166 |
s := 'HELP_STEP' |
266 | 2167 |
]. |
2168 |
aComponent == sendButton ifTrue:[ |
|
10205 | 2169 |
s := 'HELP_SEND' |
266 | 2170 |
]. |
2171 |
aComponent == returnButton ifTrue:[ |
|
10205 | 2172 |
s := 'HELP_RETURN' |
266 | 2173 |
]. |
2174 |
aComponent == restartButton ifTrue:[ |
|
10205 | 2175 |
s := 'HELP_RESTART' |
266 | 2176 |
]. |
2177 |
aComponent == contextView ifTrue:[ |
|
10205 | 2178 |
s := 'HELP_WALKBACK' |
266 | 2179 |
]. |
2180 |
aComponent == codeView ifTrue:[ |
|
10205 | 2181 |
s := 'HELP_CODEVIEW' |
266 | 2182 |
]. |
2183 |
aComponent == monitorToggle ifTrue:[ |
|
10205 | 2184 |
s := 'HELP_MONITOR' |
266 | 2185 |
]. |
2186 |
aComponent == updateButton ifTrue:[ |
|
10205 | 2187 |
s := 'HELP_UPDATE' |
266 | 2188 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2189 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2190 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2191 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2192 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
10205 | 2193 |
s := 'HELP_REC_INSP' |
266 | 2194 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2195 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
10205 | 2196 |
s := 'HELP_CON_INSP' |
266 | 2197 |
]. |
2198 |
||
2199 |
s notNil ifTrue:[ |
|
10205 | 2200 |
^ resources string:s |
266 | 2201 |
]. |
2202 |
^ nil |
|
2203 |
||
2204 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 2205 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 2206 |
! ! |
2207 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2208 |
!DebugView methodsFor:'initialization & release'! |
266 | 2209 |
|
2210 |
addToCurrentProject |
|
2211 |
"ignored here" |
|
2212 |
||
2213 |
^ self |
|
2214 |
! |
|
2215 |
||
2115 | 2216 |
destroy |
2217 |
"closing the debugger implies an abort or continue" |
|
2218 |
||
2404 | 2219 |
|m| |
2220 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
2221 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 2222 |
(self confirm:('Code modified - exit anyway ?')) |
2223 |
ifFalse:[ |
|
2224 |
^ self |
|
2225 |
] |
|
2115 | 2226 |
]. |
2227 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2228 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2229 |
|
2404 | 2230 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 2231 |
inspecting ifFalse:[ |
10205 | 2232 |
"I am running on top of a process, abort or continue it" |
2233 |
||
2234 |
windowGroup notNil ifTrue:[ |
|
2235 |
windowGroup setProcess:nil. |
|
2236 |
]. |
|
2237 |
self uncacheMyself. |
|
2238 |
||
2239 |
"/ |
|
2240 |
"/ catch invalid return; |
|
2241 |
"/ this happens, when my process has somehow died (quickterminate) |
|
2242 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
2243 |
"/ #destroy-window function. |
|
2244 |
"/ |
|
2245 |
Context cannotReturnSignal handle:[:ex | |
|
2246 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
2247 |
self uncacheMyself. |
|
2248 |
Debugger newDebugger. |
|
2249 |
ex return. |
|
2250 |
] do:[ |
|
2251 |
AbortOperationRequest isHandled ifTrue:[ |
|
2252 |
self doAbort. |
|
2253 |
] ifFalse:[ |
|
2254 |
self doContinue |
|
2255 |
] |
|
2256 |
]. |
|
2257 |
"/ We don't reach this point normally |
|
2258 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2259 |
Debugger newDebugger. |
|
2260 |
self uncacheMyself. |
|
2115 | 2261 |
]. |
2262 |
||
2299 | 2263 |
Debugger newDebugger. |
2115 | 2264 |
"/ since I am going to be destroyed, remove me from the cache |
2265 |
self uncacheMyself. |
|
2266 |
super destroy. |
|
2267 |
||
2268 |
"Modified: / 10.7.1997 / 17:15:41 / stefan" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2269 |
"Modified: / 16.11.2001 / 17:38:15 / cg" |
2115 | 2270 |
! |
2271 |
||
266 | 2272 |
initialize |
10205 | 2273 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2274 |
newLayout v exceptionAndTogglePanel| |
266 | 2275 |
|
2276 |
super initialize. |
|
2277 |
||
2340 | 2278 |
font := font onDevice:device. |
266 | 2279 |
|
8148 | 2280 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2281 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
10205 | 2282 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2283 |
|
266 | 2284 |
busy := false. |
2285 |
exclusive := false. |
|
2286 |
inspecting := false. |
|
2287 |
exitAction := nil. |
|
2288 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2289 |
stepHow := nil. |
266 | 2290 |
canContinue := false. |
2291 |
||
3269 | 2292 |
mH := 0. |
2293 |
||
3447 | 2294 |
menuPanel := MenuPanel in:self. |
8131 | 2295 |
menuPanel receiver:self. |
3447 | 2296 |
menuPanel verticalLayout:false. |
8131 | 2297 |
menu := self class menuSpec decodeAsLiteralArray. |
2298 |
menu findGuiResourcesIn:self. |
|
2299 |
menuPanel menu:menu. |
|
3447 | 2300 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2301 |
mH := menuPanel preferredHeight. |
3447 | 2302 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2303 |
||
8148 | 2304 |
newLayout := UserPreferences current useNewLayoutInDebugger. |
2305 |
newLayout ifFalse:[ |
|
10205 | 2306 |
bpanel := HorizontalPanelView in:self. |
2307 |
||
2308 |
self initializeButtonsIn:bpanel. |
|
2309 |
||
2310 |
bH := bpanel preferredHeight + 5. |
|
2311 |
bpanel origin:(0.0 @ mH) |
|
2312 |
extent:(1.0 @ bH). |
|
2313 |
panel := VariableVerticalPanel |
|
2314 |
origin:(0.0 @ (mH + bH)) |
|
2315 |
corner:(1.0 @ 1.0) |
|
2316 |
in:self. |
|
2317 |
||
2318 |
v := self initializeContextListViewIn:panel. |
|
2319 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2320 |
||
2321 |
codePanel := View in:panel. |
|
2322 |
v := self initializeCodeViewIn:codePanel. |
|
2323 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
2324 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2325 |
||
2326 |
v := self initializeInspectorViewsIn:panel. |
|
2327 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2328 |
|
8148 | 2329 |
] ifTrue:[ |
10205 | 2330 |
bpanel1 := HorizontalPanelView in:self. |
2331 |
self initializeButtons1In:bpanel1. |
|
2332 |
||
2333 |
bH1 := bpanel1 preferredHeight + 5. |
|
2334 |
bpanel1 origin:(0.0 @ mH) |
|
2335 |
extent:(1.0 @ bH1). |
|
2336 |
panel := VariableVerticalPanel |
|
2337 |
origin:(0.0 @ (mH + bH1)) |
|
2338 |
corner:(1.0 @ 1.0) |
|
2339 |
in:self. |
|
2340 |
"/ panel showHandle:true. |
|
2341 |
"/ panel handlePosition:#left. |
|
2342 |
||
2343 |
v := self initializeContextListViewIn:panel. |
|
2344 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2345 |
||
2346 |
codePanel := View in:panel. |
|
2347 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
2348 |
self initializeButtons2In:bpanel2. |
|
2349 |
||
2350 |
bH2 := bpanel2 preferredHeight + 5. |
|
2351 |
bpanel2 origin:(0.0 @ 0.0) |
|
2352 |
extent:(1.0 @ bH2). |
|
2353 |
||
2354 |
exceptionInfoLabel := Label label:''. |
|
2355 |
exceptionInfoLabel adjust:#left. |
|
2356 |
||
2357 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
2358 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
2359 |
exceptionAndTogglePanel |
|
2360 |
geometryLayout: |
|
2361 |
((LayoutFrame |
|
2362 |
origin:(0.0 @ 0.0) |
|
2363 |
corner:(1.0 @ 0.0)) |
|
2364 |
topOffset:bH2; |
|
2365 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
2366 |
rightOffset:-2). |
|
2367 |
||
2368 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
2369 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
2370 |
methodCodeToggle := PopUpList label:(resources string:'Original Code (Executed)') in:exceptionAndTogglePanel. |
|
2371 |
methodCodeToggle list:(resources array:#( 'Original Code (Executed)' 'Current Code')). |
|
2372 |
methodCodeToggle useIndex:true. |
|
2373 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
2374 |
methodCodeToggle beInvisible. |
|
2375 |
||
2376 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
2377 |
||
2378 |
v := self initializeCodeViewIn:codePanel. |
|
2379 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
2380 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2381 |
||
2382 |
v := self initializeInspectorViewsIn:panel. |
|
2383 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2384 |
]. |
2385 |
||
3387 | 2386 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
10205 | 2387 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2388 |
]. |
9626 | 2389 |
LastExtent notNil ifTrue:[ |
10205 | 2390 |
self extent:LastExtent. |
9626 | 2391 |
]. |
2392 |
LastOrigin notNil ifTrue:[ |
|
10205 | 2393 |
self origin:LastOrigin. |
9626 | 2394 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2395 |
|
3269 | 2396 |
" |
2397 |
Debugger newDebugger |
|
2398 |
" |
|
3447 | 2399 |
|
9626 | 2400 |
"Modified: / 10-11-2010 / 10:09:34 / cg" |
3269 | 2401 |
! |
2402 |
||
10205 | 2403 |
initializeAbortButtonIn:bpanel |
2404 |
abortButton := Button |
|
2405 |
label:(resources string:'Abort') |
|
2406 |
action:[ |
|
2407 |
abortButton turnOffWithoutRedraw. |
|
2408 |
self doAbort |
|
2409 |
] |
|
2410 |
in:bpanel. |
|
3447 | 2411 |
|
2412 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
2413 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
2414 |
! |
|
2415 |
||
10205 | 2416 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2417 |
"creates the top button row, consisting of 'continue', 'abort', 'terminate'..." |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2418 |
|
3447 | 2419 |
|separator| |
2420 |
||
10205 | 2421 |
bpanel horizontalLayout:#left. |
3447 | 2422 |
bpanel verticalLayout:#centerMax. |
2423 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2424 |
||
8194 | 2425 |
self initializeContinueButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2426 |
continueButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2427 |
|
9131 | 2428 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
2429 |
"/ separator borderWidth:0; level:0. |
|
3447 | 2430 |
self initializeAbortButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2431 |
abortButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2432 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2433 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2434 |
separator borderWidth:0; level:0. |
3269 | 2435 |
|
3447 | 2436 |
self initializeTerminateButtonIn:bpanel. |
2437 |
||
9131 | 2438 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 2439 |
separator borderWidth:0; level:0. |
2440 |
||
2441 |
self initializeDefineButtonIn:bpanel. |
|
4356 | 2442 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
10205 | 2443 |
separator := View extent:(10 @ 5) in:bpanel. |
2444 |
separator borderWidth:0; level:0. |
|
2445 |
self initializeReportButtonIn:bpanel. |
|
4356 | 2446 |
]. |
3447 | 2447 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 2448 |
! |
2449 |
||
10205 | 2450 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2451 |
"creates the second button row, consisting of 'next', 'step', 'return'..." |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2452 |
|
3269 | 2453 |
|separator| |
2454 |
||
9131 | 2455 |
bpanel horizontalLayout:#left. |
3269 | 2456 |
bpanel verticalLayout:#centerMax. |
2457 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2458 |
||
3447 | 2459 |
self initializeNextButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2460 |
nextButton width:100. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2461 |
|
3447 | 2462 |
self initializeStepButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2463 |
stepButton width:100. |
3447 | 2464 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2465 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2466 |
"/ I disabled the stepIn / stepOut buttons - for now. |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2467 |
"/ they do not work reliable with inlined blocks yet. |
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2468 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2469 |
|
3269 | 2470 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2471 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2472 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2473 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2474 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2475 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2476 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2477 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2478 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2479 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2480 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2481 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2482 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2483 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2484 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2485 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2486 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2487 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2488 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2489 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2490 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2491 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2492 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2493 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2494 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2495 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2496 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2497 |
|
3447 | 2498 |
self initializeSendButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2499 |
sendButton width:100. |
3447 | 2500 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2501 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2502 |
separator borderWidth:0; level:0. |
3269 | 2503 |
|
3447 | 2504 |
self initializeReturnButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2505 |
returnButton width:100. |
3447 | 2506 |
self initializeRestartButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2507 |
restartButton width:100. |
3447 | 2508 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2509 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 2510 |
! |
2511 |
||
10205 | 2512 |
initializeButtonsIn:bpanel |
3269 | 2513 |
|separator| |
2514 |
||
2515 |
bpanel horizontalLayout:#left. |
|
2516 |
bpanel verticalLayout:#centerMax. |
|
2517 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2518 |
||
3447 | 2519 |
self initializeAbortButtonIn:bpanel. |
2520 |
||
3269 | 2521 |
separator := View extent:(10 @ 5) in:bpanel. |
2522 |
separator borderWidth:0; level:0. |
|
2523 |
||
3447 | 2524 |
self initializeContinueButtonIn:bpanel. |
3269 | 2525 |
|
2526 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2527 |
separator borderWidth:0; level:0. |
|
2528 |
||
10205 | 2529 |
self initializeReturnButtonIn:bpanel. |
2530 |
self initializeRestartButtonIn:bpanel. |
|
3269 | 2531 |
|
2532 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2533 |
separator borderWidth:0; level:0. |
|
2534 |
||
3447 | 2535 |
self initializeNextButtonIn:bpanel. |
2536 |
self initializeStepButtonIn:bpanel. |
|
2537 |
||
3269 | 2538 |
"/ cg: |
2539 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
2540 |
"/ they do not work relyable with inlined blocks yet. |
|
2541 |
"/ |
|
2542 |
||
2543 |
||
2544 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
2545 |
"/ img isNil ifTrue:[ |
|
2546 |
"/ img := (resources at:'next') |
|
2547 |
"/ ]. |
|
2548 |
"/ nextButton := Button |
|
2549 |
"/ label:img |
|
2550 |
"/ action:[stepButton turnOff. self doNext] |
|
2551 |
"/ in:bpanel. |
|
2552 |
"/ |
|
2553 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
2554 |
"/ img isNil ifTrue:[ |
|
2555 |
"/ img := (resources at:'over') |
|
2556 |
"/ ]. |
|
2557 |
"/ nextOverButton := Button |
|
2558 |
"/ label:img |
|
2559 |
"/ action:[stepButton turnOff. self doNextOver] |
|
2560 |
"/ in:bpanel. |
|
2561 |
"/ |
|
2562 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
2563 |
"/ img isNil ifTrue:[ |
|
2564 |
"/ img := (resources at:'out') |
|
2565 |
"/ ]. |
|
2566 |
"/ nextOutButton := Button |
|
2567 |
"/ label:img |
|
2568 |
"/ action:[stepButton turnOff. self doNextOut] |
|
2569 |
"/ in:bpanel. |
|
2570 |
||
3447 | 2571 |
self initializeSendButtonIn:bpanel. |
2572 |
||
3187 | 2573 |
separator := View extent:(30 @ 5) in:bpanel. |
2574 |
separator borderWidth:0; level:0. |
|
3269 | 2575 |
|
3447 | 2576 |
self initializeTerminateButtonIn:bpanel. |
2577 |
||
3269 | 2578 |
separator := View extent:(30 @ 5) in:bpanel. |
2579 |
separator borderWidth:0; level:0. |
|
2580 |
||
3447 | 2581 |
self initializeDefineButtonIn:bpanel. |
4356 | 2582 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
10205 | 2583 |
self initializeReportButtonIn:bpanel. |
4356 | 2584 |
]. |
2585 |
||
3447 | 2586 |
|
2587 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
2588 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 2589 |
! |
2590 |
||
2591 |
initializeCodeViewIn:panel |
|
2592 |
|v| |
|
2593 |
||
10205 | 2594 |
v := HVScrollableView |
2595 |
for:CodeView |
|
2596 |
miniScrollerH:true |
|
2597 |
miniScrollerV:false |
|
2598 |
in:panel. |
|
3269 | 2599 |
|
2600 |
"/ v autoHideScrollBars:true. |
|
2601 |
codeView := v scrolledView. |
|
8212 | 2602 |
codeView enableMotionEvents. "/ for active help |
3269 | 2603 |
|
2604 |
^ v |
|
2605 |
! |
|
2606 |
||
2607 |
initializeContextListViewIn:panel |
|
2608 |
|v| |
|
266 | 2609 |
|
10205 | 2610 |
v := HVScrollableView |
2611 |
for:SelectionInListView |
|
2612 |
miniScrollerH:true |
|
2613 |
miniScrollerV:false |
|
2614 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2615 |
v autoHideHorizontalScrollBar:true. |
266 | 2616 |
|
2617 |
contextView := v scrolledView. |
|
2618 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 2619 |
contextView doubleClickAction:[:line | self browseImplementingClass]. |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
2620 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 2621 |
|
10205 | 2622 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 2623 |
|
3269 | 2624 |
^ v |
2625 |
! |
|
2626 |
||
5453 | 2627 |
initializeContextViewsMiddleButtonMenu |
2628 |
<resource: #programMenu > |
|
2629 |
||
10205 | 2630 |
contextView middleButtonMenu:(self middleButtonMenu). |
2631 |
! |
|
2632 |
||
2633 |
initializeContinueButtonIn:bpanel |
|
2634 |
continueButton := Button |
|
2635 |
label:(resources string:'Continue') |
|
2636 |
action:[ |
|
2637 |
continueButton turnOffWithoutRedraw. |
|
2638 |
self doContinue |
|
2639 |
] |
|
2640 |
in:bpanel. |
|
3447 | 2641 |
|
2642 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
2643 |
! |
|
2644 |
||
10205 | 2645 |
initializeDefineButtonIn:bpanel |
2646 |
defineButton := Button |
|
2647 |
label:(resources string:'Define') |
|
2648 |
action:[ |
|
2649 |
defineButton turnOffWithoutRedraw. |
|
2650 |
self doDefine |
|
2651 |
] |
|
2652 |
in:bpanel. |
|
3447 | 2653 |
defineButton beInvisible |
2654 |
||
2655 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
2656 |
! |
|
2657 |
||
3269 | 2658 |
initializeInspectorViewsIn:panel |
2659 |
|hpanel| |
|
266 | 2660 |
|
2661 |
hpanel := VariableHorizontalPanel in:panel. |
|
2662 |
||
2663 |
receiverInspector := InspectorView |
|
10205 | 2664 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
2665 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2666 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 2667 |
|
2668 |
contextInspector := ContextInspectorView |
|
10205 | 2669 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
2670 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2671 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2672 |
|
3269 | 2673 |
^ hpanel |
266 | 2674 |
! |
2675 |
||
10205 | 2676 |
initializeNextButtonIn:bpanel |
2677 |
nextButton := Button |
|
2678 |
label:(resources string:'Debug_Next') |
|
2679 |
action:[ |
|
2680 |
stepButton turnOff. |
|
2681 |
self doNext |
|
2682 |
] |
|
2683 |
in:bpanel. |
|
3447 | 2684 |
|
2685 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
2686 |
! |
|
2687 |
||
10205 | 2688 |
initializeReportButtonIn:bpanel |
2689 |
reportButton := Button |
|
2690 |
label:(resources string:'Report by Mail...') |
|
2691 |
action:[ |
|
2692 |
reportButton turnOffWithoutRedraw. |
|
2693 |
self doOpenReportMailApp. |
|
2694 |
] |
|
2695 |
in:bpanel. |
|
4356 | 2696 |
|
2697 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
2698 |
! |
|
2699 |
||
10205 | 2700 |
initializeRestartButtonIn:bpanel |
2701 |
restartButton := Button |
|
2702 |
label:(resources string:'Restart') |
|
2703 |
action:[ |
|
2704 |
restartButton turnOff. |
|
2705 |
self doRestart |
|
2706 |
] |
|
2707 |
in:bpanel. |
|
3447 | 2708 |
|
2709 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
|
2710 |
! |
|
2711 |
||
10205 | 2712 |
initializeReturnButtonIn:bpanel |
2713 |
returnButton := Button |
|
2714 |
label:(resources string:'Return') |
|
2715 |
action:[ |
|
2716 |
returnButton turnOff. |
|
2717 |
self doReturn |
|
2718 |
] |
|
2719 |
in:bpanel. |
|
3447 | 2720 |
|
2721 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
2722 |
! |
|
2723 |
||
10205 | 2724 |
initializeSendButtonIn:bpanel |
2725 |
sendButton := Button |
|
2726 |
label:(resources string:'Send') |
|
2727 |
action:[ |
|
2728 |
sendButton turnOff. |
|
2729 |
self doSend |
|
2730 |
] |
|
2731 |
in:bpanel. |
|
3447 | 2732 |
|
2733 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
2734 |
! |
|
2735 |
||
10205 | 2736 |
initializeStepButtonIn:bpanel |
2737 |
stepButton := Button |
|
2738 |
label:(resources string:'Debug_Step') |
|
2739 |
action:[ |
|
2740 |
stepButton turnOff. |
|
2741 |
self doStep |
|
2742 |
] |
|
2743 |
in:bpanel. |
|
3447 | 2744 |
|
2745 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
2746 |
! |
|
2747 |
||
10205 | 2748 |
initializeTerminateButtonIn:bpanel |
2749 |
terminateButton := Button |
|
2750 |
label:(resources string:'Debug_Terminate') |
|
2751 |
action:[ |
|
2752 |
terminateButton turnOffWithoutRedraw. |
|
2753 |
self doTerminate |
|
2754 |
] |
|
2755 |
in:bpanel. |
|
3447 | 2756 |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2757 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2758 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2759 |
|
3447 | 2760 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 2761 |
! |
2762 |
||
1249 | 2763 |
postRealize |
2764 |
super postRealize. |
|
266 | 2765 |
|
2766 |
inspecting ifTrue:[ |
|
10205 | 2767 |
inspectedProcess notNil ifTrue:[ |
2768 |
" |
|
2769 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
2770 |
to run between mine and the debugged processes prio) |
|
2771 |
" |
|
2772 |
Processor activeProcess |
|
2773 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
2774 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2775 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2776 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2777 |
self sensor addEventListener:self. |
1249 | 2778 |
|
2779 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 2780 |
! |
2781 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2782 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2783 |
"/ redefined - since the debugView runs on top of |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2784 |
"/ the debuggee, there would be no event loop for me. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2785 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2786 |
drawableId notNil ifTrue:[ |
10205 | 2787 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2788 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2789 |
"physically create the view & subviews" |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2790 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2791 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2792 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2793 |
|
266 | 2794 |
setLabelFor:aMessage in:aProcess |
9403 | 2795 |
|l lines processNameOrNil pidOrNil osPidString| |
6821 | 2796 |
|
2797 |
lines := aMessage asStringCollection. |
|
2798 |
lines size > 1 ifTrue:[ |
|
10205 | 2799 |
l := lines first |
6821 | 2800 |
] ifFalse:[ |
10205 | 2801 |
l := aMessage. |
6821 | 2802 |
]. |
2803 |
||
2804 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2805 |
Error handle:[:ex | |
10205 | 2806 |
l := l , '???' |
1030 | 2807 |
] do:[ |
10205 | 2808 |
processNameOrNil := aProcess name. |
2809 |
processNameOrNil notNil ifTrue:[ |
|
2810 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
2811 |
]. |
|
2812 |
pidOrNil := aProcess id printString. |
|
2813 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 2814 |
]. |
1030 | 2815 |
l := l , ')'. |
266 | 2816 |
self label:l. |
6821 | 2817 |
|
10205 | 2818 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
2819 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
|
9403 | 2820 |
]. |
2821 |
||
8305 | 2822 |
exceptionInfoLabel notNil ifTrue:[ |
10205 | 2823 |
exceptionInfoLabel |
2824 |
label:(resources |
|
2825 |
string:'Exception: %1 in process %2 [%3]%4' |
|
2826 |
with:(lines first colorizeAllWith:Color red) |
|
2827 |
with:(processNameOrNil ? '') |
|
2828 |
with:(pidOrNil ? '') |
|
2829 |
with:(osPidString ? '')) |
|
8305 | 2830 |
]. |
2831 |
||
6821 | 2832 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 2833 |
! ! |
2834 |
||
2835 |
!DebugView methodsFor:'interrupt handling'! |
|
2836 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2837 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2838 |
DebuggingDebugger == true ifTrue:[ |
10205 | 2839 |
'contextIRQ' printCR. |
2840 |
thisContext sender fullPrint. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2841 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2842 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2843 |
|
1364 | 2844 |
"Modified: / 30.10.1997 / 21:22:25 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2845 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2846 |
|
0 | 2847 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2848 |
DebuggingDebugger == true ifTrue:[ |
10205 | 2849 |
'stepIRQ' printCR. |
2850 |
thisContext sender fullPrint. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2851 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2852 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2853 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2854 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2855 |
"Modified: / 13.1.1998 / 21:14:11 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2856 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2857 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2858 |
stepOrNext |
10205 | 2859 |
|where here con s isWrap method wrappedMethod |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2860 |
inBlock left ignore contextBelow lastWrappedContext |
10205 | 2861 |
leftWrap enteredWrap anyStepBlocks |
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2862 |
oneMore initiallyShown inBlockBelow receiver processName| |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2863 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2864 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
2865 |
"/ DebuggingDebugger := false |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2866 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2867 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2868 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2869 |
skipLineNr == #return ifTrue:[ |
10205 | 2870 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
2871 |
here := thisContext sender sender. |
|
2872 |
here setLineNumber:nil. |
|
2873 |
here := nil. |
|
2874 |
con := thisContext sender sender sender. |
|
2875 |
||
2876 |
HaltInterrupt handle:[:ex | |
|
2877 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
2878 |
ex proceed |
|
2879 |
] do:[ |
|
2880 |
self enter:con select:nil. |
|
2881 |
]. |
|
2882 |
con := nil. |
|
2883 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2884 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2885 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2886 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2887 |
"/ "/ should no longer happen |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2888 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2889 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2890 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2891 |
"/ self enter:thisContext sender. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2892 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2893 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2894 |
|
52 | 2895 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
10205 | 2896 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
2897 |
^ self |
|
52 | 2898 |
]. |
2899 |
||
29 | 2900 |
here := thisContext. "stepInterrupt" |
10205 | 2901 |
here := here sender. "the caller; step- or contextIRQ" |
2902 |
here := here sender. "the interrupted context" |
|
29 | 2903 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2904 |
DebuggingDebugger == true ifTrue:[ |
10205 | 2905 |
'*******' printCR. |
2906 |
'here in ' print. |
|
2907 |
inWrap ifTrue:['(wrap) ' print.]. |
|
2908 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
2909 |
here selector printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2910 |
]. |
10 | 2911 |
|
2581 | 2912 |
"/ kludge an bug-workaround; |
2913 |
"/ I should not see those ... |
|
2914 |
||
2915 |
here selector == #ioInterrupt ifTrue:[ |
|
10205 | 2916 |
DebuggingDebugger == true ifTrue:[ |
2917 |
'oops - should not get that one' printCR. |
|
2918 |
]. |
|
2919 |
Processor ioInterrupt. |
|
2920 |
StepInterruptPending := 1. |
|
2921 |
InterruptPending := 1. |
|
2922 |
where := nil. here := nil. |
|
2923 |
InStepInterrupt := nil. |
|
2924 |
^ self |
|
2581 | 2925 |
]. |
2926 |
||
2927 |
stepUntilEntering notNil ifTrue:[ |
|
10205 | 2928 |
DebuggingDebugger == true ifTrue:[ |
2929 |
'check if entering ' print. stepUntilEntering printCR. |
|
2930 |
]. |
|
2931 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
2932 |
DebuggingDebugger == true ifTrue:[ |
|
2933 |
'entering...' printCR. |
|
2934 |
]. |
|
2935 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
2936 |
||
2937 |
lastStepUntilEntering := stepUntilEntering. |
|
2938 |
stepUntilEntering := nil. |
|
2939 |
self enter:here select:nil. |
|
2940 |
con := nil. |
|
2941 |
^ self |
|
2942 |
]. |
|
2943 |
"/ see if stepping context is still active ... |
|
2944 |
||
2945 |
con := here. |
|
2946 |
||
2947 |
DebuggingDebugger == true ifTrue:[ |
|
2948 |
'start searching at: ' print. |
|
2949 |
con fullPrint. |
|
2950 |
]. |
|
2951 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
2952 |
con := con sender |
|
2953 |
]. |
|
2954 |
con notNil ifTrue:[ |
|
2955 |
DebuggingDebugger == true ifTrue:[ |
|
2956 |
'steppingContext still active - continue stepping' printCR. |
|
2957 |
]. |
|
2958 |
con := nil. |
|
2959 |
where := nil. here := nil. |
|
2960 |
StepInterruptPending := 1. |
|
2961 |
InterruptPending := 1. |
|
2962 |
InStepInterrupt := nil. |
|
2963 |
^ self |
|
2964 |
]. |
|
2965 |
stepUntilEntering := nil. |
|
2581 | 2966 |
]. |
2967 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2968 |
" |
10205 | 2969 |
kludge to hide breakpoint wrappers in the context list: |
2970 |
check if we are in a wrapper methods hidden setup-sequence |
|
2971 |
if so, ignore the interrupt and continue single sending |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2972 |
" |
29 | 2973 |
isWrap := false. |
57 | 2974 |
left := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2975 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2976 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2977 |
where := here. |
57 | 2978 |
inWrap ifTrue:[ |
10205 | 2979 |
wrappedMethod := nil. |
2980 |
5 timesRepeat:[ |
|
2981 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
|
2982 |
method := where method. |
|
2983 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
2984 |
" |
|
2985 |
in a wrapper method |
|
2986 |
" |
|
2987 |
wrappedMethod ~~ method ifTrue:[ |
|
2988 |
wrappedMethod := method. |
|
2989 |
lastWrappedContext := where. |
|
2990 |
where sender receiver == method originalMethod ifFalse:[ |
|
2991 |
isWrap := true. |
|
2992 |
] |
|
2993 |
] ifFalse:[ |
|
2994 |
where == steppedContext ifTrue:[ |
|
2995 |
||
2996 |
DebuggingDebugger == true ifTrue:[ |
|
2997 |
'change stepCon from: ' print. |
|
2998 |
steppedContext print. |
|
2999 |
' to lastWrapped: ' print. |
|
3000 |
lastWrappedContext printCR. |
|
3001 |
]. |
|
3002 |
||
3003 |
inWrap := false. |
|
3004 |
leftWrap := true. |
|
3005 |
wrapperContext := steppedContext. |
|
3006 |
steppedContext := lastWrappedContext |
|
3007 |
] |
|
3008 |
] |
|
3009 |
]. |
|
3010 |
where := where sender |
|
3011 |
] |
|
3012 |
]. |
|
29 | 3013 |
]. |
3014 |
||
3015 |
isWrap ifTrue:[ |
|
10205 | 3016 |
DebuggingDebugger == true ifTrue:[ |
3017 |
'ignore wrap' printCR. |
|
3018 |
]. |
|
3019 |
||
3020 |
"/ |
|
3021 |
"/ ignore, while in wrappers hidden setup |
|
3022 |
"/ |
|
3023 |
where := nil. here := nil. |
|
3024 |
ObjectMemory flushInlineCaches. |
|
3025 |
||
3026 |
skipLineNr == #return ifTrue:[ |
|
3027 |
DebuggingDebugger == true ifTrue:[ |
|
3028 |
'skipRet in wrap' printCR. |
|
3029 |
] |
|
3030 |
]. |
|
3031 |
||
3032 |
StepInterruptPending := 1. |
|
3033 |
InterruptPending := 1. |
|
3034 |
InStepInterrupt := nil. |
|
3035 |
^ self |
|
29 | 3036 |
]. |
3037 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3038 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 3039 |
|
2581 | 3040 |
DebuggingDebugger == true ifTrue:[ |
10205 | 3041 |
'bigStep is: ' print. bigStep printCR. |
3042 |
'steppedContext is: ' print. steppedContext printCR. |
|
2581 | 3043 |
]. |
3044 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3045 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3046 |
"/ is this for a send or a step/next ? |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3047 |
"/ |
10205 | 3048 |
(bigStep |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
3049 |
and:[steppedContext notNil]) ifTrue:[ |
10205 | 3050 |
" |
3051 |
a step or next - ignore all contexts below the interesting one |
|
3052 |
" |
|
3053 |
where := here. "the interrupted context" |
|
3054 |
contextBelow := nil. |
|
3055 |
||
3056 |
where home notNil ifTrue:[ |
|
3057 |
"/ |
|
3058 |
"/ in a block called by 'our' context ? |
|
3059 |
"/ |
|
3060 |
where home == steppedContext ifTrue:[ |
|
3055 | 3061 |
"/ '*block*' printCR. |
10205 | 3062 |
inBlock := true |
3063 |
] |
|
3064 |
]. |
|
3065 |
||
3066 |
where == steppedContext ifFalse:[ |
|
3067 |
where := where sender. |
|
3068 |
||
3069 |
where notNil ifTrue:[ |
|
3070 |
where home == steppedContext ifTrue:[ |
|
3055 | 3071 |
"/ '*block*' printCR. |
10205 | 3072 |
inBlock := true. |
3073 |
] |
|
3074 |
]. |
|
57 | 3075 |
|
3076 |
"/ 'looking for ' print. |
|
3055 | 3077 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 3078 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3079 |
"/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3080 |
"/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3081 |
|
10205 | 3082 |
where == steppedContext ifFalse:[ |
3083 |
||
3084 |
"/ check if we are in a context below steppedContext |
|
3085 |
"/ (i.e. if steppedContext can be reached from |
|
3086 |
"/ interrupted context. Not using context-ref but its |
|
3087 |
"/ address to avoid creation of many useless contexts.) |
|
3088 |
||
3089 |
inBlock ifFalse:[ |
|
3090 |
[where notNil] whileTrue:[ |
|
3091 |
||
3092 |
"/ if either the receiver or any arg of this context |
|
3093 |
"/ is a block of the steppedContext, we must really |
|
3094 |
"/ do a single step. Otherwise, stepping through a |
|
3095 |
"/ do:-loop would be very difficult. |
|
3096 |
receiver := where receiver. |
|
3097 |
(receiver isBlock |
|
3098 |
and:[(receiver isKindOf:Block) |
|
3099 |
and:[receiver home == steppedContext]]) |
|
3100 |
ifTrue:[ |
|
3101 |
anyStepBlocks := true. |
|
3102 |
] ifFalse:[ |
|
3103 |
where args do:[:arg | |
|
3104 |
(arg isBlock |
|
3105 |
and:[(arg isKindOf:Block) |
|
3106 |
and:[arg home == steppedContext]]) |
|
3107 |
ifTrue:[ |
|
3108 |
anyStepBlocks := true. |
|
3109 |
] |
|
3110 |
] |
|
3111 |
]. |
|
3112 |
||
3113 |
DebuggingDebugger == true ifTrue:[ |
|
3114 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
3115 |
where selector printCR. |
|
3116 |
]. |
|
3117 |
||
3118 |
where == steppedContext ifTrue:[ |
|
3055 | 3119 |
"/ 'found it - below; ignore' printCR. |
10205 | 3120 |
" |
3121 |
found the interesting context somwehere up in the |
|
3122 |
chain. We seem to be still below the interesting one ... |
|
3123 |
" |
|
3124 |
tracing == true ifTrue:[ |
|
3125 |
here printString printCR |
|
3126 |
]. |
|
3127 |
" |
|
3128 |
yes, a context below |
|
3129 |
- continue and schedule another stepInterrupt. |
|
3130 |
Must flush caches since optimized methods not always |
|
3131 |
look for pending interrupts |
|
3132 |
" |
|
3133 |
||
3134 |
contextBelow notNil ifTrue:[ |
|
3055 | 3135 |
"/ 'prepare for unwind-catch' printCR. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3136 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3137 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3138 |
"/ self label:'single stepping - please wait ...(' , contextBelow selector , ')'. |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3139 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3140 |
|
10205 | 3141 |
DebuggingDebugger == true ifTrue:[ |
3142 |
'below stepCon; continue until unwind of: ' print. |
|
3143 |
contextBelow printCR. |
|
3144 |
]. |
|
3145 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
3146 |
StepInterruptPending := nil. |
|
3147 |
] ifFalse:[ |
|
3148 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3149 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3150 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3151 |
"/ self label:'single stepping - please wait ...(' , here selector , ')'. |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3152 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3153 |
|
10205 | 3154 |
DebuggingDebugger == true ifTrue:[ |
3155 |
'in stepCon; continue single stepping' printCR. |
|
3156 |
]. |
|
3157 |
StepInterruptPending := 1. |
|
3158 |
InterruptPending := 1. |
|
3159 |
]. |
|
3160 |
where := nil. here := nil. |
|
3161 |
InStepInterrupt := nil. |
|
3162 |
||
3163 |
^ self |
|
3164 |
]. |
|
3165 |
||
3166 |
(steppedContext notNil and:[ |
|
3167 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
3168 |
inBlockBelow := true. |
|
3169 |
]. |
|
3170 |
||
3171 |
anyStepBlocks ifFalse:[ |
|
3172 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3173 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3174 |
"/ which does not honor interrupt-on-return of block contexts |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3175 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3176 |
where isBlockContext ifFalse:[ |
10205 | 3177 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3178 |
]. |
10205 | 3179 |
] |
3180 |
]. |
|
3181 |
where := where sender |
|
3182 |
]. |
|
3183 |
s := 'context returned'. |
|
3184 |
left := true. |
|
3185 |
]. |
|
3186 |
] ifTrue:[ |
|
3055 | 3187 |
"/ 'found it right in sender' printCR. |
10205 | 3188 |
s := 'after step' |
3189 |
]. |
|
3190 |
] ifTrue:[ |
|
3055 | 3191 |
"/ 'found it right away' printCR. |
10205 | 3192 |
s := 'after step' |
3193 |
]. |
|
0 | 3194 |
] ifFalse:[ |
3055 | 3195 |
"/ ' send' printCR. |
10205 | 3196 |
" |
3197 |
a send |
|
3198 |
" |
|
3199 |
DebuggingDebugger == true ifTrue:[ |
|
3200 |
'clear steppedContext' printCR. |
|
3201 |
]. |
|
3202 |
steppedContext := nil. |
|
3203 |
s := 'after send' |
|
0 | 3204 |
]. |
7 | 3205 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3206 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3207 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
10205 | 3208 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3209 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3210 |
|
790 | 3211 |
"/ handle the case, when a subBlock leaves; |
3212 |
"/ continue stepping in the home context. |
|
3213 |
||
3214 |
left ifTrue:[ |
|
10205 | 3215 |
steppedContext home notNil ifTrue:[ |
3216 |
steppedContext := steppedContext home. |
|
3217 |
s := 'after step'. |
|
3218 |
left := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3219 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3220 |
|
10205 | 3221 |
] |
790 | 3222 |
]. |
3223 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3224 |
" |
10205 | 3225 |
kludge to hide breakpoint wrappers in the context list: |
3226 |
check if we are in a wrapper methods hidden exit-sequence |
|
3227 |
if so, ignore the interrupt and continue single sending |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3228 |
" |
10205 | 3229 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3230 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3231 |
ifTrue:[ |
10205 | 3232 |
"/ did not find our steppedContext along the chain; |
3233 |
"/ could be in a wrappedMethods exitBlock ... |
|
3234 |
||
3235 |
leftWrap ifFalse:[ |
|
3236 |
where := here. |
|
3237 |
wrappedMethod := nil. |
|
3238 |
5 timesRepeat:[ |
|
3239 |
where notNil ifTrue:[ |
|
3240 |
where isBlockContext ifFalse:[ |
|
3241 |
method := where method. |
|
3242 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
3243 |
where == wrapperContext ifTrue:[ |
|
3244 |
DebuggingDebugger == true ifTrue:[ |
|
3245 |
'change stepCon fromWrapped: ' print. |
|
3246 |
steppedContext print. |
|
3247 |
' to: ' print. |
|
3248 |
wrapperContext printCR. |
|
3249 |
]. |
|
3250 |
||
3251 |
inWrap := true. |
|
3252 |
enteredWrap := true. |
|
3253 |
steppedContext := wrapperContext. |
|
3254 |
wrapperContext := nil. |
|
3255 |
] |
|
3256 |
]. |
|
3257 |
]. |
|
3258 |
where := where sender |
|
3259 |
] |
|
3260 |
]. |
|
3261 |
]. |
|
3262 |
enteredWrap ifTrue:[ |
|
3263 |
ignore := true |
|
3264 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3265 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3266 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3267 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3268 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3269 |
left ifTrue:[ |
10205 | 3270 |
"/ special care for stepInterrupt in send, |
3271 |
"/ when created a dummy context (lineNr == 1) |
|
3272 |
||
3273 |
steppedContext lineNumber isNil ifTrue:[ |
|
3274 |
steppedContext selector == here sender selector ifTrue:[ |
|
3275 |
left := false. |
|
3276 |
s := 'after step'. |
|
3277 |
steppedContext := here sender. |
|
3278 |
]. |
|
3279 |
]. |
|
3280 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3281 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3282 |
|
57 | 3283 |
inBlock ifTrue:[ |
3055 | 3284 |
"/ 'inBlock' printCR. |
10205 | 3285 |
s := 'in block'. |
57 | 3286 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3287 |
inBlockBelow ifTrue:[ |
10205 | 3288 |
ignore := true |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3289 |
]. |
57 | 3290 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3291 |
DebuggingDebugger == true ifTrue:[ |
10205 | 3292 |
where notNil ifTrue:[ |
3293 |
'(' print. steppedContextLineno print. ') ' print. |
|
3294 |
where printCR. |
|
3295 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
3296 |
]. |
57 | 3297 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3298 |
ignore ifFalse:[ |
10205 | 3299 |
(bigStep |
3300 |
and:[steppedContextLineno notNil |
|
3301 |
and:[where notNil |
|
3302 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
3303 |
(here isBlockContext |
|
3304 |
and:[(here methodHome == steppedContext) |
|
3305 |
or:[here home == steppedContext]]) ifTrue:[ |
|
3306 |
DebuggingDebugger == true ifTrue:[ |
|
3307 |
'same line but in block' printCR. |
|
3308 |
]. |
|
3309 |
||
3310 |
steppedContext := actualContext := here. |
|
3311 |
steppedContextLineno := here lineNumber. |
|
3312 |
] ifFalse:[ |
|
3313 |
"/ kludge - I only have the info for up to 255 lines |
|
3314 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
3315 |
DebuggingDebugger == true ifTrue:[ |
|
3316 |
'same line - ignored' printCR. |
|
3317 |
]. |
|
3318 |
ignore := true |
|
3319 |
]. |
|
3320 |
]. |
|
3321 |
]. |
|
3322 |
||
3323 |
(left not |
|
3324 |
and:[skipLineNr notNil |
|
3325 |
and:[where notNil |
|
3326 |
and:[where lineNumber notNil |
|
3327 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
3328 |
DebuggingDebugger == true ifTrue:[ |
|
3329 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
3330 |
]. |
|
3331 |
ignore := true |
|
3332 |
]. |
|
3333 |
||
3334 |
(steppedContextLineno isNil |
|
3335 |
and:[skipLineNr isNil |
|
3336 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
3337 |
DebuggingDebugger == true ifTrue:[ |
|
3338 |
'same line2 (after conIRQ) - ignored' printCR. |
|
3339 |
]. |
|
3340 |
ignore := true |
|
3341 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3342 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3343 |
|
57 | 3344 |
ignore ifTrue:[ |
3055 | 3345 |
"/' ' printCR. |
10205 | 3346 |
where := nil. here := nil. |
3347 |
" |
|
3348 |
yes, a context below |
|
3349 |
- continue and schedule another stepInterrupt. |
|
3350 |
Must flush caches since optimized methods not always |
|
3351 |
look for pending interrupts |
|
3352 |
" |
|
3353 |
ObjectMemory flushInlineCaches. |
|
3354 |
StepInterruptPending := 1. |
|
3355 |
InterruptPending := 1. |
|
3356 |
InStepInterrupt := nil. |
|
3357 |
^ self |
|
57 | 3358 |
]. |
3359 |
||
3055 | 3360 |
"/ ' ' printCR. |
57 | 3361 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3362 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 3363 |
|
57 | 3364 |
tracing := false. |
3365 |
bigStep := false. |
|
3366 |
||
0 | 3367 |
"release refs to context" |
3368 |
where := nil. here := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3369 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3370 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3371 |
DebuggingDebugger == true ifTrue:[ |
10205 | 3372 |
'==> enter on: ' print. thisContext sender sender printCR. |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3373 |
]. |
1364 | 3374 |
|
3375 |
initiallyShown := nil. |
|
3376 |
(oneMore == true) ifTrue:[ |
|
10205 | 3377 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
3378 |
initiallyShown := 2 |
|
3379 |
] ifFalse:[ |
|
3380 |
initiallyShown := 1 |
|
3381 |
] |
|
1364 | 3382 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3383 |
con := thisContext sender sender. |
3435 | 3384 |
|
9235 | 3385 |
HaltInterrupt handle:[:ex | |
10205 | 3386 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
3387 |
ex proceed |
|
3435 | 3388 |
] do:[ |
10205 | 3389 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3390 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3391 |
con := nil |
1364 | 3392 |
|
3393 |
"Created: / 14.10.1996 / 12:53:39 / cg" |
|
3447 | 3394 |
"Modified: / 18.11.2001 / 01:00:55 / cg" |
0 | 3395 |
! ! |
3396 |
||
4867 | 3397 |
!DebugView methodsFor:'menu & button actions'! |
266 | 3398 |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3399 |
addBreakpoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3400 |
"add a breakpoint on the selected contexts method - if any" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3401 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3402 |
|implementorClass method| |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3403 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3404 |
selectedContext isNil ifTrue:[ |
10205 | 3405 |
^ self showError:'** select a context first **' |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3406 |
]. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3407 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
10205 | 3408 |
^ self |
3409 |
]. |
|
3410 |
||
3411 |
implementorClass := selectedContext methodClass. |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3412 |
implementorClass notNil ifTrue:[ |
10205 | 3413 |
method := implementorClass compiledMethodAt:selectedContext selector. |
3414 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
3415 |
method setBreakPoint |
|
3416 |
] |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3417 |
]. |
3511 | 3418 |
contextView middleButtonMenu disable:#addBreakpoint. |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3419 |
contextView middleButtonMenu enable:#removeBreakpoint. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3420 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3421 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3422 |
! |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3423 |
|
5875 | 3424 |
addBrowserBookmark |
3425 |
"add a browser-bookmark for the selected contexts method" |
|
3426 |
||
3427 |
|cls sel| |
|
3428 |
||
3429 |
selectedContext isNil ifTrue:[^ self]. |
|
3430 |
||
3431 |
cls := selectedContext receiver class. |
|
3432 |
sel := selectedContext selector. |
|
3433 |
(cls includesSelector:sel) ifFalse:[ |
|
10205 | 3434 |
sel := nil |
5875 | 3435 |
]. |
3436 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
3437 |
! |
|
3438 |
||
3511 | 3439 |
allowBreakPointsInDebugger |
3440 |
^ ignoreBreakpoints not |
|
3441 |
! |
|
3442 |
||
3443 |
allowBreakPointsInDebugger:aBoolean |
|
3444 |
ignoreBreakpoints := aBoolean not. |
|
5798 | 3445 |
self initializeMiddleButtonMenu. |
3446 |
self initializeContextViewsMiddleButtonMenu. |
|
3511 | 3447 |
! |
3448 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3449 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3450 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3451 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3452 |
"Created: / 15-05-2007 / 13:29:55 / cg" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3453 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3454 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3455 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3456 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3457 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3458 |
"Created: / 15-05-2007 / 13:30:04 / cg" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3459 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3460 |
|
266 | 3461 |
autoUpdateOff |
3462 |
"stop the update process" |
|
3463 |
||
3464 |
updateProcess notNil ifTrue:[ |
|
10205 | 3465 |
monitorToggle lampColor:(Color yellow). |
3466 |
updateProcess terminate. |
|
3467 |
updateProcess := nil |
|
266 | 3468 |
] |
3469 |
! |
|
3470 |
||
3471 |
autoUpdateOn |
|
3472 |
"fork a subprocess which updates the contextList in regular intervals" |
|
3473 |
||
3474 |
updateProcess isNil ifTrue:[ |
|
10205 | 3475 |
updateProcess := |
3476 |
[ |
|
3477 |
[true] whileTrue:[ |
|
3478 |
monitorToggle showLamp ifTrue:[ |
|
3479 |
monitorToggle lampColor:(Color yellow). |
|
3480 |
] ifFalse:[ |
|
3481 |
monitorToggle activeForegroundColor:Color black. |
|
3482 |
]. |
|
3483 |
(Delay forSeconds:0.25) wait. |
|
3484 |
self updateContext. |
|
3485 |
monitorToggle showLamp ifTrue:[ |
|
3486 |
monitorToggle lampColor:(Color red). |
|
3487 |
] ifFalse:[ |
|
3488 |
monitorToggle activeForegroundColor:Color red. |
|
3489 |
]. |
|
3490 |
(Delay forSeconds:0.25) wait. |
|
3491 |
self updateContext. |
|
3492 |
] |
|
3493 |
] forkAt:(Processor activePriority - 1) |
|
266 | 3494 |
] |
3495 |
||
3496 |
! |
|
3497 |
||
3269 | 3498 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3499 |
"browse the receiver's class (of the selected context's message)" |
3269 | 3500 |
|
3501 |
|cls sel| |
|
3502 |
||
3503 |
selectedContext isNil ifTrue:[^ self]. |
|
3504 |
||
3505 |
cls := selectedContext receiver class. |
|
3506 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3507 |
(cls includesSelector:sel) ifFalse:[ |
10205 | 3508 |
sel := nil |
3269 | 3509 |
]. |
3510 |
cls browserClass openInClass:cls selector:sel. |
|
3511 |
||
3512 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3513 |
! |
|
3514 |
||
3515 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3516 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 3517 |
|
3518 |
|cls mthd| |
|
3519 |
||
3520 |
selectedContext isNil ifTrue:[^ self]. |
|
3521 |
||
3522 |
mthd := selectedContext method. |
|
3447 | 3523 |
mthd notNil ifTrue:[ |
10205 | 3524 |
cls := mthd containingClass. |
3525 |
"/ still nil if unbound - then use receivers class |
|
3447 | 3526 |
]. |
3527 |
cls isNil ifTrue:[ |
|
10205 | 3528 |
cls := selectedContext receiver class |
3269 | 3529 |
]. |
3530 |
cls browserClass browseClassHierarchy:cls. |
|
3531 |
||
3447 | 3532 |
"Modified: / 17.11.2001 / 19:43:06 / cg" |
3269 | 3533 |
! |
3534 |
||
3535 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3536 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 3537 |
|
3538 |
|cls mthd| |
|
3539 |
||
3540 |
selectedContext isNil ifTrue:[^ self]. |
|
3541 |
||
3542 |
mthd := selectedContext method. |
|
3447 | 3543 |
mthd notNil ifTrue:[ |
10205 | 3544 |
cls := mthd containingClass. |
3545 |
"/ still nil if unbound - then use receivers class |
|
3447 | 3546 |
]. |
3547 |
cls isNil ifTrue:[ |
|
10205 | 3548 |
cls := selectedContext receiver class |
3269 | 3549 |
]. |
3550 |
cls browserClass browseFullClassProtocol:cls. |
|
3551 |
||
3447 | 3552 |
"Modified: / 17.11.2001 / 19:43:43 / cg" |
3269 | 3553 |
! |
3554 |
||
3555 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3556 |
"browse the implementing class (of the selected context's message)" |
3269 | 3557 |
|
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
3558 |
|mthd who sel cls| |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3559 |
|
1452 | 3560 |
selectedContext isNil ifTrue:[^ self]. |
3561 |
||
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3562 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3563 |
mthd notNil ifTrue:[ |
10205 | 3564 |
who := selectedContext method who. |
3565 |
who notNil ifTrue:[ |
|
3566 |
cls := who methodClass. |
|
3567 |
sel := who methodSelector. |
|
3568 |
] |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3569 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3570 |
cls isNil ifTrue:[ |
10205 | 3571 |
"/ class not found - try receiver |
3572 |
cls := selectedContext receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3573 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3574 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3575 |
cls browserClass openInClass:cls selector:sel. |
266 | 3576 |
|
1452 | 3577 |
"Created: / 22.11.1995 / 21:27:01 / cg" |
3578 |
"Modified: / 3.2.1998 / 19:46:40 / cg" |
|
266 | 3579 |
! |
3580 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3581 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3582 |
"open a browser on the implementors of the selected method's selector" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3583 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3584 |
selectedContext isNil ifTrue:[ |
10205 | 3585 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3586 |
]. |
4153 | 3587 |
"/ selectedContext receiver class browserClass |
3588 |
UserPreferences systemBrowserClass |
|
10205 | 3589 |
browseImplementorsOf:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3590 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3591 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3592 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3593 |
"open a browser on the implementors of some selector" |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3594 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3595 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3596 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3597 |
(sel := codeView selection) notNil ifTrue:[ |
10205 | 3598 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3599 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3600 |
initial isNil ifTrue:[ |
10205 | 3601 |
initial := selectedContext isNil |
3602 |
ifTrue:[nil] |
|
3603 |
ifFalse:[selectedContext selector]. |
|
3604 |
]. |
|
3605 |
selector := Dialog |
|
3606 |
requestSelector:'Selector to browse implementors of:' |
|
3607 |
initialAnswer:initial. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3608 |
selector size == 0 ifFalse:[ |
10205 | 3609 |
UserPreferences systemBrowserClass |
3610 |
browseImplementorsMatching:selector. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3611 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3612 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3613 |
"Modified: / 6.2.2000 / 01:05:14 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3614 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3615 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3616 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3617 |
"browse the application class (of the process, if it is a GUI process)" |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3618 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3619 |
|p appClass| |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3620 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3621 |
p := inspectedProcess ? Processor activeProcess. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3622 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
10205 | 3623 |
WindowGroup scheduledWindowGroups do:[:wg | |
3624 |
wg process == p ifTrue:[ |
|
3625 |
appClass := wg application class. |
|
3626 |
appClass browserClass openInClass:appClass selector:nil. |
|
3627 |
^ self |
|
3628 |
] |
|
3629 |
] |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3630 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3631 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3632 |
|
3269 | 3633 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3634 |
"browse the receiver's class (of the selected context's message)" |
3269 | 3635 |
|
3636 |
|cls sel| |
|
3637 |
||
3638 |
selectedContext isNil ifTrue:[^ self]. |
|
3639 |
||
3640 |
cls := selectedContext receiver class. |
|
3641 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3642 |
(cls includesSelector:sel) ifFalse:[ |
10205 | 3643 |
sel := nil |
3269 | 3644 |
]. |
3645 |
cls browserClass openInClass:cls selector:sel. |
|
3646 |
||
3647 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3648 |
! |
|
3649 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3650 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3651 |
"open a browser on the senders of the selected method's selector" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3652 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3653 |
selectedContext isNil ifTrue:[ |
10205 | 3654 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3655 |
]. |
3140 | 3656 |
UserPreferences systemBrowserClass |
10205 | 3657 |
browseAllCallsOn:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3658 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3659 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3660 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3661 |
"open a browser on the senders of some selector" |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3662 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3663 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3664 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3665 |
(sel := codeView selection) notNil ifTrue:[ |
10205 | 3666 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3667 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3668 |
initial isNil ifTrue:[ |
10205 | 3669 |
initial := selectedContext isNil |
3670 |
ifTrue:[nil] |
|
3671 |
ifFalse:[selectedContext selector]. |
|
3672 |
]. |
|
3673 |
selector := Dialog |
|
3674 |
requestSelector:'Selector to browse senders of:' |
|
3675 |
initialAnswer:initial. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3676 |
selector size == 0 ifFalse:[ |
10205 | 3677 |
UserPreferences systemBrowserClass |
3678 |
browseAllCallsOn:selector asSymbol. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3679 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3680 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3681 |
"Modified: / 6.2.2000 / 01:05:29 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3682 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3683 |
|
9626 | 3684 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 3685 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 3686 |
LastExtent := self extent. |
3687 |
LastOrigin := self origin. |
|
3688 |
||
3689 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
3690 |
! |
|
3691 |
||
266 | 3692 |
copyWalkbackText |
3693 |
"place the contents of the walkback view into the copy-paste buffer. |
|
3694 |
This allows pasting it into some other view for printing ..." |
|
3695 |
||
6034 | 3696 |
self setClipboardText:(contextArray collect:[:con | con fullPrintString]) asStringCollection |
266 | 3697 |
|
3698 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
3699 |
! |
|
3700 |
||
3701 |
doAbort |
|
1187 | 3702 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 3703 |
at save places (for example: in the event loop) and returns back |
3704 |
from whatever the process is doing, but does not terminate it." |
|
3705 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3706 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 3707 |
(self confirm:('Code modified - abort anyway ?')) |
3708 |
ifFalse:[ |
|
3709 |
^ self |
|
3710 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3711 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3712 |
|
266 | 3713 |
inspecting ifTrue:[ |
10205 | 3714 |
inspectedProcess isDead ifTrue:[ |
3715 |
self showTerminated. |
|
3716 |
^ self |
|
3717 |
]. |
|
3718 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3719 |
self showError:'** the process does not handle the abort signal **' |
|
3720 |
] ifTrue:[ |
|
3721 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
3722 |
]. |
|
3723 |
^ self |
|
266 | 3724 |
]. |
3725 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3726 |
steppedContext := wrapperContext := nil. |
266 | 3727 |
haveControl := false. |
3728 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3729 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3730 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3731 |
catchBlock notNil ifTrue:[ |
10205 | 3732 |
abortButton turnOff. |
3733 |
catchBlock value. |
|
3734 |
||
3735 |
"/ not reached |
|
3736 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
266 | 3737 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3738 |
|
266 | 3739 |
^ self. |
3740 |
||
3447 | 3741 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 3742 |
! |
3743 |
||
6487 | 3744 |
doAbortAll |
3745 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
3746 |
at save places (for example: in the event loop) and returns back |
|
3747 |
from whatever the process is doing, but does not terminate it." |
|
3748 |
||
3749 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
10205 | 3750 |
(self confirm:('Code modified - abort anyway ?')) |
3751 |
ifFalse:[ |
|
3752 |
^ self |
|
3753 |
] |
|
6487 | 3754 |
]. |
3755 |
||
3756 |
inspecting ifTrue:[ |
|
10205 | 3757 |
inspectedProcess isDead ifTrue:[ |
3758 |
self showTerminated. |
|
3759 |
^ self |
|
3760 |
]. |
|
3761 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3762 |
self showError:'** the process does not handle the abort signal **' |
|
3763 |
] ifTrue:[ |
|
3764 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
3765 |
]. |
|
3766 |
^ self |
|
6487 | 3767 |
]. |
3768 |
||
3769 |
steppedContext := wrapperContext := nil. |
|
3770 |
haveControl := false. |
|
3771 |
exitAction := #abortAll. |
|
3772 |
||
3773 |
"exit private event-loop" |
|
3774 |
catchBlock notNil ifTrue:[ |
|
10205 | 3775 |
abortButton turnOff. |
3776 |
catchBlock value. |
|
3777 |
||
3778 |
"/ not reached |
|
3779 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 3780 |
]. |
3781 |
||
3782 |
^ self. |
|
3783 |
||
3784 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
3785 |
! |
|
3786 |
||
266 | 3787 |
doContinue |
3788 |
"continue from menu" |
|
3789 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3790 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3791 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3792 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 3793 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
3794 |
^ self |
|
3795 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3796 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3797 |
|
266 | 3798 |
inspecting ifTrue:[ |
10205 | 3799 |
device hasColors ifTrue:[ |
3800 |
continueButton foregroundColor:Color red darkened. |
|
3801 |
]. |
|
3802 |
continueButton label:(resources string:'Stop'). |
|
3803 |
continueButton action:[self doStop]. |
|
3804 |
||
3805 |
self processPerform:#resume. |
|
3806 |
||
3807 |
^ self |
|
266 | 3808 |
]. |
3809 |
canContinue ifTrue:[ |
|
10205 | 3810 |
exContext := thisContext findSpecialHandle:false raise:true. |
3811 |
||
3812 |
(exContext notNil |
|
3813 |
and:[ (ex := exContext receiver) isLazyValue not |
|
3814 |
and:[ ex isException |
|
3815 |
and:[ ex signal == NoHandlerError |
|
3816 |
and:[ ex parameter signal == RecursionError]]]]) |
|
3817 |
ifTrue:[ |
|
3818 |
"/ debug due to unhandled recursionInterrupt. |
|
3819 |
"/ ask if we should proceed with more stack. |
|
3820 |
||
3821 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
3822 |
answer == true ifTrue:[ |
|
3823 |
proc := Processor activeProcess. |
|
3824 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
3825 |
]. |
|
3826 |
]. |
|
3827 |
||
3828 |
steppedContext := wrapperContext := nil. |
|
3829 |
tracing := false. |
|
3830 |
haveControl := false. |
|
3831 |
exitAction := #continue. |
|
3832 |
||
3833 |
"exit private event-loop" |
|
3834 |
catchBlock value. |
|
3835 |
||
3836 |
"/ not reached. |
|
3837 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
3838 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3839 |
|
266 | 3840 |
] ifFalse:[ |
10205 | 3841 |
inspecting ifFalse:[ |
3842 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
3843 |
self showSelection:1. |
|
3844 |
self doReturn |
|
3845 |
] |
|
266 | 3846 |
] |
477 | 3847 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3848 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 3849 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 3850 |
! |
3851 |
||
3187 | 3852 |
doDefine |
5955 | 3853 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3854 |
bagOfClassNames bagOfUsedClassNames implClass idx callee restart| |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3855 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3856 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3857 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3858 |
|
3283 | 3859 |
selector := actualContext selector. |
8963 | 3860 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3861 |
implClass notNil ifTrue:[ |
10205 | 3862 |
"/ must be a subclassResponsibility |
3863 |
||
3864 |
idx := contextArray identityIndexOf:actualContext. |
|
3865 |
idx > 1 ifTrue:[ |
|
3866 |
callee := contextArray at:idx-1. |
|
3867 |
||
3868 |
callee selector == #subclassResponsibility ifTrue:[ |
|
3869 |
restart := false. |
|
3870 |
] |
|
3871 |
]. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3872 |
]. |
5955 | 3873 |
|
3874 |
"generate nice argument names" |
|
3875 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
3876 |
bagOfUsedClassNames := Bag new. |
|
10205 | 3877 |
argNames := actualContext args |
3878 |
collect: |
|
3879 |
[:eachArg | |
|
3880 |
|nm| |
|
3881 |
||
3882 |
nm := eachArg class name. |
|
3883 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
3884 |
nm article , nm |
|
3885 |
] ifFalse:[ |
|
3886 |
bagOfUsedClassNames add:nm. |
|
3887 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
3888 |
]. |
|
3889 |
]. |
|
5955 | 3890 |
|
3891 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 3892 |
|
3447 | 3893 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
3894 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
3895 |
||
3896 |
actualContext receiver isNil ifTrue:[ |
|
10205 | 3897 |
(self confirm:'Are you sure you want to add this method (to UndefinedObject) ?') |
3898 |
ifFalse:[ |
|
3899 |
^ self |
|
3900 |
] |
|
3447 | 3901 |
]. |
3902 |
||
3903 |
receiversClass := actualContext receiver class. |
|
3904 |
||
3905 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
|
10205 | 3906 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
3907 |
cat := 'accessing'. |
|
3447 | 3908 |
]. |
3909 |
(selector numArgs == 1 |
|
3910 |
and:[(selector endsWith:':') |
|
10205 | 3911 |
and:[receiversClass instVarNames includes:(selector copyWithoutLast:1)]]) |
3447 | 3912 |
ifTrue:[ |
10205 | 3913 |
code := '%1\' , haltStmtFix , '\ %2 := arg.'. |
3914 |
cat := 'accessing'. |
|
3447 | 3915 |
]. |
3916 |
||
3917 |
"/ actualContext receiver isClass ifTrue:[ |
|
3918 |
"/ selector == #new ifTrue:[ |
|
3919 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
3920 |
"/ ]. |
|
3921 |
"/ selector == #'new:' ifTrue:[ |
|
3922 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
3923 |
"/ ]. |
|
3924 |
"/ ]. |
|
3925 |
code isNil ifTrue:[ |
|
10205 | 3926 |
code := '%1\' , haltStmtDef |
3927 |
]. |
|
3928 |
||
3929 |
self |
|
3930 |
codeAccept:(code bindWith:proto with:selector) withCRs |
|
3931 |
inClass:receiversClass |
|
3932 |
unwind:false |
|
3933 |
category:cat |
|
3934 |
onCancel:[^ self]. |
|
3269 | 3935 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3936 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3937 |
restart ifTrue:[ |
10205 | 3938 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3939 |
] |
3427 | 3940 |
|
3447 | 3941 |
"Modified: / 17.11.2001 / 23:43:54 / cg" |
3187 | 3942 |
! |
3943 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3944 |
doIgnoreBreakpoints |
3511 | 3945 |
self allowBreakPointsInDebugger:false |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3946 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3947 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3948 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3949 |
"single send; reenter with next message send" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3950 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3951 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3952 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3953 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 3954 |
(self confirm:('Code modified - step anyway ?')) |
3955 |
ifFalse:[ |
|
3956 |
^ self |
|
3957 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3958 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3959 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3960 |
canContinue ifTrue:[ |
10205 | 3961 |
steppedContext := wrapperContext := nil. |
3962 |
haveControl := false. |
|
3963 |
exitAction := #step. |
|
3964 |
||
3965 |
"exit private event-loop" |
|
3966 |
catchBlock value. |
|
3967 |
||
3968 |
"/ not reached |
|
3969 |
'DebugView [warning]: send failed' errorPrintCR. |
|
3970 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3971 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3972 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3973 |
"Created: / 6.3.1997 / 21:09:36 / cg" |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3974 |
"Modified: / 29.7.1998 / 21:49:29 / cg" |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3975 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3976 |
|
266 | 3977 |
doNext |
1072 | 3978 |
"skip for next source-code line; entering blocks" |
266 | 3979 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3980 |
stepHow := #nextIn. |
266 | 3981 |
self doStep:nil |
790 | 3982 |
|
1072 | 3983 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3984 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3985 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3986 |
doNextOut |
1072 | 3987 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3988 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3989 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3990 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3991 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3992 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 3993 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3994 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3995 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3996 |
doNextOver |
1072 | 3997 |
"skip for next source-code line; skip over blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3998 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3999 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4000 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4001 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4002 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 4003 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 4004 |
! |
4005 |
||
4006 |
doNoTrace |
|
4007 |
traceView notNil ifTrue:[ |
|
10205 | 4008 |
traceView topView destroy. |
4009 |
traceView := nil. |
|
266 | 4010 |
]. |
4011 |
tracing := false |
|
4012 |
! |
|
4013 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4014 |
doNotIgnoreBreakpoints |
3511 | 4015 |
self allowBreakPointsInDebugger:true |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4016 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4017 |
|
4356 | 4018 |
doOpenReportMailApp |
4019 |
"open a mail report tool" |
|
4020 |
||
4021 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4022 |
|
4356 | 4023 |
str := '' writeStream. |
4024 |
||
4025 |
str nextPutLine:('Error notification from ' |
|
10205 | 4026 |
, OperatingSystem getLoginName |
4027 |
, '@' |
|
4028 |
, OperatingSystem getHostName). |
|
4356 | 4029 |
str cr. |
4030 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
4031 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 4032 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
4033 |
str nextPutLine:('Description: ' , self label). |
|
4034 |
"/ str nextPutLine:('Error: ', printedException description). |
|
4035 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
4036 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
4037 |
str nextPutLine:'Backtrace:'. |
|
4038 |
str cr. |
|
4039 |
||
4040 |
firstContext notNil ifTrue:[ |
|
10205 | 4041 |
firstContext fullPrintAllOn:str. |
4356 | 4042 |
]. |
4043 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4044 |
|
10205 | 4045 |
SendMailTool |
4046 |
openForMessage:(str contents) |
|
4047 |
withSubject:('STX Error:[', self label, ']') |
|
4048 |
preOpenBlock:[:inst| |
|
4049 |
inst recipientEntryField value:'error@exept.de' |
|
4050 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4051 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4052 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 4053 |
! |
4054 |
||
266 | 4055 |
doRestart |
4056 |
"restart - the selected context will be restarted" |
|
10205 | 4057 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4058 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 4059 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
4060 |
^ self |
|
4061 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4062 |
]. |
266 | 4063 |
inspecting ifTrue:[ |
10205 | 4064 |
selectedContext isNil ifTrue:[ |
4065 |
^ self showError:'** select a context first **' |
|
4066 |
]. |
|
4067 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
4068 |
^ self |
|
266 | 4069 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4070 |
steppedContext := wrapperContext := nil. |
266 | 4071 |
haveControl := false. |
6365 | 4072 |
exitAction := #restart. "exit private event-loop" |
4073 |
||
4074 |
catchBlock value. |
|
4075 |
||
4076 |
"/ normally not reached |
|
10205 | 4077 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4078 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4079 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4080 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4081 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 4082 |
! |
4083 |
||
4084 |
doReturn |
|
4085 |
"return - the selected context will do a ^nil" |
|
4086 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4087 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 4088 |
(self confirm:('Code modified - return anyway ?')) |
4089 |
ifFalse:[ |
|
4090 |
^ self |
|
4091 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4092 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4093 |
|
266 | 4094 |
inspecting ifTrue:[ |
10205 | 4095 |
selectedContext isNil ifTrue:[ |
4096 |
^ self showError:'** select a context first **' |
|
4097 |
]. |
|
4098 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
4099 |
^ self |
|
266 | 4100 |
]. |
4101 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4102 |
steppedContext := wrapperContext := nil. |
266 | 4103 |
haveControl := false. |
4104 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4105 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4106 |
"exit private event-loop" |
6365 | 4107 |
catchBlock value. |
477 | 4108 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4109 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4110 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4111 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4112 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4113 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 4114 |
! |
4115 |
||
4116 |
doSend |
|
4117 |
"single send; reenter with next message send" |
|
4118 |
||
1072 | 4119 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4120 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4121 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4122 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4123 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4124 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4125 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4126 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4127 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4128 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4129 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4130 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4131 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4132 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4133 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4134 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4135 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4136 |
|
1072 | 4137 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 4138 |
! |
4139 |
||
4140 |
doStep |
|
4141 |
"skip for next send in selected method" |
|
4142 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4143 |
stepHow := #step. |
790 | 4144 |
self doStep:-1 |
4145 |
||
1072 | 4146 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 4147 |
! |
4148 |
||
4149 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4150 |
"common helper for step, skip & next. |
10205 | 4151 |
Arrange for single-steppping until we pass lineNr (if nonNil) |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4152 |
or to next line (if nil) or to next send (if -1)" |
266 | 4153 |
|
4154 |
|con method| |
|
4155 |
||
4156 |
inspecting ifTrue:[^ self]. |
|
4157 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4158 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 4159 |
(self confirm:('Code modified - step anyway ?')) |
4160 |
ifFalse:[ |
|
4161 |
^ self |
|
4162 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4163 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4164 |
|
266 | 4165 |
canContinue ifTrue:[ |
10205 | 4166 |
selectedContext notNil ifTrue:[ |
4167 |
con := actualContext. "/ selectedContext. |
|
4168 |
steppedContextLineno := actualContext lineNumber. |
|
4169 |
] ifFalse:[ |
|
4170 |
con := contextArray at:2. |
|
4171 |
steppedContextLineno := con lineNumber. |
|
4172 |
]. |
|
4173 |
||
4174 |
skipLineNr := lineNr. |
|
4175 |
||
4176 |
lineNr == -1 ifTrue:[ |
|
4177 |
steppedContextLineno := skipLineNr := nil. |
|
4178 |
]. |
|
4179 |
||
4180 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
4181 |
steppedContext := contextArray at:1. |
|
4182 |
stepHow := #nextIn. |
|
4183 |
] ifFalse:[ |
|
4184 |
stepHow == #nextOut ifTrue:[ |
|
4185 |
steppedContext := con home. |
|
4186 |
] ifFalse:[ |
|
4187 |
steppedContext := con. |
|
4188 |
]. |
|
4189 |
]. |
|
4190 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4191 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
4192 |
"/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
4193 |
|
10205 | 4194 |
" |
4195 |
if we step in a wrapped method, |
|
4196 |
prepare to skip the prolog ... |
|
4197 |
" |
|
4198 |
||
4199 |
inWrap := false. |
|
4200 |
method := con method. |
|
4201 |
(method notNil |
|
4202 |
and:[method isWrapped |
|
4203 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
4204 |
inWrap := true |
|
4205 |
]. |
|
4206 |
||
4207 |
lineNr == #return ifTrue:[ |
|
4208 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
4209 |
]. |
|
4210 |
||
4211 |
con := nil. |
|
4212 |
bigStep := true. |
|
4213 |
haveControl := false. |
|
4214 |
exitAction := #step. |
|
4215 |
||
4216 |
"exit private event-loop" |
|
4217 |
catchBlock value. |
|
4218 |
||
4219 |
"/ not reached |
|
4220 |
'DebugView [warning]: step failed' errorPrintCR. |
|
4221 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 4222 |
] |
477 | 4223 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4224 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 4225 |
! |
4226 |
||
4227 |
doStop |
|
4228 |
"stop the process (if its running, otherwise this is a no-op)" |
|
4229 |
||
4230 |
inspecting ifTrue:[ |
|
10205 | 4231 |
device hasColors ifTrue:[ |
4232 |
continueButton foregroundColor:Color green darkened darkened. |
|
4233 |
]. |
|
4234 |
continueButton label:(resources string:'Continue'). |
|
4235 |
continueButton action:[self doContinue]. |
|
4236 |
||
4237 |
self processPerform:#stop. |
|
4238 |
||
4239 |
^ self |
|
266 | 4240 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4241 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4242 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 4243 |
! |
4244 |
||
4245 |
doTerminate |
|
4246 |
"terminate - the process has a chance for cleanup" |
|
4247 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4248 |
self checkIfCodeIsReallyModified ifTrue:[ |
10205 | 4249 |
(self confirm:('Code modified - terminate anyway ?')) |
4250 |
ifFalse:[ |
|
4251 |
^ self |
|
4252 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4253 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4254 |
|
266 | 4255 |
inspecting ifTrue:[ |
10205 | 4256 |
self processPerform:#terminate. |
4257 |
^ self |
|
266 | 4258 |
]. |
4259 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4260 |
steppedContext := wrapperContext := nil. |
266 | 4261 |
haveControl := false. |
10205 | 4262 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4263 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4264 |
"exit private event-loop" |
6365 | 4265 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4266 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4267 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4268 |
inspecting ifFalse:[ |
10205 | 4269 |
'DebugView [warning]: terminate failed' errorPrintCR. |
4270 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
4271 |
Debugger newDebugger. |
|
4272 |
Processor activeProcess terminate. |
|
4273 |
] |
|
266 | 4274 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4275 |
terminateButton turnOff. |
477 | 4276 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4277 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 4278 |
! |
4279 |
||
4280 |
doTrace |
|
4281 |
"tracing - not really implemented ..." |
|
4282 |
||
4283 |
self warn:'this function is not yet implemented'. |
|
4284 |
||
4285 |
"/ |v b| |
|
4286 |
"/ |
|
4287 |
"/ traceView isNil ifTrue:[ |
|
4288 |
"/ v := StandardSystemView on:Display. |
|
4289 |
"/ v label:'Debugger-Trace'. |
|
4290 |
"/ v icon:icon. |
|
4291 |
"/ |
|
4292 |
"/ b := Button label:'untrace' in:v. |
|
4293 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
4294 |
"/ b action:[ |
|
4295 |
"/ StepInterruptPending := nil. |
|
4296 |
"/ tracing := false. |
|
4297 |
"/ v unrealize. |
|
4298 |
"/ traceView := nil |
|
4299 |
"/ ]. |
|
4300 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
4301 |
"/ traceView origin:(0 @ (b height)) |
|
4302 |
"/ extent:[v width @ (v height - b height)] |
|
4303 |
"/ ]. |
|
4304 |
"/ v realize. |
|
4305 |
"/ |
|
4306 |
"/ tracing := true. |
|
4307 |
! |
|
4308 |
||
4309 |
doTraceStep |
|
4310 |
"tracestep - not implemented yet" |
|
4311 |
||
4312 |
canContinue ifTrue:[ |
|
10205 | 4313 |
tracing := true. |
4314 |
self doStep |
|
266 | 4315 |
] |
4316 |
! |
|
4317 |
||
4318 |
exit |
|
4319 |
"exit from menu: immediate exit from smalltalk" |
|
4320 |
||
4321 |
OperatingSystem exit |
|
4322 |
! |
|
4323 |
||
8170 | 4324 |
hasHaltsToIgnore |
4325 |
^ IgnoredHalts notEmptyOrNil |
|
4326 |
! |
|
4327 |
||
9922 | 4328 |
ignoreAllHaltsForever |
4329 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil forAll:true. |
|
4330 |
||
4331 |
"Created: / 08-05-2011 / 10:19:56 / cg" |
|
4332 |
! |
|
4333 |
||
8179 | 4334 |
ignoreHaltForever |
9922 | 4335 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil forAll:false. |
4336 |
||
4337 |
"Modified: / 08-05-2011 / 10:20:03 / cg" |
|
8179 | 4338 |
! |
4339 |
||
266 | 4340 |
inspectContext |
4341 |
"launch an inspector on the currently selected context" |
|
4342 |
||
4343 |
contextView selection notNil ifTrue:[ |
|
10205 | 4344 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
4345 |
(contextArray at:(contextView selection)) inspect. |
|
4346 |
] |
|
266 | 4347 |
] |
4348 |
! |
|
4349 |
||
8170 | 4350 |
isStoppedAtHaltOrBreakPoint |
4351 |
^ isStoppedAtHaltOrBreakPoint |
|
4352 |
! |
|
4353 |
||
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4354 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4355 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4356 |
! |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4357 |
|
8142 | 4358 |
middleButtonMenu |
4359 |
<resource: #programMenu > |
|
4360 |
||
9488 | 4361 |
|items m nameOfExecutable| |
8142 | 4362 |
|
4363 |
exclusive ifTrue:[ |
|
10205 | 4364 |
items := #( |
4365 |
('Show More WalkBack' showMore ) |
|
4366 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4367 |
('-' ) |
|
4368 |
('Add Breakpoint' addBreakpoint ) |
|
4369 |
('Remove Breakpoint' removeBreakpoint ) |
|
4370 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4371 |
('-' ) |
|
4372 |
). |
|
8142 | 4373 |
] ifFalse:[ |
10205 | 4374 |
items := #( |
4375 |
('Show More WalkBack' showMore ) |
|
4376 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4377 |
('-' ) |
|
4378 |
('Skip' skip ) |
|
4379 |
('Step Out' skipForReturn ) |
|
4380 |
('Skip until Entering...' skipUntilEntering ) |
|
4381 |
('-' ) |
|
8142 | 4382 |
" |
10205 | 4383 |
('Continue' doContinue ) |
4384 |
('Terminate' doTerminate ) |
|
4385 |
('Abort' doAbort ) |
|
4386 |
('-' ) |
|
4387 |
('Step' doStep ) |
|
4388 |
('Send' doSend ) |
|
4389 |
('-' ) |
|
4390 |
('Return' doReturn ) |
|
4391 |
('Restart' doRestart ) |
|
4392 |
('-' ) |
|
8142 | 4393 |
" |
10205 | 4394 |
('Add Breakpoint' addBreakpoint ) |
4395 |
('Remove Breakpoint' removeBreakpoint ) |
|
4396 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4397 |
). |
|
4398 |
||
4399 |
self allowBreakPointsInDebugger ifFalse:[ |
|
4400 |
items := items , #( |
|
4401 |
('Allow Breakpoints && halt in Debugger' doNotIgnoreBreakpoints ) |
|
4402 |
). |
|
4403 |
] ifTrue:[ |
|
4404 |
items := items , #( |
|
4405 |
('Ignore Breakpoints && halt in Debugger' doIgnoreBreakpoints ) |
|
4406 |
). |
|
4407 |
]. |
|
4408 |
||
4409 |
items := items , #( |
|
4410 |
('-' ) |
|
4411 |
('Browse Implementing Class' browseImplementingClass ) |
|
4412 |
('Browse Receivers Class' browseReceiversClass ) |
|
4413 |
('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
|
4414 |
('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
4415 |
('Implementors' browseImplementors ) |
|
4416 |
('Implementors Of...' browseImplementorsOf ) |
|
4417 |
('Senders' browseSenders ) |
|
4418 |
('Senders Of...' browseSendersOf ) |
|
4419 |
('-' ) |
|
4420 |
('Inspect Context' inspectContext ) |
|
4421 |
). |
|
8142 | 4422 |
]. |
4423 |
||
9488 | 4424 |
items := items , #( |
10205 | 4425 |
('Copy WalkBack Text' copyWalkbackText ) |
4426 |
('-' ) |
|
4427 |
('QuickTerminate' quickTerminate ) |
|
4428 |
('=' )). |
|
9488 | 4429 |
|
4430 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
4431 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
4432 |
||
4433 |
items := items , { |
|
10205 | 4434 |
{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
4435 |
||
4436 |
m := PopUpMenu |
|
4437 |
itemList:items |
|
4438 |
resources:resources |
|
4439 |
receiver:self |
|
4440 |
for:contextView. |
|
8142 | 4441 |
|
4442 |
verboseBacktrace ifTrue:[ |
|
10205 | 4443 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
4444 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback |
|
8142 | 4445 |
]. |
4446 |
||
4447 |
inspecting ifTrue:[ |
|
10205 | 4448 |
m notNil ifTrue:[ |
4449 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
4450 |
browseClassHierarchy browseFullClassProtocol |
|
4451 |
browseImplementors browseSenders inspectContext skip doStepOut). |
|
4452 |
]. |
|
8142 | 4453 |
]. |
4454 |
self updateMenuItems. |
|
4455 |
||
4456 |
^ m. |
|
9488 | 4457 |
|
4458 |
"Modified: / 19-05-2010 / 11:49:56 / cg" |
|
8142 | 4459 |
! |
4460 |
||
3447 | 4461 |
openAboutThisApplication |
4462 |
"opens an about box for this application." |
|
4463 |
||
7112 | 4464 |
Dialog aboutClass:self class. |
4465 |
||
4466 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 4467 |
! |
4468 |
||
9612
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4469 |
openBreakPointBrowser |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4470 |
Tools::BreakpointBrowser open |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4471 |
|
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4472 |
"Created: / 27-10-2010 / 12:52:49 / cg" |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4473 |
! |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4474 |
|
9922 | 4475 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
4476 |
|answer dT| |
|
4477 |
||
4478 |
[ |
|
10205 | 4479 |
answer := Dialog |
4480 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
4481 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
4482 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4483 |
||
4484 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
4485 |
dT notNil ifTrue:[ |
|
4486 |
LastIgnoreHaltDuration := dT. |
|
4487 |
self addIgnoredHaltForCount:nil orTimeDuration:dT forAll:true. |
|
4488 |
^ self. |
|
4489 |
]. |
|
9922 | 4490 |
] loop |
4491 |
||
4492 |
"Created: / 08-05-2011 / 10:19:20 / cg" |
|
4493 |
! |
|
4494 |
||
8170 | 4495 |
openIgnoreHaltNTimesDialog |
8179 | 4496 |
|answer n| |
4497 |
||
4498 |
[ |
|
10205 | 4499 |
answer := Dialog |
4500 |
request:(resources string:'How often should this halt be ignored ?') |
|
4501 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
4502 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4503 |
||
4504 |
n := Integer readFrom:answer onError:nil. |
|
4505 |
n notNil ifTrue:[ |
|
4506 |
LastIgnoreHaltNTimes := n. |
|
4507 |
self addIgnoredHaltForCount:n orTimeDuration:nil forAll:false. |
|
4508 |
^ self. |
|
4509 |
]. |
|
8179 | 4510 |
] loop. |
9922 | 4511 |
|
4512 |
"Modified: / 08-05-2011 / 10:20:19 / cg" |
|
8179 | 4513 |
! |
4514 |
||
4515 |
openIgnoreHaltUntilTimeElapsedDialog |
|
4516 |
|answer dT| |
|
4517 |
||
4518 |
[ |
|
10205 | 4519 |
answer := Dialog |
4520 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
4521 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
4522 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4523 |
||
4524 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
4525 |
dT notNil ifTrue:[ |
|
4526 |
LastIgnoreHaltDuration := dT. |
|
4527 |
self addIgnoredHaltForCount:nil orTimeDuration:dT forAll:false. |
|
4528 |
^ self. |
|
4529 |
]. |
|
8179 | 4530 |
] loop |
9613
380816519281
changed: #openIgnoreHaltUntilTimeElapsedDialog
Claus Gittinger <cg@exept.de>
parents:
9612
diff
changeset
|
4531 |
|
9922 | 4532 |
"Modified: / 08-05-2011 / 10:20:11 / cg" |
8170 | 4533 |
! |
4534 |
||
8620 | 4535 |
openSettingsDialog |
4536 |
|settingsList settingsApp| |
|
4537 |
||
10205 | 4538 |
settingsList := |
4539 |
#( |
|
4540 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
4541 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
4542 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
4543 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
4544 |
). |
|
8620 | 4545 |
|
4546 |
settingsApp := SettingsDialog new. |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4547 |
"/ settingsApp requestor:self. |
8620 | 4548 |
settingsApp installSettingsEntries:settingsList. |
4549 |
settingsApp allButOpen. |
|
4550 |
settingsApp window label:('Debugger Settings'). |
|
4551 |
settingsApp openWindow. |
|
4552 |
! |
|
4553 |
||
266 | 4554 |
quickTerminate |
4555 |
"quick terminate - the process will get no chance for cleanup actions" |
|
4556 |
||
4557 |
inspecting ifTrue:[ |
|
10205 | 4558 |
self processPerform:#terminateNoSignal. |
4559 |
^ self |
|
266 | 4560 |
]. |
4561 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4562 |
steppedContext := wrapperContext := nil. |
266 | 4563 |
haveControl := false. |
4564 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4565 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4566 |
"exit private event-loop" |
6365 | 4567 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4568 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4569 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4570 |
inspecting ifFalse:[ |
10205 | 4571 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
4572 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
4573 |
Debugger newDebugger. |
|
4574 |
Processor activeProcess terminateNoSignal. |
|
4575 |
] |
|
266 | 4576 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4577 |
terminateButton turnOff. |
477 | 4578 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4579 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 4580 |
! |
4581 |
||
4582 |
removeAllBreakpoints |
|
4583 |
"remove all trace & breakpoints - if any" |
|
4584 |
||
1327 | 4585 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
10205 | 4586 |
self withExecuteCursorDo:[ |
4587 |
MessageTracer unwrapAllMethods |
|
4588 |
] |
|
1319 | 4589 |
] |
1327 | 4590 |
|
1661 | 4591 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
266 | 4592 |
! |
4593 |
||
4594 |
removeBreakpoint |
|
4595 |
"remove breakpoint on the selected contexts method - if any" |
|
4596 |
||
4597 |
|implementorClass method| |
|
4598 |
||
4599 |
selectedContext isNil ifTrue:[ |
|
10205 | 4600 |
^ self showError:'** select a context first **' |
266 | 4601 |
]. |
1327 | 4602 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
10205 | 4603 |
^ self |
4604 |
]. |
|
4605 |
||
4606 |
implementorClass := selectedContext methodClass. |
|
266 | 4607 |
implementorClass notNil ifTrue:[ |
10205 | 4608 |
method := implementorClass compiledMethodAt:selectedContext selector. |
4609 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
4610 |
method clearBreakPoint |
|
4611 |
] |
|
266 | 4612 |
]. |
4613 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
3511 | 4614 |
contextView middleButtonMenu enable:#addBreakpoint. |
1327 | 4615 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4616 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
266 | 4617 |
! |
4618 |
||
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4619 |
selectedContextIsWrapped |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4620 |
|con mthd| |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4621 |
|
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4622 |
contextView selection notNil ifTrue:[ |
10205 | 4623 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
4624 |
con := contextArray at:(contextView selection). |
|
4625 |
mthd := con methodHome method. |
|
4626 |
^ mthd notNil and:[mthd isWrapped] |
|
4627 |
] |
|
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4628 |
]. |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4629 |
^ false. |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4630 |
! |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4631 |
|
3447 | 4632 |
showDenseWalkback |
3427 | 4633 |
|m| |
4634 |
||
4635 |
m := contextView middleButtonMenu. |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4636 |
verboseBacktrace := false. |
3694 | 4637 |
m labelAt:#showDenseWalkback put:(resources string:'Show Verbose WalkBack'). |
3447 | 4638 |
m selectorAt:#showDenseWalkback put:#showVerboseWalkback. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4639 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4640 |
|
3447 | 4641 |
"Created: / 17.11.2001 / 20:08:08 / cg" |
4642 |
"Modified: / 17.11.2001 / 22:39:48 / cg" |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4643 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4644 |
|
266 | 4645 |
showMore |
3447 | 4646 |
"double the number of contexts shown" |
266 | 4647 |
|
4648 |
contextArray notNil ifTrue:[ |
|
10205 | 4649 |
nChainShown := nChainShown * 2. |
4650 |
self redisplayBacktrace. |
|
266 | 4651 |
] |
563 | 4652 |
|
3447 | 4653 |
"Modified: / 17.11.2001 / 20:14:31 / cg" |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4654 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4655 |
|
3447 | 4656 |
showVerboseWalkback |
4657 |
|m| |
|
4658 |
||
4659 |
verboseBacktrace := true. |
|
4660 |
m := contextView middleButtonMenu. |
|
3694 | 4661 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
3447 | 4662 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback. |
4663 |
||
4664 |
self redisplayBacktrace. |
|
4665 |
||
4666 |
"Created: / 17.11.2001 / 20:07:57 / cg" |
|
4667 |
"Modified: / 17.11.2001 / 22:39:41 / cg" |
|
4668 |
! |
|
4669 |
||
4670 |
showingDenseWalkback |
|
4671 |
^ verboseBacktrace == false. |
|
4672 |
||
4673 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
4674 |
! |
|
4675 |
||
4676 |
showingVerboseWalkback |
|
4677 |
^ verboseBacktrace == true. |
|
4678 |
||
4679 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
4680 |
! |
|
4681 |
||
9626 | 4682 |
sizeChanged:how |
10205 | 4683 |
super sizeChanged:how. |
9626 | 4684 |
LastExtent := self extent. |
4685 |
||
4686 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
4687 |
! |
|
4688 |
||
266 | 4689 |
skip |
4690 |
"skip for cursor line in selected method" |
|
4691 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4692 |
stepHow := #skip. |
266 | 4693 |
self doStep:codeView cursorLine. |
790 | 4694 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4695 |
"Modified: 3.3.1997 / 20:56:23 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4696 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4697 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4698 |
skipForReturn |
2581 | 4699 |
"skip until the selected context is left." |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4700 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4701 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4702 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4703 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4704 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 4705 |
! |
4706 |
||
4707 |
skipUntilEntering |
|
4708 |
"skip until some particular method is invoked." |
|
4709 |
||
4710 |
|selector| |
|
4711 |
||
10205 | 4712 |
selector := Dialog |
4713 |
request:'Skip until entering what (matchpattern):' |
|
4714 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 4715 |
selector size == 0 ifTrue:[^ self]. |
4716 |
||
4717 |
stepUntilEntering := selector asSymbol. |
|
4718 |
stepHow := #send. |
|
4719 |
self doStep:-1. |
|
4720 |
||
4721 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 4722 |
! |
4723 |
||
8170 | 4724 |
stopIgnoringHalts |
8179 | 4725 |
self class stopIgnoringHalts |
8170 | 4726 |
! |
4727 |
||
3447 | 4728 |
toggleVerboseWalkback |
4729 |
verboseBacktrace ifFalse:[ |
|
10205 | 4730 |
self showVerboseWalkback |
3447 | 4731 |
] ifTrue:[ |
10205 | 4732 |
self showDenseWalkback |
3447 | 4733 |
]. |
4734 |
||
4735 |
"Modified: / 17.11.2001 / 20:07:45 / cg" |
|
266 | 4736 |
! ! |
4737 |
||
4738 |
!DebugView methodsFor:'private'! |
|
4739 |
||
6487 | 4740 |
abortAllIsHandled |
9750 | 4741 |
^ AbortAllOperationWantedQuery query |
4742 |
||
4743 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 4744 |
! |
4745 |
||
266 | 4746 |
busy |
4747 |
^ busy |
|
4748 |
! |
|
4749 |
||
3269 | 4750 |
canBrowseClassHierarchy |
4751 |
|m| |
|
4752 |
||
4753 |
m := contextView middleButtonMenu. |
|
4754 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
|
4755 |
! |
|
4756 |
||
4757 |
canBrowseFullClassProtocol |
|
4758 |
|m| |
|
4759 |
||
4760 |
m := contextView middleButtonMenu. |
|
4761 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
|
4762 |
! |
|
4763 |
||
4764 |
canBrowseImplementingClass |
|
4765 |
|m| |
|
4766 |
||
4767 |
m := contextView middleButtonMenu. |
|
4768 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
|
4769 |
! |
|
4770 |
||
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4771 |
canBrowseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4772 |
|p| |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4773 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4774 |
p := inspectedProcess ? Processor activeProcess. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4775 |
p isNil ifTrue:[^ false]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4776 |
^ p isGUIProcess |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4777 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4778 |
|
3269 | 4779 |
canBrowseReceiversClass |
4780 |
|m| |
|
4781 |
||
4782 |
m := contextView middleButtonMenu. |
|
4783 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
|
4784 |
! |
|
4785 |
||
4786 |
canDefineMethod |
|
4787 |
^ defineButton isVisible |
|
4788 |
! |
|
4789 |
||
3447 | 4790 |
canRestart |
4791 |
^ restartButton isEnabled |
|
4792 |
||
4793 |
"Modified: / 17.11.2001 / 19:59:49 / cg" |
|
4794 |
! |
|
4795 |
||
4796 |
canReturn |
|
4797 |
^ returnButton isEnabled |
|
4798 |
||
4799 |
"Modified: / 17.11.2001 / 19:59:18 / cg" |
|
4800 |
! |
|
4801 |
||
9583 | 4802 |
canSendEmail |
4803 |
^ SendMailTool notNil |
|
4804 |
||
4805 |
"Created: / 15-10-2010 / 11:51:23 / cg" |
|
4806 |
! |
|
4807 |
||
3269 | 4808 |
canShowMore |
4809 |
^ canShowMore |
|
4810 |
! |
|
4811 |
||
7797 | 4812 |
contextListEntryFor:aContext |
4813 |
|s| |
|
4814 |
||
4815 |
aContext selector == #doIt ifTrue:[ |
|
10205 | 4816 |
aContext receiver isNil ifTrue:[ |
4817 |
^ 'doIt' allBold |
|
4818 |
] |
|
7797 | 4819 |
]. |
4820 |
||
4821 |
s := Text new writeStream. |
|
4822 |
aContext printOn:s. |
|
4823 |
^ s contents |
|
4824 |
||
4825 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
4826 |
! |
|
4827 |
||
266 | 4828 |
exclusive:aBoolean |
4829 |
exclusive := aBoolean |
|
4830 |
! |
|
4831 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4832 |
explainSelection |
8212 | 4833 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4834 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4835 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4836 |
interval isEmpty ifTrue:[ |
10205 | 4837 |
crsrPos := codeView characterPositionOfCursor. |
4838 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
4839 |
crsrPos := (crsrPos - 1) max:1 |
|
4840 |
]. |
|
4841 |
interval := crsrPos to:crsrPos. |
|
4842 |
]. |
|
4843 |
self |
|
4844 |
withNodeValueAtInterval:interval |
|
4845 |
do:[:value :description | |
|
4846 |
self showValue:value |
|
4847 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4848 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4849 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4850 |
findNodeForInterval:interval |
8212 | 4851 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4852 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4853 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4854 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
4855 |
source := codeView contentsAsString string. |
10205 | 4856 |
"/ source := currentMethod notNil |
4857 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 4858 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
4859 |
source isNil ifTrue:[^ nil]. |
8214 | 4860 |
|
8212 | 4861 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
4862 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4863 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4864 |
|
7912 | 4865 |
findNodeIn:tree forInterval:interval |
4866 |
<resource: #obsolete> |
|
10205 | 4867 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4868 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4869 |
|
7912 | 4870 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4871 |
node := nil. |
10205 | 4872 |
tree nodesDo:[:each | |
4873 |
(each intersectsInterval:interval) ifTrue:[ |
|
4874 |
(node isNil or:[node == each parent]) ifTrue:[ |
|
4875 |
node := each |
|
4876 |
] ifFalse:[ |
|
4877 |
(node parent notNil |
|
4878 |
and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
4879 |
] |
|
4880 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4881 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4882 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4883 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4884 |
|
2581 | 4885 |
goodSkipUntilSelector |
4886 |
|current| |
|
4887 |
||
4888 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
4889 |
selectedContext isNil ifTrue:[^ nil]. |
|
4890 |
current := selectedContext selector. |
|
4891 |
current isNil ifTrue:[^ nil]. |
|
4892 |
('change:*' match:current) ifTrue:[ |
|
10205 | 4893 |
^ 'update:*' |
2581 | 4894 |
]. |
4895 |
^ nil |
|
4896 |
! |
|
4897 |
||
8179 | 4898 |
haltSelectors |
4899 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:'). |
|
4900 |
! |
|
4901 |
||
3447 | 4902 |
hasContextSelected |
4903 |
^ contextView hasSelection |
|
4904 |
||
4905 |
"Created: / 17.11.2001 / 19:57:03 / cg" |
|
4906 |
! |
|
4907 |
||
10205 | 4908 |
inspectedProcess |
4909 |
^ inspectedProcess |
|
266 | 4910 |
! |
4911 |
||
4912 |
interruptProcessWith:aBlock |
|
4913 |
"let inspected process do something, then update the context list" |
|
4914 |
||
4915 |
inspectedProcess isDead ifTrue:[ |
|
10205 | 4916 |
self showTerminated. |
4917 |
^ self |
|
266 | 4918 |
]. |
4919 |
inspectedProcess interruptWith:aBlock. |
|
4920 |
" |
|
4921 |
give the process a chance to run, then update |
|
4922 |
" |
|
4923 |
(Delay forSeconds:0.2) wait. |
|
4924 |
self setContext:(inspectedProcess suspendedContext). |
|
4925 |
! |
|
4926 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4927 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4928 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4929 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4930 |
|
8194 | 4931 |
openHTMLDocument: anHTMLFilename |
4932 |
"open a HTMLDocumentView on anHTMLFilename" |
|
4933 |
||
4934 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
4935 |
! |
|
4936 |
||
266 | 4937 |
processPerform:aMessage |
4938 |
"do something, then update the context list" |
|
4939 |
||
4940 |
inspectedProcess isDead ifTrue:[ |
|
10205 | 4941 |
self showTerminated. |
4942 |
^ self |
|
266 | 4943 |
]. |
4944 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4945 |
|
266 | 4946 |
" |
4947 |
give the process a chance to run, then update |
|
4948 |
" |
|
4949 |
(Delay forSeconds:0.2) wait. |
|
4950 |
self setContext:(inspectedProcess suspendedContext). |
|
4951 |
! |
|
4952 |
||
939 | 4953 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4954 |
"force redisplay of the walkBack list; invoked when the |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4955 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4956 |
|
939 | 4957 |
|oldSelection oldContext con idx| |
4958 |
||
4959 |
contextArray notNil ifTrue:[ |
|
10205 | 4960 |
self withExecuteCursorDo:[ |
4961 |
oldSelection := contextView selection. |
|
4962 |
oldSelection notNil ifTrue:[ |
|
4963 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
4964 |
]. |
|
4965 |
||
4966 |
con := firstContext. |
|
950 | 4967 |
"/ con := contextArray at:1. |
10205 | 4968 |
"/ force redeisplay, even if same by changing the first entry |
4969 |
contextArray size > 0 ifTrue:[ |
|
4970 |
contextArray at:1 put:nil. |
|
4971 |
]. |
|
4972 |
self setContext:con. |
|
4973 |
||
4974 |
oldContext isNil ifTrue:[ |
|
4975 |
idx := oldSelection |
|
4976 |
] ifFalse:[ |
|
4977 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
4978 |
]. |
|
4979 |
contextView setSelection:idx. |
|
4980 |
idx notNil ifTrue:[ |
|
4981 |
self showSelection:idx |
|
4982 |
] |
|
4983 |
] |
|
939 | 4984 |
] |
4985 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4986 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 4987 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 4988 |
! |
4989 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4990 |
selectedInterval |
7912 | 4991 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4992 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4993 |
|
7823 | 4994 |
showError:message |
4995 |
codeView contents:(resources string:message). |
|
4996 |
shown ifTrue:[ |
|
10205 | 4997 |
exclusive ifTrue:[ |
4998 |
"/ consider this a kludge: |
|
4999 |
"/ if exclusive, cannot use flash, since it suspends |
|
5000 |
"/ (but we cannot suspend here ...) |
|
5001 |
codeView redrawInverted. device flush. |
|
5002 |
OperatingSystem millisecondDelay:200. |
|
5003 |
codeView redraw |
|
5004 |
] ifFalse:[ |
|
5005 |
codeView flash |
|
5006 |
] |
|
7823 | 5007 |
] |
5008 |
||
5009 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
5010 |
! |
|
5011 |
||
5012 |
showTerminated |
|
5013 |
self showError:'** the process has terminated **' |
|
5014 |
! |
|
5015 |
||
5016 |
showValue:aValue |
|
5017 |
"/ TODO: show value in info field |
|
5018 |
"/ Transcript showCR:aValue printString |
|
5019 |
! |
|
5020 |
||
10205 | 5021 |
stepping |
5022 |
^ stepping |
|
5023 |
! |
|
5024 |
||
5025 |
unstep |
|
7823 | 5026 |
stepping := false. |
5027 |
bigStep := false. |
|
5028 |
steppedContext := wrapperContext := nil. |
|
5029 |
exitAction := nil |
|
5030 |
||
5031 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
5032 |
! |
|
5033 |
||
10203 | 5034 |
updateButtonsAndMenuItemsForContext:aContext |
5035 |
|m| |
|
5036 |
||
5037 |
m := contextView middleButtonMenu. |
|
5038 |
m notNil ifTrue:[ |
|
10205 | 5039 |
self updateMenuItems. |
5040 |
||
5041 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
5042 |
abortButton enable. |
|
5043 |
m enable:#doAbort. |
|
5044 |
] ifFalse:[ |
|
5045 |
abortButton disable. |
|
5046 |
m disable:#doAbort. |
|
5047 |
]. |
|
5048 |
exclusive ifTrue:[ |
|
5049 |
terminateButton disable. |
|
5050 |
m disable:#doTerminate. |
|
5051 |
] ifFalse:[ |
|
5052 |
terminateButton enable. |
|
5053 |
m enable:#doTerminate. |
|
5054 |
]. |
|
10203 | 5055 |
]. |
5056 |
||
5057 |
mayProceed == false ifTrue:[ |
|
10205 | 5058 |
continueButton disable. |
5059 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 5060 |
] ifFalse:[ |
10205 | 5061 |
continueButton enable. |
5062 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 5063 |
]. |
5064 |
||
5065 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
|
5066 |
! |
|
5067 |
||
7823 | 5068 |
updateContext |
5069 |
|oldContext idx| |
|
5070 |
||
5071 |
inspectedProcess state == #dead ifTrue:[ |
|
10205 | 5072 |
self showTerminated. |
5073 |
^ self |
|
7823 | 5074 |
]. |
5075 |
||
5076 |
oldContext := selectedContext. |
|
5077 |
[ |
|
10205 | 5078 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
5079 |
oldContext notNil ifTrue:[ |
|
5080 |
contextArray notNil ifTrue:[ |
|
5081 |
idx := contextArray identityIndexOf:oldContext. |
|
5082 |
idx ~~ 0 ifTrue:[ |
|
5083 |
self showSelection:idx |
|
5084 |
] ifFalse:[ |
|
5085 |
codeView contents:('** context returned **') |
|
5086 |
] |
|
5087 |
] |
|
5088 |
] |
|
5089 |
]. |
|
7823 | 5090 |
] valueUninterruptably. |
5091 |
||
5092 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 5093 |
! |
5094 |
||
10203 | 5095 |
updateMenuItems |
5096 |
|m mthd cls mCls rCls| |
|
5097 |
||
5098 |
" |
|
5099 |
enable/disable some menu items |
|
5100 |
" |
|
5101 |
m := contextView middleButtonMenu. |
|
5102 |
m notNil ifTrue:[ |
|
10205 | 5103 |
m disable:#removeBreakpoint. |
5104 |
m disable:#addBreakpoint. |
|
5105 |
canShowMore ifFalse:[ |
|
5106 |
m disable:#showMore |
|
5107 |
]. |
|
5108 |
||
5109 |
selectedContext notNil ifTrue:[ |
|
5110 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
5111 |
||
5112 |
mthd := selectedContext method. |
|
5113 |
mthd notNil ifTrue:[ |
|
5114 |
cls := mCls := mthd containingClass. |
|
5115 |
mthd isBreakpointed ifTrue:[ |
|
5116 |
m enable:#removeBreakpoint. |
|
5117 |
] ifFalse:[ |
|
5118 |
m enable:#addBreakpoint. |
|
5119 |
] |
|
5120 |
]. |
|
5121 |
rCls := selectedContext receiver class. |
|
5122 |
cls isNil ifTrue:[ |
|
5123 |
cls := rCls |
|
5124 |
]. |
|
5125 |
cls notNil ifTrue:[ |
|
5126 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5127 |
rCls == mCls ifTrue:[ |
|
5128 |
m disable:#browseReceiversClass |
|
5129 |
]. |
|
5130 |
mCls isNil ifTrue:[ |
|
5131 |
m disable:#browseImplementingClass |
|
5132 |
] |
|
5133 |
||
5134 |
] ifFalse:[ |
|
5135 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5136 |
]. |
|
5137 |
] ifFalse:[ |
|
5138 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5139 |
] |
|
10203 | 5140 |
] |
5141 |
! |
|
5142 |
||
8212 | 5143 |
withNodeValueAtInterval:interval do:aBlock |
9294
e19553d7e864
changed: #withNodeValueAtInterval:do:
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
5144 |
|node definingNode nm nmBold varIdx parentNode receiver con receiversNonMetaClass| |
8212 | 5145 |
|
5146 |
"/interval printCR. |
|
10205 | 5147 |
Error |
5148 |
handle:[:ex | ] |
|
5149 |
do:[ |
|
5150 |
[ |
|
5151 |
node := self findNodeForInterval:interval |
|
5152 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
5153 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
5154 |
|
8212 | 5155 |
node isNil ifTrue:[ ^ self ]. |
10205 | 5156 |
node isVariable ifFalse:[ |
5157 |
"/ Transcript showCR:node. |
|
5158 |
^ self |
|
8592 | 5159 |
]. |
8212 | 5160 |
|
5161 |
nm := node name. |
|
8214 | 5162 |
nmBold := nm allBold. |
8600 | 5163 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 5164 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 5165 |
receiver := actualContext methodHome receiver. |
8212 | 5166 |
|
5167 |
(nm = 'self') ifTrue:[ |
|
10205 | 5168 |
aBlock value:receiver value:'receiver' allBold. |
5169 |
^ self |
|
8212 | 5170 |
]. |
5171 |
(nm = 'super') ifTrue:[ |
|
10205 | 5172 |
aBlock value:receiver value:'receiver' allBold. |
5173 |
^ self |
|
8212 | 5174 |
]. |
5175 |
(nm = 'thisContext') ifTrue:[ |
|
10205 | 5176 |
aBlock value:actualContext value:'context' allBold. |
5177 |
^ self |
|
8212 | 5178 |
]. |
5179 |
||
5180 |
definingNode := node whoDefines:nm. |
|
5181 |
definingNode isNil ifTrue:[ |
|
10205 | 5182 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 5183 |
"/aBlock value:'xIII' value:'instVar'. |
10205 | 5184 |
receiver class isMetaclass ifTrue:[ |
5185 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
5186 |
] ifFalse:[ |
|
5187 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
5188 |
]. |
|
5189 |
^ self |
|
5190 |
]. |
|
5191 |
||
5192 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
5193 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
5194 |
aBlock value:'' value:'private class ',nmBold. |
|
5195 |
^ self |
|
5196 |
]. |
|
5197 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
5198 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
5199 |
^ self |
|
5200 |
]. |
|
5201 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
5202 |
|pool| |
|
5203 |
||
5204 |
pool := Smalltalk at:eachPoolName. |
|
5205 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
5206 |
(pool classVarNames includes:nm) ifTrue:[ |
|
5207 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
5208 |
^ self |
|
5209 |
]. |
|
5210 |
]. |
|
5211 |
(Smalltalk includesKey:nm asSymbol) ifTrue:[ |
|
5212 |
(Smalltalk at:nm asSymbol) isClass ifTrue:[ |
|
5213 |
aBlock value:'class: ',nmBold value:nil. |
|
5214 |
] ifFalse:[ |
|
5215 |
aBlock value:(Smalltalk at:nm asSymbol) value:'global ',nmBold. |
|
5216 |
]. |
|
5217 |
^ self |
|
5218 |
]. |
|
5219 |
aBlock value:'' value:'unknown'. |
|
5220 |
^ self |
|
8212 | 5221 |
]. |
5222 |
"/definingNode printCR. |
|
5223 |
||
5224 |
definingNode isMethod ifTrue:[ |
|
10205 | 5225 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
5226 |
varIdx ~~ 0 ifTrue:[ |
|
5227 |
Error |
|
5228 |
handle:[:ex | ] |
|
5229 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
5230 |
^ self |
|
5231 |
]. |
|
5232 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
5233 |
varIdx ~~ 0 ifTrue:[ |
|
5234 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
5235 |
Error |
|
5236 |
handle:[:ex | ] |
|
5237 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
5238 |
^ self |
|
5239 |
] |
|
5240 |
]. |
|
8212 | 5241 |
]. |
5242 |
||
5243 |
definingNode isBlock ifTrue:[ |
|
10205 | 5244 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
5245 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
5246 |
varIdx ~~ 0 ifTrue:[ |
|
5247 |
"/ am I in this block ? |
|
5248 |
(actualContext lineNumber notNil |
|
5249 |
and:[ definingNode lastLineNumber notNil |
|
5250 |
and:[ (actualContext lineNumber |
|
5251 |
between:definingNode firstLineNumber |
|
5252 |
and:definingNode lastLineNumber) |
|
5253 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
5254 |
ifTrue:[ |
|
5255 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
5256 |
^ self |
|
5257 |
]. |
|
8214 | 5258 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
10205 | 5259 |
^ self |
5260 |
] |
|
5261 |
]. |
|
8212 | 5262 |
]. |
5263 |
||
5264 |
parentNode := definingNode parent. |
|
5265 |
||
5266 |
[parentNode notNil] whileTrue:[ |
|
5267 |
"/'isMethod ' print. parentNode isMethod printCR. |
|
10205 | 5268 |
parentNode isMethod ifTrue:[ |
5269 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
5270 |
varIdx ~~ 0 ifTrue:[ |
|
5271 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
5272 |
Error |
|
5273 |
handle:[:ex | ] |
|
5274 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
5275 |
^ self |
|
5276 |
] |
|
5277 |
]. |
|
5278 |
]. |
|
8212 | 5279 |
"/'isBlock ' print. parentNode isBlock printCR. |
10205 | 5280 |
parentNode isBlock ifTrue:[ |
5281 |
"/ we dont have any information on the inlineability |
|
5282 |
"/ of this block here (RBParser does not know what |
|
5283 |
"/ the compiler does. |
|
5284 |
"/ therefore, it is questionable if we can use the |
|
5285 |
"/ contexts home context here. |
|
5286 |
"/ am I in this block ? |
|
5287 |
con := actualContext. |
|
5288 |
[con notNil |
|
5289 |
and:[ parentNode lastLineNumber notNil |
|
5290 |
and:[ con lineNumber notNil |
|
5291 |
and:[ con lineNumber |
|
5292 |
between:parentNode firstLineNumber |
|
5293 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
5294 |
con := con sender. |
|
5295 |
]. |
|
5296 |
con notNil ifTrue:[ |
|
5297 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
5298 |
varIdx ~~ 0 ifTrue:[ |
|
5299 |
Error |
|
5300 |
handle:[:ex | ] |
|
5301 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
5302 |
^ self |
|
5303 |
]. |
|
5304 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
5305 |
varIdx ~~ 0 ifTrue:[ |
|
5306 |
Error |
|
5307 |
handle:[:ex | ] |
|
5308 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
5309 |
^ self |
|
5310 |
]. |
|
5311 |
]. |
|
5312 |
]. |
|
5313 |
parentNode := parentNode parent. |
|
8212 | 5314 |
]. |
8214 | 5315 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 5316 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
5317 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 5318 |
! ! |
5319 |
||
5320 |
!DebugView methodsFor:'private queries'! |
|
5321 |
||
5322 |
isAborting |
|
5323 |
^ exitAction == #abort |
|
5324 |
! |
|
5325 |
||
5326 |
setOfHiddenCallingSelectors |
|
5327 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
5328 |
! |
|
5329 |
||
5330 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
5331 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
5332 |
! ! |
|
5333 |
||
9922 | 5334 |
!DebugView methodsFor:'private-breakpoints'! |
5335 |
||
5336 |
addIgnoredHaltForCount:countOrNil orTimeDuration:dTOrNil forAll:aBoolean |
|
5337 |
|haltingContext haltingMethod lineNrOfHalt| |
|
5338 |
||
5339 |
aBoolean ifTrue:[ |
|
10205 | 5340 |
haltingMethod := #all |
9922 | 5341 |
] ifFalse:[ |
10205 | 5342 |
haltingContext := self findHaltingContext. |
5343 |
haltingContext isNil ifTrue:[ Transcript showCR:'no halting context found'. ^ self ]. |
|
5344 |
||
5345 |
haltingMethod := haltingContext method. |
|
5346 |
lineNrOfHalt := haltingContext lineNumber. |
|
9922 | 5347 |
]. |
5348 |
||
5349 |
self class |
|
10205 | 5350 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
5351 |
forCount:countOrNil orTimeDuration:dTOrNil |
|
9922 | 5352 |
|
5353 |
"Created: / 08-05-2011 / 10:20:31 / cg" |
|
5354 |
! |
|
5355 |
||
5356 |
canAddBreakpoint |
|
5357 |
|m| |
|
5358 |
||
5359 |
m := contextView middleButtonMenu. |
|
5360 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
5361 |
! |
|
5362 |
||
5363 |
canRemoveBreakpoint |
|
5364 |
|m| |
|
5365 |
||
5366 |
m := contextView middleButtonMenu. |
|
5367 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
5368 |
! |
|
5369 |
||
5370 |
findHaltingContext |
|
5371 |
|haltSelectors| |
|
5372 |
||
5373 |
haltSelectors := self haltSelectors. |
|
5374 |
||
10205 | 5375 |
contextArray keysAndValuesDo:[:idx :con | |
5376 |
|sel con2 sel2| |
|
5377 |
||
5378 |
sel := con selector. |
|
5379 |
(haltSelectors includes:sel) ifTrue:[ |
|
5380 |
con method mclass == Object ifTrue:[ |
|
5381 |
con2 := contextArray at:idx+1. |
|
5382 |
sel2 := con2 selector. |
|
5383 |
(haltSelectors includes:sel2) ifTrue:[ |
|
5384 |
con2 method mclass == Object ifTrue:[ |
|
5385 |
^ contextArray at:idx+2. |
|
5386 |
] |
|
5387 |
]. |
|
5388 |
^ contextArray at:idx+1 |
|
5389 |
]. |
|
5390 |
]. |
|
5391 |
con method isWrapped ifTrue:[ |
|
5392 |
^ con |
|
5393 |
]. |
|
9922 | 5394 |
]. |
5395 |
^ nil |
|
5396 |
||
5397 |
"Modified: / 20-10-2010 / 10:18:02 / cg" |
|
5398 |
! |
|
5399 |
||
5400 |
ignoreBreakpoints |
|
5401 |
^ ignoreBreakpoints |
|
5402 |
||
5403 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
5404 |
! ! |
|
5405 |
||
7823 | 5406 |
!DebugView methodsFor:'private-cache handling'! |
5407 |
||
5408 |
cacheMyself |
|
5409 |
"remember myself for next debug session" |
|
5410 |
||
5411 |
"caching the last debugger will make the next debugger appear |
|
5412 |
faster, since no resources have to be allocated in the display. |
|
5413 |
We have to be careful to release all refs to the debuggee, though. |
|
5414 |
Otherwise, the GC will not be able to release it." |
|
5415 |
||
5416 |
windowGroup notNil ifTrue:[ |
|
10205 | 5417 |
windowGroup setProcess:nil. |
7823 | 5418 |
]. |
5419 |
||
5420 |
self releaseDebuggee. |
|
5421 |
||
5422 |
cachable ~~ true ifTrue:[^ self]. |
|
5423 |
||
5424 |
"/ |
|
5425 |
"/ only cache if I am on the Display |
|
5426 |
"/ |
|
5427 |
device == Display ifTrue:[ |
|
10205 | 5428 |
exclusive ifTrue:[ |
5429 |
CachedExclusive := self |
|
5430 |
] ifFalse:[ |
|
5431 |
CachedDebugger := self |
|
5432 |
]. |
|
7823 | 5433 |
]. |
5434 |
||
5435 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
10205 | 5436 |
ObjectMemory stepInterruptHandler:nil |
7823 | 5437 |
]. |
5438 |
||
5439 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
5440 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
5441 |
! |
|
5442 |
||
5443 |
isCached |
|
5444 |
"tell wether we are a cached debugger" |
|
5445 |
||
5446 |
CachedExclusive == self ifTrue:[ |
|
10205 | 5447 |
^ true. |
7823 | 5448 |
]. |
5449 |
CachedDebugger == self ifTrue:[ |
|
10205 | 5450 |
^ true. |
7823 | 5451 |
]. |
5452 |
||
5453 |
^ false. |
|
5454 |
||
5455 |
"Created: 10.7.1997 / 15:22:43 / stefan" |
|
5456 |
! |
|
5457 |
||
5458 |
releaseDebuggee |
|
5459 |
"We have to be careful to release all refs to the debuggee, |
|
5460 |
because we may be in the cache. |
|
5461 |
Otherwise, the GC will not be able to release it" |
|
5462 |
||
5463 |
busy := false. |
|
5464 |
||
5465 |
codeView acceptAction:nil. |
|
5466 |
codeView doItAction:nil. |
|
5467 |
codeView contents:nil. |
|
5468 |
||
5469 |
receiverInspector release. |
|
5470 |
contextInspector release. |
|
5471 |
inspectedProcess := nil. |
|
5472 |
contextArray := nil. |
|
5473 |
selectedContext := actualContext := firstContext := nil. |
|
5474 |
steppedContext := wrapperContext := nil. |
|
5475 |
catchBlock := nil. |
|
5476 |
grabber := nil. |
|
5477 |
self autoUpdateOff. |
|
5478 |
||
5479 |
"Created: / 10.7.1997 / 14:57:51 / stefan" |
|
5480 |
"Modified: / 10.7.1997 / 15:50:38 / stefan" |
|
5481 |
"Modified: / 17.11.2001 / 22:58:17 / cg" |
|
5482 |
! |
|
5483 |
||
5484 |
uncacheMyself |
|
5485 |
"do not remember myself any longer for next debug session" |
|
5486 |
||
5487 |
cachable := false. |
|
5488 |
||
5489 |
CachedExclusive == self ifTrue:[ |
|
10205 | 5490 |
CachedExclusive := nil. |
7823 | 5491 |
]. |
5492 |
CachedDebugger == self ifTrue:[ |
|
10205 | 5493 |
CachedDebugger := nil. |
7823 | 5494 |
]. |
5495 |
OpenDebuggers notNil ifTrue:[ |
|
10205 | 5496 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 5497 |
]. |
5498 |
||
5499 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
5500 |
! ! |
|
5501 |
||
5502 |
!DebugView methodsFor:'private-context handling'! |
|
5503 |
||
266 | 5504 |
setContext:aContext |
5505 |
"show calling chain from aContext in the walk-back listview" |
|
5506 |
||
641 | 5507 |
^ self setContext:aContext releaseInspectors:true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5508 |
|
641 | 5509 |
"Modified: 27.6.1996 / 17:21:59 / cg" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5510 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5511 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5512 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5513 |
"show calling chain from aContext in the walk-back listview. |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5514 |
Most complications here arise from filtering less-interesting contexts |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5515 |
if not in verbose-context mode." |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5516 |
|
3702 | 5517 |
|con text method caller caller2 called called2 m count c cc |
3447 | 5518 |
suspendContext calledBySuspendContext nm h calledContext| |
266 | 5519 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5520 |
(contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
10205 | 5521 |
"no change" |
5522 |
^ false |
|
266 | 5523 |
]. |
5524 |
||
8170 | 5525 |
isStoppedAtHaltOrBreakPoint := false. |
939 | 5526 |
firstContext := aContext. |
5527 |
||
266 | 5528 |
m := contextView middleButtonMenu. |
5529 |
m notNil ifTrue:[ |
|
10205 | 5530 |
m disable:#showMore. |
266 | 5531 |
]. |
3269 | 5532 |
canShowMore := false. |
266 | 5533 |
|
5534 |
aContext isNil ifTrue:[ |
|
10205 | 5535 |
text := Array with:'** no context **'. |
5536 |
contextArray := nil. |
|
266 | 5537 |
] ifFalse:[ |
10205 | 5538 |
text := OrderedCollection new:nChainShown. |
5539 |
contextArray := OrderedCollection new:nChainShown. |
|
5540 |
con := aContext. |
|
5541 |
calledContext := nil. |
|
5542 |
||
5543 |
verboseBacktrace ~~ true ifTrue:[ |
|
5544 |
"/ with dense backtrace, hide the ProcessorScheduler |
|
5545 |
"/ contexts at the top; look for a Process>>suspend* |
|
5546 |
"/ context within the first 10 contexts |
|
5547 |
||
5548 |
suspendContext := nil. |
|
5549 |
c := con. |
|
5550 |
1 to:10 do:[:i | |
|
5551 |
|sel| |
|
5552 |
||
5553 |
c notNil ifTrue:[ |
|
5554 |
(sel := c selector) notNil ifTrue:[ |
|
5555 |
((sel isSymbol and:[sel startsWith:'suspend']) |
|
5556 |
and:[c receiver isMemberOf:Process]) ifTrue:[ |
|
5557 |
suspendContext := c. |
|
5558 |
calledBySuspendContext := cc. |
|
5559 |
]. |
|
5560 |
]. |
|
5561 |
cc := c. |
|
5562 |
c := c sender. |
|
5563 |
] |
|
5564 |
]. |
|
5565 |
suspendContext notNil ifTrue:[ |
|
5566 |
con := suspendContext. |
|
5567 |
calledContext := calledBySuspendContext. |
|
5568 |
suspendContext := nil |
|
5569 |
]. |
|
5570 |
]. |
|
5571 |
||
5572 |
con notNil ifTrue:[ |
|
5573 |
"/ hide the halt implementation |
|
5574 |
(self haltSelectors includes:con selector) ifTrue:[ |
|
5575 |
(con method notNil and:[con method mclass == Object]) ifTrue:[ |
|
5576 |
isStoppedAtHaltOrBreakPoint := true. |
|
5577 |
verboseBacktrace ~~ true ifTrue:[ |
|
5578 |
calledContext := con. |
|
5579 |
con := con sender. |
|
5580 |
] |
|
5581 |
]. |
|
5582 |
] |
|
5583 |
]. |
|
5584 |
" |
|
5585 |
get them all |
|
5586 |
" |
|
5587 |
count := 0. |
|
5588 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
|
5589 |
(self haltSelectors includes:con selector) ifTrue:[ |
|
5590 |
(con method notNil and:[con method mclass == Object]) ifTrue:[ |
|
5591 |
isStoppedAtHaltOrBreakPoint := true. |
|
5592 |
] |
|
5593 |
]. |
|
5594 |
||
5595 |
[ |
|
5596 |
DebuggingDebugger == true ifTrue:[ |
|
5597 |
'showingContext1: (' print. con print. |
|
5598 |
') --> ' print. (self showingContext1:con calling:calledContext) printCR. |
|
5599 |
]. |
|
5600 |
self showingContext1:con calling:calledContext |
|
5601 |
] whileFalse:[ |
|
5602 |
calledContext := con. |
|
5603 |
con := con sender. |
|
5604 |
]. |
|
5605 |
||
5606 |
DebuggingDebugger == true ifTrue:[ |
|
5607 |
'showingContext2: (' print. con print. |
|
5608 |
') --> ' print. (self showingContext2:con nesting:count) printCR. |
|
5609 |
]. |
|
5610 |
||
5611 |
(self showingContext2:con nesting:count) ifTrue:[ |
|
5612 |
"/ ignore it, if its in the same |
|
5613 |
"/ method as the previous context |
|
3447 | 5614 |
"/ (verboseBacktrace ~~ true |
10205 | 5615 |
"/ and:[count > 0 |
3447 | 5616 |
"/ and:[contextArray last method == con method |
10205 | 5617 |
"/ and:[(contextArray last isBlockContext not |
3447 | 5618 |
"/ & con isBlockContext not) not ]]]) ifTrue:[ |
5619 |
"/ "/ skip it, if its in the same method |
|
5620 |
"/ "/ as the called context. |
|
5621 |
"/ ] ifFalse:[ |
|
10205 | 5622 |
contextArray add:con. |
5623 |
||
5624 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
5625 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
5626 |
] ifFalse:[ |
|
5627 |
Error |
|
5628 |
handle:[:ex | nm := '???' ] |
|
5629 |
do:[ |
|
5630 |
nm := self contextListEntryFor:con. |
|
5631 |
]. |
|
5632 |
]. |
|
5633 |
text add:nm. |
|
5634 |
count := count + 1. |
|
3447 | 5635 |
"/ ]. |
10205 | 5636 |
]. |
5637 |
||
5638 |
"/ |
|
5639 |
"/ kludge: if its a wrapped method, then hide the wrap-call |
|
5640 |
"/ |
|
5641 |
method := con method. |
|
5642 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
5643 |
called := con. |
|
5644 |
caller := con sender. |
|
5645 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
|
5646 |
called2 := caller. |
|
5647 |
caller2 := caller sender. |
|
5648 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
|
5649 |
calledContext := called2. |
|
5650 |
con := caller2 |
|
5651 |
] |
|
5652 |
]. |
|
5653 |
caller := caller2 := nil |
|
5654 |
]. |
|
5655 |
||
5656 |
"/ with dense backtrace, skip the doIt methods context |
|
5657 |
"/ (its dummy anyway) and fake that contexts name |
|
5658 |
||
5659 |
verboseBacktrace ~~ true ifTrue:[ |
|
5660 |
(con isBlockContext |
|
5661 |
and:[(h := con home) == con sender |
|
5662 |
and:[h notNil |
|
5663 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
|
5664 |
and:[h method who isNil]]]]) ifTrue:[ |
|
5665 |
calledContext := con. |
|
5666 |
con := con sender. |
|
5667 |
text removeLast. |
|
5668 |
||
5669 |
text add:(self contextListEntryFor:con methodHome). |
|
5670 |
]. |
|
5671 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
|
5672 |
]. |
|
5673 |
||
5674 |
"/ with dense backtrace, dont show below the doIt |
|
5675 |
( verboseBacktrace ~~ true |
|
5676 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
|
5677 |
con := nil. |
|
5678 |
] ifFalse:[ |
|
5679 |
calledContext := con. |
|
5680 |
con := con sender |
|
5681 |
] |
|
5682 |
]. |
|
5683 |
||
5684 |
" |
|
5685 |
did we reach the end ? |
|
5686 |
" |
|
5687 |
(con isNil or:[con sender isNil]) ifTrue:[ |
|
5688 |
||
5689 |
"/ the very last one is the startup context |
|
5690 |
"/ (in main) - it has nil as receiver and nil as selector |
|
5691 |
||
5692 |
(contextArray notEmpty |
|
5693 |
and:[contextArray last selector isNil]) ifTrue:[ |
|
5694 |
contextArray removeLast. |
|
5695 |
text removeLast |
|
5696 |
]. |
|
5697 |
||
5698 |
verboseBacktrace ~~ true ifTrue:[ |
|
5699 |
"/ in dense mode, remove the process startup |
|
5700 |
"/ contexts (if any) |
|
5701 |
||
5702 |
(contextArray size > 0 |
|
5703 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
5704 |
con selector == #start ifTrue:[ |
|
5705 |
contextArray removeLast. |
|
5706 |
text removeLast. |
|
5707 |
||
5708 |
[contextArray size > 0 |
|
5709 |
and:[contextArray last methodHome == con]] whileTrue:[ |
|
5710 |
contextArray removeLast. |
|
5711 |
text removeLast. |
|
5712 |
] |
|
5713 |
] |
|
5714 |
] |
|
5715 |
] |
|
5716 |
] ifFalse:[ |
|
5717 |
m notNil ifTrue:[ |
|
5718 |
m enable:#showMore. |
|
5719 |
]. |
|
5720 |
canShowMore := true. |
|
5721 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
|
5722 |
]. |
|
266 | 5723 |
]. |
5724 |
||
5725 |
contextView setList:text. |
|
944 | 5726 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5727 |
releaseInspectors ifTrue:[ |
10205 | 5728 |
receiverInspector release. |
5729 |
contextInspector release. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5730 |
]. |
266 | 5731 |
|
5732 |
m notNil ifTrue:[ |
|
10205 | 5733 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 5734 |
]. |
3511 | 5735 |
self updateMenuItems. |
266 | 5736 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5737 |
|
7797 | 5738 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
5739 |
"Modified: / 21-05-2007 / 13:31:02 / cg" |
|
266 | 5740 |
! |
5741 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5742 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5743 |
"show calling chain from aContext in the walk-back listview. |
1213 | 5744 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5745 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5746 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5747 |
|
8152 | 5748 |
con := aContext. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5749 |
verboseBacktrace ifFalse:[ |
10205 | 5750 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
5751 |
con := con sender. |
|
5752 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
5753 |
con := con sender. |
|
5754 |
]. |
|
5755 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5756 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5757 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5758 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5759 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5760 |
"Modified: / 17.1.1998 / 12:43:19 / cg" |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5761 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5762 |
|
3447 | 5763 |
showingContext1:aContext calling:calledContext |
7823 | 5764 |
"return false, if this (top) context is to be skipped. |
10205 | 5765 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 5766 |
the set of methods which are suppressed is my (claus's) own choice." |
5767 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5768 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 5769 |
|
5770 |
verboseBacktrace == true ifTrue:[ ^true ]. |
|
5771 |
aContext isNil ifTrue:[ ^true ]. |
|
5772 |
||
5773 |
sel := aContext selector. |
|
5774 |
rec := aContext receiver. |
|
5775 |
mthd := aContext method. |
|
5776 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
5777 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5778 |
"/ to avoid firing/waiting the lazy or future |
10205 | 5779 |
recIsException := (rec isLazyValue not) and:[rec isException]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5780 |
aContext sender notNil ifTrue:[ |
10205 | 5781 |
senderRec := aContext sender receiver |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5782 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5783 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5784 |
DebuggingDebugger == true ifTrue:[ |
10205 | 5785 |
'showingContext1: (' print. aContext print. |
5786 |
') calling: (' print. calledContext print. |
|
5787 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5788 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5789 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5790 |
(#(doCallHandler: doRaise |
3447 | 5791 |
) includes:sel) |
10205 | 5792 |
ifTrue:[ |
5793 |
recIsException ifTrue:[ ^ false]. |
|
5794 |
]. |
|
3447 | 5795 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5796 |
(#(raise raiseRequest |
3447 | 5797 |
) includes:sel) |
10205 | 5798 |
ifTrue:[ |
5799 |
recIsException ifTrue:[ |
|
5800 |
(senderRec isLazyValue not |
|
5801 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
5802 |
]. |
|
5803 |
]. |
|
3447 | 5804 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5805 |
(#(doWhile: |
3447 | 5806 |
) includes:sel) |
10205 | 5807 |
ifTrue:[ |
5808 |
rec isBlock ifTrue:[ |
|
5809 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
5810 |
]. |
|
5811 |
]. |
|
3447 | 5812 |
|
8620 | 5813 |
calledContext notNil ifTrue:[ |
10205 | 5814 |
calledSel := calledContext selector. |
5815 |
calledRec := calledContext receiver. |
|
5816 |
||
5817 |
calledRec isBlock ifTrue:[ |
|
5818 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
5819 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
5820 |
]. |
|
5821 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
5822 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8620 | 5823 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5824 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5825 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5826 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5827 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5828 |
"/ |
10205 | 5829 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5830 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5831 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5832 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5833 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5834 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5835 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5836 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5837 |
"/ ]. |
8620 | 5838 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5839 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5840 |
(#(handleDo:) includes:sel) |
10205 | 5841 |
ifTrue:[ |
5842 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
5843 |
]. |
|
5844 |
(#( |
|
5845 |
withCursor:do: |
|
5846 |
withWaitCursorDo: |
|
3447 | 5847 |
) includes:sel) |
10205 | 5848 |
ifTrue:[ |
5849 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
5850 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
5851 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
5852 |
]. |
|
5853 |
||
5854 |
(#( |
|
5855 |
wait |
|
5856 |
waitWithTimeout: |
|
5857 |
waitWithTimeoutMs: |
|
3447 | 5858 |
) includes:sel) |
10205 | 5859 |
ifTrue:[ |
5860 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
5861 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
5862 |
]. |
|
3447 | 5863 |
|
5864 |
^ true |
|
5865 |
||
9662 | 5866 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
5867 |
"Modified: / 08-12-2010 / 18:21:02 / cg" |
|
3447 | 5868 |
! |
5869 |
||
5870 |
showingContext2:aContext nesting:nesting |
|
7823 | 5871 |
"return false, if this (intermediate) context is to be skipped. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5872 |
Here, we hide some well known methods, which are usually |
10205 | 5873 |
not too interesting; |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5874 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 5875 |
|
10205 | 5876 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5877 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5878 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5879 |
verboseBacktrace ifTrue:[^ true]. |
3447 | 5880 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5881 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5882 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5883 |
sel := aContext selector. |
939 | 5884 |
mClass := aContext methodClass. |
5885 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5886 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5887 |
sender notNil ifTrue:[ |
10205 | 5888 |
senderSelector := sender selector. |
5889 |
senderReceiver := sender receiver. |
|
5890 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5891 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5892 |
|
939 | 5893 |
sel == #withCursor:do: ifTrue:[ |
10205 | 5894 |
(mClass == WindowGroup) ifTrue:[^ false]. |
5895 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 5896 |
]. |
5897 |
(sel == #withExecuteCursorDo: |
|
5898 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
10205 | 5899 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 5900 |
]. |
5901 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
5902 |
(sel == #do: |
6600 | 5903 |
or:[sel == #from:to:do: |
6601 | 5904 |
or:[sel == #keysAndValuesDo: |
5905 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
10205 | 5906 |
mClass == Array ifTrue:[^ false]. |
5907 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
5908 |
mClass == Set ifTrue:[^ false]. |
|
5909 |
mClass == Dictionary ifTrue:[^ false]. |
|
5910 |
mClass == Interval ifTrue:[^ false]. |
|
5911 |
]. |
|
5912 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5913 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5914 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5915 |
or:[sel == #perform:with:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5916 |
or:[sel == #perform:with:with:with:with:]]]]) |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5917 |
ifTrue:[ |
10205 | 5918 |
nesting == 0 ifTrue:[^ true]. |
5919 |
mClass == Array ifTrue:[^ false]. |
|
5920 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5921 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5922 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5923 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5924 |
|
939 | 5925 |
(mClass == Object) ifTrue:[ |
10205 | 5926 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 5927 |
]. |
5928 |
||
5929 |
(mClass == Method) ifTrue:[ |
|
10205 | 5930 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 5931 |
]. |
5932 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5933 |
(mClass == SmallInteger) ifTrue:[ |
10205 | 5934 |
(sel == #to:do:) ifTrue:[^ false]. |
5935 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5936 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5937 |
|
939 | 5938 |
(mClass == Block) ifTrue:[ |
10205 | 5939 |
sel == #ensure: ifTrue:[^ false]. |
5940 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
5941 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
5942 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
5943 |
sel == #on:do: ifTrue:[^ false]. |
|
5944 |
||
5945 |
sel == #value ifTrue:[^ false]. |
|
5946 |
sel == #value: ifTrue:[^ false]. |
|
5947 |
sel == #value:value: ifTrue:[^ false]. |
|
5948 |
sel == #value:value:value: ifTrue:[^ false]. |
|
5949 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
5950 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
5951 |
sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5952 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5953 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5954 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5955 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5956 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5957 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5958 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5959 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5960 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5961 |
"/ sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5962 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5963 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5964 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5965 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5966 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5967 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5968 |
|
10205 | 5969 |
aContext home notNil ifTrue:[ |
5970 |
aContext home receiver isLazyValue ifFalse:[ |
|
5971 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
|
5972 |
(aContext home selector == #wait) ifTrue:[^ false]. |
|
5973 |
(aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
5974 |
] |
|
5975 |
] |
|
5976 |
] |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5977 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5978 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5979 |
(rec isExceptionHandler) ifTrue:[ |
10205 | 5980 |
sel == #handle:do: ifTrue:[^ false]. |
5981 |
sel == #handleDo: ifTrue:[^ false]. |
|
5982 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
5983 |
sel == #answer:do: ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5984 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5985 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
10205 | 5986 |
sel == #doRaise ifTrue:[^ false]. |
5987 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
5988 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
5989 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
5990 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5991 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5992 |
(mClass == Context) ifTrue:[ |
10205 | 5993 |
sel == #unwind ifTrue:[^ false]. |
5994 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5995 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5996 |
(mClass == ProcessorScheduler) ifTrue:[ |
10205 | 5997 |
sel == #interruptActive ifTrue:[^ false]. |
5998 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
5999 |
sel == #suspend: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6000 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6001 |
mClass == Process ifTrue:[ |
10205 | 6002 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6003 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6004 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6005 |
|
9662 | 6006 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
6007 |
"Modified: / 08-12-2010 / 18:21:45 / cg" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
6008 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
6009 |
|
4859 | 6010 |
!DebugView methodsFor:'private-control loop'! |
266 | 6011 |
|
6012 |
controlLoop |
|
6013 |
"this is a kludge: |
|
10205 | 6014 |
start a dispatchloop which exits when |
6015 |
either continue, return or step is pressed |
|
266 | 6016 |
" |
6017 |
||
6018 |
haveControl := true. |
|
664 | 6019 |
[ |
10205 | 6020 |
[haveControl] whileTrue:[ |
6021 |
self controlLoopCatchingErrors |
|
6022 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
6023 |
] ensure:[ |
10205 | 6024 |
catchBlock := nil. |
6025 |
haveControl := false |
|
266 | 6026 |
]. |
664 | 6027 |
|
6028 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 6029 |
! |
6030 |
||
6031 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
6032 |
"this is the debuggers own private event handling loop; |
1187 | 6033 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
6034 |
|
266 | 6035 |
"setup a self removing catch-block" |
6036 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
6037 |
||
6038 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
10205 | 6039 |
"if we do not have multiple processes or its a system process |
6040 |
we start another dispatch loop, which exits when |
|
6041 |
either continue, return or step is pressed |
|
6042 |
or (via the catchBlock) if an error occurs. |
|
6043 |
Since our display is an extra exclusive one, |
|
6044 |
all processing for normal views stops here ... |
|
6045 |
" |
|
6046 |
||
6047 |
WindowGroup setActiveGroup:windowGroup. |
|
6048 |
SignalSet anySignal handle:[:ex | |
|
6049 |
|signal| |
|
6050 |
||
6051 |
signal := ex signal. |
|
6052 |
||
6053 |
self showError:'*** Error in modal debugger: |
|
266 | 6054 |
|
334 | 6055 |
>>>> Signal: ' , signal printString , ' |
266 | 6056 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 6057 |
>>>> From: ' , ex suspendedContext sender printString , ' |
6058 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
6059 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
6060 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6061 |
>>>> : ' , ex suspendedContext sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6062 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6063 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6064 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6065 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6066 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6067 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6068 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6069 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6070 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 6071 |
>>>> Message: ' , ex description , ' |
266 | 6072 |
|
1187 | 6073 |
caught & ignored.'. |
10205 | 6074 |
ex return. |
6075 |
] do:[ |
|
6076 |
UserNotification handle:[:ex | |
|
6077 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
|
6078 |
ex proceed |
|
6079 |
]. |
|
6080 |
self showError:ex description. |
|
6081 |
ex proceed. |
|
6082 |
] do:[ |
|
6083 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
|
6084 |
haveControl]. |
|
6085 |
] |
|
6086 |
]. |
|
6087 |
WindowGroup setActiveGroup:nil. |
|
266 | 6088 |
] ifFalse:[ |
10205 | 6089 |
"we do have multiple processes - |
6090 |
simply enter the DebugViews-Windowgroup event loop. |
|
6091 |
effectively suspending event processing for the currently |
|
6092 |
active group. |
|
6093 |
" |
|
6094 |
SignalSet anySignal handle:[:ex | |
|
6095 |
|answer signal eMsg| |
|
6096 |
||
6097 |
signal := ex signal. |
|
6098 |
||
6099 |
DebuggingDebugger ~~ true ifTrue:[ |
|
6100 |
(signal == ActivityNotification) ifTrue:[ |
|
6101 |
ex proceed |
|
6102 |
]. |
|
6103 |
"/ |
|
6104 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
6105 |
"/ |
|
6106 |
ex catchInDebugger ifTrue:[ |
|
6107 |
'DebugView [info]: ',signal printString,'-signal in debugger cought for close' infoPrintCR. |
|
6108 |
self destroy. |
|
6109 |
ex reject |
|
6110 |
]. |
|
6111 |
||
6112 |
"/ |
|
6113 |
"/ ignore recursive breakpoints |
|
6114 |
"/ |
|
6115 |
(signal isControlInterrupt) ifTrue:[ |
|
6116 |
ignoreBreakpoints == true ifTrue:[ |
|
6117 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
6118 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
6119 |
ex proceed |
|
6120 |
]. |
|
6121 |
]. |
|
6122 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
6123 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
6124 |
answer := Dialog |
|
6125 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
6126 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
6127 |
values:#( #proceed #close ) |
|
6128 |
default:#close. |
|
6129 |
answer == #close ifTrue:[ |
|
6130 |
self destroy. |
|
6131 |
ex reject |
|
6132 |
]. |
|
6133 |
ex return. |
|
6134 |
]. |
|
6135 |
signal == RecursiveExceptionError ifTrue:[ |
|
6136 |
(ex parameter signal == BreakPointInterrupt) |
|
6137 |
ifTrue:[ |
|
6138 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
6139 |
ex proceed. |
|
6140 |
]. |
|
6141 |
||
6142 |
self showError:'*** Recursive error in debugger: |
|
266 | 6143 |
|
6144 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 6145 |
>>>> ' , ex parameter signal printString , ' |
266 | 6146 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 6147 |
>>>> From: ' , ex suspendedContext sender printString , ' |
6148 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
6149 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
6150 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 6151 |
>>>> Message: ' , ex description , ' |
266 | 6152 |
|
1187 | 6153 |
caught & ignored.'. |
10205 | 6154 |
ex return |
6155 |
]. |
|
6156 |
]. |
|
6157 |
||
6158 |
self topView raiseDeiconified. |
|
6159 |
||
6160 |
eMsg := ex description. |
|
6161 |
(ex signal isControlInterrupt) ifTrue:[ |
|
6162 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
6163 |
]. |
|
6164 |
Dialog aboutToOpenBoxNotificationSignal |
|
6165 |
handle:[:ex | ex proceed ] |
|
6166 |
do:[ |
|
6167 |
answer := Dialog |
|
6168 |
choose:('Error in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
|
6169 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
6170 |
values:#( #proceed #cancel #debug ) |
|
6171 |
default:#cancel. |
|
6172 |
]. |
|
6173 |
answer == #debug ifTrue:[ |
|
6174 |
'DebugView [info]: cought exception - debugging' infoPrintCR. |
|
6175 |
Debugger |
|
6176 |
enterUnconditional:(ex suspendedContext) |
|
6177 |
withMessage:'Error in debugger: ' , eMsg |
|
6178 |
mayProceed:true. |
|
6179 |
ex proceed. |
|
6180 |
]. |
|
6181 |
answer == #proceed ifTrue:[ |
|
6182 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
6183 |
ex proceed. |
|
6184 |
]. |
|
6185 |
'DebugView [info]: cought exception - returning' infoPrintCR. |
|
6186 |
ex return. |
|
6187 |
] do:[ |
|
6188 |
"/ make certain that sub-debuggers, inspectors etc. |
|
6189 |
"/ come up on my device. |
|
6190 |
Screen currentScreenQuerySignal answer:device |
|
6191 |
do:[ |
|
6192 |
windowGroup |
|
6193 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
6194 |
true] |
|
6195 |
onLeave:[] |
|
6196 |
] |
|
6197 |
]. |
|
266 | 6198 |
]. |
6199 |
catchBlock := nil. |
|
6200 |
||
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
6201 |
"Created: / 24.11.1995 / 20:33:45 / cg" |
3447 | 6202 |
"Modified: / 18.11.2001 / 01:04:17 / cg" |
266 | 6203 |
! ! |
6204 |
||
0 | 6205 |
!DebugView methodsFor:'user interaction'! |
6206 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6207 |
checkIfCodeIsReallyModified |
6616 | 6208 |
|source| |
6209 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6210 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6211 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6212 |
currentMethod isNil ifTrue:[ |
10205 | 6213 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6214 |
]. |
6616 | 6215 |
source := currentMethod source. |
6216 |
source notNil ifTrue:[ |
|
10205 | 6217 |
source string = codeView contents string ifTrue:[ |
6218 |
^ false |
|
6219 |
]. |
|
6220 |
(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
|
6221 |
^ false |
|
6222 |
]. |
|
6616 | 6223 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6224 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6225 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6226 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6227 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6228 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6229 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6230 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6231 |
checkSelectionChangeAllowed:newSelection |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6232 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6233 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6234 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6235 |
and:[newSelection = contextView selection]) ifTrue:[ |
10205 | 6236 |
^ true |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6237 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6238 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6239 |
(self confirm:('Code modified - change selection anyway ?')) ifFalse:[ |
10205 | 6240 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6241 |
]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6242 |
codeView modified:false. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6243 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6244 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6245 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6246 |
|
266 | 6247 |
codeAccept:someCode |
6248 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
6249 |
and including selected method cannot be continued." |
|
6250 |
||
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6251 |
^ self codeAccept:someCode unwind:false "true" category:nil onCancel:nil |
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6252 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6253 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 6254 |
! |
6255 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6256 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
3427 | 6257 |
"user wants some code to be recompiled - must unwind stack since everything above |
6258 |
and including selected method cannot be continued." |
|
6259 |
||
6260 |
" |
|
6261 |
actually, this is not true, since the active methods will still be |
|
6262 |
executed correctly - however, the code shown in the debugger is no |
|
6263 |
longer in sync (showing the new code) with the executed code. |
|
6264 |
Therefore, we hide those contexts to avoid confusion .... |
|
6265 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
6266 |
||
6267 |
"walk up context chain and find highest context which is either the selected context, |
|
6268 |
or - if its a block-context - whose home is the selected context" |
|
6269 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6270 |
|con top newMethod| |
3427 | 6271 |
|
6272 |
codeView withWaitCursorDo:[ |
|
10205 | 6273 |
" |
6274 |
find the method-home context for this one |
|
6275 |
" |
|
6276 |
doUnwind ifTrue:[ |
|
6277 |
con := selectedContext. |
|
6278 |
top := con. |
|
6279 |
[con notNil] whileTrue:[ |
|
6280 |
(con methodHome == selectedContext) ifTrue:[ |
|
6281 |
top := con |
|
6282 |
]. |
|
6283 |
con := con sender |
|
6284 |
]. |
|
6285 |
]. |
|
6286 |
||
6287 |
"/ |
|
6288 |
"/ provide the classes nameSpace on a query; |
|
6289 |
"/ in case we accept while in another nameSpace context, |
|
6290 |
"/ (but for a class which is somewhere else) |
|
6291 |
"/ |
|
6292 |
(Class updateChangeFileQuerySignal, |
|
6293 |
Class updateChangeListQuerySignal, |
|
6294 |
Class updateHistoryLineQuerySignal) answer:true |
|
6295 |
do:[ |
|
6296 |
Class nameSpaceQuerySignal |
|
6297 |
answer:(aClass nameSpace) |
|
6298 |
do:[ |
|
6299 |
Class packageQuerySignal |
|
6300 |
answer:(aClass package ? PackageId noProjectID) |
|
6301 |
do:[ |
|
6302 |
codeView contents:someCode. |
|
6303 |
newMethod := aClass compilerClass |
|
6304 |
compile:someCode |
|
6305 |
forClass:aClass |
|
6306 |
inCategory:category |
|
6307 |
notifying:codeView. |
|
6308 |
]. |
|
6309 |
]. |
|
6310 |
]. |
|
6311 |
||
6312 |
inspecting ifFalse:[ |
|
6313 |
" |
|
6314 |
if it worked, remove everything up to and including top |
|
6315 |
from context chain |
|
6316 |
" |
|
6317 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
6318 |
codeView modified:false. |
|
6319 |
||
6320 |
doUnwind ifTrue:[ |
|
6321 |
selectedContext canReturn ifTrue:[ |
|
6322 |
self setContext:(top "sender"). |
|
6323 |
exitAction := #restart. |
|
6324 |
selectedContext setLineNumber:1. |
|
6325 |
self doRestart. |
|
6326 |
] ifFalse:[ |
|
6327 |
self setContext:(top sender). |
|
6328 |
exitAction := #return. |
|
6329 |
]. |
|
6330 |
||
6331 |
" |
|
6332 |
continue/step is no longer possible |
|
6333 |
" |
|
6334 |
"/ continueButton disable. |
|
6335 |
"/ canContinue := false. |
|
6336 |
]. |
|
6337 |
||
6338 |
contextView selection:1. |
|
6339 |
"/ self showSelection:1. |
|
6340 |
"/ contextView makeSelectionVisible. "/ scrollToLine:(selection - 1) |
|
6341 |
] ifFalse:[ |
|
6342 |
^ cancelAction value |
|
6343 |
] |
|
6344 |
]. |
|
3427 | 6345 |
]. |
6346 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
6347 |
"Created: / 17-11-2001 / 21:50:55 / cg" |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
6348 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
3427 | 6349 |
! |
6350 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6351 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6352 |
"user wants some code to be recompiled - must unwind stack since everything above |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6353 |
and including selected method cannot be continued." |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6354 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6355 |
" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6356 |
actually, this is not true, since the active methods will still be |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6357 |
executed correctly - however, the code shown in the debugger is no |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6358 |
longer in sync (showing the new code) with the executed code. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6359 |
Therefore, we hide those contexts to avoid confusion .... |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6360 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6361 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6362 |
"walk up context chain and find highest context which is either the selected context, |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6363 |
or - if its a block-context - whose home is the selected context" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6364 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6365 |
|sel implementorClass method category| |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6366 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6367 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6368 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6369 |
"/ find the method-home context for this one |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6370 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6371 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6372 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6373 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6374 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6375 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6376 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6377 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6378 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6379 |
|
10205 | 6380 |
" |
6381 |
use class&selector to find the method for the compilation |
|
6382 |
and compile. |
|
6383 |
" |
|
6384 |
category := givenCategoryOrNil. |
|
6385 |
sel := selectedContext selector. |
|
6386 |
implementorClass := selectedContext methodClass. |
|
6387 |
implementorClass notNil ifTrue:[ |
|
6388 |
category isNil ifTrue:[ |
|
6389 |
method := implementorClass compiledMethodAt:sel. |
|
6390 |
category := method category |
|
6391 |
] |
|
6392 |
] ifFalse:[ |
|
6393 |
implementorClass := selectedContext receiver class. |
|
6394 |
implementorClass ~~ Object ifTrue:[ |
|
6395 |
implementorClass := Dialog |
|
6396 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
6397 |
initialAnswer:implementorClass name |
|
6398 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
6399 |
implementorClass size == 0 ifTrue:[ |
|
6400 |
^ cancelAction value "/ cancelled |
|
6401 |
]. |
|
6402 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
6403 |
implementorClass isNil ifTrue:[ |
|
6404 |
Dialog warn:'No such class'. |
|
6405 |
^ cancelAction value "/ cancelled |
|
6406 |
]. |
|
6407 |
]. |
|
6408 |
]. |
|
6409 |
||
6410 |
self |
|
6411 |
codeAccept:someCode |
|
6412 |
inClass:implementorClass |
|
6413 |
unwind:doUnwind |
|
6414 |
category:category |
|
6415 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6416 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6417 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6418 |
"Created: / 17-11-2001 / 21:50:55 / cg" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6419 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6420 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6421 |
|
7912 | 6422 |
codeCompletion |
6423 |
|cls| |
|
6424 |
||
8212 | 6425 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 6426 |
|
7912 | 6427 |
cls := currentMethod mclass. |
8212 | 6428 |
cls isNil ifTrue:[ ^ self ]. |
6429 |
||
7912 | 6430 |
UserInformation handle:[:ex | |
10205 | 6431 |
ex proceed. |
7912 | 6432 |
] do:[ |
10205 | 6433 |
DoWhatIMeanSupport codeCompletionForClass:cls context:selectedContext codeView:codeView. |
7912 | 6434 |
]. |
6435 |
! |
|
6436 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6437 |
confirm:aString |
6971 | 6438 |
"open a modal yes-no dialog. |
6439 |
Redefined here, to answer true, if exclusice Debugger, which cannot handle popup boxes" |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6440 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6441 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
10205 | 6442 |
^ true |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6443 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6444 |
^ super confirm:aString. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6445 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6446 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
6447 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
6448 |
"user clicked on a header line - show selected code in textView. |
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
6449 |
Also sent to autoselect an interesting context on entry." |
0 | 6450 |
|
9235 | 6451 |
HaltInterrupt handle:[:ex | |
10205 | 6452 |
ignoreBreakpoints ifFalse:[ex reject]. |
6453 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
6454 |
ex proceed |
|
3447 | 6455 |
] do:[ |
10205 | 6456 |
self updateForContext:lineNr |
3269 | 6457 |
]. |
6458 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
6459 |
|
3447 | 6460 |
"Modified: / 17.11.2001 / 22:12:16 / cg" |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6461 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6462 |
|
10205 | 6463 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6464 |
stackInspector notNil ifTrue:[ |
10205 | 6465 |
stackInspector destroy. |
6466 |
stackInspector := nil. |
|
6467 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
6468 |
contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6469 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6470 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6471 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6472 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6473 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6474 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6475 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6476 |
sel notNil ifTrue:[ |
10205 | 6477 |
self showSelection:sel |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6478 |
] |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6479 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6480 |
"Created: / 18-06-2010 / 12:29:21 / cg" |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6481 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6482 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6483 |
processEvent:anEvent |
6129 | 6484 |
"filter keyboard events for popUp variable value display. |
6485 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6486 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6487 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6488 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6489 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6490 |
evView notNil ifTrue:[ |
10205 | 6491 |
focusView := evView windowGroup focusView. |
6492 |
focusView isNil ifTrue:[ |
|
6493 |
focusView := evView. |
|
6494 |
]. |
|
6495 |
||
6496 |
anEvent isKeyPressEvent ifTrue:[ |
|
6497 |
key := anEvent key. |
|
6498 |
rawKey := anEvent rawKey. |
|
6499 |
||
6500 |
inCodeView := (focusView == codeView |
|
6501 |
or:[focusView isComponentOf:codeView]). |
|
6502 |
inCodeView ifTrue:[ |
|
6503 |
key == #CodeCompletion ifTrue:[ |
|
6504 |
"/ complete the word before/under the cursor. |
|
6505 |
self sensor |
|
6506 |
pushUserEvent:#codeCompletion |
|
6507 |
for:self |
|
6508 |
withArguments:#(). |
|
6509 |
^ true |
|
6510 |
]. |
|
6511 |
]. |
|
6512 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6513 |
|
3602 | 6514 |
false ifTrue:[ |
10205 | 6515 |
anEvent isButtonReleaseEvent ifTrue:[ |
6516 |
anEvent view == codeView ifTrue:[ |
|
6517 |
(RBParser notNil and:[RBParser isLoaded]) |
|
6518 |
ifTrue:[ |
|
6519 |
self sensor |
|
6520 |
pushEvent:anEvent. "/ must be first in queue |
|
6521 |
||
6522 |
self sensor |
|
6523 |
pushUserEvent:#explainSelection |
|
6524 |
for:self |
|
6525 |
withArguments:nil. |
|
6526 |
^ true "/ eaten |
|
6527 |
] |
|
6528 |
] |
|
6529 |
]. |
|
3602 | 6530 |
]. |
6531 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6532 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6533 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6534 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6535 |
|
8212 | 6536 |
setCurrentMethod:aMethodOrNil |
6537 |
currentMethod := aMethodOrNil. |
|
6538 |
! |
|
6539 |
||
1327 | 6540 |
showSelection:lineNr |
6541 |
"user clicked on a header line - show selected code in textView. |
|
6542 |
Also sent to autoselect an interesting context on entry." |
|
6543 |
||
10205 | 6544 |
Notification |
6545 |
handle: |
|
6546 |
[:ex | |
|
6547 |
"/ ex suspendedContext fullPrintAll. |
|
6548 |
Transcript showCR:ex description. |
|
6549 |
"/ Transcript showCR:ex parameter. |
|
6550 |
ex proceed |
|
6551 |
] |
|
6552 |
do: |
|
6553 |
[ |
|
6554 |
Error |
|
6555 |
handle: |
|
6556 |
[:ex | |
|
6557 |
|s con| |
|
6558 |
||
6559 |
ex signal isControlInterrupt |
|
6560 |
ifTrue:[ |
|
6561 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' infoPrintCR. |
|
6562 |
ex proceed |
|
6563 |
]. |
|
6564 |
||
6565 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' bindWith:ex suspendedContext) infoPrintCR. |
|
6566 |
||
6567 |
s := '' writeStream. |
|
6568 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
6569 |
s nextPutLine:'****'. |
|
6570 |
s nextPutAll: '**** '; nextPutLine:(ex description "withCRs"). |
|
6571 |
s nextPutLine:'****'. |
|
6572 |
con := ex suspendedContext. |
|
6573 |
s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6574 |
con := con sender. |
|
6575 |
HaltInterrupt ignoreIn:[ |
|
6576 |
con fullPrintAllOn:s. |
|
6577 |
]. |
|
5842 | 6578 |
"/ [con notNil] whileTrue:[ |
6579 |
"/ Error catch:[:ex | |
|
6580 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6581 |
"/ ]. |
|
4947 | 6582 |
"/ |
5842 | 6583 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
6584 |
"/ con := nil |
|
6585 |
"/ ] ifFalse:[ |
|
6586 |
"/ con := con sender. |
|
6587 |
"/ ] |
|
6588 |
"/ ]. |
|
10205 | 6589 |
codeView contents:(s contents). |
6590 |
ex return. |
|
6591 |
] |
|
6592 |
do: |
|
6593 |
[ |
|
6594 |
self doShowSelection:lineNr |
|
6595 |
] |
|
6596 |
] |
|
1327 | 6597 |
|
6815 | 6598 |
"Modified: / 04-07-2006 / 14:50:06 / cg" |
1327 | 6599 |
! |
6600 |
||
10205 | 6601 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6602 |
stackInspector isNil ifTrue:[ |
10205 | 6603 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
6604 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
6605 |
stackInspector := InspectorView |
|
6606 |
origin:(0.6 @ 0.0) |
|
6607 |
corner:(1.0 @ 1.0) |
|
6608 |
in:contextInspector superView. |
|
6609 |
stackInspector realize. |
|
6610 |
stackInspector fieldListLabel:'Stack'. |
|
6611 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6612 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6613 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6614 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6615 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6616 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6617 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6618 |
"show selected code for lineNr in contextList in textView. |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6619 |
Also used to autoselect an interesting context on entry." |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6620 |
|
56 | 6621 |
|con homeContext sel method code canAccept |
105 | 6622 |
implementorClass lineNrInMethod rec m line |
10205 | 6623 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 6624 |
codeSet highlighter evaluatorClass |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6625 |
canDefine callee searchClass originalMethod| |
3187 | 6626 |
|
6627 |
canDefine := false. |
|
8212 | 6628 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
6629 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6630 |
contextArray notNil ifTrue:[ |
10205 | 6631 |
lineNr <= contextArray size ifTrue:[ |
6632 |
con := contextArray at:lineNr. |
|
6633 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
6634 |
]. |
|
6635 |
" |
|
6636 |
clicking on the '** ...'-line shows more ... |
|
6637 |
" |
|
6638 |
con isNil ifTrue:[ |
|
6639 |
line := contextView list at:lineNr. |
|
6640 |
(line startsWith:'**') ifTrue:[ |
|
6641 |
self showMore. |
|
6642 |
lineNr >= contextArray size ifTrue:[ |
|
6643 |
contextView setSelection:lineNr. |
|
6644 |
con := contextArray at:lineNr ifAbsent:nil |
|
6645 |
] |
|
6646 |
]. |
|
6647 |
con isNil ifTrue:[ |
|
6648 |
codeView contents:nil. |
|
6649 |
^ self |
|
6650 |
]. |
|
6651 |
]. |
|
6652 |
||
6653 |
selectedContext := con. |
|
6654 |
m := contextView middleButtonMenu. |
|
6655 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
6656 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
6657 |
]. |
|
6658 |
||
6659 |
self withExecuteCursorDo:[ |
|
6660 |
codeSet := false. |
|
6661 |
||
6662 |
" |
|
6663 |
give it to the (lower right) inspector |
|
6664 |
" |
|
6665 |
Error handle:[:ex | |
|
6666 |
'DebugView [warning]: error while accessing context' errorPrintCR. |
|
6667 |
contextInspector inspect:nil. |
|
9479 | 6668 |
"/ ex reject. |
10205 | 6669 |
] do:[ |
6670 |
contextInspector inspect:con. |
|
6671 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
6672 |
]. |
|
6673 |
||
6674 |
"/ show a stack inspector sometimes |
|
6675 |
||
6676 |
con hasStackToShow ifTrue:[ |
|
6677 |
self showStackInspectorFor:con |
|
6678 |
] ifFalse:[ |
|
6679 |
self hideStackInspector |
|
6680 |
]. |
|
6681 |
||
6682 |
homeContext := con methodHome. |
|
6683 |
con canReturn ifTrue:[ |
|
6684 |
returnButton enable. restartButton enable. |
|
6685 |
] ifFalse:[ |
|
6686 |
returnButton disable. restartButton disable. |
|
6687 |
]. |
|
6688 |
||
6689 |
lineNrInMethod := con lineNumber. |
|
6690 |
||
6691 |
canAccept := false. |
|
6692 |
||
6693 |
homeContext isNil ifTrue:[ |
|
6694 |
" |
|
6695 |
mhmh - an optimized block |
|
6696 |
should get the block here, and get the method from |
|
6697 |
that one ... |
|
6698 |
But in the current version, there is no easy way to get to the block |
|
6699 |
since that one is not in the context. |
|
6700 |
A future new block calling scheme will fix this |
|
6701 |
(passing the block instead of the home as block argument). |
|
6702 |
" |
|
6703 |
||
6704 |
"temporary kludge - peek into the sender context. |
|
6705 |
If its a do-like method and there is a single block variable |
|
6706 |
in the args or temporaries, that must be the one. |
|
6707 |
This helps in some cases. |
|
6708 |
" |
|
6709 |
(sender := con sender) notNil ifTrue:[ |
|
6710 |
tryVars := false. |
|
6711 |
(selSender := sender selector) notNil ifTrue:[ |
|
6712 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
6713 |
tryVars := true. |
|
6714 |
] |
|
6715 |
]. |
|
6716 |
tryVars ifTrue:[ |
|
6717 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
6718 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
6719 |
possibleBlocks size == 1 ifTrue:[ |
|
6720 |
method := possibleBlocks first method. |
|
6721 |
]. |
|
6722 |
] |
|
6723 |
]. |
|
6724 |
] ifFalse:[ |
|
6725 |
"fetch rec here - so we won't need context in doItAction" |
|
6726 |
rec := homeContext receiver. |
|
6727 |
sel := homeContext selector. |
|
6728 |
sel notNil ifTrue:[ |
|
6729 |
canAccept := true. |
|
6730 |
||
6731 |
implementorClass := homeContext methodClass. |
|
6732 |
implementorClass isNil ifTrue:[ |
|
6733 |
Error handle:[:ex | |
|
6734 |
ex signal == BreakPointInterrupt ifTrue:[ |
|
6735 |
ex proceed. |
|
6736 |
]. |
|
6737 |
code := 'error while asking method for its source'. |
|
6738 |
code := code , Character cr , ex signal printString. |
|
6739 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6740 |
||
6741 |
canAccept := false. |
|
6742 |
ex return. |
|
6743 |
] do:[ |
|
6744 |
" |
|
6745 |
special: look if this context was created by |
|
6746 |
valueWithReceiver kind of method invocation; |
|
6747 |
if so, grab the method from the sender and show it |
|
6748 |
" |
|
6749 |
((sender := homeContext sender) notNil |
|
6750 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
6751 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
6752 |
method := sender receiver. |
|
6753 |
canAccept := false. |
|
6754 |
] ifFalse:[ |
|
6755 |
(method := con method) notNil ifTrue:[ |
|
6756 |
canAccept := false. |
|
6757 |
] |
|
6758 |
]. |
|
6759 |
] |
|
6760 |
] ifFalse:[ |
|
6761 |
method := implementorClass compiledMethodAt:sel. |
|
6762 |
]. |
|
6763 |
] |
|
6764 |
]. |
|
6765 |
||
6766 |
homeContext notNil ifTrue:[ |
|
6767 |
searchClass := homeContext searchClass ? rec class. |
|
6768 |
currentMethod := searchClass lookupMethodFor:sel. |
|
6769 |
]. |
|
6770 |
originalMethod := currentMethod. |
|
6771 |
(currentMethod notNil and:[currentMethod ~~ method]) ifTrue:[ |
|
6772 |
originalMethod := method. |
|
6773 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
6774 |
method := originalMethod. |
|
6775 |
] ifFalse:[ |
|
6776 |
method := currentMethod. |
|
6777 |
lineNrInMethod := nil. |
|
6778 |
canAccept := true. |
|
6779 |
]. |
|
6780 |
methodCodeToggle beVisible. |
|
6781 |
] ifFalse:[ |
|
6782 |
methodCodeToggle beInvisible. |
|
6783 |
]. |
|
6784 |
||
6785 |
code isNil ifTrue:[ |
|
6786 |
errMsg := nil. |
|
6787 |
method isNil ifTrue:[ |
|
6788 |
"/ fall back heuristics |
|
6789 |
con isBlockContext ifTrue:[ |
|
6790 |
((sender := con sender) notNil |
|
6791 |
and:[((sender selector ? '') startsWith:'value') |
|
6792 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
6793 |
code := sender receiver source. |
|
6794 |
] |
|
6795 |
] ifFalse:[ |
|
6796 |
((sender := con sender) notNil |
|
6797 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
6798 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
6799 |
method := sender receiver. |
|
6800 |
] |
|
6801 |
] |
|
6802 |
]. |
|
6803 |
method notNil ifTrue:[ |
|
6804 |
Error handle:[:ex | |
|
6805 |
ex signal isControlInterrupt ifTrue:[ |
|
6806 |
ex proceed. |
|
6807 |
]. |
|
6808 |
code := 'error while asking method for its source'. |
|
6809 |
code := code , Character cr , ex signal printString. |
|
6810 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6811 |
||
6812 |
canAccept := false. |
|
6813 |
ex return. |
|
6814 |
] do:[ |
|
6815 |
self sensor shiftDown ifTrue:[ |
|
6816 |
code := method decompiledSource |
|
6817 |
] ifFalse:[ |
|
6818 |
code := method source. |
|
6819 |
]. |
|
6820 |
]. |
|
6821 |
code isNil ifTrue:[ |
|
6822 |
method sourceFilename notNil ifTrue:[ |
|
6823 |
codeView contents:(resources |
|
6824 |
string:'** no sourcefile: %1 **' |
|
6825 |
with:method sourceFilename). |
|
6826 |
codeView flash. |
|
6827 |
codeSet := true. |
|
6828 |
] ifFalse:[ |
|
6829 |
[ |
|
6830 |
|src| |
|
6831 |
||
6832 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
6833 |
codeView contents:src. |
|
6834 |
codeSet := true. |
|
6835 |
] on: Error do:[ |
|
6836 |
errMsg := '** no source **' |
|
6837 |
]. |
|
6838 |
] |
|
6839 |
]. |
|
6840 |
] ifFalse:[ |
|
6841 |
homeContext isNil ifTrue:[ |
|
6842 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
6843 |
] ifFalse:[ |
|
6844 |
errMsg := '** no method - no source **'. |
|
6845 |
canDefine := true. |
|
6846 |
] |
|
6847 |
]. |
|
6848 |
errMsg notNil ifTrue:[ |
|
6849 |
self showError:errMsg. |
|
6850 |
codeSet := true. |
|
6851 |
] |
|
6852 |
]. |
|
6853 |
||
6854 |
code isNil ifTrue:[ |
|
6855 |
"/ canAccept := false. |
|
6856 |
codeSet ifFalse:[ |
|
6857 |
codeView contents:nil. |
|
6858 |
] |
|
6859 |
] ifFalse:[ |
|
6860 |
lineNrInMethod notNil ifTrue:[ |
|
6861 |
lineNrInMethod == 0 ifTrue:[ |
|
6862 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
6863 |
lineNrInMethod := method lineNumber |
|
6864 |
]. |
|
6865 |
"/ guess lineNumber from sent-messages selector |
|
6866 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
6867 |
lineNrInMethod == 0 ifTrue:[ |
|
6868 |
|conIdx sentContext messages| |
|
6869 |
||
6870 |
conIdx := contextArray identityIndexOf:con. |
|
6871 |
conIdx > 1 ifTrue:[ |
|
6872 |
sentContext := contextArray at:conIdx-1. |
|
6873 |
sentContext isBlockContext ifFalse:[ |
|
6874 |
(method notNil and:[code notNil]) ifTrue:[ |
|
6875 |
messages := method messagesSent. |
|
6876 |
messages size == 1 ifTrue:[ |
|
6877 |
sentContext selector == messages first ifTrue:[ |
|
6878 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
6879 |
] |
|
6880 |
] |
|
6881 |
]. |
|
6882 |
]. |
|
6883 |
]. |
|
6884 |
]. |
|
6885 |
]. |
|
6886 |
]. |
|
6887 |
||
6888 |
UserPreferences current syntaxColoring ifTrue:[ |
|
6889 |
implementorClass isNil ifTrue:[ |
|
6890 |
(con isBlockContext |
|
6891 |
and:[con home isNil |
|
6892 |
and:[con guessedHome notNil]]) |
|
6893 |
ifTrue:[ |
|
6894 |
implementorClass := con guessedHome mclass |
|
6895 |
] |
|
6896 |
]. |
|
6897 |
implementorClass notNil ifTrue:[ |
|
6898 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
6899 |
code size < 100000 ifTrue:[ |
|
6900 |
Error handle:[:ex | |
|
6901 |
] do:[ |
|
6902 |
code := highlighter formatMethod:code in:implementorClass. |
|
6903 |
] |
|
6904 |
] |
|
6905 |
] |
|
6906 |
] |
|
6907 |
]. |
|
1555 | 6908 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6909 |
"/ code ~= (codeView contents) ifTrue:[ |
10205 | 6910 |
codeView setContents:code. |
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6911 |
"/ ]. |
10205 | 6912 |
(lineNrInMethod notNil |
6913 |
and:[lineNrInMethod ~~ 0 |
|
6914 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 6915 |
lineNrInMethod == 255 ifFalse:[ |
10205 | 6916 |
(lineNrInMethod == 255 |
6917 |
and:[method notNil |
|
6918 |
and:[method hasCode not]]) ifTrue:[ |
|
6919 |
"/ means: do not really know in interpreted methods |
|
6920 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
6921 |
] ifFalse:[ |
|
6922 |
codeView selectLine:lineNrInMethod. |
|
6923 |
]. |
|
6924 |
codeView makeSelectionVisible |
|
7000 | 6925 |
]. |
10205 | 6926 |
] ifFalse:[ |
6927 |
codeView unselect. |
|
6928 |
codeView scrollToTop |
|
6929 |
] |
|
6930 |
]. |
|
6931 |
||
6932 |
codeView acceptEnabled:canAccept. |
|
6933 |
canAccept ifTrue:[ |
|
6934 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
6935 |
] ifFalse:[ |
|
6936 |
codeView acceptAction:[:code | self beep] |
|
6937 |
]. |
|
6938 |
||
6939 |
receiverInspector inspect:rec. |
|
6940 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
|
6941 |
||
6942 |
" |
|
6943 |
the one below is wrong: currently, the |
|
6944 |
evaluator cannot handle passed contexts. |
|
6945 |
Once it does, pass con as in:-arg |
|
6946 |
" |
|
6947 |
(rec isJavaObject |
|
6948 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
6949 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
6950 |
evaluatorClass := Parser |
|
6951 |
] ifFalse:[ |
|
6952 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
6953 |
evaluatorClass := method mclass evaluatorClass. |
|
6954 |
] ifFalse:[ |
|
6955 |
evaluatorClass := rec class evaluatorClass. |
|
6956 |
]. |
|
6957 |
]. |
|
6958 |
||
6959 |
codeView doItAction:[:theCode | |
|
6960 |
evaluatorClass |
|
6961 |
evaluate:theCode |
|
6962 |
in:actualContext |
|
6963 |
receiver:rec |
|
6964 |
notifying:codeView |
|
6965 |
logged:true |
|
6966 |
ifFail:nil |
|
6967 |
]. |
|
6968 |
self setCurrentMethod:method. |
|
6969 |
||
6970 |
selectedContext := homeContext. |
|
6971 |
actualContext := con |
|
6972 |
]. |
|
4122 | 6973 |
] ifFalse:[ |
10205 | 6974 |
codeView contents:nil. |
4122 | 6975 |
]. |
6976 |
codeView modified:false. |
|
6977 |
||
6978 |
con isContext ifFalse:[ |
|
10205 | 6979 |
sendButton disable. |
4122 | 6980 |
] ifTrue:[ |
10205 | 6981 |
sendButton enable. |
6982 |
]. |
|
6983 |
||
6984 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 6985 |
(due to the block held in codeView). |
6986 |
(not really needed, since stuff gets collected away sooner or later ... |
|
6987 |
... but this makes it a bit sooner) |
|
6988 |
" |
|
6989 |
con := nil. |
|
6990 |
homeContext := nil. |
|
6991 |
||
10205 | 6992 |
(callee notNil |
6993 |
and:[callee method notNil |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6994 |
and:[callee method selector == #subclassResponsibility]] |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6995 |
) ifTrue:[ |
10205 | 6996 |
canDefine := true. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6997 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6998 |
|
4122 | 6999 |
canDefine ifTrue:[ |
10205 | 7000 |
defineButton beVisible. |
4122 | 7001 |
] ifFalse:[ |
10205 | 7002 |
defineButton beInvisible. |
4122 | 7003 |
]. |
7004 |
||
7005 |
" |
|
7006 |
enable/disable some menu items |
|
7007 |
" |
|
7008 |
self updateMenuItems |
|
7009 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
7010 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
7011 |
"Modified: / 18-06-2010 / 12:33:49 / cg" |
4122 | 7012 |
! ! |
7013 |
||
8170 | 7014 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
7015 |
||
7016 |
ignoreCount:something |
|
7017 |
ignoreCount := something. |
|
7018 |
! |
|
7019 |
||
7020 |
ignoreEndTime:something |
|
7021 |
ignoreEndTime := something. |
|
7022 |
! |
|
7023 |
||
7024 |
method |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7025 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7026 |
|
9922 | 7027 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
7028 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7029 |
m := weakMethodHolder at:1. |
9796 | 7030 |
"/ wait until really gone (it could still be on the call stack |
7031 |
"/ |
|
7032 |
"/ m notNil ifTrue:[ |
|
7033 |
"/ m mclass isNil ifTrue:[ |
|
7034 |
"/ "/ no longer valid |
|
7035 |
"/ weakMethodHolder at:1 put:nil. |
|
7036 |
"/ ^ nil |
|
7037 |
"/ ]. |
|
7038 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7039 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7040 |
|
9922 | 7041 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 7042 |
! |
7043 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7044 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7045 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7046 |
|
9922 | 7047 |
methodArg == #all ifTrue:[ |
10205 | 7048 |
weakMethodHolder := methodArg |
9922 | 7049 |
] ifFalse:[ |
10205 | 7050 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 7051 |
]. |
8170 | 7052 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7053 |
|
9922 | 7054 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 7055 |
! ! |
7056 |
||
7057 |
!DebugView::IgnoredHalt methodsFor:'misc'! |
|
7058 |
||
7059 |
decrementIgnoreCount |
|
7060 |
ignoreCount notNil ifTrue:[ |
|
10205 | 7061 |
ignoreCount > 0 ifTrue:[ |
7062 |
ignoreCount := ignoreCount - 1 |
|
7063 |
] |
|
8170 | 7064 |
] |
7065 |
! ! |
|
7066 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7067 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7068 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7069 |
printOn:aStream |
9922 | 7070 |
|method| |
7071 |
||
7072 |
(method := self method) isNil ifTrue:[ |
|
10205 | 7073 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
7074 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7075 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7076 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7077 |
aStream nextPutAll:'Ignore '. |
9922 | 7078 |
method printOn:aStream. |
7079 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7080 |
ignoreEndTime notNil ifTrue:[ |
10205 | 7081 |
aStream nextPutAll:'until '. |
7082 |
ignoreEndTime printOn:aStream. |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7083 |
] ifFalse:[ |
10205 | 7084 |
(ignoreCount > 0) ifTrue:[ |
7085 |
aStream nextPutAll:'for '. |
|
7086 |
ignoreCount printOn:aStream. |
|
7087 |
] ifFalse:[ |
|
7088 |
(ignoreCount < 0) ifTrue:[ |
|
7089 |
aStream nextPutAll:'forEver'. |
|
7090 |
] ifFalse:[ |
|
7091 |
aStream nextPutAll:' no longer'. |
|
7092 |
]. |
|
7093 |
]. |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7094 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7095 |
|
9922 | 7096 |
"Modified: / 08-05-2011 / 10:29:11 / cg" |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7097 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7098 |
|
8170 | 7099 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
7100 |
||
9078 | 7101 |
haltIgnoredInfoString |
7102 |
"some string describing why and how this halt is ignored; |
|
7103 |
nil if not ignored" |
|
7104 |
||
7105 |
ignoreCount notNil ifTrue:[ |
|
10205 | 7106 |
ignoreCount > 0 ifTrue:[ |
7107 |
^ '%1 more calls ignored' bindWith:ignoreCount |
|
7108 |
]. |
|
7109 |
^ nil |
|
9078 | 7110 |
]. |
7111 |
ignoreEndTime notNil ifTrue:[ |
|
10205 | 7112 |
(ignoreEndTime > Timestamp now) ifTrue:[ |
7113 |
^ 'ignored until %1' bindWith:ignoreEndTime |
|
7114 |
]. |
|
7115 |
^ nil |
|
9078 | 7116 |
]. |
7117 |
||
7118 |
^ 'ignored until reenabled' |
|
7119 |
! |
|
7120 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7121 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7122 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7123 |
|
9796 | 7124 |
self method isNil ifTrue:[self halt. ^ false ]. "/ method no longer valid |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7125 |
ignoreEndTime notNil ifTrue:[ |
10205 | 7126 |
^ ignoreEndTime > Timestamp now |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7127 |
]. |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7128 |
ignoreCount notNil ifTrue:[ |
10205 | 7129 |
^ ignoreCount > 0 |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7130 |
]. |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7131 |
^ false |
9796 | 7132 |
|
7133 |
"Modified: / 23-03-2011 / 15:21:02 / cg" |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7134 |
! |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7135 |
|
8170 | 7136 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7137 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 7138 |
weakMethodHolder == #all ifTrue:[^ true]. |
7139 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7140 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 7141 |
|
7142 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 7143 |
! |
7144 |
||
7145 |
isHaltIgnored |
|
9078 | 7146 |
"true if this halt should be ignored" |
7147 |
||
8170 | 7148 |
ignoreCount notNil ifTrue:[ |
10205 | 7149 |
^ ignoreCount > 0 |
8170 | 7150 |
]. |
7151 |
ignoreEndTime notNil ifTrue:[ |
|
10205 | 7152 |
^ ignoreEndTime > Timestamp now |
8170 | 7153 |
]. |
7154 |
||
7155 |
^ true |
|
7156 |
! |
|
7157 |
||
7158 |
isHaltIgnoredInMethod:aMethod line:line |
|
9095 | 7159 |
"/ Transcript show:'?same as ign '; show:(weakMethodHolder at:1); show:' at '; showCR:lineNumber. |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7160 |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7161 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 7162 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 7163 |
|
7164 |
^ self isHaltIgnored |
|
7165 |
! ! |
|
7166 |
||
4122 | 7167 |
!DebugView class methodsFor:'documentation'! |
7168 |
||
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
7169 |
version_CVS |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
7170 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.521 2011-07-08 11:16:03 cg Exp $' |
4122 | 7171 |
! ! |
7172 |
||
7173 |
DebugView initialize! |