author | Claus Gittinger <cg@exept.de> |
Mon, 02 Mar 2015 14:39:16 +0100 | |
changeset 15497 | c05f957c8150 |
parent 15413 | 764b28599a90 |
child 15566 | 184cea584be5 |
child 15656 | 8df723e008c6 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
15413 | 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 |
|
15084 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
0 | 16 |
StandardSystemView subclass:#DebugView |
12839 | 17 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
18 |
receiverInspector contextInspector contextArray selectedContext |
|
19 |
catchBlock grabber mayProceed traceView tracing bigStep |
|
14714 | 20 |
skipLineNr abortButton terminateButton continueButton stepButton |
21 |
nextButton nextOverButton nextOutButton sendButton returnButton |
|
22 |
restartButton exclusive inspecting nChainShown inspectedProcess |
|
23 |
updateProcess updateButton defineButton monitorToggle stepping |
|
24 |
steppedContextLineno actualContext inWrap stackInspector |
|
15257 | 25 |
steppedContext wrapperContext firstContext stepHow cachable |
26 |
currentMethod ignoreBreakpoints stepUntilEntering |
|
27 |
lastStepUntilEntering lastSelectionInReceiverInspector |
|
28 |
lastSelectionInContextInspector canShowMore reportButton |
|
29 |
setOfHiddenCallingSelectors isStoppedAtHaltOrBreakPoint |
|
30 |
exceptionInfoLabel methodCodeToggle |
|
12839 | 31 |
methodCodeToggleSelectionHolder |
32 |
isStoppedAtBreakPointWithParameter breakPointParameter |
|
13362 | 33 |
hideSupportCode contextInfoLabel resendButton |
13488 | 34 |
gotoDialogOpenerButton isStoppedInModalDialog selectorToDefine |
14523 | 35 |
classToDefineIn gotoApplicationActionMethodButton |
15257 | 36 |
isStoppedInApplicationAction isStoppedAtStatementBreakpoint |
37 |
verboseBacktraceHolder' |
|
12839 | 38 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
15497 | 39 |
DebuggingDebugger DebuggingDebugger2 DebuggingContextWalk |
12839 | 40 |
DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts |
41 |
ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration |
|
13111 | 42 |
LastExtent LastOrigin RememberedCallChain DebuggingDebugger3 |
14695 | 43 |
NumberOfDebuggers DebuggerOnMainDisplayOnly' |
12839 | 44 |
poolDictionaries:'' |
45 |
category:'Interface-Debugger' |
|
0 | 46 |
! |
47 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
48 |
Object subclass:#IgnoredHaltOrBreakpoint |
12937 | 49 |
instanceVariableNames:'ignoreEndTime ignoreCount ignoreUntilShiftKeyPressed |
14608 | 50 |
ignoredReceiverClasses ignoredProcesses |
51 |
ignoredSendingClassAndSelectors' |
|
12839 | 52 |
classVariableNames:'' |
53 |
poolDictionaries:'' |
|
54 |
privateIn:DebugView |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
55 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
56 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
57 |
DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredHalt |
12839 | 58 |
instanceVariableNames:'weakMethodHolder lineNumber' |
59 |
classVariableNames:'' |
|
60 |
poolDictionaries:'' |
|
61 |
privateIn:DebugView |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
62 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
63 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
64 |
DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredBreakpoint |
12839 | 65 |
instanceVariableNames:'parameter' |
66 |
classVariableNames:'' |
|
67 |
poolDictionaries:'' |
|
68 |
privateIn:DebugView |
|
8170 | 69 |
! |
70 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
71 |
!DebugView class methodsFor:'documentation'! |
29 | 72 |
|
73 |
copyright |
|
74 |
" |
|
75 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
15413 | 76 |
All Rights Reserved |
29 | 77 |
|
78 |
This software is furnished under a license and may be used |
|
79 |
only in accordance with the terms of that license and with the |
|
80 |
inclusion of the above copyright notice. This software may not |
|
81 |
be provided or otherwise made available to, or used by, any |
|
82 |
other person. No title to or ownership of the software is |
|
83 |
hereby transferred. |
|
84 |
" |
|
85 |
! |
|
0 | 86 |
|
29 | 87 |
documentation |
88 |
" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
89 |
This class implements a graphical debugger interface. |
29 | 90 |
The debugger usually sits on top of the faulting process, |
10205 | 91 |
taking over its event processing. |
12840 | 92 |
|
2358 | 93 |
(this is different from other Smalltalk debuggers, which control |
94 |
the debuggee as a separate process. Consider this an historic |
|
14680 | 95 |
leftover - the debugger was one of the first applications written for ST/X. |
96 |
||
12840 | 97 |
The whole setup might be changed, once the required process primitives |
98 |
are available, which allow control of another processes execution |
|
99 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
14680 | 100 |
to have the debugger control the debuggee (i.e. two processes). |
15413 | 101 |
However, as it works as it is, and is reliable enough, |
14680 | 102 |
why should we change it without a particular need...). |
2358 | 103 |
|
104 |
Only the 'stopped' debugged process is affected; |
|
29 | 105 |
other processes continue to respond to events. |
12840 | 106 |
The one exception to this is when an error occurs within the dispatcher process |
107 |
or in one of the eventhandler processes. In this case, the debugger |
|
29 | 108 |
will sit on an exclusive display connection. |
109 |
||
35 | 110 |
See additional information in 'doc/misc/debugger.doc'. |
53 | 111 |
|
14680 | 112 |
Notice & Warning (attention when changing thingslike menus, window spec etc. here): |
15413 | 113 |
the DebugView class caches the last used debugger in a class variable, |
114 |
and hides/shows this window without recreating one from scratch. This is done to make |
|
115 |
the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint. |
|
116 |
||
117 |
It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one) |
|
118 |
is kept there. You will notice this, if a debugger comes up without showing any contents. |
|
119 |
In this case, close (or destroy) the broken debugView, and execute |
|
120 |
Debugger newDebugger |
|
121 |
which removes the cached debugger and forces creation of a new one the next time. |
|
122 |
This is a temporary workaround - the debugger should be fixed to avoid this situation. |
|
123 |
||
124 |
You must also flush the cached debugger, if you change the debugger's |
|
125 |
initialization code (buttons, menu, etc.) or the debugger's class layout, |
|
126 |
and you want the new code to become effective. |
|
508 | 127 |
|
128 |
[author:] |
|
15413 | 129 |
Claus Gittinger |
508 | 130 |
|
131 |
[see also:] |
|
15413 | 132 |
Exception Signal |
133 |
Process |
|
29 | 134 |
" |
135 |
! ! |
|
0 | 136 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
137 |
!DebugView class methodsFor:'initialization'! |
243 | 138 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
139 |
initialize |
13362 | 140 |
DebuggingDebugger := DebuggingDebugger2 := MoreDebuggingDetail := false. |
141 |
||
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
142 |
InitialNChainShown := 50. |
8148 | 143 |
"/ DefaultDebuggerBackgroundColor := nil. |
3387 | 144 |
"/ DefaultDebuggerBackgroundColor := Color red lightened. |
145 |
"/ DefaultDebuggerBackgroundColor := Color blue lightened lightened. |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
146 |
|
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
147 |
"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
|
148 |
"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
|
149 |
! |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
150 |
|
243 | 151 |
reinitialize |
7822 | 152 |
"reinitialize after an image-restart" |
153 |
||
243 | 154 |
self newDebugger |
155 |
! ! |
|
156 |
||
10203 | 157 |
!DebugView class methodsFor:'cleanup'! |
158 |
||
10205 | 159 |
lowSpaceCleanup |
10203 | 160 |
"in low memory situations, give up cached debuggers" |
161 |
||
162 |
CachedDebugger := nil. |
|
163 |
CachedExclusive := nil. |
|
164 |
OpenDebuggers := nil. |
|
11391 | 165 |
RememberedCallChain := nil. |
10203 | 166 |
|
167 |
" |
|
168 |
DebugView lowSpaceCleanup |
|
169 |
" |
|
170 |
||
11391 | 171 |
"Modified: / 08-03-2012 / 01:30:21 / cg" |
10203 | 172 |
! |
173 |
||
174 |
newDebugger |
|
13488 | 175 |
"force creation of a new debugger (give up cached debuggers). |
176 |
Call this, if you changed the debugger heavily, and you want to avoid |
|
177 |
that an old, cached debugger gets reused when the next error comes around." |
|
10203 | 178 |
|
179 |
CachedDebugger := nil. |
|
180 |
CachedExclusive := nil. |
|
181 |
OpenDebuggers := nil. |
|
182 |
||
183 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
|
15413 | 184 |
Debugger := self |
10203 | 185 |
]. |
186 |
||
187 |
" |
|
188 |
DebugView newDebugger |
|
189 |
" |
|
190 |
! ! |
|
191 |
||
192 |
!DebugView class methodsFor:'defaults'! |
|
193 |
||
14695 | 194 |
debuggerOnMainDisplayOnly |
195 |
^ DebuggerOnMainDisplayOnly ? true |
|
196 |
! |
|
197 |
||
10203 | 198 |
defaultIcon |
199 |
"return the browsers default window icon" |
|
200 |
||
201 |
<resource: #programImage> |
|
202 |
||
10205 | 203 |
^ ToolbarIconLibrary debug22x22Icon |
10203 | 204 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
205 |
||
206 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
207 |
! |
|
208 |
||
209 |
defaultIconForAboutBox |
|
210 |
<resource: #programImage> |
|
211 |
||
10205 | 212 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
10203 | 213 |
! |
214 |
||
215 |
defaultVerboseBacktrace |
|
216 |
<resource: #obsolete> |
|
217 |
self obsoleteMethodWarning. |
|
218 |
^ UserPreferences current verboseBacktraceInDebugger |
|
219 |
||
220 |
"Created: 11.1.1997 / 12:14:35 / cg" |
|
221 |
! |
|
222 |
||
223 |
defaultVerboseBacktrace:aBoolean |
|
224 |
<resource: #obsolete> |
|
225 |
self obsoleteMethodWarning. |
|
226 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
227 |
! |
|
228 |
||
13111 | 229 |
maxNumberOfDebuggers |
230 |
"to prevent debuggers from flooding the screen, |
|
231 |
in case of an error in an ever-forked background process |
|
232 |
(such as tooltip process)" |
|
233 |
||
234 |
^ 10 |
|
235 |
! |
|
236 |
||
10203 | 237 |
updateStyleCache |
238 |
"extract values from the styleSheet and cache them in class variables" |
|
239 |
||
240 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
241 |
||
242 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
|
243 |
||
244 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
245 |
! ! |
|
246 |
||
247 |
!DebugView class methodsFor:'ignoring halts'! |
|
248 |
||
249 |
haltIgnoreInformationFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
250 |
"the information (if any) about the ignore-state of a halt" |
|
251 |
||
252 |
IgnoredHalts isNil ifTrue:[^ nil]. |
|
253 |
||
10205 | 254 |
IgnoredHalts do:[:ign | |
15413 | 255 |
(ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
256 |
"/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) |
|
257 |
ifTrue:[ |
|
258 |
^ ign |
|
259 |
]. |
|
10203 | 260 |
]. |
261 |
^ nil. |
|
262 |
! |
|
263 |
||
264 |
hasIgnoredHalts |
|
265 |
self removeInactiveIgnores. |
|
266 |
^ IgnoredHalts notEmptyOrNil |
|
267 |
! |
|
268 |
||
15413 | 269 |
ignoreBreakpointWithParameter:parameterOrNil |
270 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
271 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
14608 | 272 |
|
12937 | 273 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
274 |
or until some time has elapsed. |
|
275 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
|
276 |
||
15413 | 277 |
self |
278 |
ignoreHaltOrBreakpoint:#halt |
|
279 |
method:nil line:nil |
|
280 |
parameter:parameterOrNil |
|
281 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
282 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
283 |
orIfCalledFromMethod:nil |
|
284 |
! |
|
285 |
||
286 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
287 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
288 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
14608 | 289 |
|
12937 | 290 |
"remember to ignore a halt in some method for some number of invocations |
291 |
or until some time has elapsed. |
|
292 |
With nil count and time arguments, such an ignored halt is reactivated" |
|
293 |
||
15413 | 294 |
self |
295 |
ignoreHaltOrBreakpoint:#halt |
|
296 |
method:haltingMethod line:lineNrOfHalt |
|
297 |
parameter:nil |
|
298 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
299 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
300 |
orIfCalledFromMethod:nil |
|
301 |
! |
|
302 |
||
303 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
304 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
305 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
306 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
14608 | 307 |
|
308 |
"remember to ignore a halt in some method for some number of invocations |
|
309 |
or until some time has elapsed. |
|
310 |
With nil count and time arguments, such an ignored halt is reactivated" |
|
311 |
||
15413 | 312 |
self |
313 |
ignoreHaltOrBreakpoint:#halt |
|
314 |
method:haltingMethod line:lineNrOfHalt |
|
315 |
parameter:nil |
|
316 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
317 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
318 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
319 |
! |
|
320 |
||
321 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
|
322 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
323 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
12937 | 324 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
325 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
326 |
or until some time has elapsed. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
327 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
328 |
|
14608 | 329 |
^ self |
15413 | 330 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
331 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
332 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
333 |
orIfCalledFromMethod:nil |
|
334 |
! |
|
335 |
||
336 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
|
337 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
338 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
339 |
orIfCalledFromMethod:ifCalledFromMethodOrNil |
|
14608 | 340 |
|
341 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
|
342 |
or until some time has elapsed. |
|
343 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
|
344 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
345 |
|oldEntry ign| |
12947 | 346 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
347 |
IgnoredHalts notNil ifTrue:[ |
15413 | 348 |
self removeInactiveIgnores. |
349 |
type == #halt ifTrue:[ |
|
350 |
oldEntry := IgnoredHalts |
|
351 |
detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil] |
|
352 |
ifNone:nil. |
|
353 |
] ifFalse:[ |
|
354 |
oldEntry := IgnoredHalts |
|
355 |
detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil] |
|
356 |
ifNone:nil. |
|
357 |
]. |
|
358 |
oldEntry notNil ifTrue:[ |
|
359 |
(processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[ |
|
360 |
receiverClassOrNil notNil ifTrue:[ |
|
361 |
oldEntry ignoreForReceiverClass:receiverClassOrNil. |
|
362 |
]. |
|
363 |
processOrNil notNil ifTrue:[ |
|
364 |
oldEntry ignoreForProcess:processOrNil. |
|
365 |
]. |
|
366 |
^ self. |
|
367 |
]. |
|
368 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
369 |
] |
|
370 |
]. |
|
371 |
||
372 |
(countOrNil notNil |
|
373 |
or:[dTOrNil notNil |
|
12937 | 374 |
or:[untilShiftKey == true |
375 |
or:[receiverClassOrNil notNil |
|
14608 | 376 |
or:[processOrNil notNil |
377 |
or:[ifCalledFromMethodOrNil notNil]]]]] |
|
12937 | 378 |
) ifTrue:[ |
15413 | 379 |
IgnoredHalts isNil ifTrue:[ |
380 |
IgnoredHalts := OrderedCollection new. |
|
381 |
]. |
|
382 |
type == #halt ifTrue:[ |
|
383 |
ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil. |
|
384 |
] ifFalse:[ |
|
385 |
ign := IgnoredHalt new breakpointWithParameter:parameterOrNil. |
|
386 |
]. |
|
387 |
||
388 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
389 |
ign ignoreCount:countOrNil. |
|
390 |
]. |
|
391 |
(dTOrNil notNil) ifTrue:[ |
|
392 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
393 |
]. |
|
394 |
untilShiftKey == true ifTrue:[ |
|
395 |
ign ignoreUntilShiftKeyPressed:true. |
|
396 |
]. |
|
397 |
receiverClassOrNil notNil ifTrue:[ |
|
398 |
ign ignoreForReceiverClass:receiverClassOrNil. |
|
399 |
]. |
|
400 |
processOrNil notNil ifTrue:[ |
|
401 |
ign ignoreForProcess:processOrNil. |
|
402 |
]. |
|
403 |
ifCalledFromMethodOrNil notNil ifTrue:[ |
|
404 |
ign ignoreIfCalledFromMethod:ifCalledFromMethodOrNil. |
|
405 |
]. |
|
406 |
IgnoredHalts add:ign. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
407 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
408 |
Smalltalk changed:#ignoredHalts. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
409 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
410 |
"Created: / 06-03-2012 / 12:37:58 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
411 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
412 |
|
12937 | 413 |
isBreakpointToBeIgnoredForParameter:parameter context:aContext modifyEntryCount:modifyCount |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
414 |
"/ should a breakpoint be ignored ? |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
415 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
416 |
IgnoredHalts isNil ifTrue:[^ false]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
417 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
418 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
419 |
IgnoredHalts do:[:ign | |
15413 | 420 |
(ign isForBreakpointWithParameter:parameter) ifTrue:[ |
421 |
Transcript show:'Debugger [info]: break ignored for ', parameter. |
|
422 |
||
423 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
424 |
ign isHaltIgnored ifFalse:[ |
|
425 |
Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter. |
|
426 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
427 |
]. |
|
428 |
^ true. |
|
429 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
430 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
431 |
|
13162 | 432 |
IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
433 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
434 |
^ false. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
435 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
436 |
"Created: / 06-03-2012 / 12:50:30 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
437 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
438 |
|
12937 | 439 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod context:aContext modifyEntryCount:modifyCount |
12562 | 440 |
"should a halt be ignored ?" |
441 |
||
442 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
443 |
||
444 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
|
445 |
IgnoredHalts do:[:ign | |
|
15413 | 446 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[ |
447 |
Transcript show:'Debugger [info]: halt/break ignored in ', haltingMethod whoString. |
|
448 |
Transcript show:' ('; show:ign; showCR:')'. |
|
449 |
||
450 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
451 |
ign isHaltIgnored ifFalse:[ |
|
452 |
Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString. |
|
453 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
454 |
]. |
|
455 |
^ true. |
|
456 |
]. |
|
12562 | 457 |
]. |
458 |
||
13162 | 459 |
IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty. |
12562 | 460 |
|
461 |
^ false. |
|
462 |
||
463 |
"Modified (comment): / 06-03-2012 / 12:51:43 / cg" |
|
464 |
! |
|
465 |
||
10203 | 466 |
removeInactiveIgnores |
467 |
IgnoredHalts notNil ifTrue:[ |
|
15413 | 468 |
IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
10203 | 469 |
]. |
470 |
! |
|
471 |
||
472 |
stopIgnoringHalts |
|
473 |
"forget about all ignored halts" |
|
474 |
||
475 |
IgnoredHalts := nil. |
|
476 |
Smalltalk changed:#ignoredHalts. |
|
15302 | 477 |
! |
478 |
||
479 |
stopIgnoringHaltsFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
480 |
"remove the information (if any) about the ignore-state of a halt; |
|
481 |
effectively reenables the breakpoint/halt" |
|
482 |
||
483 |
IgnoredHalts isNil ifTrue:[^ self]. |
|
484 |
||
485 |
IgnoredHalts := IgnoredHalts reject:[:ign | |
|
15413 | 486 |
(ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
15302 | 487 |
]. |
10203 | 488 |
! ! |
489 |
||
490 |
!DebugView class methodsFor:'instance creation / entering'! |
|
0 | 491 |
|
2421 | 492 |
enter |
493 |
"enter a debugger" |
|
494 |
||
5455 | 495 |
<context: #return> |
496 |
||
10205 | 497 |
^ self |
15413 | 498 |
enter:thisContext sender |
499 |
withMessage:'Debugger Entered' |
|
500 |
mayProceed:true. |
|
10205 | 501 |
! |
502 |
||
503 |
enter:aContext withMessage:aString |
|
2355 | 504 |
"enter a debugger" |
505 |
||
5455 | 506 |
<context: #return> |
507 |
||
2355 | 508 |
^ self |
15413 | 509 |
enter:aContext |
510 |
withMessage:aString |
|
511 |
mayProceed:true |
|
2355 | 512 |
! |
513 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
514 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 515 |
"enter a debugger; if this is a recursive invocation, enter |
516 |
a MiniDebugger instead. |
|
517 |
This is the standard way of entering the debugger; |
|
518 |
sent from error- and halt messages." |
|
0 | 519 |
|
3447 | 520 |
<context: #return> |
521 |
||
14695 | 522 |
|display| |
523 |
||
13111 | 524 |
(NumberOfDebuggers ? 0) > self maxNumberOfDebuggers ifTrue:[ |
15413 | 525 |
NumberOfDebuggers := self allInstances count:[:d | d isOpen]. |
526 |
NumberOfDebuggers > self maxNumberOfDebuggers ifTrue:[ |
|
527 |
MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true. |
|
528 |
]. |
|
13111 | 529 |
]. |
530 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
531 |
DebuggingDebugger == true ifTrue:[ |
15413 | 532 |
'==> enter1: (' print. aContext print. ')' printCR. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
533 |
]. |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
534 |
|
14695 | 535 |
display := (self debuggerOnMainDisplayOnly) |
15413 | 536 |
ifTrue:[ Display ] |
537 |
ifFalse:[ Screen current ]. |
|
14695 | 538 |
|
539 |
Screen currentScreenQuerySignal answer:display |
|
540 |
do:[ |
|
15413 | 541 |
StepInterruptPending := nil. |
542 |
ControlInterrupt handle:[:ex | |
|
543 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
|
544 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
545 |
ex proceed |
|
546 |
] do:[ |
|
547 |
|debugger| |
|
548 |
||
549 |
" |
|
550 |
well, it could be a stepping or sending debugger up there; |
|
551 |
in this case, return to it. This happens, when a stepping process |
|
552 |
runs into an error (for example, a halt). In this case, we want the |
|
553 |
stepping debugger to come up again instead of a new one. |
|
554 |
" |
|
555 |
(debugger := self openDebuggerForActiveProcess) notNil ifTrue:[ |
|
556 |
debugger unstep. |
|
557 |
debugger setLabelFor:aString in:Processor activeProcess. |
|
558 |
debugger mayProceed:mayProceed. |
|
559 |
^ debugger enter:aContext select:nil. |
|
560 |
]. |
|
561 |
]. |
|
562 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
|
14695 | 563 |
]. |
526 | 564 |
|
13666 | 565 |
"Modified: / 06-11-2013 / 20:58:54 / cg" |
53 | 566 |
! |
567 |
||
8347 | 568 |
enterException:ex |
569 |
"enter a debugger; if this is a recursive invocation, enter |
|
570 |
a MiniDebugger instead. |
|
571 |
This is the standard way of entering the debugger; |
|
572 |
sent from error- and halt messages." |
|
573 |
||
574 |
^ self |
|
15413 | 575 |
enter:ex returnableSuspendedContext |
576 |
withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger) |
|
577 |
mayProceed:(ex mayProceed). |
|
8347 | 578 |
! |
579 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
580 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 581 |
"enter a debugger - do not check for recursive invocation" |
582 |
||
5455 | 583 |
<context: #return> |
584 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
585 |
|aDebugger| |
266 | 586 |
|
587 |
StepInterruptPending := nil. |
|
13111 | 588 |
NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1. |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
589 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
590 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
591 |
"/ to avoid recursive debugging ... |
3447 | 592 |
ControlInterrupt handle:[:ex | |
15413 | 593 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
594 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
595 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
596 |
] do:[ |
15413 | 597 |
aDebugger := self new. |
3447 | 598 |
]. |
599 |
||
600 |
aDebugger isNil ifTrue:[ |
|
15413 | 601 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
602 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
603 |
mayProceed ifTrue:[ |
|
604 |
(Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs |
|
605 |
yesLabel:'Continue' noLabel:'Abort') |
|
606 |
ifTrue:[ |
|
607 |
^ nil |
|
608 |
]. |
|
609 |
] ifFalse:[ |
|
610 |
self information:'Error caught.\\Press OK to abort the operation.' withCRs. |
|
611 |
]. |
|
612 |
AbortOperationRequest raise. |
|
613 |
"not reached" |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
614 |
]. |
3447 | 615 |
|
616 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
617 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 618 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
619 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
620 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
621 |
" |
15413 | 622 |
nil halt |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
623 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
624 |
|
3447 | 625 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 626 |
! |
627 |
||
6430 | 628 |
enterWithMessage:message |
629 |
"enter a debugger" |
|
630 |
||
631 |
<context: #return> |
|
632 |
||
10205 | 633 |
^ self |
15413 | 634 |
enter:(thisContext sender) |
635 |
withMessage:message |
|
636 |
mayProceed:true. |
|
6430 | 637 |
! |
638 |
||
266 | 639 |
new |
10205 | 640 |
"return a new DebugView. |
2358 | 641 |
- return a cached debugger if it already exists. |
642 |
Also, care for remote displays on which no debugger is wanted |
|
643 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
644 |
||
14695 | 645 |
|debugger currentScreen debuggerScreen| |
2358 | 646 |
|
647 |
currentScreen := Screen current. |
|
14 | 648 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
649 |
currentScreen notNil ifTrue:[ |
15413 | 650 |
(currentScreen suppressDebugger) ifTrue:[ |
651 |
"/ no debuggers with that device - show an alertBox which aborts... |
|
652 |
^ nil. |
|
653 |
]. |
|
654 |
(currentScreen mayOpenDebugger) ifFalse:[ |
|
655 |
"/ no debugger on that device - but on the main screen |
|
656 |
currentScreen := Display ? Screen default. |
|
657 |
]. |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
658 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
659 |
|
266 | 660 |
" |
10205 | 661 |
need a blocking debugger if no processes or |
662 |
or if its a timing/interrupt process |
|
266 | 663 |
(because otherwise we would not get any events here ... |
664 |
" |
|
665 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
15413 | 666 |
((debugger := CachedExclusive) isNil |
667 |
or:[debugger device ~~ currentScreen |
|
668 |
or:[currentScreen isNil |
|
669 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
|
670 |
debugger := self newExclusive |
|
671 |
]. |
|
672 |
CachedExclusive := nil. |
|
266 | 673 |
] ifFalse:[ |
15413 | 674 |
CachedDebugger notNil ifTrue:[ |
675 |
(CachedDebugger device ~~ currentScreen |
|
676 |
or:[currentScreen isNil |
|
677 |
or:[currentScreen isOpen not |
|
678 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
|
679 |
CachedDebugger := nil |
|
680 |
] |
|
681 |
]. |
|
682 |
||
683 |
(debugger := CachedDebugger) notNil ifTrue:[ |
|
684 |
CachedDebugger := nil. |
|
685 |
] ifFalse:[ |
|
686 |
debuggerScreen := currentScreen. |
|
687 |
debuggerScreen isNil ifTrue:[ |
|
688 |
"/ use the default display |
|
689 |
debuggerScreen := Screen default. |
|
690 |
]. |
|
691 |
(debuggerScreen isNil |
|
692 |
or:[debuggerScreen isOpen not |
|
693 |
"/ or:[debuggerDevice mayOpenDebugger not] |
|
694 |
]) ifTrue:[ |
|
695 |
"/ no debugger |
|
696 |
^ nil. |
|
697 |
]. |
|
698 |
||
699 |
Screen currentScreenQuerySignal answer:debuggerScreen |
|
700 |
do:[ |
|
701 |
debugger := super new. |
|
702 |
]. |
|
703 |
debugger label:'Debugger'. |
|
704 |
debugger icon:self defaultIcon. |
|
705 |
] |
|
266 | 706 |
]. |
73 | 707 |
^ debugger |
875 | 708 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
709 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 710 |
! |
0 | 711 |
|
266 | 712 |
newExclusive |
713 |
"return a debugger for exclusive display access" |
|
714 |
||
715 |
|debugger| |
|
105 | 716 |
|
266 | 717 |
debugger := super new. |
718 |
debugger label:'Debugger'. |
|
875 | 719 |
debugger icon:self defaultIcon. |
266 | 720 |
debugger exclusive:true. |
721 |
^ debugger |
|
875 | 722 |
|
723 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 724 |
! |
725 |
||
13666 | 726 |
openDebuggerForActiveProcess |
727 |
"return an already open debugger for the active process, or nil, if there is none. |
|
728 |
Open debuggers exist when stepping only, as then, the debugger is left open until the step |
|
729 |
is reached, to avoid too much flickering and redrawing on the screen" |
|
730 |
||
731 |
|active| |
|
732 |
||
733 |
" |
|
734 |
well, it could be a stepping or sending debugger up there; |
|
735 |
in this case, return to it. This happens, when a stepping process |
|
736 |
runs into an error (for example, a halt). In this case, we want the |
|
737 |
stepping debugger to come up again instead of a new one. |
|
738 |
" |
|
739 |
OpenDebuggers notNil ifTrue:[ |
|
15413 | 740 |
active := Processor activeProcess. |
741 |
OpenDebuggers do:[:aDebugger | |
|
742 |
|debuggersProcess| |
|
743 |
||
744 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
|
745 |
debuggersProcess := aDebugger inspectedProcess. |
|
746 |
debuggersProcess == active ifTrue:[ |
|
747 |
aDebugger device isOpen ifTrue:[ |
|
748 |
DebuggingDebugger == true ifTrue:[ |
|
749 |
'reusing cached debugger' errorPrintCR. |
|
750 |
]. |
|
751 |
aDebugger unstep. |
|
752 |
^ aDebugger. |
|
753 |
] |
|
754 |
]. |
|
755 |
(debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[ |
|
756 |
aDebugger destroy. |
|
757 |
]. |
|
758 |
] |
|
759 |
] |
|
13666 | 760 |
]. |
761 |
^ nil |
|
762 |
||
763 |
"Created: / 06-11-2013 / 20:57:49 / cg" |
|
764 |
! |
|
765 |
||
29 | 766 |
openOn:aProcess |
767 |
"start a debugger on aProcess |
|
768 |
(actually not more than a good-looking inspector)" |
|
15 | 769 |
|
52 | 770 |
|aDebugger label nm| |
15 | 771 |
|
772 |
aDebugger := super new. |
|
875 | 773 |
aDebugger icon:self defaultIcon. |
29 | 774 |
aProcess notNil ifTrue:[ |
15413 | 775 |
nm := aProcess name. |
776 |
nm notNil ifTrue:[ |
|
777 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
778 |
] ifFalse:[ |
|
779 |
nm := aProcess id printString |
|
780 |
]. |
|
781 |
label := 'Debugger [' , nm , ']'. |
|
29 | 782 |
] ifFalse:[ |
15413 | 783 |
label := 'no process' |
29 | 784 |
]. |
1114 | 785 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 786 |
aDebugger openOn:aProcess. |
787 |
^ nil |
|
875 | 788 |
|
1114 | 789 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 790 |
! ! |
791 |
||
3269 | 792 |
!DebugView class methodsFor:'menu specs'! |
793 |
||
12437 | 794 |
breakPointMenuSpec |
795 |
"This resource specification was automatically generated |
|
796 |
by the MenuEditor of ST/X." |
|
797 |
||
798 |
"Do not manually edit this!! If it is corrupted, |
|
799 |
the MenuEditor may not be able to read the specification." |
|
800 |
||
801 |
||
802 |
" |
|
803 |
MenuEditor new openOnClass:DebugView andSelector:#breakPointMenuSpec |
|
804 |
(Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp |
|
805 |
" |
|
806 |
||
807 |
<resource: #menu> |
|
808 |
||
15413 | 809 |
^ |
12437 | 810 |
#(Menu |
15413 | 811 |
( |
812 |
(MenuItem |
|
813 |
enabled: canRemoveBreakpoint |
|
814 |
label: 'Remove Breakpoint' |
|
815 |
itemValue: removeBreakpoint |
|
816 |
) |
|
817 |
(MenuItem |
|
818 |
label: 'Remove all Breakpoints' |
|
819 |
itemValue: removeAllBreakpoints |
|
820 |
) |
|
821 |
(MenuItem |
|
822 |
label: '-' |
|
823 |
) |
|
824 |
(MenuItem |
|
825 |
label: 'Ignore this Halt/BreakPoint' |
|
826 |
submenu: |
|
827 |
(Menu |
|
828 |
( |
|
829 |
(MenuItem |
|
830 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
831 |
label: 'Forever (Until Ignoring is Stopped)' |
|
832 |
itemValue: ignoreHaltForever |
|
833 |
) |
|
834 |
(MenuItem |
|
835 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
836 |
label: 'For Some Time...' |
|
837 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
838 |
) |
|
839 |
(MenuItem |
|
840 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
841 |
label: 'For the Next N Times...' |
|
842 |
itemValue: openIgnoreHaltNTimesDialog |
|
843 |
) |
|
844 |
(MenuItem |
|
845 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
846 |
label: 'Until Shift-Key is Pressed' |
|
847 |
itemValue: ignoreHaltUntilShiftKeyIsPressed |
|
848 |
) |
|
849 |
(MenuItem |
|
850 |
label: '-' |
|
851 |
) |
|
852 |
(MenuItem |
|
853 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
854 |
label: 'In Current Process' |
|
855 |
itemValue: ignoreHaltForCurrentProcess |
|
856 |
) |
|
857 |
(MenuItem |
|
858 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
859 |
label: 'For this Receiver Class' |
|
860 |
itemValue: ignoreHaltForThisReceiverClass |
|
861 |
) |
|
862 |
(MenuItem |
|
863 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
864 |
label: 'If Called from Any Of' |
|
865 |
submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf |
|
866 |
) |
|
867 |
) |
|
868 |
nil |
|
869 |
nil |
|
870 |
) |
|
871 |
) |
|
872 |
(MenuItem |
|
873 |
enabled: isStoppedAtBreakPointWithParameter |
|
874 |
label: 'Ignore all BreakPoints with this Parameter' |
|
875 |
submenu: |
|
876 |
(Menu |
|
877 |
( |
|
878 |
(MenuItem |
|
879 |
enabled: isStoppedAtBreakPointWithParameter |
|
880 |
label: 'Forever (Reenable in BreakPoint-Browser)' |
|
881 |
itemValue: ignoreBreakpointsWithThisParameterForever |
|
882 |
) |
|
883 |
(MenuItem |
|
884 |
enabled: isStoppedAtBreakPointWithParameter |
|
885 |
label: 'For Some Time...' |
|
886 |
itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
|
887 |
) |
|
888 |
(MenuItem |
|
889 |
enabled: isStoppedAtBreakPointWithParameter |
|
890 |
label: 'For the Next N Times...' |
|
891 |
itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog |
|
892 |
) |
|
893 |
(MenuItem |
|
894 |
enabled: isStoppedAtBreakPointWithParameter |
|
895 |
label: 'Until Shift-Key is Pressed' |
|
896 |
itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
|
897 |
) |
|
898 |
(MenuItem |
|
899 |
label: '-' |
|
900 |
) |
|
901 |
(MenuItem |
|
902 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
903 |
label: 'In Current Process' |
|
904 |
itemValue: ignoreAllHaltsForCurrentProcess |
|
905 |
) |
|
906 |
(MenuItem |
|
907 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
908 |
label: 'For this Receiver Class' |
|
909 |
itemValue: ignoreAllHaltsForThisReceiverClass |
|
910 |
) |
|
911 |
(MenuItem |
|
912 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
913 |
label: 'If Called from Any Of' |
|
914 |
submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
|
915 |
) |
|
916 |
) |
|
917 |
nil |
|
918 |
nil |
|
919 |
) |
|
920 |
) |
|
921 |
(MenuItem |
|
922 |
label: 'Ignore all Halts/BreakPoints' |
|
923 |
submenu: |
|
924 |
(Menu |
|
925 |
( |
|
926 |
(MenuItem |
|
927 |
label: 'Forever (Until Ignoring is Stopped)' |
|
928 |
itemValue: ignoreAllHaltsForever |
|
929 |
) |
|
930 |
(MenuItem |
|
931 |
label: 'For Some Time...' |
|
932 |
itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
|
933 |
) |
|
934 |
(MenuItem |
|
935 |
label: 'Until Shift-Key is Pressed' |
|
936 |
itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
|
937 |
) |
|
938 |
) |
|
939 |
nil |
|
940 |
nil |
|
941 |
) |
|
942 |
) |
|
943 |
(MenuItem |
|
944 |
enabled: hasHaltsToIgnore |
|
945 |
label: 'Stop Ignoring' |
|
946 |
itemValue: stopIgnoringHalts |
|
947 |
) |
|
948 |
(MenuItem |
|
949 |
label: '-' |
|
950 |
) |
|
951 |
(MenuItem |
|
952 |
enabled: canAddBreakpoint |
|
953 |
label: 'Add Breakpoint' |
|
954 |
itemValue: addBreakpoint |
|
955 |
) |
|
956 |
(MenuItem |
|
957 |
label: 'Manage Breakpoints' |
|
958 |
itemValue: openBreakPointBrowser |
|
959 |
) |
|
960 |
(MenuItem |
|
961 |
label: '-' |
|
962 |
) |
|
963 |
(MenuItem |
|
964 |
label: 'Allow Halt in Debugger' |
|
965 |
itemValue: allowBreakPointsInDebugger: |
|
966 |
indication: allowBreakPointsInDebugger |
|
967 |
) |
|
968 |
) |
|
969 |
nil |
|
970 |
nil |
|
12437 | 971 |
) |
972 |
! |
|
973 |
||
974 |
classMenuSpec |
|
975 |
"This resource specification was automatically generated |
|
976 |
by the MenuEditor of ST/X." |
|
977 |
||
978 |
"Do not manually edit this!! If it is corrupted, |
|
979 |
the MenuEditor may not be able to read the specification." |
|
980 |
||
981 |
||
982 |
" |
|
12840 | 983 |
MenuEditor new openOnClass:DebugView andSelector:#receiverMenuSpec |
984 |
(Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp |
|
12437 | 985 |
" |
986 |
||
987 |
<resource: #menu> |
|
988 |
||
15413 | 989 |
^ |
12437 | 990 |
#(Menu |
15413 | 991 |
( |
992 |
(MenuItem |
|
993 |
enabled: canBrowseImplementingClass |
|
994 |
label: 'Browse Implementing Class' |
|
995 |
itemValue: browseImplementingClass |
|
996 |
) |
|
997 |
(MenuItem |
|
998 |
enabled: canBrowseReceiversClass |
|
999 |
label: 'Browse Receiver''s Class' |
|
1000 |
itemValue: browseReceiversClass |
|
1001 |
) |
|
1002 |
(MenuItem |
|
1003 |
enabled: canBrowseProcessesApplication |
|
1004 |
label: 'Browse Application Class' |
|
1005 |
itemValue: browseProcessesApplication |
|
1006 |
) |
|
1007 |
(MenuItem |
|
1008 |
label: '-' |
|
1009 |
) |
|
1010 |
(MenuItem |
|
1011 |
enabled: canBrowseClassHierarchy |
|
1012 |
label: 'Browse Receiver''s Class Hierarchy' |
|
1013 |
itemValue: browseClassHierarchy |
|
1014 |
isVisible: false |
|
1015 |
) |
|
1016 |
(MenuItem |
|
1017 |
enabled: canBrowseFullClassProtocol |
|
1018 |
label: 'Browse Receiver''s Full Protocol' |
|
1019 |
itemValue: browseFullClassProtocol |
|
1020 |
isVisible: false |
|
1021 |
) |
|
1022 |
(MenuItem |
|
1023 |
label: '-' |
|
1024 |
isVisible: false |
|
1025 |
) |
|
1026 |
(MenuItem |
|
1027 |
enabled: canInspectWidgetHierarchy |
|
1028 |
label: 'Inspect Widget Hierarchy' |
|
1029 |
itemValue: inspectWidgetHierarchy |
|
1030 |
) |
|
1031 |
) |
|
1032 |
nil |
|
1033 |
nil |
|
12437 | 1034 |
) |
1035 |
! |
|
1036 |
||
1037 |
contextMenuSpec |
|
1038 |
"This resource specification was automatically generated |
|
1039 |
by the MenuEditor of ST/X." |
|
1040 |
||
1041 |
"Do not manually edit this!! If it is corrupted, |
|
1042 |
the MenuEditor may not be able to read the specification." |
|
1043 |
||
1044 |
||
1045 |
" |
|
1046 |
MenuEditor new openOnClass:DebugView andSelector:#contextMenuSpec |
|
1047 |
(Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp |
|
1048 |
" |
|
1049 |
||
1050 |
<resource: #menu> |
|
1051 |
||
15413 | 1052 |
^ |
12437 | 1053 |
#(Menu |
15413 | 1054 |
( |
1055 |
(MenuItem |
|
1056 |
enabled: canReturn |
|
1057 |
label: 'Return' |
|
1058 |
itemValue: doReturn |
|
1059 |
) |
|
1060 |
(MenuItem |
|
1061 |
enabled: canRestart |
|
1062 |
label: 'Restart' |
|
1063 |
itemValue: doRestart |
|
1064 |
) |
|
1065 |
(MenuItem |
|
1066 |
label: '-' |
|
1067 |
) |
|
1068 |
(MenuItem |
|
1069 |
enabled: hasContextSelected |
|
1070 |
label: 'Inspect' |
|
1071 |
itemValue: inspectContext |
|
1072 |
) |
|
1073 |
(MenuItem |
|
1074 |
label: 'Copy WalkBack Text' |
|
1075 |
itemValue: copyWalkbackText |
|
1076 |
) |
|
1077 |
(MenuItem |
|
1078 |
label: 'Inspect Method' |
|
1079 |
itemValue: inspectContextsMethod |
|
1080 |
) |
|
1081 |
(MenuItem |
|
1082 |
label: 'Bookmark Method in SystemBrowser' |
|
1083 |
itemValue: addBrowserBookmark |
|
1084 |
) |
|
1085 |
(MenuItem |
|
1086 |
label: '-' |
|
1087 |
) |
|
1088 |
(MenuItem |
|
1089 |
enabled: hasBlockContextSelected |
|
1090 |
label: 'Find Home Context in Caller Chain...' |
|
1091 |
itemValue: findHomeContext |
|
1092 |
) |
|
1093 |
(MenuItem |
|
1094 |
enabled: hasContextSelected |
|
1095 |
label: 'Find Context with String in Source...' |
|
1096 |
itemValue: findContextWithStringInSource |
|
1097 |
) |
|
1098 |
(MenuItem |
|
1099 |
enabled: hasContextSelected |
|
1100 |
label: 'Find Context with Value in Variable...' |
|
1101 |
itemValue: findContextWithValueInVariable |
|
1102 |
) |
|
1103 |
(MenuItem |
|
1104 |
enabled: hasContextSelected |
|
1105 |
label: 'Find Next Exception Handler' |
|
1106 |
itemValue: findNextExceptionHandlerContext |
|
1107 |
) |
|
1108 |
(MenuItem |
|
1109 |
enabled: hasContextSelected |
|
1110 |
label: 'Find Handler For...' |
|
1111 |
itemValue: findHandlerFor |
|
1112 |
) |
|
1113 |
(MenuItem |
|
1114 |
label: 'Find Dialog Opener...' |
|
1115 |
itemValue: doGotoDialogOpener |
|
1116 |
) |
|
1117 |
(MenuItem |
|
1118 |
label: 'Find Application Action Method...' |
|
1119 |
itemValue: doGotoApplicationActionMethod |
|
1120 |
) |
|
1121 |
(MenuItem |
|
1122 |
label: '-' |
|
1123 |
) |
|
1124 |
(MenuItem |
|
1125 |
label: 'Remember Callchain && Highlight on Next Entry' |
|
1126 |
itemValue: rememberCallchain |
|
1127 |
) |
|
1128 |
(MenuItem |
|
1129 |
label: 'Clear Remembered Callchain' |
|
1130 |
itemValue: clearRememberedCallchain |
|
1131 |
) |
|
1132 |
) |
|
1133 |
nil |
|
1134 |
nil |
|
12437 | 1135 |
) |
1136 |
! |
|
1137 |
||
1138 |
fileMenuSpec |
|
1139 |
"This resource specification was automatically generated |
|
1140 |
by the MenuEditor of ST/X." |
|
1141 |
||
1142 |
"Do not manually edit this!! If it is corrupted, |
|
1143 |
the MenuEditor may not be able to read the specification." |
|
1144 |
||
1145 |
||
1146 |
" |
|
1147 |
MenuEditor new openOnClass:DebugView andSelector:#fileMenuSpec |
|
1148 |
(Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp |
|
1149 |
" |
|
1150 |
||
1151 |
<resource: #menu> |
|
1152 |
||
15413 | 1153 |
^ |
12437 | 1154 |
#(Menu |
15413 | 1155 |
( |
1156 |
(MenuItem |
|
1157 |
enabled: canSendEmail |
|
1158 |
label: 'Report a Bug via eMail...' |
|
1159 |
itemValue: doOpenReportMailApp |
|
1160 |
) |
|
1161 |
(MenuItem |
|
1162 |
label: '-' |
|
1163 |
) |
|
1164 |
(MenuItem |
|
1165 |
enabled: canCloseAllDebuggers |
|
1166 |
label: 'Close all Debuggers...' |
|
1167 |
itemValue: closeAllDebuggers |
|
1168 |
isVisible: isNotInspecting |
|
1169 |
) |
|
1170 |
(MenuItem |
|
1171 |
label: '-' |
|
1172 |
) |
|
1173 |
(MenuItem |
|
1174 |
label: 'Exit' |
|
1175 |
itemValue: closeRequest |
|
1176 |
isVisible: isInspecting |
|
1177 |
) |
|
1178 |
(MenuItem |
|
1179 |
label: 'Close Debugger and Abort' |
|
1180 |
itemValue: closeRequest |
|
1181 |
isVisible: isNotInspecting |
|
1182 |
) |
|
1183 |
) |
|
1184 |
nil |
|
1185 |
nil |
|
12437 | 1186 |
) |
1187 |
! |
|
1188 |
||
1189 |
helpMenuSpec |
|
1190 |
"This resource specification was automatically generated |
|
1191 |
by the MenuEditor of ST/X." |
|
1192 |
||
1193 |
"Do not manually edit this!! If it is corrupted, |
|
1194 |
the MenuEditor may not be able to read the specification." |
|
1195 |
||
1196 |
||
1197 |
" |
|
1198 |
MenuEditor new openOnClass:DebugView andSelector:#helpMenuSpec |
|
1199 |
(Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp |
|
1200 |
" |
|
1201 |
||
1202 |
<resource: #menu> |
|
1203 |
||
15413 | 1204 |
^ |
12437 | 1205 |
#(Menu |
15413 | 1206 |
( |
1207 |
(MenuItem |
|
1208 |
label: 'Debugger''s Documentation' |
|
1209 |
itemValue: openHTMLDocument: |
|
1210 |
argument: 'tools/debugger/TOP.html' |
|
1211 |
) |
|
1212 |
(MenuItem |
|
1213 |
label: '-' |
|
1214 |
) |
|
1215 |
(MenuItem |
|
1216 |
label: 'About DebugView...' |
|
1217 |
itemValue: openAboutThisApplication |
|
1218 |
) |
|
1219 |
) |
|
1220 |
nil |
|
1221 |
nil |
|
12437 | 1222 |
) |
1223 |
! |
|
1224 |
||
3269 | 1225 |
menuSpec |
1226 |
"This resource specification was automatically generated |
|
1227 |
by the MenuEditor of ST/X." |
|
1228 |
||
1229 |
"Do not manually edit this!! If it is corrupted, |
|
1230 |
the MenuEditor may not be able to read the specification." |
|
1231 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
1232 |
|
3269 | 1233 |
" |
1234 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
1235 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
1236 |
" |
|
1237 |
||
1238 |
<resource: #menu> |
|
1239 |
||
15413 | 1240 |
^ |
5875 | 1241 |
#(Menu |
15413 | 1242 |
( |
1243 |
(MenuItem |
|
1244 |
label: 'File' |
|
1245 |
submenuChannel: fileMenuSpec |
|
1246 |
) |
|
1247 |
(MenuItem |
|
1248 |
label: 'View' |
|
1249 |
submenuChannel: viewMenuSpec |
|
1250 |
) |
|
1251 |
(MenuItem |
|
1252 |
label: 'Process' |
|
1253 |
submenuChannel: processMenuSpec |
|
1254 |
) |
|
1255 |
(MenuItem |
|
1256 |
label: 'Context' |
|
1257 |
submenuChannel: contextMenuSpec |
|
1258 |
) |
|
1259 |
(MenuItem |
|
1260 |
label: 'Receiver' |
|
1261 |
submenuChannel: classMenuSpec |
|
1262 |
) |
|
1263 |
(MenuItem |
|
1264 |
label: 'Selector' |
|
1265 |
submenuChannel: selectorMenuSpec |
|
1266 |
) |
|
1267 |
(MenuItem |
|
1268 |
label: 'Breakpoint' |
|
1269 |
submenuChannel: breakPointMenuSpec |
|
1270 |
) |
|
1271 |
(MenuItem |
|
1272 |
label: 'MENU_Help' |
|
1273 |
startGroup: conditionalRight |
|
1274 |
submenuChannel: helpMenuSpec |
|
1275 |
) |
|
1276 |
) |
|
1277 |
nil |
|
1278 |
nil |
|
12437 | 1279 |
) |
1280 |
! |
|
1281 |
||
1282 |
processMenuSpec |
|
1283 |
"This resource specification was automatically generated |
|
1284 |
by the MenuEditor of ST/X." |
|
1285 |
||
1286 |
"Do not manually edit this!! If it is corrupted, |
|
1287 |
the MenuEditor may not be able to read the specification." |
|
1288 |
||
1289 |
||
1290 |
" |
|
1291 |
MenuEditor new openOnClass:DebugView andSelector:#processMenuSpec |
|
1292 |
(Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp |
|
1293 |
" |
|
1294 |
||
1295 |
<resource: #menu> |
|
1296 |
||
15413 | 1297 |
^ |
12437 | 1298 |
#(Menu |
15413 | 1299 |
( |
1300 |
(MenuItem |
|
1301 |
label: 'Continue' |
|
1302 |
itemValue: doContinue |
|
1303 |
) |
|
1304 |
(MenuItem |
|
1305 |
label: 'Next (Line-Step)' |
|
1306 |
itemValue: doNext |
|
1307 |
) |
|
1308 |
(MenuItem |
|
1309 |
label: 'Step' |
|
1310 |
itemValue: doStep |
|
1311 |
) |
|
1312 |
(MenuItem |
|
1313 |
label: '-' |
|
1314 |
) |
|
1315 |
(MenuItem |
|
1316 |
label: 'After 5 Seconds' |
|
1317 |
submenu: |
|
1318 |
(Menu |
|
1319 |
( |
|
1320 |
(MenuItem |
|
1321 |
label: 'Continue' |
|
1322 |
itemValue: doContinueAfterDelay |
|
1323 |
) |
|
1324 |
(MenuItem |
|
1325 |
label: 'Next (Line-Step)' |
|
1326 |
itemValue: doNextAfterDelay |
|
1327 |
) |
|
1328 |
(MenuItem |
|
1329 |
label: 'Step' |
|
1330 |
itemValue: doStepAfterDelay |
|
1331 |
) |
|
1332 |
) |
|
1333 |
nil |
|
1334 |
nil |
|
1335 |
) |
|
1336 |
) |
|
1337 |
(MenuItem |
|
1338 |
label: '-' |
|
1339 |
) |
|
1340 |
(MenuItem |
|
1341 |
label: 'Skip to Cursor Line' |
|
1342 |
itemValue: skip |
|
1343 |
) |
|
1344 |
(MenuItem |
|
1345 |
label: 'Step Out (Skip until Return)' |
|
1346 |
itemValue: skipForReturn |
|
1347 |
) |
|
1348 |
(MenuItem |
|
1349 |
label: 'Skip until Entering...' |
|
1350 |
itemValue: skipUntilEntering |
|
1351 |
) |
|
1352 |
(MenuItem |
|
1353 |
label: '-' |
|
1354 |
) |
|
1355 |
(MenuItem |
|
1356 |
label: 'Abort' |
|
1357 |
itemValue: doAbort |
|
1358 |
) |
|
1359 |
(MenuItem |
|
1360 |
enabled: abortAllIsHandled |
|
1361 |
label: 'Abort All' |
|
1362 |
itemValue: doAbortAll |
|
1363 |
) |
|
1364 |
(MenuItem |
|
1365 |
label: '-' |
|
1366 |
) |
|
1367 |
(MenuItem |
|
1368 |
label: 'Inspect' |
|
1369 |
itemValue: doInspectProcess |
|
1370 |
) |
|
1371 |
(MenuItem |
|
1372 |
label: 'Change Priority...' |
|
1373 |
itemValue: doChangeProcessPriority |
|
1374 |
) |
|
1375 |
(MenuItem |
|
1376 |
label: '-' |
|
1377 |
) |
|
1378 |
(MenuItem |
|
1379 |
label: 'Terminate' |
|
1380 |
itemValue: doTerminate |
|
1381 |
) |
|
1382 |
(MenuItem |
|
1383 |
label: 'Hard Terminate (Danger)' |
|
1384 |
itemValue: quickTerminate |
|
1385 |
isVisible: false |
|
1386 |
) |
|
1387 |
) |
|
1388 |
nil |
|
1389 |
nil |
|
12437 | 1390 |
) |
1391 |
! |
|
1392 |
||
1393 |
selectorMenuSpec |
|
1394 |
"This resource specification was automatically generated |
|
1395 |
by the MenuEditor of ST/X." |
|
1396 |
||
1397 |
"Do not manually edit this!! If it is corrupted, |
|
1398 |
the MenuEditor may not be able to read the specification." |
|
1399 |
||
1400 |
||
1401 |
" |
|
1402 |
MenuEditor new openOnClass:DebugView andSelector:#selectorMenuSpec |
|
1403 |
(Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp |
|
1404 |
" |
|
1405 |
||
1406 |
<resource: #menu> |
|
1407 |
||
15413 | 1408 |
^ |
12437 | 1409 |
#(Menu |
15413 | 1410 |
( |
1411 |
(MenuItem |
|
1412 |
label: 'Browse Implementors...' |
|
1413 |
itemValue: browseImplementorsOf |
|
1414 |
) |
|
1415 |
(MenuItem |
|
1416 |
label: 'Browse Senders...' |
|
1417 |
itemValue: browseSendersOf |
|
1418 |
) |
|
1419 |
(MenuItem |
|
1420 |
label: '-' |
|
1421 |
) |
|
1422 |
(MenuItem |
|
1423 |
enabled: canDefineMethod |
|
1424 |
label: 'Define Missing Method' |
|
1425 |
itemValue: doDefineMethod |
|
1426 |
) |
|
1427 |
) |
|
1428 |
nil |
|
1429 |
nil |
|
12437 | 1430 |
) |
1431 |
! |
|
1432 |
||
1433 |
viewMenuSpec |
|
1434 |
"This resource specification was automatically generated |
|
1435 |
by the MenuEditor of ST/X." |
|
1436 |
||
1437 |
"Do not manually edit this!! If it is corrupted, |
|
1438 |
the MenuEditor may not be able to read the specification." |
|
1439 |
||
1440 |
||
1441 |
" |
|
1442 |
MenuEditor new openOnClass:DebugView andSelector:#viewMenuSpec |
|
1443 |
(Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp |
|
1444 |
" |
|
1445 |
||
1446 |
<resource: #menu> |
|
1447 |
||
15413 | 1448 |
^ |
12437 | 1449 |
#(Menu |
15413 | 1450 |
( |
1451 |
(MenuItem |
|
1452 |
enabled: canShowMore |
|
1453 |
label: 'Show More WalkBack' |
|
1454 |
itemValue: showMoreWalkback |
|
1455 |
) |
|
1456 |
(MenuItem |
|
1457 |
enabled: canShowMore |
|
1458 |
label: 'Show Full WalkBack' |
|
1459 |
itemValue: showFullWalkback |
|
1460 |
) |
|
1461 |
(MenuItem |
|
1462 |
label: '-' |
|
1463 |
) |
|
1464 |
(MenuItem |
|
1465 |
label: 'Show Dense WalkBack' |
|
1466 |
itemValue: showingDenseWalkback: |
|
1467 |
hideMenuOnActivated: false |
|
1468 |
indication: showingDenseWalkback |
|
1469 |
) |
|
1470 |
(MenuItem |
|
1471 |
enabled: notShowingDenseWalkbackHolder |
|
1472 |
label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)' |
|
1473 |
itemValue: showingSupportCode: |
|
1474 |
hideMenuOnActivated: false |
|
1475 |
indication: showingSupportCode |
|
1476 |
) |
|
1477 |
(MenuItem |
|
1478 |
label: '-' |
|
1479 |
) |
|
1480 |
(MenuItem |
|
1481 |
label: 'Raise Debugger when Entering' |
|
1482 |
itemValue: autoRaiseView: |
|
1483 |
hideMenuOnActivated: false |
|
1484 |
indication: autoRaiseView |
|
1485 |
) |
|
1486 |
(MenuItem |
|
1487 |
label: '-' |
|
1488 |
) |
|
1489 |
(MenuItem |
|
1490 |
label: 'Settings...' |
|
1491 |
itemValue: openSettingsDialog |
|
1492 |
) |
|
1493 |
) |
|
1494 |
nil |
|
1495 |
nil |
|
3269 | 1496 |
) |
1497 |
! ! |
|
1498 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1499 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1500 |
|
4121 | 1501 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1502 |
"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
|
1503 |
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
|
1504 |
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
|
1505 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1506 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1507 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1508 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1509 |
|
12839 | 1510 |
"/ fetch some contexts... |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1511 |
someContexts := Array new:25. |
2042 | 1512 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1513 |
idx := 1. |
10205 | 1514 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
15413 | 1515 |
someContexts at:idx put:con. |
1516 |
con := con sender. |
|
1517 |
idx := idx + 1. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1518 |
]. |
12839 | 1519 |
"/ search... |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1520 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1521 |
^ someContexts at:idx. |
13398 | 1522 |
|
1523 |
"Modified: / 28-08-2013 / 20:12:47 / cg" |
|
3447 | 1524 |
! |
1525 |
||
10205 | 1526 |
interestingContextIndexIn:aContextArray |
12039 | 1527 |
"return an interesting context's index, or nil. |
1528 |
This is the context initially shown (selected) in the walkback. |
|
3447 | 1529 |
We move up the calling chain, skipping all intermediate Signal |
12039 | 1530 |
and Exception contexts, to present the context in which the error actually occured. |
13398 | 1531 |
Just for your (my) convenience :-)" |
3447 | 1532 |
|
13309 | 1533 |
|con found offset sel prev rcvr nMax idx methodHome method| |
3447 | 1534 |
|
13398 | 1535 |
"/ Transcript showCR:'x'. |
7713 | 1536 |
"/ Transcript showCR:aContextArray. |
7648 | 1537 |
|
3447 | 1538 |
nMax := aContextArray size. |
1539 |
nMax <= 1 ifTrue:[^ 1]. |
|
1540 |
con := aContextArray at:1. |
|
1541 |
con isBlockContext ifTrue:[^ 1]. |
|
12039 | 1542 |
(con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1]. "/ we are already there |
3447 | 1543 |
|
1544 |
"/ somewhere, at the bottom, there must be a raise ... |
|
1545 |
"/ find the exception |
|
1546 |
1 to:5 do:[:i | |
|
15413 | 1547 |
found isNil ifTrue:[ |
1548 |
con := aContextArray at:i ifAbsent:nil. |
|
1549 |
con notNil ifTrue:[ |
|
1550 |
sel := con selector ? ''. |
|
1551 |
(sel isSymbol |
|
1552 |
and:[ (sel startsWith:'raise') |
|
1553 |
and:[ ((rcvr := con receiver) isLazyValue not) |
|
1554 |
and:[ rcvr isExceptionCreator]]]) ifTrue:[ |
|
1555 |
offset := i. |
|
1556 |
found := con. |
|
1557 |
||
1558 |
"/ if this is a noHandler exception, |
|
1559 |
"/ skip forward to the erronous context |
|
1560 |
(rcvr isException) ifTrue:[ |
|
1561 |
rcvr creator == Signal noHandlerSignal ifTrue:[ |
|
1562 |
found := rcvr suspendedContext. |
|
1563 |
offset := aContextArray identityIndexOf:found. |
|
1564 |
] |
|
1565 |
]. |
|
1566 |
]. |
|
1567 |
]. |
|
1568 |
]. |
|
3447 | 1569 |
]. |
12039 | 1570 |
"/ Transcript showCR:con. |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1571 |
"/ Transcript show:'1 '; showCR:found. |
12839 | 1572 |
|
3447 | 1573 |
found isNil ifTrue:[ |
15413 | 1574 |
"/ this is a kludge, but convenient. |
1575 |
"/ show the place where the error (divisionByZero...) happend, |
|
1576 |
"/ not where the signal was raised. |
|
1577 |
con := (aContextArray at:1). |
|
1578 |
sel := con methodHome selector. |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1579 |
|
13398 | 1580 |
"/ Transcript show:'2 '; showCR:con. |
15413 | 1581 |
"/ typically a DivisionByZero - show caller of division |
1582 |
(sel == #// |
|
1583 |
or:[sel == #/ |
|
1584 |
or:[sel == #\\]]) ifTrue:[ |
|
1585 |
^ 2 |
|
1586 |
]. |
|
1587 |
||
1588 |
"/ show the place of the bad message; not where the Signal was raised... |
|
1589 |
(sel == #doesNotUnderstand:) ifTrue:[ |
|
1590 |
idx := 3. |
|
1591 |
nMax > 2 ifTrue:[ |
|
1592 |
sel := (aContextArray at:idx) selector ? ''. |
|
1593 |
sel == #doesNotUnderstand: ifTrue:[ |
|
1594 |
idx := 4 |
|
1595 |
]. |
|
1596 |
nMax > idx ifTrue:[ |
|
1597 |
sel := (aContextArray at:idx) selector ? ''. |
|
1598 |
"/ show the place of the perfor-send; not where the Signal was raised... |
|
1599 |
((sel == #perform:) |
|
1600 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
|
1601 |
idx := idx + 1 |
|
1602 |
]. |
|
1603 |
] |
|
1604 |
]. |
|
1605 |
^ idx min:nMax |
|
1606 |
]. |
|
1607 |
||
1608 |
"/ show the bad method; not where the Signal was raised... |
|
1609 |
(sel == #noByteCode) ifTrue:[ |
|
1610 |
^ 2 |
|
1611 |
]. |
|
3447 | 1612 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1613 |
"/ "/ 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
|
1614 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1615 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1616 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1617 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1618 |
"/ "/ 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
|
1619 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1620 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1621 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1622 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1623 |
"/ "/ 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
|
1624 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1625 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1626 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1627 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1628 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1629 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1630 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1631 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1632 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1633 |
"/ ]. |
7862 | 1634 |
|
15413 | 1635 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
1636 |
(sel == #signalInterrupt:) ifTrue:[ |
|
1637 |
^ 2 |
|
1638 |
]. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1639 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1640 |
"/ "/ 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
|
1641 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1642 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1643 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1644 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1645 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1646 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1647 |
"/ "/ 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
|
1648 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1649 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1650 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
1651 |
|
15413 | 1652 |
"/ show the place of the bad index; not where the Signal was raised... |
1653 |
( #(#notIndexed |
|
1654 |
#indexNotIntegerOrOutOfBounds: |
|
1655 |
#subscriptBoundsError: |
|
1656 |
#elementBoundsError: |
|
1657 |
"/ #subclassResponsibility |
|
1658 |
) includes:sel) ifTrue:[ |
|
1659 |
idx := 2. |
|
1660 |
[ idx <= 3 |
|
1661 |
and:[ |
|
1662 |
sel := (aContextArray at:idx) selector. |
|
1663 |
#(#notIndexed |
|
1664 |
#indexNotIntegerOrOutOfBounds: |
|
1665 |
#subscriptBoundsError: |
|
1666 |
#elementBoundsError: ) includes:sel |
|
1667 |
] |
|
1668 |
] whileTrue:[ idx := idx + 1 ]. |
|
1669 |
sel := (aContextArray at:idx) selector. |
|
1670 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1671 |
ifTrue:[ |
|
1672 |
sel := (aContextArray at:idx+1) selector. |
|
1673 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1674 |
ifTrue:[ |
|
1675 |
sel := (aContextArray at:idx+2) selector. |
|
1676 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1677 |
ifTrue:[ |
|
1678 |
^ idx+3 |
|
1679 |
]. |
|
1680 |
^ idx+2 |
|
1681 |
]. |
|
1682 |
^ idx+1 |
|
1683 |
]. |
|
1684 |
^ idx |
|
1685 |
]. |
|
1686 |
offset := 1. |
|
8152 | 1687 |
]. |
1688 |
||
1689 |
"/ the above is all too hard-coded; |
|
1690 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1691 |
"/ as more methods get flagged, remove code from above. |
|
1692 |
con := aContextArray at:offset ifAbsent:nil. |
|
13398 | 1693 |
"/ Transcript show:'2 '; showCR:con. |
10205 | 1694 |
[ |
15413 | 1695 |
con notNil |
1696 |
and:[ (methodHome := con methodHome) notNil |
|
1697 |
and:[ (method := methodHome method) notNil |
|
1698 |
and:[ method shouldBeSkippedInDebuggersWalkBack ]]] |
|
8152 | 1699 |
] whileTrue:[ |
1700 |
"/ Transcript showCR:con methodHome method. |
|
15413 | 1701 |
offset := offset + 1. |
1702 |
con := aContextArray at:offset ifAbsent:nil. |
|
8152 | 1703 |
]. |
13309 | 1704 |
methodHome := nil. "/ help GC |
3447 | 1705 |
|
1706 |
" |
|
1707 |
got it; move up, skipping all intermediate Signal and |
|
1708 |
Exception contexts |
|
1709 |
" |
|
1710 |
prev := nil. |
|
1711 |
rcvr := con receiver. |
|
10205 | 1712 |
[ |
15413 | 1713 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1714 |
] whileTrue:[ |
15413 | 1715 |
prev := con. |
1716 |
nMax > offset ifFalse:[^ offset]. |
|
1717 |
||
1718 |
offset := offset + 1. |
|
1719 |
con := aContextArray at:offset. |
|
1720 |
rcvr := con receiver. |
|
3447 | 1721 |
]. |
1722 |
||
1723 |
" |
|
1724 |
now, we are one above the raising context |
|
1725 |
" |
|
13398 | 1726 |
"/ Transcript show:'3 '; showCR:con. |
1727 |
||
1728 |
(con selector == #retry:coercing:) ifTrue:[ |
|
15413 | 1729 |
"/ show the operation which failed to coerce, not the coerce |
1730 |
^ offset + 1 |
|
13398 | 1731 |
]. |
3447 | 1732 |
|
1733 |
" |
|
13398 | 1734 |
if the sender-method of the raise is one of object's error methods ... |
3447 | 1735 |
" |
10205 | 1736 |
( #( halt halt: |
15413 | 1737 |
error error: |
1738 |
doesNotUnderstand: |
|
1739 |
subclassResponsibility |
|
1740 |
primitiveFailed) includes:con selector) |
|
3447 | 1741 |
ifTrue:[ |
15413 | 1742 |
con selector == #doesNotUnderstand: ifTrue:[ |
1743 |
" |
|
1744 |
one more up, to get to the originating context |
|
1745 |
" |
|
1746 |
con := aContextArray at:(offset + 1). |
|
1747 |
con isNil ifTrue:[^ offset]. |
|
1748 |
offset := offset + 1. |
|
1749 |
]. |
|
1750 |
con := aContextArray at:(offset + 1). |
|
1751 |
con isNil ifTrue:[^ offset]. |
|
1752 |
offset := offset + 1. |
|
3447 | 1753 |
] ifFalse:[ |
15413 | 1754 |
" |
1755 |
ok, got the raise - if its a BreakPoint, look for the sender |
|
1756 |
" |
|
1757 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
|
1758 |
offset := offset + 1 |
|
1759 |
]. |
|
3447 | 1760 |
]. |
1761 |
||
1762 |
^ offset |
|
1763 |
||
7713 | 1764 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
13398 | 1765 |
"Modified: / 28-08-2013 / 20:23:35 / cg" |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1766 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1767 |
|
14662 | 1768 |
!DebugView methodsFor:'accessing'! |
1769 |
||
1770 |
contextInspector |
|
1771 |
^ contextInspector |
|
1772 |
! |
|
1773 |
||
1774 |
inspectedProcess |
|
1775 |
^ inspectedProcess |
|
1776 |
! ! |
|
1777 |
||
15257 | 1778 |
!DebugView methodsFor:'aspects'! |
1779 |
||
1780 |
verboseBacktraceHolder |
|
1781 |
verboseBacktraceHolder isNil ifTrue:[ |
|
15413 | 1782 |
verboseBacktraceHolder := ValueHolder with:false |
15257 | 1783 |
]. |
1784 |
^ verboseBacktraceHolder |
|
1785 |
! ! |
|
1786 |
||
73 | 1787 |
!DebugView methodsFor:'basic'! |
1788 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1789 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1790 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1791 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1792 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1793 |
m notNil ifTrue:[ |
15413 | 1794 |
self updateMenuItems. |
1795 |
||
1796 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
|
1797 |
abortButton enable. |
|
1798 |
m enable:#doAbort. |
|
1799 |
] ifFalse:[ |
|
1800 |
abortButton disable. |
|
1801 |
m disable:#doAbort. |
|
1802 |
]. |
|
1803 |
exclusive ifTrue:[ |
|
1804 |
terminateButton disable. |
|
1805 |
m disable:#doTerminate. |
|
1806 |
] ifFalse:[ |
|
1807 |
terminateButton enable. |
|
1808 |
m enable:#doTerminate. |
|
1809 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1810 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1811 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1812 |
mayProceed == false ifTrue:[ |
15413 | 1813 |
continueButton disable. |
1814 |
m notNil ifTrue:[m disable:#doContinue]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1815 |
] ifFalse:[ |
15413 | 1816 |
continueButton enable. |
1817 |
m notNil ifTrue:[m enable:#doContinue] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1818 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1819 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1820 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1821 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1822 |
|
13842 | 1823 |
enter |
1824 |
"enter a debugger" |
|
1825 |
||
1826 |
<context: #return> |
|
1827 |
||
1828 |
^ self |
|
15413 | 1829 |
enter:thisContext sender |
1830 |
select: nil. |
|
13842 | 1831 |
|
1832 |
"Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1833 |
! |
|
1834 |
||
1364 | 1835 |
enter:aContext select:initialSelectionOrNil |
73 | 1836 |
"enter the debugger - get and display the context, then start an |
1837 |
exclusive event loop on top of eveything else" |
|
1838 |
||
3447 | 1839 |
<context: #return> |
1840 |
||
9076 | 1841 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c| |
3447 | 1842 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1843 |
DebuggingDebugger == true ifTrue:[ |
15413 | 1844 |
'==> enter2: (' print. aContext print. |
1845 |
') select: ' print. initialSelectionOrNil printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1846 |
]. |
3447 | 1847 |
thisContext isRecursive ifTrue:[ |
15413 | 1848 |
"/ care for the special case, were the Debugger was autoloaded. |
1849 |
"/ in this case, thisContext IS recursive, but thats no error |
|
1850 |
"/ condition. |
|
1851 |
foundNoByteCodeContext := false. |
|
1852 |
foundExitContext := false. |
|
1853 |
||
1854 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1855 |
[ |
|
1856 |
foundNoByteCodeContext not |
|
1857 |
and:[ foundExitContext not |
|
1858 |
and:[c notNil |
|
1859 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
1860 |
]]]] |
|
1861 |
whileTrue:[ |
|
1862 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
1863 |
foundExitContext := true |
|
1864 |
]. |
|
1865 |
c selector == #noByteCode ifTrue:[ |
|
1866 |
foundNoByteCodeContext := true |
|
1867 |
]. |
|
1868 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1869 |
]. |
|
1870 |
||
1871 |
(foundNoByteCodeContext not |
|
1872 |
and:[ foundExitContext not]) ifFalse:[ |
|
1873 |
('DebugView [warning]: reentered') errorPrintCR. |
|
1874 |
||
1875 |
^ MiniDebugger |
|
1876 |
enter:aContext |
|
1877 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
1878 |
mayProceed:mayProceed. |
|
1879 |
]. |
|
1880 |
foundExitContext ifTrue:[ |
|
1881 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
1882 |
^ self. |
|
1883 |
]. |
|
3447 | 1884 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1885 |
|
10203 | 1886 |
"/'entering: ' print. aContext printCR. |
1887 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 1888 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1889 |
||
11890 | 1890 |
(self isHaltToBeIgnored) ifTrue:[ |
15413 | 1891 |
^ self. |
8170 | 1892 |
]. |
11892 | 1893 |
"/ "/ does not work yet - but we should ignore any breakpoints while stepping |
1894 |
"/ (stepping and:[steppedContext notNil]) ifTrue:[ |
|
1895 |
"/ self isEnteredDueToBreakpointOrHalt ifTrue:[ |
|
1896 |
"/ 'DebugView [info]: ignored other interrupt while stepping' infoPrintCR. |
|
1897 |
"/ ^ self |
|
1898 |
"/ ]. |
|
1899 |
"/ ]. |
|
8170 | 1900 |
|
13965 | 1901 |
iAmNew := self drawableId isNil. |
73 | 1902 |
|
15257 | 1903 |
self verboseBacktraceHolder value:(UserPreferences current verboseBacktraceInDebugger). |
939 | 1904 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
1905 |
busy := cachable := true. |
73 | 1906 |
inspecting := false. |
1907 |
inspectedProcess := Processor activeProcess. |
|
1908 |
stepping := false. |
|
1909 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1910 |
stepHow := nil. |
8148 | 1911 |
nChainShown := InitialNChainShown. |
73 | 1912 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1913 |
"/ if debugger is entered while a box has grabbed the |
9076 | 1914 |
"/ 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
|
1915 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1916 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1917 |
"/ 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
|
1918 |
"/ 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
|
1919 |
"/ 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
|
1920 |
Screen allScreens do:[:aScreen | |
15413 | 1921 |
aScreen ungrabPointer. |
1922 |
aScreen ungrabKeyboard. |
|
10205 | 1923 |
]. |
1924 |
||
1925 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1926 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
15413 | 1927 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1928 |
] ifFalse:[ |
15413 | 1929 |
terminateButton enable. |
1930 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1931 |
]. |
73 | 1932 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1933 |
iAmNew ifFalse:[ |
15413 | 1934 |
"/ not the first time - disable buttons & menus |
1935 |
"/ from the previous life |
|
1936 |
self turnOffAllButtons. |
|
1937 |
||
1938 |
m := contextView middleButtonMenu. |
|
1939 |
m notNil ifTrue:[ |
|
1940 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
1941 |
]. |
|
1942 |
self showingDenseWalkback:(self verboseBacktraceHolder value not). |
|
132 | 1943 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1944 |
self iconLabel:'Debugger'. |
132 | 1945 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1946 |
windowGroup isNil ifTrue:[ |
15413 | 1947 |
self windowGroup: WindowGroup new. |
1948 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1949 |
]. |
132 | 1950 |
exclusive ifFalse:[ |
15413 | 1951 |
"/ create a (modal) windowGroup for myself |
1952 |
||
1953 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1954 |
] ifTrue:[ |
15413 | 1955 |
"/ create a windowGroup with a synchronous sensor for me |
1956 |
||
1957 |
windowGroup beSynchronous. |
|
73 | 1958 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1959 |
windowGroup setProcess:Processor activeProcess. |
15027 | 1960 |
IsDebuggingQuery answer:true do:[ |
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
1961 |
|
15413 | 1962 |
" |
1963 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
|
1964 |
" |
|
12039 | 1965 |
"/Transcript show:'0 '; showCR:aContext. |
1966 |
"/Transcript show:'0 '; showCR:thisContext sender. |
|
1967 |
"/Transcript show:'0 '; showCR:thisContext sender sender. |
|
1968 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender. |
|
1969 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender. |
|
1970 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender. |
|
1971 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender. |
|
1972 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender. |
|
1973 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender . |
|
1974 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender. |
|
1975 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender. |
|
1976 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender. |
|
1977 |
"/Transcript showCR:initialSelectionOrNil. |
|
15413 | 1978 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
1979 |
"/'after setContext; first is ' print. |
|
1980 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
1981 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
1982 |
||
1983 |
self updateButtonsAndMenuItemsForContext:aContext. |
|
1984 |
||
1985 |
" |
|
1986 |
If this is a new debugger, do a realize. |
|
1987 |
Otherwise, its probably better to do a map, which shows the |
|
1988 |
view at the previous position, without a need for the user to set the |
|
1989 |
position again |
|
1990 |
" |
|
1991 |
iAmNew ifTrue:[ |
|
1992 |
self realize. |
|
1993 |
] ifFalse:[ |
|
1994 |
self remap. |
|
1995 |
]. |
|
1996 |
self setForegroundWindow. |
|
1997 |
||
1998 |
exclusive ifTrue:[ |
|
1999 |
self showError:' |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2000 |
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
|
2001 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2002 |
This is a modal debugger - all event processing is stopped.. |
10205 | 2003 |
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
|
2004 |
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
|
2005 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2006 |
Also, there is no event processing (redraw) for other views.' |
15413 | 2007 |
]. |
2008 |
||
2009 |
self autoRaiseView ifTrue:[ |
|
2010 |
"/ self raise. |
|
2011 |
self raiseDeiconified. |
|
2012 |
self topView activate; setForegroundWindow; activate. |
|
2013 |
]. |
|
2014 |
||
2015 |
canContinue := true. |
|
2016 |
exitAction := nil. |
|
2017 |
||
2018 |
"/ enter private event handling loop. This is left (and we come back here again) |
|
2019 |
"/ when any button was pressed which requires continuation of the debuggee or |
|
2020 |
"/ closedown of the debugger. |
|
2021 |
[self controlLoop] ifCurtailed:[ |
|
2022 |
windowGroup notNil ifTrue:[ |
|
2023 |
windowGroup setProcess:nil. |
|
2024 |
]. |
|
2025 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
2026 |
self destroy |
|
2027 |
]. |
|
2028 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2029 |
]. |
10203 | 2030 |
"/ here after my own control loop is finished. |
2031 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2032 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2033 |
"/ 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
|
2034 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 2035 |
contextView contents:nil. |
2036 |
||
73 | 2037 |
codeView acceptAction:nil. |
942 | 2038 |
codeView doItAction:nil. |
73 | 2039 |
|
4892 | 2040 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
15413 | 2041 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 2042 |
]. |
2043 |
||
11911 | 2044 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
2045 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
2046 |
||
73 | 2047 |
(exitAction ~~ #step) ifTrue:[ |
15413 | 2048 |
"/ not stepping or continue - close window |
2049 |
self cacheMyself. |
|
2050 |
receiverInspector release. |
|
2051 |
contextInspector release. |
|
2052 |
||
2053 |
self unmap. |
|
2054 |
self flush. |
|
2055 |
||
2056 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
2057 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
2058 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
2059 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
2060 |
(exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ]. |
|
2061 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
2062 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
2063 |
exitAction isBlock ifTrue:[ |
|
2064 |
self exit_unwindThenDo:exitAction. |
|
2065 |
"does not return" |
|
2066 |
]. |
|
2067 |
"not reached" |
|
2068 |
^ self |
|
73 | 2069 |
]. |
2070 |
||
3447 | 2071 |
"/ stepping - window stays open |
940 | 2072 |
selectedContext := actualContext := firstContext := nil. |
73 | 2073 |
|
2472 | 2074 |
"/ restore the previous pointer grab |
73 | 2075 |
grabber notNil ifTrue:[ |
15413 | 2076 |
self graphicsDevice grabPointerInView:grabber. |
2077 |
grabber := nil. |
|
61 | 2078 |
]. |
73 | 2079 |
|
2080 |
(exitAction == #step) ifTrue:[ |
|
15413 | 2081 |
" |
2082 |
schedule another stepInterrupt |
|
2083 |
- must enter myself into the collection of open debuggers, |
|
2084 |
in case the stepping process comes back again via a halt or signal |
|
2085 |
before the step is finished. In this case, the stepping debugger should |
|
2086 |
come up (instead of a new one) |
|
2087 |
- must flush caches since optimized methods not always |
|
2088 |
look for pending interrupts |
|
2089 |
" |
|
2090 |
||
2091 |
"/ |
|
2092 |
"/ also must care for stepping into a return |
|
2093 |
"/ |
|
2094 |
steppedContext notNil ifTrue:[ |
|
2095 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
2096 |
]. |
|
2097 |
||
2098 |
OpenDebuggers isNil ifTrue:[ |
|
2099 |
OpenDebuggers := WeakIdentitySet new. |
|
2100 |
]. |
|
2101 |
OpenDebuggers add:self. |
|
2102 |
||
2103 |
self label:'single stepping - please wait ...'. |
|
2104 |
stepping := true. |
|
2105 |
||
2106 |
ObjectMemory stepInterruptHandler:self. |
|
2107 |
Processor activeProcess stepInterruptHandler:self. |
|
2108 |
ObjectMemory flushCaches. |
|
2109 |
||
2110 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
2111 |
Context singleStepInterruptRequest |
|
2112 |
raiseWith: |
|
2113 |
(("bigStep" steppedContextLineno notNil) |
|
2114 |
ifTrue:[#next] |
|
2115 |
ifFalse:[#step]) |
|
2116 |
] ifFalse:[ |
|
2117 |
"/ see if we came here through an interrupt-action |
|
2118 |
"/ (i.e. aProcess interruptWith:...) |
|
2119 |
||
2120 |
enteredByInterrupt := false. |
|
2121 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2122 |
[enteredByInterrupt not |
|
2123 |
and:[con notNil |
|
2124 |
and:[con ~~ aContext]]] whileTrue:[ |
|
2125 |
((sel := con selector) == #timerInterrupt |
|
2126 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
2127 |
enteredByInterrupt := true. |
|
2128 |
] ifFalse:[ |
|
2129 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2130 |
]. |
|
2131 |
]. |
|
2132 |
||
2133 |
ObjectMemory flushInlineCaches. |
|
2134 |
||
2135 |
DebuggingDebugger == true ifTrue:[ |
|
2136 |
enteredByInterrupt printCR. |
|
2137 |
]. |
|
2138 |
enteredByInterrupt ifTrue:[ |
|
2139 |
"/ don't want to step through all intermediate |
|
2140 |
"/ (scheduler-) contexts; place a return-trap on the |
|
2141 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2142 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2143 |
"/ 'special unwind return' printCR. |
15413 | 2144 |
con unwindThenDo:[ |
2145 |
Processor activeProcess stepInterruptHandler:self. |
|
2146 |
ObjectMemory stepInterruptHandler:self. |
|
2147 |
InStepInterrupt := nil. |
|
2148 |
StepInterruptPending := 1. |
|
2149 |
InterruptPending := 1]. |
|
2150 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2151 |
"/ 'normal step return' printCR. |
15413 | 2152 |
skipLineNr ~~ #return ifTrue:[ |
2153 |
StepInterruptPending := 1. |
|
2154 |
InterruptPending := 1. |
|
2155 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2156 |
"/ 'step for return' printCR. |
15413 | 2157 |
] |
2158 |
]. |
|
2159 |
InStepInterrupt := nil |
|
2160 |
] |
|
73 | 2161 |
] ifFalse:[ |
15413 | 2162 |
OpenDebuggers notNil ifTrue:[ |
2163 |
OpenDebuggers remove:self ifAbsent:[]. |
|
2164 |
]. |
|
2165 |
self cacheMyself. |
|
73 | 2166 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2167 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
2168 |
"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
|
2169 |
"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
|
2170 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
11697 | 2171 |
"Modified: / 27-07-2012 / 17:35:56 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2172 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2173 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2174 |
exit_abort |
5455 | 2175 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
2176 |
"/ that one would run on top of this context. |
|
2177 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2178 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2179 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2180 |
"/ done in the #enter:select method. |
5455 | 2181 |
"/ You are not expected to understand this. |
2182 |
||
6487 | 2183 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
2184 |
! |
|
2185 |
||
2186 |
exit_abortAll |
|
2187 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2188 |
"/ that one would run on top of this context. |
|
2189 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2190 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2191 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2192 |
"/ done in the #enter:select method. |
6487 | 2193 |
"/ You are not expected to understand this. |
2194 |
||
2195 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2196 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2197 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2198 |
exit_quickTerminate |
3447 | 2199 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2200 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2201 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2202 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 2203 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2204 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2205 |
|
13360 | 2206 |
exit_resend |
2207 |
|con| |
|
2208 |
||
2209 |
selectedContext notNil ifTrue:[ |
|
15413 | 2210 |
con := selectedContext. |
2211 |
self cacheMyself. |
|
2212 |
" |
|
2213 |
have to catch errors occuring in unwind-blocks |
|
2214 |
" |
|
2215 |
Error handle:[:ex | |
|
2216 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2217 |
ex description infoPrintCR. |
|
2218 |
ex proceed |
|
2219 |
] do:[ |
|
2220 |
^ con unwindThenResend. |
|
2221 |
]. |
|
2222 |
'DebugView [warning]: cannot resend selected context''s message' errorPrintCR |
|
13360 | 2223 |
] |
2224 |
! |
|
2225 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2226 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2227 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2228 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2229 |
selectedContext notNil ifTrue:[ |
15413 | 2230 |
con := selectedContext. |
2231 |
self cacheMyself. |
|
2232 |
" |
|
2233 |
have to catch errors occuring in unwind-blocks |
|
2234 |
" |
|
2235 |
Error handle:[:ex | |
|
2236 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2237 |
ex description infoPrintCR. |
|
2238 |
ex proceed |
|
2239 |
] do:[ |
|
2240 |
con unwindAndRestart. |
|
2241 |
]. |
|
2242 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2243 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2244 |
|
11818 | 2245 |
"Created: / 16-11-2001 / 17:23:17 / cg" |
11819 | 2246 |
"Modified: / 26-09-2012 / 15:09:52 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2247 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2248 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2249 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2250 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2251 |
|
14902 | 2252 |
retVal := nil. |
2253 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2254 |
selectedContext notNil ifTrue:[ |
15413 | 2255 |
" |
2256 |
if there is a selection in the codeView, |
|
2257 |
evaluate it and use the result as return value |
|
2258 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2259 |
"/ 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
|
2260 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2261 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2262 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2263 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2264 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2265 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2266 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2267 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2268 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2269 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2270 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2271 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2272 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2273 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2274 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2275 |
|
15413 | 2276 |
con := selectedContext. |
2277 |
self cacheMyself. |
|
2278 |
" |
|
2279 |
have to catch errors occuring in unwind-blocks |
|
2280 |
" |
|
2281 |
Error handle:[:ex | |
|
2282 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2283 |
ex description infoPrintCR. |
|
2284 |
ex proceed |
|
2285 |
] do:[ |
|
2286 |
con unwind:retVal. |
|
2287 |
]. |
|
2288 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2289 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2290 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2291 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 2292 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2293 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2294 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2295 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2296 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2297 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2298 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2299 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2300 |
Error handle:[:ex | |
15413 | 2301 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2302 |
ex description infoPrintCR. |
|
2303 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2304 |
] do:[ |
15413 | 2305 |
self cacheMyself. |
2306 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2307 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2308 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2309 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2310 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 2311 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
2312 |
! |
|
2313 |
||
6487 | 2314 |
exit_unwindThenDo:aBlock |
2315 |
|con| |
|
2316 |
||
2317 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2318 |
"/ that one would run on top of this context. |
|
2319 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2320 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2321 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2322 |
"/ done in the #enter:select method. |
6487 | 2323 |
"/ You are not expected to understand this. |
2324 |
||
2325 |
" |
|
2326 |
have to catch errors occuring in unwind-blocks |
|
2327 |
" |
|
2328 |
self cacheMyself. |
|
12743 | 2329 |
con := thisContext sender. |
6487 | 2330 |
|
2331 |
Error handle:[:ex | |
|
15413 | 2332 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2333 |
ex description infoPrintCR. |
|
2334 |
ex proceed |
|
6487 | 2335 |
] do:[ |
15413 | 2336 |
"/ find the enter:select context. |
2337 |
[(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ |
|
2338 |
con := con sender |
|
2339 |
]. |
|
2340 |
||
2341 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
2342 |
con sender receiver == self class ifTrue:[ |
|
2343 |
con := con sender. |
|
2344 |
con sender receiver == self class ifTrue:[ |
|
2345 |
con := con sender methodHome. |
|
2346 |
]. |
|
2347 |
]. |
|
2348 |
||
2349 |
con unwindThenDo:aBlock. |
|
6487 | 2350 |
]. |
2351 |
'DebugView [warning]: abort failed' errorPrintCR |
|
2352 |
||
2353 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
2354 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
2355 |
! |
|
2356 |
||
3447 | 2357 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
2358 |
|selection con1 con2 h| |
|
2359 |
||
2360 |
initialSelectionOrNil notNil ifTrue:[ |
|
15413 | 2361 |
^ initialSelectionOrNil |
3447 | 2362 |
]. |
2363 |
||
2364 |
" |
|
2365 |
and find the one context to show initially |
|
2366 |
- if we came here by a send (single step), its the top context; |
|
2367 |
- if we came here by a step (i.e. bigStep), its the top context |
|
2368 |
(for ifs and whiles) or the sender (for regular sends). |
|
2369 |
- otherwise, we came here by some signal raise, and we are interested |
|
2370 |
in the context where the raise actually occured. |
|
2371 |
" |
|
2372 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
2373 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
12039 | 2374 |
"/ Transcript show:'x '; showCR:exitAction. |
2375 |
||
2376 |
"/ came here via a step? |
|
3447 | 2377 |
exitAction == #step ifTrue:[ |
15413 | 2378 |
selection := 1. |
2379 |
steppedContext notNil ifTrue:[ |
|
2380 |
||
2381 |
" |
|
2382 |
if we came here by a big-step, show the method where we are |
|
2383 |
" |
|
2384 |
con1 == steppedContext ifTrue:[ |
|
2385 |
selection := 1 |
|
2386 |
] ifFalse:[ |
|
2387 |
con2 == steppedContext ifTrue:[ |
|
2388 |
selection := 2 |
|
2389 |
] |
|
2390 |
]. |
|
2391 |
" |
|
2392 |
for bigStep, we could also be in a block below the actual method ... |
|
2393 |
" |
|
2394 |
((h := con1 home) notNil |
|
2395 |
and:[h == steppedContext]) ifTrue:[ |
|
2396 |
selection := 1 |
|
2397 |
] ifFalse:[ |
|
2398 |
(con2 notNil |
|
2399 |
and:[(h := con2 home) notNil |
|
2400 |
and:[h == steppedContext]]) ifTrue:[ |
|
2401 |
selection := 2 |
|
2402 |
] |
|
2403 |
]. |
|
2404 |
h := nil. |
|
2405 |
] |
|
3447 | 2406 |
] ifFalse:[ |
15413 | 2407 |
steppedContext isNil ifTrue:[ |
2408 |
" |
|
2409 |
preselect a more interesting context, (where halt/raise was ...) |
|
2410 |
" |
|
2411 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
2412 |
selection := self class interestingContextIndexIn:contextArray. |
|
12039 | 2413 |
"/ Transcript show:'x '; showCR:selection. |
15413 | 2414 |
selection := selection min:(contextArray size). |
2415 |
] ifFalse:[ |
|
2416 |
" |
|
2417 |
if we came here by a big-step, show the method where we are |
|
2418 |
" |
|
2419 |
con1 == steppedContext ifTrue:[ |
|
2420 |
selection := 1 |
|
2421 |
] ifFalse:[ |
|
2422 |
con2 == steppedContext ifTrue:[ |
|
2423 |
selection := 2. |
|
2424 |
] |
|
2425 |
] |
|
2426 |
] |
|
3447 | 2427 |
]. |
2428 |
^ selection |
|
2429 |
||
2430 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
2431 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 2432 |
! |
2433 |
||
5110 | 2434 |
isInspecting |
2435 |
^ inspecting |
|
2436 |
! |
|
2437 |
||
2438 |
isNotInspecting |
|
2439 |
^ inspecting not |
|
2440 |
! |
|
2441 |
||
73 | 2442 |
openOn:aProcess |
10205 | 2443 |
"enter the debugger on a process - |
73 | 2444 |
in this case, we are just inspecting the context chain of the process, |
2445 |
not running on top of the debugged process, but as a separate |
|
2446 |
one. (think of it as an inspector showing more detail, and offering |
|
2447 |
some more control operations)" |
|
2448 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2449 |
|bpanel dummy w| |
73 | 2450 |
|
15257 | 2451 |
self verboseBacktraceHolder value:( UserPreferences current verboseBacktraceInDebugger ). |
939 | 2452 |
|
73 | 2453 |
busy := true. |
2454 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2455 |
stepHow := nil. |
73 | 2456 |
inspecting := true. |
2457 |
inspectedProcess := aProcess. |
|
8148 | 2458 |
nChainShown := InitialNChainShown. |
73 | 2459 |
|
2460 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2461 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2462 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2463 |
"/ get the max size & freeze button |
6647 | 2464 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2465 |
w := continueButton preferredWidth. |
6647 | 2466 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2467 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2468 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2469 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2470 |
aProcess state == #run ifTrue:[ |
15413 | 2471 |
self graphicsDevice hasColors ifTrue:[ |
2472 |
continueButton foregroundColor:Color red darkened. |
|
2473 |
]. |
|
2474 |
continueButton label:(resources string:'Stop'). |
|
2475 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2476 |
] ifFalse:[ |
15413 | 2477 |
self graphicsDevice hasColors ifTrue:[ |
2478 |
continueButton foregroundColor:Color green darkened darkened. |
|
2479 |
]. |
|
2480 |
continueButton label:(resources string:'Continue'). |
|
2481 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2482 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2483 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 2484 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2485 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2486 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2487 |
|
92 | 2488 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 2489 |
dummy borderWidth:0; level:0. |
61 | 2490 |
|
73 | 2491 |
"/ stepButton destroy. |
2492 |
"/ sendButton destroy. |
|
2493 |
||
2494 |
updateButton := Button |
|
15413 | 2495 |
label:(resources string:'Update') |
2496 |
action:[self updateContext] |
|
2497 |
in:bpanel. |
|
73 | 2498 |
monitorToggle := Toggle in:bpanel. |
6647 | 2499 |
monitorToggle label:(resources string:'Monitor'). |
73 | 2500 |
monitorToggle pressAction:[self autoUpdateOn]. |
2501 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
2502 |
||
2503 |
"can only look into process - context chain is not active" |
|
2504 |
canContinue := true. |
|
2505 |
||
2506 |
terminateButton enable. |
|
2507 |
abortButton enable. |
|
2508 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2509 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2510 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2511 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2512 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2513 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 2514 |
|
2515 |
aProcess isNil ifTrue:[ |
|
15413 | 2516 |
terminateButton disable. |
2517 |
abortButton disable. |
|
2518 |
continueButton disable. |
|
2519 |
returnButton disable. |
|
2520 |
restartButton disable. |
|
73 | 2521 |
] ifFalse:[ |
15413 | 2522 |
(aProcess suspendedContext isNil |
2523 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
2524 |
terminateButton disable. |
|
2525 |
]. |
|
2526 |
||
2527 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
2528 |
||
2529 |
catchBlock := [ |
|
2530 |
catchBlock := nil. |
|
2531 |
contextArray := nil. |
|
2532 |
selectedContext := actualContext := firstContext := nil. |
|
2533 |
steppedContext := wrapperContext := nil. |
|
2534 |
||
2535 |
(exitAction == #terminate) ifTrue:[ |
|
2536 |
aProcess terminate. |
|
2537 |
]. |
|
2538 |
(exitAction == #quickTerminate) ifTrue:[ |
|
2539 |
aProcess terminateNoSignal. |
|
2540 |
]. |
|
2541 |
super destroy |
|
2542 |
]. |
|
73 | 2543 |
]. |
2544 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2545 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2546 |
"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
|
2547 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2548 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2549 |
|
13388 | 2550 |
selectContextWithIndex:index |
13362 | 2551 |
self showSelection:index. |
2552 |
contextView setSelection:index. |
|
2553 |
index > 1 ifTrue:[ |
|
15413 | 2554 |
contextView scrollToLine:(index - 1) |
13362 | 2555 |
]. |
2556 |
! |
|
2557 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2558 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 2559 |
|selection| |
2560 |
||
2561 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2562 |
selection notNil ifTrue:[ |
15413 | 2563 |
self selectContextWithIndex:selection |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2564 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2565 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2566 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 2567 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2568 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2569 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2570 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2571 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2572 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2573 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2574 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2575 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2576 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2577 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2578 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2579 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2580 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2581 |
! ! |
2582 |
||
2583 |
!DebugView methodsFor:'help'! |
|
2584 |
||
8212 | 2585 |
flyByHelpDependsOnPositionIn:aView |
2586 |
"subclasses where the help-text depends upon the pointer position might |
|
2587 |
want to redefine this" |
|
2588 |
||
2589 |
^ aView == codeView |
|
2590 |
! |
|
2591 |
||
3510 | 2592 |
flyByHelpTextFor:aComponent |
2593 |
|s| |
|
2594 |
||
2595 |
aComponent == abortButton ifTrue:[ |
|
15413 | 2596 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2597 |
]. |
2598 |
aComponent == terminateButton ifTrue:[ |
|
15413 | 2599 |
Processor activeProcess isGUIProcess ifTrue:[ |
2600 |
s := 'Terminate the process (closes view and shuts down application)' |
|
2601 |
] ifFalse:[ |
|
2602 |
s := 'Terminate the process' |
|
2603 |
] |
|
3510 | 2604 |
]. |
2605 |
aComponent == continueButton ifTrue:[ |
|
15413 | 2606 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2607 |
s := 'Stop' |
|
2608 |
] ifFalse:[ |
|
2609 |
s := 'Continue execution' |
|
2610 |
] |
|
3510 | 2611 |
]. |
2612 |
aComponent == stepButton ifTrue:[ |
|
15413 | 2613 |
s := 'Step to next send in selected context (don''t enter into called methods)' |
3510 | 2614 |
]. |
2615 |
aComponent == nextButton ifTrue:[ |
|
15413 | 2616 |
s := 'Step to next line in selected context (don''t enter into called methods)' |
3510 | 2617 |
]. |
2618 |
aComponent == nextOverButton ifTrue:[ |
|
15413 | 2619 |
s := 'Step over to cursor-line' |
3510 | 2620 |
]. |
2621 |
aComponent == nextOutButton ifTrue:[ |
|
15413 | 2622 |
s := 'Step out to caller' |
3510 | 2623 |
]. |
2624 |
aComponent == sendButton ifTrue:[ |
|
15413 | 2625 |
s := 'Send next message (enter into called methods)' |
3510 | 2626 |
]. |
2627 |
aComponent == returnButton ifTrue:[ |
|
15413 | 2628 |
restartButton enabled ifTrue:[ |
2629 |
s := 'Return from the selected method' |
|
2630 |
] ifFalse:[ |
|
2631 |
s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2632 |
] |
|
3510 | 2633 |
]. |
2634 |
aComponent == restartButton ifTrue:[ |
|
15413 | 2635 |
restartButton enabled ifTrue:[ |
2636 |
s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again' |
|
2637 |
] ifFalse:[ |
|
2638 |
s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2639 |
] |
|
3510 | 2640 |
]. |
13361 | 2641 |
aComponent == resendButton ifTrue:[ |
15413 | 2642 |
resendButton enabled ifTrue:[ |
2643 |
s := 'Resend the selected method''s message.\If the code was changed in the meanwhile, the new method will be called with the original arguments.' |
|
2644 |
] ifFalse:[ |
|
2645 |
s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2646 |
] |
|
13361 | 2647 |
]. |
3510 | 2648 |
aComponent == monitorToggle ifTrue:[ |
15413 | 2649 |
s := 'Toggle monitoring' |
3510 | 2650 |
]. |
2651 |
aComponent == updateButton ifTrue:[ |
|
15413 | 2652 |
s := 'Update' |
3510 | 2653 |
]. |
13464 | 2654 |
aComponent == defineButton ifTrue:[ |
15413 | 2655 |
s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then' |
13464 | 2656 |
]. |
8656 | 2657 |
aComponent == reportButton ifTrue:[ |
15413 | 2658 |
s := 'Send a defect report via eMail' |
8656 | 2659 |
]. |
3510 | 2660 |
s notNil ifTrue:[ |
15413 | 2661 |
^ resources stringWithCRs:s |
3510 | 2662 |
]. |
2663 |
^ nil |
|
2664 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2665 |
"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
|
2666 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2667 |
! |
2668 |
||
8212 | 2669 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2670 |
|s vline line col pos interval| |
8212 | 2671 |
|
2672 |
aComponent == codeView ifFalse:[^ nil]. |
|
2673 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2674 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2675 |
|
8396 | 2676 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2677 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2678 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2679 |
|
2680 |
pos := codeView characterPositionOfLine:line col:col. |
|
2681 |
interval := pos to:pos. |
|
2682 |
||
10205 | 2683 |
self |
15413 | 2684 |
withNodeValueAtInterval:interval |
2685 |
do:[:value :description | |
|
2686 |
|valueClassOrSizeString valueString| |
|
2687 |
||
2688 |
valueClassOrSizeString := valueString := ''. |
|
2689 |
||
2690 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2691 |
value isString ifTrue:[ |
|
2692 |
value isText ifTrue:[ |
|
2693 |
valueString := '"',(value contractTo:80),'"'. |
|
2694 |
] ifFalse:[ |
|
2695 |
valueString := value storeString contractTo:80. |
|
2696 |
]. |
|
2697 |
] ifFalse:[ |
|
2698 |
(value isBoolean |
|
2699 |
or:[ value isInteger |
|
2700 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2701 |
valueString := value printString. |
|
2702 |
] ifFalse:[ |
|
2703 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2704 |
||
2705 |
(value isArray |
|
2706 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2707 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2708 |
]. |
|
2709 |
||
2710 |
Error handle:[:ex | |
|
2711 |
valueString := '??? (',ex description,')' |
|
2712 |
] do:[ |
|
2713 |
[ |
|
2714 |
valueString := value printString contractTo:80. |
|
2715 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
|
2716 |
] |
|
2717 |
] |
|
2718 |
]. |
|
2719 |
description isEmptyOrNil ifTrue:[ |
|
2720 |
s := valueString , valueClassOrSizeString |
|
2721 |
] ifFalse:[ |
|
2722 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2723 |
]. |
|
2724 |
]. |
|
8592 | 2725 |
"/ Transcript showCR:s. |
2726 |
^ s |
|
9446 | 2727 |
|
2728 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2729 |
! |
2730 |
||
266 | 2731 |
helpTextFor:aComponent |
2732 |
|s| |
|
2733 |
||
2734 |
aComponent == abortButton ifTrue:[ |
|
15413 | 2735 |
s := 'HELP_ABORT' |
266 | 2736 |
]. |
2737 |
aComponent == terminateButton ifTrue:[ |
|
15413 | 2738 |
s := 'HELP_TERMINATE' |
266 | 2739 |
]. |
2740 |
aComponent == continueButton ifTrue:[ |
|
15413 | 2741 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2742 |
s := 'HELP_STOP' |
|
2743 |
] ifFalse:[ |
|
2744 |
s := 'HELP_CONTINUE' |
|
2745 |
] |
|
266 | 2746 |
]. |
2747 |
aComponent == stepButton ifTrue:[ |
|
15413 | 2748 |
s := 'HELP_STEP' |
266 | 2749 |
]. |
2750 |
aComponent == nextButton ifTrue:[ |
|
15413 | 2751 |
s := 'HELP_NEXT' |
266 | 2752 |
]. |
1065 | 2753 |
aComponent == nextOverButton ifTrue:[ |
15413 | 2754 |
s := 'HELP_NEXTOVER' |
1065 | 2755 |
]. |
2756 |
aComponent == nextOutButton ifTrue:[ |
|
15413 | 2757 |
s := 'HELP_NEXTOUT' |
1065 | 2758 |
]. |
266 | 2759 |
aComponent == stepButton ifTrue:[ |
15413 | 2760 |
s := 'HELP_STEP' |
266 | 2761 |
]. |
2762 |
aComponent == sendButton ifTrue:[ |
|
15413 | 2763 |
s := 'HELP_SEND' |
266 | 2764 |
]. |
2765 |
aComponent == returnButton ifTrue:[ |
|
15413 | 2766 |
returnButton enabled ifTrue:[ |
2767 |
s := 'HELP_RETURN' |
|
2768 |
] ifFalse:[ |
|
2769 |
s := 'HELP_RETURN_DISABLED' |
|
2770 |
]. |
|
266 | 2771 |
]. |
2772 |
aComponent == restartButton ifTrue:[ |
|
15413 | 2773 |
restartButton enabled ifTrue:[ |
2774 |
s := 'HELP_RESTART' |
|
2775 |
] ifFalse:[ |
|
2776 |
s := 'HELP_RESTART_DISABLED' |
|
2777 |
]. |
|
266 | 2778 |
]. |
13361 | 2779 |
aComponent == resendButton ifTrue:[ |
15413 | 2780 |
resendButton enabled ifTrue:[ |
2781 |
s := 'HELP_RESEND' |
|
2782 |
] ifFalse:[ |
|
2783 |
s := 'HELP_RESEND_DISABLED' |
|
2784 |
]. |
|
13361 | 2785 |
]. |
266 | 2786 |
aComponent == contextView ifTrue:[ |
15413 | 2787 |
s := 'HELP_WALKBACK' |
266 | 2788 |
]. |
2789 |
aComponent == codeView ifTrue:[ |
|
15413 | 2790 |
s := 'HELP_CODEVIEW' |
266 | 2791 |
]. |
2792 |
aComponent == monitorToggle ifTrue:[ |
|
15413 | 2793 |
s := 'HELP_MONITOR' |
266 | 2794 |
]. |
2795 |
aComponent == updateButton ifTrue:[ |
|
15413 | 2796 |
s := 'HELP_UPDATE' |
266 | 2797 |
]. |
14523 | 2798 |
aComponent == gotoDialogOpenerButton ifTrue:[ |
15413 | 2799 |
s := 'HELP_GOTO_DIALOG_OPENER' |
14523 | 2800 |
]. |
2801 |
aComponent == gotoApplicationActionMethodButton ifTrue:[ |
|
15413 | 2802 |
s := 'HELP_GOTO_APPLICATION_ACTION' |
14523 | 2803 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2804 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2805 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2806 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2807 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
15413 | 2808 |
s := 'HELP_REC_INSP' |
266 | 2809 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2810 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
15413 | 2811 |
s := 'HELP_CON_INSP' |
266 | 2812 |
]. |
2813 |
||
2814 |
s notNil ifTrue:[ |
|
15413 | 2815 |
^ resources stringWithCRs:s |
266 | 2816 |
]. |
2817 |
^ nil |
|
2818 |
||
2819 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 2820 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 2821 |
! ! |
2822 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2823 |
!DebugView methodsFor:'initialization & release'! |
266 | 2824 |
|
2825 |
addToCurrentProject |
|
2826 |
"ignored here" |
|
2827 |
||
2828 |
^ self |
|
2829 |
! |
|
2830 |
||
2115 | 2831 |
destroy |
2832 |
"closing the debugger implies an abort or continue" |
|
2833 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2834 |
self destroyWithConfirmation:true |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2835 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2836 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2837 |
"Modified: / 23-03-2012 / 12:50:01 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2838 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2839 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2840 |
destroyWithConfirmation:withConfirmation |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2841 |
"closing the debugger implies an abort or continue" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2842 |
|
2404 | 2843 |
|m| |
2844 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2845 |
withConfirmation ifTrue:[ |
15413 | 2846 |
self checkIfCodeIsReallyModified ifTrue:[ |
2847 |
(self confirm:('Code modified - exit anyway ?')) |
|
2848 |
ifFalse:[ |
|
2849 |
^ self |
|
2850 |
] |
|
2851 |
] |
|
2115 | 2852 |
]. |
2853 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2854 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2855 |
|
2404 | 2856 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 2857 |
inspecting ifFalse:[ |
15413 | 2858 |
"I am running on top of a process, abort or continue it" |
2859 |
||
2860 |
windowGroup notNil ifTrue:[ |
|
2861 |
windowGroup setProcess:nil. |
|
2862 |
]. |
|
2863 |
self uncacheMyself. |
|
2864 |
||
2865 |
"/ |
|
2866 |
"/ catch invalid return; |
|
2867 |
"/ this happens, when my process has somehow died (quickterminate) |
|
2868 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
2869 |
"/ #destroy-window function. |
|
2870 |
"/ |
|
2871 |
Context cannotReturnSignal handle:[:ex | |
|
2872 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
2873 |
self uncacheMyself. |
|
2874 |
Debugger newDebugger. |
|
2875 |
ex return. |
|
2876 |
] do:[ |
|
2877 |
AbortOperationRequest isHandled ifTrue:[ |
|
2878 |
self doAbort. |
|
2879 |
] ifFalse:[ |
|
2880 |
self doContinue |
|
2881 |
] |
|
2882 |
]. |
|
2883 |
"/ We don't reach this point normally |
|
2884 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2115 | 2885 |
]. |
2886 |
||
2299 | 2887 |
Debugger newDebugger. |
2115 | 2888 |
"/ since I am going to be destroyed, remove me from the cache |
2889 |
self uncacheMyself. |
|
2890 |
super destroy. |
|
2891 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2892 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
2893 |
"Created: / 23-03-2012 / 12:49:50 / cg" |
2115 | 2894 |
! |
2895 |
||
266 | 2896 |
initialize |
10205 | 2897 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
12529 | 2898 |
newLayout v exceptionAndTogglePanel codeToggleLabels userPrefs| |
266 | 2899 |
|
2900 |
super initialize. |
|
2901 |
||
12529 | 2902 |
userPrefs := UserPreferences current. |
2903 |
||
15257 | 2904 |
self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger). |
2905 |
||
12529 | 2906 |
hideSupportCode := userPrefs hideSupportCodeInDebugger ? false. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2907 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
15413 | 2908 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2909 |
|
266 | 2910 |
busy := false. |
2911 |
exclusive := false. |
|
2912 |
inspecting := false. |
|
2913 |
exitAction := nil. |
|
2914 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2915 |
stepHow := nil. |
266 | 2916 |
canContinue := false. |
2917 |
||
3269 | 2918 |
mH := 0. |
2919 |
||
3447 | 2920 |
menuPanel := MenuPanel in:self. |
8131 | 2921 |
menuPanel receiver:self. |
3447 | 2922 |
menuPanel verticalLayout:false. |
8131 | 2923 |
menu := self class menuSpec decodeAsLiteralArray. |
2924 |
menu findGuiResourcesIn:self. |
|
2925 |
menuPanel menu:menu. |
|
3447 | 2926 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2927 |
mH := menuPanel preferredHeight. |
3447 | 2928 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2929 |
||
12529 | 2930 |
newLayout := userPrefs useNewLayoutInDebugger. |
8148 | 2931 |
newLayout ifFalse:[ |
15413 | 2932 |
bpanel := HorizontalPanelView in:self. |
2933 |
||
2934 |
self initializeButtonsIn:bpanel. |
|
2935 |
||
2936 |
bH := bpanel preferredHeight + 5. |
|
2937 |
bpanel origin:(0.0 @ mH) |
|
2938 |
extent:(1.0 @ bH). |
|
2939 |
panel := VariableVerticalPanel |
|
2940 |
origin:(0.0 @ (mH + bH)) |
|
2941 |
corner:(1.0 @ 1.0) |
|
2942 |
in:self. |
|
2943 |
||
2944 |
v := self initializeContextListViewIn:panel. |
|
2945 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2946 |
||
2947 |
codePanel := View in:panel. |
|
2948 |
v := self initializeCodeViewIn:codePanel. |
|
2949 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
2950 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2951 |
||
2952 |
v := self initializeInspectorViewsIn:panel. |
|
2953 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2954 |
|
8148 | 2955 |
] ifTrue:[ |
15413 | 2956 |
bpanel1 := HorizontalPanelView in:self. |
2957 |
self initializeButtons1In:bpanel1. |
|
2958 |
||
2959 |
contextInfoLabel := Label label:''. |
|
2960 |
contextInfoLabel adjust:#left. |
|
2961 |
bpanel1 add:contextInfoLabel. |
|
2962 |
||
2963 |
bH1 := bpanel1 preferredHeight + 5. |
|
2964 |
bpanel1 origin:(0.0 @ mH) |
|
2965 |
extent:(1.0 @ bH1). |
|
2966 |
panel := VariableVerticalPanel |
|
2967 |
origin:(0.0 @ (mH + bH1)) |
|
2968 |
corner:(1.0 @ 1.0) |
|
2969 |
in:self. |
|
2970 |
"/ panel showHandle:true. |
|
2971 |
"/ panel handlePosition:#left. |
|
2972 |
||
2973 |
v := self initializeContextListViewIn:panel. |
|
2974 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2975 |
||
2976 |
codePanel := View in:panel. |
|
2977 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
2978 |
self initializeButtons2In:bpanel2. |
|
2979 |
||
2980 |
bH2 := bpanel2 preferredHeight + 5. |
|
2981 |
bpanel2 origin:(0.0 @ 0.0) |
|
2982 |
extent:(1.0 @ bH2). |
|
2983 |
||
2984 |
exceptionInfoLabel := Label label:''. |
|
2985 |
exceptionInfoLabel adjust:#left. |
|
2986 |
||
2987 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
2988 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
2989 |
exceptionAndTogglePanel |
|
2990 |
geometryLayout: |
|
2991 |
((LayoutFrame |
|
2992 |
origin:(0.0 @ 0.0) |
|
2993 |
corner:(1.0 @ 0.0)) |
|
2994 |
topOffset:bH2; |
|
2995 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
2996 |
rightOffset:-2). |
|
2997 |
||
2998 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
2999 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
3000 |
codeToggleLabels := resources array:{ |
|
3001 |
'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
|
3002 |
'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
|
3003 |
}. |
|
3004 |
methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
|
3005 |
methodCodeToggle list:codeToggleLabels. |
|
3006 |
methodCodeToggle useIndex:true. |
|
3007 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
3008 |
methodCodeToggle beInvisible. |
|
3009 |
||
3010 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
3011 |
||
3012 |
v := self initializeCodeViewIn:codePanel. |
|
3013 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
3014 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3015 |
||
3016 |
v := self initializeInspectorViewsIn:panel. |
|
3017 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3018 |
]. |
3019 |
||
3387 | 3020 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
15413 | 3021 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3022 |
]. |
9626 | 3023 |
LastExtent notNil ifTrue:[ |
15413 | 3024 |
self extent:LastExtent. |
9626 | 3025 |
]. |
3026 |
LastOrigin notNil ifTrue:[ |
|
15413 | 3027 |
self origin:LastOrigin. |
9626 | 3028 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3029 |
|
3269 | 3030 |
" |
3031 |
Debugger newDebugger |
|
3032 |
" |
|
3447 | 3033 |
|
11693 | 3034 |
"Modified: / 27-07-2012 / 14:46:07 / cg" |
3269 | 3035 |
! |
3036 |
||
10205 | 3037 |
initializeAbortButtonIn:bpanel |
3038 |
abortButton := Button |
|
15413 | 3039 |
label:(resources string:'Abort') |
3040 |
action:[ |
|
3041 |
abortButton turnOffWithoutRedraw. |
|
3042 |
self doAbort |
|
3043 |
] |
|
3044 |
in:bpanel. |
|
3447 | 3045 |
|
3046 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
3047 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
3048 |
! |
|
3049 |
||
10205 | 3050 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3051 |
"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
|
3052 |
|
3447 | 3053 |
|separator| |
3054 |
||
10205 | 3055 |
bpanel horizontalLayout:#left. |
3447 | 3056 |
bpanel verticalLayout:#centerMax. |
3057 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3058 |
||
8194 | 3059 |
self initializeContinueButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3060 |
continueButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3061 |
|
9131 | 3062 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
3063 |
"/ separator borderWidth:0; level:0. |
|
3447 | 3064 |
self initializeAbortButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3065 |
abortButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3066 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3067 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3068 |
separator borderWidth:0; level:0. |
3269 | 3069 |
|
3447 | 3070 |
self initializeTerminateButtonIn:bpanel. |
3071 |
||
9131 | 3072 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 3073 |
separator borderWidth:0; level:0. |
3074 |
||
13362 | 3075 |
self initializeGotoDialogOpenerButtonIn:bpanel. |
14523 | 3076 |
self initializeGotoApplicationActionMethodButtonIn:bpanel. |
3447 | 3077 |
self initializeDefineButtonIn:bpanel. |
14523 | 3078 |
|
4356 | 3079 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
15413 | 3080 |
separator := View extent:(10 @ 5) in:bpanel. |
3081 |
separator borderWidth:0; level:0. |
|
3082 |
self initializeReportButtonIn:bpanel. |
|
4356 | 3083 |
]. |
3447 | 3084 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 3085 |
! |
3086 |
||
10205 | 3087 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3088 |
"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
|
3089 |
|
3269 | 3090 |
|separator| |
3091 |
||
9131 | 3092 |
bpanel horizontalLayout:#left. |
3269 | 3093 |
bpanel verticalLayout:#centerMax. |
3094 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3095 |
||
3447 | 3096 |
self initializeNextButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3097 |
nextButton width:100. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3098 |
|
3447 | 3099 |
self initializeStepButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3100 |
stepButton width:100. |
3447 | 3101 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3102 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3103 |
"/ 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
|
3104 |
"/ 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
|
3105 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3106 |
|
3269 | 3107 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3108 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3109 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3110 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3111 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3112 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3113 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3114 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3115 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3116 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3117 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3118 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3119 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3120 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3121 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3122 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3123 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3124 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3125 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3126 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3127 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3128 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3129 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3130 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3131 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3132 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3133 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3134 |
|
3447 | 3135 |
self initializeSendButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3136 |
sendButton width:100. |
3447 | 3137 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3138 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3139 |
separator borderWidth:0; level:0. |
3269 | 3140 |
|
3447 | 3141 |
self initializeReturnButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3142 |
returnButton width:100. |
3447 | 3143 |
self initializeRestartButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3144 |
restartButton width:100. |
13360 | 3145 |
self initializeResendButtonIn:bpanel. |
3146 |
resendButton width:100. |
|
3447 | 3147 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
3148 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 3149 |
! |
3150 |
||
10205 | 3151 |
initializeButtonsIn:bpanel |
3269 | 3152 |
|separator| |
3153 |
||
3154 |
bpanel horizontalLayout:#left. |
|
3155 |
bpanel verticalLayout:#centerMax. |
|
3156 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3157 |
||
3447 | 3158 |
self initializeAbortButtonIn:bpanel. |
3159 |
||
3269 | 3160 |
separator := View extent:(10 @ 5) in:bpanel. |
3161 |
separator borderWidth:0; level:0. |
|
3162 |
||
3447 | 3163 |
self initializeContinueButtonIn:bpanel. |
3269 | 3164 |
|
3165 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3166 |
separator borderWidth:0; level:0. |
|
3167 |
||
10205 | 3168 |
self initializeReturnButtonIn:bpanel. |
3169 |
self initializeRestartButtonIn:bpanel. |
|
13360 | 3170 |
self initializeResendButtonIn:bpanel. |
3269 | 3171 |
|
3172 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3173 |
separator borderWidth:0; level:0. |
|
3174 |
||
3447 | 3175 |
self initializeNextButtonIn:bpanel. |
3176 |
self initializeStepButtonIn:bpanel. |
|
3177 |
||
3269 | 3178 |
"/ cg: |
3179 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
3180 |
"/ they do not work relyable with inlined blocks yet. |
|
3181 |
"/ |
|
3182 |
||
3183 |
||
3184 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
3185 |
"/ img isNil ifTrue:[ |
|
3186 |
"/ img := (resources at:'next') |
|
3187 |
"/ ]. |
|
3188 |
"/ nextButton := Button |
|
3189 |
"/ label:img |
|
3190 |
"/ action:[stepButton turnOff. self doNext] |
|
3191 |
"/ in:bpanel. |
|
3192 |
"/ |
|
3193 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
3194 |
"/ img isNil ifTrue:[ |
|
3195 |
"/ img := (resources at:'over') |
|
3196 |
"/ ]. |
|
3197 |
"/ nextOverButton := Button |
|
3198 |
"/ label:img |
|
3199 |
"/ action:[stepButton turnOff. self doNextOver] |
|
3200 |
"/ in:bpanel. |
|
3201 |
"/ |
|
3202 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
3203 |
"/ img isNil ifTrue:[ |
|
3204 |
"/ img := (resources at:'out') |
|
3205 |
"/ ]. |
|
3206 |
"/ nextOutButton := Button |
|
3207 |
"/ label:img |
|
3208 |
"/ action:[stepButton turnOff. self doNextOut] |
|
3209 |
"/ in:bpanel. |
|
3210 |
||
3447 | 3211 |
self initializeSendButtonIn:bpanel. |
3212 |
||
3187 | 3213 |
separator := View extent:(30 @ 5) in:bpanel. |
3214 |
separator borderWidth:0; level:0. |
|
3269 | 3215 |
|
3447 | 3216 |
self initializeTerminateButtonIn:bpanel. |
3217 |
||
3269 | 3218 |
separator := View extent:(30 @ 5) in:bpanel. |
3219 |
separator borderWidth:0; level:0. |
|
3220 |
||
3447 | 3221 |
self initializeDefineButtonIn:bpanel. |
4356 | 3222 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
15413 | 3223 |
self initializeReportButtonIn:bpanel. |
4356 | 3224 |
]. |
3225 |
||
3447 | 3226 |
|
3227 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
3228 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 3229 |
! |
3230 |
||
3231 |
initializeCodeViewIn:panel |
|
13519 | 3232 |
|scrollableCodeView| |
3269 | 3233 |
|
10628 | 3234 |
(UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
15413 | 3235 |
scrollableCodeView := codeView := Tools::CodeView2 new. |
3236 |
codeView model: ValueHolder new. |
|
3237 |
codeView methodHolder: ValueHolder new. |
|
3238 |
codeView classHolder: ValueHolder new. |
|
10628 | 3239 |
] ifFalse:[ |
15413 | 3240 |
scrollableCodeView := HVScrollableView |
3241 |
for:CodeView |
|
3242 |
miniScrollerH:true |
|
3243 |
miniScrollerV:false |
|
3244 |
in:panel. |
|
3245 |
||
3246 |
codeView := scrollableCodeView scrolledView. |
|
3247 |
codeView enableMotionEvents. "/ for active help |
|
3248 |
]. |
|
3249 |
||
3250 |
(UserPreferences current showAcceptCancelBarInBrowser |
|
3251 |
and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
|
3252 |
ViewWithAcceptAndCancelBar notNil ifTrue:[ |
|
3253 |
|v| |
|
3254 |
||
3255 |
v := ViewWithAcceptAndCancelBar new. |
|
3256 |
v slaveView:scrollableCodeView. |
|
3257 |
v reallyModifiedHolder:(codeView isCodeView2 |
|
3258 |
ifTrue:[ codeView reallyModifiedChannel ] |
|
3259 |
ifFalse:[ |
|
3260 |
BlockValue |
|
3261 |
with:[:m | |
|
3262 |
|same| |
|
3263 |
||
3264 |
same := (codeView contentsAsString string = currentMethod source string). |
|
3265 |
codeView modifiedChannel setValue:false. "/ so it triggers again |
|
3266 |
same not. |
|
3267 |
] |
|
3268 |
argument:codeView modifiedChannel |
|
3269 |
]). |
|
3270 |
v cancelAction: |
|
3271 |
[ |
|
3272 |
"/ codeView setClipboardText:(codeView contents). "/ for undo |
|
3273 |
codeView device rememberInCopyBufferHistory:(codeView contents). "/ for undo |
|
3274 |
codeView contents:(currentMethod source). |
|
3275 |
codeView modifiedChannel setValue:false; changed. "/ trigger |
|
3276 |
codeView requestFocus. |
|
3277 |
]. |
|
3278 |
v compareAction: |
|
3279 |
[ |
|
3280 |
v := DiffCodeView |
|
3281 |
openOn:codeView contentsAsString |
|
3282 |
label:(resources string:'Changed definition (to be accepted ?)') |
|
3283 |
and:currentMethod source |
|
3284 |
label:(resources string:'Method''s Original Code'). |
|
3285 |
v label:(resources string:'Changed Code in Debugger'). |
|
3286 |
v waitUntilVisible. |
|
3287 |
"/ codeView requestFocus |
|
3288 |
]. |
|
3289 |
scrollableCodeView := v. |
|
3290 |
] |
|
13519 | 3291 |
]. |
3292 |
||
3293 |
panel add:scrollableCodeView. |
|
3294 |
^ scrollableCodeView |
|
10628 | 3295 |
|
13842 | 3296 |
"Modified: / 06-12-2013 / 17:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3269 | 3297 |
! |
3298 |
||
3299 |
initializeContextListViewIn:panel |
|
3300 |
|v| |
|
266 | 3301 |
|
10205 | 3302 |
v := HVScrollableView |
15413 | 3303 |
for:SelectionInListView |
3304 |
miniScrollerH:true |
|
3305 |
miniScrollerV:false |
|
3306 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
3307 |
v autoHideHorizontalScrollBar:true. |
266 | 3308 |
|
3309 |
contextView := v scrolledView. |
|
3310 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 3311 |
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
|
3312 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 3313 |
|
10205 | 3314 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 3315 |
|
3269 | 3316 |
^ v |
3317 |
! |
|
3318 |
||
5453 | 3319 |
initializeContextViewsMiddleButtonMenu |
3320 |
<resource: #programMenu > |
|
3321 |
||
10205 | 3322 |
contextView middleButtonMenu:(self middleButtonMenu). |
3323 |
! |
|
3324 |
||
3325 |
initializeContinueButtonIn:bpanel |
|
3326 |
continueButton := Button |
|
15413 | 3327 |
label:(resources string:'Continue') |
3328 |
action:[ |
|
3329 |
continueButton turnOffWithoutRedraw. |
|
3330 |
self doContinue |
|
3331 |
] |
|
3332 |
in:bpanel. |
|
3447 | 3333 |
|
3334 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
3335 |
! |
|
3336 |
||
10205 | 3337 |
initializeDefineButtonIn:bpanel |
3338 |
defineButton := Button |
|
15413 | 3339 |
label:(resources string:'Define') |
3340 |
action:[ |
|
3341 |
defineButton turnOffWithoutRedraw. |
|
3342 |
self doDefine |
|
3343 |
] |
|
3344 |
in:bpanel. |
|
3447 | 3345 |
defineButton beInvisible |
3346 |
||
3347 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
3348 |
! |
|
3349 |
||
14523 | 3350 |
initializeGotoApplicationActionMethodButtonIn:bpanel |
3351 |
gotoApplicationActionMethodButton := Button |
|
15413 | 3352 |
label:(resources string:'Goto Responsible Application Method') |
3353 |
action:[ |
|
3354 |
gotoApplicationActionMethodButton turnOffWithoutRedraw. |
|
3355 |
self doGotoApplicationActionMethod |
|
3356 |
] |
|
3357 |
in:bpanel. |
|
14523 | 3358 |
|
3359 |
gotoApplicationActionMethodButton beInvisible |
|
3360 |
! |
|
3361 |
||
13362 | 3362 |
initializeGotoDialogOpenerButtonIn:bpanel |
3363 |
gotoDialogOpenerButton := Button |
|
15413 | 3364 |
label:(resources string:'Goto Dialog Opener') |
3365 |
action:[ |
|
3366 |
gotoDialogOpenerButton turnOffWithoutRedraw. |
|
3367 |
self doGotoDialogOpener |
|
3368 |
] |
|
3369 |
in:bpanel. |
|
13362 | 3370 |
|
3371 |
gotoDialogOpenerButton beInvisible |
|
3372 |
! |
|
3373 |
||
3269 | 3374 |
initializeInspectorViewsIn:panel |
3375 |
|hpanel| |
|
266 | 3376 |
|
3377 |
hpanel := VariableHorizontalPanel in:panel. |
|
3378 |
||
3379 |
receiverInspector := InspectorView |
|
15413 | 3380 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
3381 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3382 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 3383 |
|
3384 |
contextInspector := ContextInspectorView |
|
15413 | 3385 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
3386 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3387 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3388 |
|
3269 | 3389 |
^ hpanel |
266 | 3390 |
! |
3391 |
||
10205 | 3392 |
initializeNextButtonIn:bpanel |
3393 |
nextButton := Button |
|
15413 | 3394 |
label:(resources string:'Debug_Next') |
3395 |
action:[ |
|
3396 |
stepButton turnOff. |
|
3397 |
self doNext |
|
3398 |
] |
|
3399 |
in:bpanel. |
|
3447 | 3400 |
|
3401 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
3402 |
! |
|
3403 |
||
10205 | 3404 |
initializeReportButtonIn:bpanel |
3405 |
reportButton := Button |
|
15413 | 3406 |
label:(resources string:'Report by Mail...') |
3407 |
action:[ |
|
3408 |
reportButton turnOffWithoutRedraw. |
|
3409 |
self doOpenReportMailApp. |
|
3410 |
] |
|
3411 |
in:bpanel. |
|
4356 | 3412 |
|
3413 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
3414 |
! |
|
3415 |
||
13360 | 3416 |
initializeResendButtonIn:bpanel |
3417 |
resendButton := Button |
|
15413 | 3418 |
label:(resources string:'Resend') |
3419 |
action:[ |
|
3420 |
resendButton turnOff. |
|
3421 |
self doResend |
|
3422 |
] |
|
3423 |
in:bpanel. |
|
13490 | 3424 |
|
3425 |
"/ if we have this, we do not need the restart button |
|
3426 |
restartButton beInvisible. |
|
13360 | 3427 |
! |
3428 |
||
10205 | 3429 |
initializeRestartButtonIn:bpanel |
3430 |
restartButton := Button |
|
15413 | 3431 |
label:(resources string:'Restart') |
3432 |
action:[ |
|
3433 |
restartButton turnOff. |
|
3434 |
self doRestart |
|
3435 |
] |
|
3436 |
in:bpanel. |
|
3447 | 3437 |
|
3438 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
|
3439 |
! |
|
3440 |
||
10205 | 3441 |
initializeReturnButtonIn:bpanel |
3442 |
returnButton := Button |
|
15413 | 3443 |
label:(resources string:'Return') |
3444 |
action:[ |
|
3445 |
returnButton turnOff. |
|
3446 |
self doReturn |
|
3447 |
] |
|
3448 |
in:bpanel. |
|
3447 | 3449 |
|
3450 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
3451 |
! |
|
3452 |
||
10205 | 3453 |
initializeSendButtonIn:bpanel |
3454 |
sendButton := Button |
|
15413 | 3455 |
label:(resources string:'Send') |
3456 |
action:[ |
|
3457 |
sendButton turnOff. |
|
3458 |
self doSend |
|
3459 |
] |
|
3460 |
in:bpanel. |
|
3447 | 3461 |
|
3462 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
3463 |
! |
|
3464 |
||
10205 | 3465 |
initializeStepButtonIn:bpanel |
3466 |
stepButton := Button |
|
15413 | 3467 |
label:(resources string:'Debug_Step') |
3468 |
action:[ |
|
3469 |
stepButton turnOff. |
|
3470 |
self doStep |
|
3471 |
] |
|
3472 |
in:bpanel. |
|
3447 | 3473 |
|
3474 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
3475 |
! |
|
3476 |
||
10205 | 3477 |
initializeTerminateButtonIn:bpanel |
3478 |
terminateButton := Button |
|
15413 | 3479 |
label:(resources string:'Debug_Terminate') |
3480 |
action:[ |
|
3481 |
terminateButton turnOffWithoutRedraw. |
|
3482 |
self doTerminate |
|
3483 |
] |
|
3484 |
in:bpanel. |
|
3447 | 3485 |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3486 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3487 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3488 |
|
3447 | 3489 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 3490 |
! |
3491 |
||
1249 | 3492 |
postRealize |
3493 |
super postRealize. |
|
266 | 3494 |
|
3495 |
inspecting ifTrue:[ |
|
15413 | 3496 |
inspectedProcess notNil ifTrue:[ |
3497 |
" |
|
3498 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
3499 |
to run between mine and the debugged processes prio) |
|
3500 |
" |
|
3501 |
Processor activeProcess |
|
3502 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
3503 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3504 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3505 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3506 |
self sensor addEventListener:self. |
1249 | 3507 |
|
3508 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 3509 |
! |
3510 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3511 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3512 |
"/ 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
|
3513 |
"/ 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
|
3514 |
|
13965 | 3515 |
self drawableId notNil ifTrue:[ |
15413 | 3516 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3517 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3518 |
"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
|
3519 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3520 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3521 |
|
11818 | 3522 |
releaseDebuggee |
3523 |
"We have to be careful to release all refs to the debuggee, |
|
3524 |
because we may be in the cache. |
|
3525 |
Otherwise, the GC will not be able to release it" |
|
3526 |
||
3527 |
busy := false. |
|
3528 |
||
3529 |
codeView acceptAction:nil. |
|
3530 |
codeView doItAction:nil. |
|
3531 |
codeView contents:nil. |
|
3532 |
||
3533 |
receiverInspector release. |
|
3534 |
contextInspector release. |
|
3535 |
inspectedProcess := nil. |
|
3536 |
contextArray := nil. |
|
13361 | 3537 |
((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[ |
15413 | 3538 |
selectedContext := nil. |
11818 | 3539 |
]. |
3540 |
actualContext := firstContext := nil. |
|
3541 |
steppedContext := wrapperContext := nil. |
|
3542 |
catchBlock := nil. |
|
3543 |
grabber := nil. |
|
3544 |
self autoUpdateOff. |
|
3545 |
||
3546 |
"Created: / 10-07-1997 / 14:57:51 / stefan" |
|
3547 |
"Modified: / 26-09-2012 / 15:08:21 / cg" |
|
3548 |
! |
|
3549 |
||
266 | 3550 |
setLabelFor:aMessage in:aProcess |
9403 | 3551 |
|l lines processNameOrNil pidOrNil osPidString| |
6821 | 3552 |
|
3553 |
lines := aMessage asStringCollection. |
|
3554 |
lines size > 1 ifTrue:[ |
|
15413 | 3555 |
l := lines first |
6821 | 3556 |
] ifFalse:[ |
15413 | 3557 |
l := aMessage. |
6821 | 3558 |
]. |
3559 |
||
3560 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
3561 |
Error handle:[:ex | |
15413 | 3562 |
l := l , '???' |
1030 | 3563 |
] do:[ |
15413 | 3564 |
processNameOrNil := aProcess name. |
3565 |
processNameOrNil notNil ifTrue:[ |
|
3566 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
3567 |
]. |
|
3568 |
pidOrNil := aProcess id printString. |
|
3569 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 3570 |
]. |
1030 | 3571 |
l := l , ')'. |
266 | 3572 |
self label:l. |
6821 | 3573 |
|
10205 | 3574 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
15413 | 3575 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
9403 | 3576 |
]. |
3577 |
||
8305 | 3578 |
exceptionInfoLabel notNil ifTrue:[ |
15413 | 3579 |
exceptionInfoLabel |
3580 |
label:(resources |
|
3581 |
string:'%1 in process %2 [%3]%4' |
|
3582 |
with:(lines first colorizeAllWith:Color red) |
|
3583 |
with:(processNameOrNil ? '') |
|
3584 |
with:(pidOrNil ? '') |
|
3585 |
with:(osPidString ? '')) |
|
8305 | 3586 |
]. |
3587 |
||
6821 | 3588 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 3589 |
! ! |
3590 |
||
3591 |
!DebugView methodsFor:'interrupt handling'! |
|
3592 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3593 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3594 |
DebuggingDebugger == true ifTrue:[ |
15413 | 3595 |
'contextIRQ' printCR. |
3596 |
thisContext methodHome sender fullPrint. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3597 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3598 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3599 |
|
1364 | 3600 |
"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
|
3601 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3602 |
|
0 | 3603 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3604 |
DebuggingDebugger == true ifTrue:[ |
15413 | 3605 |
'stepIRQ' print. |
3606 |
"/ ' in ' print. thisContext sender fullPrint. |
|
3607 |
'' printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3608 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
3609 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3610 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3611 |
|
11636 | 3612 |
"Modified: / 20-07-2012 / 14:06:54 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3613 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3614 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3615 |
stepOrNext |
15413 | 3616 |
|where here con s isWrap method wrappedMethod |
11636 | 3617 |
originalMethodOfWrappedMethod originalMethodsContext |
3618 |
inBlock subBlockLeft ignore contextBelow wrapContext |
|
10205 | 3619 |
leftWrap enteredWrap anyStepBlocks |
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3620 |
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
|
3621 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3622 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3623 |
"/ DebuggingDebugger := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3624 |
"/ DebuggingDebugger2 := true |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3625 |
"/ DebuggingDebugger2 := false |
11636 | 3626 |
"/ DebuggingDebugger3 := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3627 |
"/ '' printCR |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3628 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3629 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3630 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3631 |
skipLineNr == #return ifTrue:[ |
15413 | 3632 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
3633 |
here := thisContext sender sender. |
|
3634 |
here setLineNumber:nil. |
|
3635 |
here := nil. |
|
3636 |
con := thisContext sender sender sender. |
|
3637 |
||
3638 |
HaltInterrupt handle:[:ex | |
|
3639 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
3640 |
ex proceed |
|
3641 |
] do:[ |
|
3642 |
self enter:con select:nil. |
|
3643 |
]. |
|
3644 |
con := nil. |
|
3645 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3646 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3647 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3648 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3649 |
"/ "/ 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
|
3650 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3651 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3652 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3653 |
"/ 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
|
3654 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3655 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3656 |
|
52 | 3657 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
15413 | 3658 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
3659 |
^ self |
|
52 | 3660 |
]. |
3661 |
||
29 | 3662 |
here := thisContext. "stepInterrupt" |
10205 | 3663 |
here := here sender. "the caller; step- or contextIRQ" |
3664 |
here := here sender. "the interrupted context" |
|
29 | 3665 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3666 |
DebuggingDebugger2 == true ifTrue:[ |
15413 | 3667 |
'***************************' printCR. |
3668 |
'here in ' print. |
|
3669 |
inWrap ifTrue:['(wrap) ' print.]. |
|
3670 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
3671 |
here selector printCR. |
|
3672 |
'stepping in ' print. |
|
3673 |
steppedContext notNil ifTrue:[ |
|
3674 |
((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print. |
|
3675 |
]. |
|
3676 |
steppedContext printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3677 |
]. |
10 | 3678 |
|
13197 | 3679 |
"/ when single stepping, ignore breakpoints |
3680 |
here selector == #break ifTrue:[ |
|
15413 | 3681 |
(here receiver isKindOf:Breakpoint) ifTrue:[ |
3682 |
false "here receiver isEnabled" ifFalse:[ |
|
3683 |
con := nil. |
|
3684 |
where := nil. here := nil. |
|
3685 |
StepInterruptPending := 1. |
|
3686 |
InterruptPending := 1. |
|
3687 |
InStepInterrupt := nil. |
|
3688 |
^ self |
|
3689 |
] |
|
3690 |
]. |
|
13197 | 3691 |
]. |
3692 |
||
3693 |
"/ kludge: a bug-workaround; |
|
3694 |
"/ I should not see those... |
|
2581 | 3695 |
|
3696 |
here selector == #ioInterrupt ifTrue:[ |
|
15413 | 3697 |
DebuggingDebugger2 == true ifTrue:[ |
3698 |
'oops - should not get that one' printCR. |
|
3699 |
]. |
|
3700 |
Processor ioInterrupt. |
|
3701 |
StepInterruptPending := 1. |
|
3702 |
InterruptPending := 1. |
|
3703 |
where := nil. here := nil. |
|
3704 |
InStepInterrupt := nil. |
|
3705 |
^ self |
|
2581 | 3706 |
]. |
3707 |
||
3708 |
stepUntilEntering notNil ifTrue:[ |
|
15413 | 3709 |
DebuggingDebugger2 == true ifTrue:[ |
3710 |
'check if entering ' print. stepUntilEntering printCR. |
|
3711 |
]. |
|
3712 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
3713 |
DebuggingDebugger2 == true ifTrue:[ |
|
3714 |
'entering...' printCR. |
|
3715 |
]. |
|
3716 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
3717 |
||
3718 |
lastStepUntilEntering := stepUntilEntering. |
|
3719 |
stepUntilEntering := nil. |
|
3720 |
self enter:here select:nil. |
|
3721 |
con := nil. |
|
3722 |
^ self |
|
3723 |
]. |
|
3724 |
"/ see if stepping context is still active ... |
|
3725 |
||
3726 |
con := here. |
|
3727 |
||
3728 |
DebuggingDebugger2 == true ifTrue:[ |
|
3729 |
'start searching at: ' print. |
|
3730 |
con fullPrint. |
|
3731 |
]. |
|
3732 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
3733 |
con := con sender |
|
3734 |
]. |
|
3735 |
con notNil ifTrue:[ |
|
3736 |
DebuggingDebugger2 == true ifTrue:[ |
|
3737 |
'steppingContext still active - continue stepping' printCR. |
|
3738 |
]. |
|
3739 |
con := nil. |
|
3740 |
where := nil. here := nil. |
|
3741 |
StepInterruptPending := 1. |
|
3742 |
InterruptPending := 1. |
|
3743 |
InStepInterrupt := nil. |
|
3744 |
^ self |
|
3745 |
]. |
|
3746 |
stepUntilEntering := nil. |
|
2581 | 3747 |
]. |
3748 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
3749 |
" |
11636 | 3750 |
kludge to hide breakpoint wrappers in the context list and when single stepping: |
15413 | 3751 |
check if we are in a wrapper method's hidden setup-sequence |
3752 |
if so, ignore the interrupt and continue single sending. |
|
3753 |
Assume we are in a wrappers setup code, if there is another context above, |
|
3754 |
which is for the wrapper method (i.e. if there is context with an originalmethod |
|
3755 |
of some other context higher in the caller chain |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
3756 |
" |
29 | 3757 |
isWrap := false. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3758 |
subBlockLeft := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3759 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3760 |
|
57 | 3761 |
inWrap ifTrue:[ |
15413 | 3762 |
"/ situation1: |
3763 |
"/ valueWithReceiver or other |
|
3764 |
"/ foo (wrapped) <- wrapContext |
|
3765 |
"/ |
|
3766 |
"/ situation2: |
|
3767 |
"/ foo (original) <- originalMethodsContext |
|
3768 |
"/ valueWithReceiver |
|
3769 |
"/ foo (wrapped) <- wrapContext |
|
3770 |
"/ |
|
3771 |
"/ situation3: |
|
3772 |
"/ other |
|
3773 |
"/ foo (original) <- originalMethodsContext |
|
3774 |
"/ valueWithReceiver |
|
3775 |
"/ foo (wrapped) <- wrapContext |
|
3776 |
"/ |
|
3777 |
"/ situation4: |
|
3778 |
"/ ... many-contexts ... (more than 8) |
|
3779 |
"/ possibly foo (original) |
|
3780 |
"/ valueWithReceiver or other |
|
3781 |
"/ foo (wrapped) |
|
3782 |
"/ |
|
3783 |
||
3784 |
"/ search for the wrapped method's context and extract the original method |
|
3785 |
where := here. |
|
3786 |
8 timesRepeat:[ |
|
3787 |
wrapContext isNil ifTrue:[ |
|
3788 |
where notNil ifTrue:[ |
|
3789 |
DebuggingDebugger2 == true ifTrue:[ |
|
3790 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
3791 |
where printCR |
|
3792 |
]. |
|
3793 |
where isBlockContext ifFalse:[ |
|
3794 |
method := where method. |
|
3795 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
3796 |
originalMethodOfWrappedMethod := method originalMethod. |
|
3797 |
wrappedMethod := method. |
|
3798 |
wrapContext := where. |
|
3799 |
]. |
|
3800 |
]. |
|
3801 |
where := where sender |
|
3802 |
] |
|
3803 |
] |
|
3804 |
]. |
|
3805 |
DebuggingDebugger2 == true ifTrue:[ |
|
3806 |
'wrap-context is: ' print. |
|
3807 |
wrapContext notNil ifTrue:[ |
|
3808 |
((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print. |
|
3809 |
]. |
|
3810 |
wrapContext printCR |
|
3811 |
]. |
|
3812 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
3813 |
'oops no wrap?' errorPrintCR. |
|
3814 |
]. |
|
11636 | 3815 |
]. |
3816 |
||
3817 |
(inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[ |
|
15413 | 3818 |
isWrap := false. |
3819 |
"/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ]. |
|
3820 |
where := here. |
|
3821 |
8 timesRepeat:[ |
|
3822 |
originalMethodsContext isNil ifTrue:[ |
|
3823 |
where notNil ifTrue:[ |
|
3824 |
DebuggingDebugger2 ifTrue:[ |
|
3825 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
3826 |
where printCR |
|
3827 |
]. |
|
3828 |
where isBlockContext ifFalse:[ |
|
3829 |
method := where method. |
|
3830 |
method == originalMethodOfWrappedMethod ifTrue:[ |
|
3831 |
originalMethodsContext := here. |
|
3832 |
where == here ifTrue:[ |
|
3833 |
"/ situation2 |
|
3834 |
DebuggingDebugger2 ifTrue:[ 's2' printCR ]. |
|
3835 |
isWrap := true. |
|
3836 |
"/ here setSender:(wrapContext sender). --- leads to a crash |
|
3837 |
] ifFalse: [ |
|
3838 |
"/ situation3 |
|
3839 |
DebuggingDebugger2 ifTrue:[ 's3' printCR ]. |
|
3840 |
inWrap := false. |
|
3841 |
isWrap := false. |
|
3842 |
]. |
|
3843 |
steppedContext := where |
|
11636 | 3844 |
"/ ] ifFalse:[ |
3845 |
"/ where selector == wrapContext selector ifTrue:[ |
|
3846 |
"/ where receiver == wrapContext receiver ifTrue:[ |
|
3847 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
3848 |
"/ method printCR. |
|
3849 |
"/ method originalMethod printCR. |
|
3850 |
"/ originalMethodOfWrappedMethod printCR. |
|
3851 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
3852 |
"/ ]. |
|
3853 |
"/ ]. |
|
15413 | 3854 |
]. |
3855 |
where := where sender |
|
3856 |
]. |
|
3857 |
]. |
|
3858 |
]. |
|
3859 |
]. |
|
3860 |
DebuggingDebugger2 ifTrue:[ |
|
3861 |
'original method-context is: ' print. |
|
3862 |
originalMethodsContext notNil ifTrue:[ |
|
3863 |
((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print. |
|
3864 |
]. |
|
3865 |
originalMethodsContext printCR |
|
3866 |
]. |
|
3867 |
originalMethodsContext isNil ifTrue:[ |
|
3868 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
3869 |
"/ situation4 |
|
3870 |
DebuggingDebugger2 ifTrue:[ 's4' printCR ]. |
|
3871 |
DebuggingDebugger2 ifTrue:[ steppedContext printCR ]. |
|
3872 |
isWrap := false. |
|
3873 |
] ifFalse:[ |
|
3874 |
"/ situation1 |
|
3875 |
DebuggingDebugger2 ifTrue:[ 's1' printCR ]. |
|
3876 |
isWrap := true. |
|
3877 |
"/ steppedContext := wrapContext |
|
3878 |
]. |
|
3879 |
]. |
|
29 | 3880 |
]. |
3881 |
||
3882 |
isWrap ifTrue:[ |
|
15413 | 3883 |
DebuggingDebugger2 == true ifTrue:[ |
3884 |
'ignore wrap' printCR. |
|
3885 |
]. |
|
3886 |
||
3887 |
"/ |
|
3888 |
"/ ignore, while in wrappers hidden setup |
|
3889 |
"/ |
|
3890 |
where := nil. here := nil. |
|
3891 |
ObjectMemory flushInlineCaches. |
|
3892 |
||
3893 |
DebuggingDebugger2 == true ifTrue:[ |
|
3894 |
skipLineNr == #return ifTrue:[ |
|
3895 |
'skipRet in wrap' printCR. |
|
3896 |
] |
|
3897 |
]. |
|
3898 |
||
3899 |
StepInterruptPending := 1. |
|
3900 |
InterruptPending := 1. |
|
3901 |
InStepInterrupt := nil. |
|
3902 |
^ self |
|
29 | 3903 |
]. |
3904 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3905 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 3906 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3907 |
DebuggingDebugger2 == true ifTrue:[ |
15413 | 3908 |
'bigStep is: ' print. bigStep printCR. |
3909 |
'steppedContext is: ' print. steppedContext printCR. |
|
2581 | 3910 |
]. |
3911 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3912 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3913 |
"/ 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
|
3914 |
"/ |
10205 | 3915 |
(bigStep |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
3916 |
and:[steppedContext notNil]) ifTrue:[ |
15413 | 3917 |
" |
3918 |
a step or next - ignore all contexts below the interesting one |
|
3919 |
" |
|
3920 |
where := here. "the interrupted context" |
|
3921 |
contextBelow := nil. |
|
3922 |
||
3923 |
where home notNil ifTrue:[ |
|
3924 |
"/ |
|
3925 |
"/ in a block called by 'our' context ? |
|
3926 |
"/ |
|
3927 |
where home == steppedContext ifTrue:[ |
|
3928 |
"/ '*block*' printCR. |
|
3929 |
inBlock := true |
|
3930 |
] |
|
3931 |
]. |
|
3932 |
||
3933 |
where == steppedContext ifFalse:[ |
|
3934 |
where := where sender. |
|
3935 |
||
3936 |
where notNil ifTrue:[ |
|
3937 |
where home == steppedContext ifTrue:[ |
|
3938 |
"/ '*block*' printCR. |
|
3939 |
inBlock := true. |
|
3940 |
] |
|
3941 |
]. |
|
57 | 3942 |
|
3943 |
"/ 'looking for ' print. |
|
3055 | 3944 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 3945 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3946 |
"/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
|
3947 |
"/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
|
3948 |
|
15413 | 3949 |
where == steppedContext ifFalse:[ |
3950 |
||
3951 |
"/ check if we are in a context below steppedContext |
|
3952 |
"/ (i.e. if steppedContext can be reached from |
|
3953 |
"/ interrupted context. Not using context-ref but its |
|
3954 |
"/ address to avoid creation of many useless contexts.) |
|
3955 |
||
3956 |
inBlock ifFalse:[ |
|
3957 |
[where notNil] whileTrue:[ |
|
3958 |
||
3959 |
"/ if either the receiver or any arg of this context |
|
3960 |
"/ is a block of the steppedContext, we must really |
|
3961 |
"/ do a single step. Otherwise, stepping through a |
|
3962 |
"/ do:-loop would be very difficult. |
|
3963 |
receiver := where receiver. |
|
13197 | 3964 |
where selector == #critical: ifTrue:[ |
3965 |
anyStepBlocks := true. |
|
3966 |
] ifFalse:[ |
|
15413 | 3967 |
(receiver isBlock |
3968 |
and:[(receiver isKindOf:Block) |
|
3969 |
and:[receiver homeMethod == steppedContext method |
|
3970 |
"receiver home == steppedContext"]]) |
|
3971 |
ifTrue:[ |
|
3972 |
anyStepBlocks := true. |
|
3973 |
] ifFalse:[ |
|
3974 |
where args do:[:arg | |
|
3975 |
(arg isBlock |
|
3976 |
and:[(arg isKindOf:Block) |
|
3977 |
and:[arg homeMethod == steppedContext method |
|
3978 |
"arg home == steppedContext"]]) |
|
3979 |
ifTrue:[ |
|
3980 |
anyStepBlocks := true. |
|
3981 |
] ifFalse:[ |
|
3982 |
(where methodHome notNil |
|
3983 |
and:[where methodHome receiver isBlock |
|
3984 |
and:[(where methodHome receiver isKindOf:Block) |
|
3985 |
and:[where methodHome receiver homeMethod == steppedContext method |
|
3986 |
"where methodHome receiver home == steppedContext"]]]) |
|
3987 |
ifTrue:[ |
|
3988 |
anyStepBlocks := true. |
|
3989 |
] |
|
3990 |
]. |
|
3991 |
] |
|
3992 |
]. |
|
13197 | 3993 |
]. |
15413 | 3994 |
DebuggingDebugger2 == true ifTrue:[ |
3995 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
3996 |
where selector printCR. |
|
3997 |
]. |
|
3998 |
||
3999 |
where == steppedContext ifTrue:[ |
|
3055 | 4000 |
"/ 'found it - below; ignore' printCR. |
15413 | 4001 |
" |
4002 |
found the interesting context somwehere up in the |
|
4003 |
chain. We seem to be still below the interesting one ... |
|
4004 |
" |
|
4005 |
tracing == true ifTrue:[ |
|
4006 |
here printString printCR |
|
4007 |
]. |
|
4008 |
" |
|
4009 |
yes, a context below |
|
4010 |
- continue and schedule another stepInterrupt. |
|
4011 |
Must flush caches since optimized methods not always |
|
4012 |
look for pending interrupts |
|
4013 |
" |
|
4014 |
||
4015 |
contextBelow notNil ifTrue:[ |
|
3055 | 4016 |
"/ '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
|
4017 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4018 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4019 |
"/ 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
|
4020 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4021 |
|
15413 | 4022 |
DebuggingDebugger2 == true ifTrue:[ |
4023 |
'below stepCon; continue until unwind of: ' print. |
|
4024 |
contextBelow printCR. |
|
4025 |
]. |
|
4026 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
4027 |
StepInterruptPending := nil. |
|
4028 |
] ifFalse:[ |
|
4029 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4030 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4031 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4032 |
"/ 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
|
4033 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4034 |
|
15413 | 4035 |
DebuggingDebugger2 == true ifTrue:[ |
4036 |
'in stepCon; continue single stepping' printCR. |
|
4037 |
]. |
|
4038 |
StepInterruptPending := 1. |
|
4039 |
InterruptPending := 1. |
|
4040 |
]. |
|
4041 |
where := nil. here := nil. |
|
4042 |
InStepInterrupt := nil. |
|
4043 |
||
4044 |
^ self |
|
4045 |
]. |
|
4046 |
||
4047 |
(steppedContext notNil and:[ |
|
4048 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
4049 |
inBlockBelow := true. |
|
4050 |
]. |
|
4051 |
||
4052 |
anyStepBlocks ifFalse:[ |
|
4053 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4054 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4055 |
"/ 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
|
4056 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4057 |
where isBlockContext ifFalse:[ |
15413 | 4058 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4059 |
]. |
15413 | 4060 |
] |
4061 |
]. |
|
4062 |
where := where sender |
|
4063 |
]. |
|
4064 |
s := 'Debugger: context returned'. |
|
4065 |
subBlockLeft := true. |
|
4066 |
]. |
|
4067 |
] ifTrue:[ |
|
3055 | 4068 |
"/ 'found it right in sender' printCR. |
15413 | 4069 |
s := 'Debugger: after step' |
4070 |
]. |
|
4071 |
] ifTrue:[ |
|
3055 | 4072 |
"/ 'found it right away' printCR. |
15413 | 4073 |
s := 'Debugger: after step' |
4074 |
]. |
|
0 | 4075 |
] ifFalse:[ |
3055 | 4076 |
"/ ' send' printCR. |
15413 | 4077 |
" |
4078 |
a send |
|
4079 |
" |
|
4080 |
DebuggingDebugger2 == true ifTrue:[ |
|
4081 |
'clear steppedContext' printCR. |
|
4082 |
]. |
|
4083 |
steppedContext := nil. |
|
4084 |
s := 'Debugger: after send' |
|
0 | 4085 |
]. |
7 | 4086 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4087 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4088 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
15413 | 4089 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4090 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4091 |
|
790 | 4092 |
"/ handle the case, when a subBlock leaves; |
4093 |
"/ continue stepping in the home context. |
|
4094 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4095 |
subBlockLeft ifTrue:[ |
15413 | 4096 |
steppedContext home notNil ifTrue:[ |
4097 |
steppedContext := steppedContext home. |
|
4098 |
s := 'Debugger: after step'. |
|
4099 |
subBlockLeft := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4100 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4101 |
|
15413 | 4102 |
] |
790 | 4103 |
]. |
4104 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4105 |
" |
10205 | 4106 |
kludge to hide breakpoint wrappers in the context list: |
15413 | 4107 |
check if we are in a wrapper methods hidden exit-sequence |
4108 |
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
|
4109 |
" |
10205 | 4110 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4111 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4112 |
ifTrue:[ |
15413 | 4113 |
"/ did not find our steppedContext along the chain; |
4114 |
"/ could be in a wrappedMethods exitBlock ... |
|
4115 |
||
4116 |
leftWrap ifFalse:[ |
|
4117 |
where := here. |
|
4118 |
wrappedMethod := nil. |
|
4119 |
5 timesRepeat:[ |
|
4120 |
where notNil ifTrue:[ |
|
4121 |
where isBlockContext ifFalse:[ |
|
4122 |
method := where method. |
|
4123 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4124 |
where == wrapperContext ifTrue:[ |
|
4125 |
DebuggingDebugger2 == true ifTrue:[ |
|
4126 |
'change stepCon fromWrapped: ' print. |
|
4127 |
steppedContext print. |
|
4128 |
' to: ' print. |
|
4129 |
wrapperContext printCR. |
|
4130 |
]. |
|
4131 |
||
4132 |
inWrap := true. |
|
4133 |
enteredWrap := true. |
|
4134 |
steppedContext := wrapperContext. |
|
4135 |
wrapperContext := nil. |
|
4136 |
] |
|
4137 |
]. |
|
4138 |
]. |
|
4139 |
where := where sender |
|
4140 |
] |
|
4141 |
]. |
|
4142 |
]. |
|
4143 |
enteredWrap ifTrue:[ |
|
4144 |
ignore := true |
|
4145 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4146 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4147 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4148 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4149 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4150 |
subBlockLeft ifTrue:[ |
15413 | 4151 |
"/ special care for stepInterrupt in send, |
4152 |
"/ when created a dummy context (lineNr == 1) |
|
4153 |
||
4154 |
steppedContext lineNumber isNil ifTrue:[ |
|
4155 |
steppedContext selector == here sender selector ifTrue:[ |
|
4156 |
subBlockLeft := false. |
|
4157 |
s := 'Debugger: after step'. |
|
4158 |
steppedContext := here sender. |
|
4159 |
]. |
|
4160 |
]. |
|
4161 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4162 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4163 |
|
57 | 4164 |
inBlock ifTrue:[ |
15413 | 4165 |
DebuggingDebugger2 == true ifTrue:[ |
4166 |
'inBlock' printCR. |
|
4167 |
]. |
|
4168 |
s := 'Debugger: in block'. |
|
57 | 4169 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4170 |
inBlockBelow ifTrue:[ |
15413 | 4171 |
DebuggingDebugger2 == true ifTrue:[ |
4172 |
'inBlockBelow' printCR. |
|
4173 |
]. |
|
4174 |
ignore := true |
|
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4175 |
]. |
57 | 4176 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4177 |
DebuggingDebugger2 == true ifTrue:[ |
15413 | 4178 |
where notNil ifTrue:[ |
4179 |
'(' print. steppedContextLineno print. ') ' print. |
|
4180 |
where printCR. |
|
4181 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
4182 |
]. |
57 | 4183 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4184 |
ignore ifFalse:[ |
15413 | 4185 |
(bigStep |
4186 |
and:[steppedContextLineno notNil |
|
4187 |
and:[where notNil |
|
4188 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
4189 |
(here isBlockContext |
|
4190 |
and:[(here methodHome == steppedContext) |
|
4191 |
or:[here home == steppedContext]]) ifTrue:[ |
|
4192 |
DebuggingDebugger2 == true ifTrue:[ |
|
4193 |
'same line but in block' printCR. |
|
4194 |
]. |
|
4195 |
||
4196 |
steppedContext := actualContext := here. |
|
4197 |
steppedContextLineno := here lineNumber. |
|
4198 |
] ifFalse:[ |
|
4199 |
"/ kludge - I only have the info for up to 255 lines |
|
4200 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
4201 |
DebuggingDebugger2 == true ifTrue:[ |
|
4202 |
'same line - ignored' printCR. |
|
4203 |
]. |
|
4204 |
ignore := true |
|
4205 |
]. |
|
4206 |
]. |
|
4207 |
]. |
|
4208 |
||
4209 |
(subBlockLeft not |
|
4210 |
and:[skipLineNr notNil |
|
4211 |
and:[where notNil |
|
4212 |
and:[where lineNumber notNil |
|
4213 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
4214 |
DebuggingDebugger2 == true ifTrue:[ |
|
4215 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
4216 |
]. |
|
4217 |
ignore := true |
|
4218 |
]. |
|
4219 |
||
4220 |
(steppedContextLineno isNil |
|
4221 |
and:[skipLineNr isNil |
|
4222 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
4223 |
DebuggingDebugger2 == true ifTrue:[ |
|
4224 |
'same line2 (after conIRQ) - ignored' printCR. |
|
4225 |
]. |
|
4226 |
ignore := true |
|
4227 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4228 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4229 |
|
57 | 4230 |
ignore ifTrue:[ |
3055 | 4231 |
"/' ' printCR. |
15413 | 4232 |
where := nil. here := nil. |
4233 |
" |
|
4234 |
yes, a context below |
|
4235 |
- continue and schedule another stepInterrupt. |
|
4236 |
Must flush caches since optimized methods not always |
|
4237 |
look for pending interrupts |
|
4238 |
" |
|
4239 |
ObjectMemory flushInlineCaches. |
|
4240 |
StepInterruptPending := 1. |
|
4241 |
InterruptPending := 1. |
|
4242 |
InStepInterrupt := nil. |
|
4243 |
^ self |
|
57 | 4244 |
]. |
4245 |
||
3055 | 4246 |
"/ ' ' printCR. |
57 | 4247 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4248 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 4249 |
|
57 | 4250 |
tracing := false. |
4251 |
bigStep := false. |
|
4252 |
||
0 | 4253 |
"release refs to context" |
4254 |
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
|
4255 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4256 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4257 |
DebuggingDebugger2 == true ifTrue:[ |
15413 | 4258 |
'==> 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
|
4259 |
]. |
1364 | 4260 |
|
4261 |
initiallyShown := nil. |
|
4262 |
(oneMore == true) ifTrue:[ |
|
15413 | 4263 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
4264 |
initiallyShown := 2 |
|
4265 |
] ifFalse:[ |
|
4266 |
initiallyShown := 1 |
|
4267 |
] |
|
1364 | 4268 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4269 |
con := thisContext sender sender. |
3435 | 4270 |
|
9235 | 4271 |
HaltInterrupt handle:[:ex | |
15413 | 4272 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
4273 |
ex proceed |
|
3435 | 4274 |
] do:[ |
15413 | 4275 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4276 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4277 |
con := nil |
1364 | 4278 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4279 |
"Created: / 14-10-1996 / 12:53:39 / cg" |
11636 | 4280 |
"Modified: / 20-07-2012 / 15:26:26 / cg" |
0 | 4281 |
! ! |
4282 |
||
4867 | 4283 |
!DebugView methodsFor:'menu & button actions'! |
266 | 4284 |
|
5875 | 4285 |
addBrowserBookmark |
4286 |
"add a browser-bookmark for the selected contexts method" |
|
4287 |
||
4288 |
|cls sel| |
|
4289 |
||
4290 |
selectedContext isNil ifTrue:[^ self]. |
|
4291 |
||
4292 |
cls := selectedContext receiver class. |
|
4293 |
sel := selectedContext selector. |
|
4294 |
(cls includesSelector:sel) ifFalse:[ |
|
15413 | 4295 |
sel := nil |
5875 | 4296 |
]. |
4297 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
4298 |
! |
|
4299 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4300 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4301 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4302 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4303 |
"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
|
4304 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4305 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4306 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4307 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4308 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4309 |
"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
|
4310 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4311 |
|
266 | 4312 |
autoUpdateOff |
4313 |
"stop the update process" |
|
4314 |
||
4315 |
updateProcess notNil ifTrue:[ |
|
15413 | 4316 |
monitorToggle lampColor:(Color yellow). |
4317 |
updateProcess terminate. |
|
4318 |
updateProcess := nil |
|
266 | 4319 |
] |
4320 |
! |
|
4321 |
||
4322 |
autoUpdateOn |
|
4323 |
"fork a subprocess which updates the contextList in regular intervals" |
|
4324 |
||
4325 |
updateProcess isNil ifTrue:[ |
|
15413 | 4326 |
updateProcess := |
4327 |
[ |
|
4328 |
[true] whileTrue:[ |
|
4329 |
monitorToggle showLamp ifTrue:[ |
|
4330 |
monitorToggle lampColor:(Color yellow). |
|
4331 |
] ifFalse:[ |
|
4332 |
monitorToggle activeForegroundColor:Color black. |
|
4333 |
]. |
|
4334 |
(Delay forSeconds:0.25) wait. |
|
4335 |
self updateContext. |
|
4336 |
monitorToggle showLamp ifTrue:[ |
|
4337 |
monitorToggle lampColor:(Color red). |
|
4338 |
] ifFalse:[ |
|
4339 |
monitorToggle activeForegroundColor:Color red. |
|
4340 |
]. |
|
4341 |
(Delay forSeconds:0.25) wait. |
|
4342 |
self updateContext. |
|
4343 |
] |
|
4344 |
] forkAt:(Processor activePriority - 1) |
|
266 | 4345 |
] |
4346 |
||
4347 |
! |
|
4348 |
||
13408 | 4349 |
browseBlocksHome |
4350 |
"browse the receiver block's home method (if a value-like send is selected)" |
|
4351 |
||
13414 | 4352 |
|cls sel block mthd| |
13408 | 4353 |
|
4354 |
selectedContext isNil ifTrue:[^ self]. |
|
4355 |
(block := selectedContext receiver) isBlock ifFalse:[ ^ self ]. |
|
4356 |
||
13414 | 4357 |
mthd := block method. |
4358 |
cls := mthd mclass. |
|
4359 |
sel := mthd selector. |
|
4360 |
||
4361 |
(cls notNil and:[(cls includesSelector:sel)]) ifTrue:[ |
|
15413 | 4362 |
cls browserClass openInClass:cls selector:sel. |
4363 |
^ self |
|
13414 | 4364 |
]. |
4365 |
||
4366 |
mthd source notEmptyOrNil ifTrue:[ |
|
15413 | 4367 |
(Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs) |
4368 |
ifTrue:[ |
|
4369 |
UserPreferences current systemBrowserClass |
|
4370 |
browseMethods:{ mthd } title:'Unbound Method' sort:false |
|
4371 |
"/ TextView openWith:mthd source title:'Unbound Method''s Source'. |
|
4372 |
]. |
|
4373 |
^ self |
|
13414 | 4374 |
]. |
4375 |
cls notNil ifTrue:[ |
|
15413 | 4376 |
(Dialog confirm:'Block''s home method is (no longer) present in any class and no source can be shown.\Do you want to browse the method''s last class instead?' withCRs) |
4377 |
ifTrue:[ |
|
4378 |
cls browserClass openInClass:cls selector:nil. |
|
4379 |
]. |
|
4380 |
^ self |
|
13414 | 4381 |
]. |
4382 |
Dialog information:'Block''s home method is (no longer) present in any class.'. |
|
13408 | 4383 |
! |
4384 |
||
3269 | 4385 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4386 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4387 |
|
4388 |
|cls sel| |
|
4389 |
||
4390 |
selectedContext isNil ifTrue:[^ self]. |
|
4391 |
||
4392 |
cls := selectedContext receiver class. |
|
4393 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4394 |
(cls includesSelector:sel) ifFalse:[ |
15413 | 4395 |
sel := nil |
3269 | 4396 |
]. |
4397 |
cls browserClass openInClass:cls selector:sel. |
|
4398 |
||
4399 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
4400 |
! |
|
4401 |
||
4402 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4403 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 4404 |
|
4405 |
|cls mthd| |
|
4406 |
||
4407 |
selectedContext isNil ifTrue:[^ self]. |
|
4408 |
||
4409 |
mthd := selectedContext method. |
|
3447 | 4410 |
mthd notNil ifTrue:[ |
15413 | 4411 |
cls := mthd containingClass. |
4412 |
"/ still nil if unbound - then use receivers class |
|
3447 | 4413 |
]. |
4414 |
cls isNil ifTrue:[ |
|
15413 | 4415 |
cls := selectedContext receiver class |
3269 | 4416 |
]. |
4417 |
cls browserClass browseClassHierarchy:cls. |
|
4418 |
||
3447 | 4419 |
"Modified: / 17.11.2001 / 19:43:06 / cg" |
3269 | 4420 |
! |
4421 |
||
4422 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4423 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 4424 |
|
4425 |
|cls mthd| |
|
4426 |
||
4427 |
selectedContext isNil ifTrue:[^ self]. |
|
4428 |
||
4429 |
mthd := selectedContext method. |
|
3447 | 4430 |
mthd notNil ifTrue:[ |
15413 | 4431 |
cls := mthd containingClass. |
4432 |
"/ still nil if unbound - then use receivers class |
|
3447 | 4433 |
]. |
4434 |
cls isNil ifTrue:[ |
|
15413 | 4435 |
cls := selectedContext receiver class |
3269 | 4436 |
]. |
4437 |
cls browserClass browseFullClassProtocol:cls. |
|
4438 |
||
3447 | 4439 |
"Modified: / 17.11.2001 / 19:43:43 / cg" |
3269 | 4440 |
! |
4441 |
||
4442 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4443 |
"browse the implementing class (of the selected context's message)" |
3269 | 4444 |
|
11610 | 4445 |
|con mthd who sel cls home| |
4446 |
||
4447 |
con := selectedContext ? actualContext. |
|
4448 |
con isNil ifTrue:[^ self]. |
|
4449 |
||
4450 |
mthd := con method. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4451 |
mthd notNil ifTrue:[ |
15413 | 4452 |
who := mthd who. |
4453 |
who notNil ifTrue:[ |
|
4454 |
cls := who methodClass. |
|
4455 |
sel := who methodSelector. |
|
4456 |
] ifFalse:[ |
|
4457 |
"might have been re-accepted" |
|
4458 |
(home := con methodHome) notNil ifTrue:[ |
|
4459 |
(sel := home selector) notNil ifTrue:[ |
|
4460 |
cls := home receiver class |
|
4461 |
whichClassImplements:selectedContext selector. |
|
4462 |
cls notNil ifTrue:[ |
|
4463 |
Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
|
4464 |
]. |
|
4465 |
] |
|
4466 |
]. |
|
4467 |
]. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4468 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4469 |
cls isNil ifTrue:[ |
15413 | 4470 |
"/ class not found - try receiver |
4471 |
cls := con receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4472 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4473 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4474 |
cls browserClass openInClass:cls selector:sel. |
266 | 4475 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
4476 |
"Created: / 22-11-1995 / 21:27:01 / cg" |
11610 | 4477 |
"Modified: / 19-07-2012 / 11:27:32 / cg" |
266 | 4478 |
! |
4479 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4480 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4481 |
"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
|
4482 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4483 |
selectedContext isNil ifTrue:[ |
15413 | 4484 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4485 |
]. |
4153 | 4486 |
"/ selectedContext receiver class browserClass |
11610 | 4487 |
self withWaitCursorDo:[ |
15413 | 4488 |
UserPreferences systemBrowserClass |
4489 |
browseImplementorsOf:selectedContext selector. |
|
11610 | 4490 |
] |
4491 |
||
4492 |
"Modified: / 19-07-2012 / 11:44:03 / cg" |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4493 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4494 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4495 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4496 |
"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
|
4497 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4498 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4499 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4500 |
(sel := codeView selection) notNil ifTrue:[ |
15413 | 4501 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4502 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4503 |
initial isNil ifTrue:[ |
15413 | 4504 |
initial := selectedContext isNil |
4505 |
ifTrue:[nil] |
|
4506 |
ifFalse:[selectedContext selector]. |
|
10205 | 4507 |
]. |
4508 |
selector := Dialog |
|
15413 | 4509 |
requestSelector:'Selector to browse implementors of:' |
4510 |
initialAnswer:initial. |
|
11610 | 4511 |
|
4512 |
selector notEmptyOrNil ifTrue:[ |
|
15413 | 4513 |
self withWaitCursorDo:[ |
4514 |
UserPreferences systemBrowserClass |
|
4515 |
browseImplementorsMatching:selector. |
|
4516 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4517 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4518 |
|
11610 | 4519 |
"Modified: / 19-07-2012 / 11:43:52 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4520 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4521 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4522 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4523 |
"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
|
4524 |
|
13488 | 4525 |
|app appClass| |
4526 |
||
4527 |
(app := self processesApplication) notNil ifTrue:[ |
|
15413 | 4528 |
appClass := app class. |
4529 |
appClass browserClass openInClass:appClass selector:nil. |
|
4530 |
^ self |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4531 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4532 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4533 |
|
3269 | 4534 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4535 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4536 |
|
4537 |
|cls sel| |
|
4538 |
||
4539 |
selectedContext isNil ifTrue:[^ self]. |
|
4540 |
||
11610 | 4541 |
selectedContext isCheapBlockContext ifTrue:[ |
15413 | 4542 |
cls := selectedContext method mclass. |
4543 |
sel := selectedContext method selector. |
|
11610 | 4544 |
] ifFalse:[ |
15413 | 4545 |
cls := selectedContext receiver class. |
4546 |
sel := selectedContext selector. |
|
11610 | 4547 |
]. |
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4548 |
(cls includesSelector:sel) ifFalse:[ |
15413 | 4549 |
sel := nil |
3269 | 4550 |
]. |
4551 |
cls browserClass openInClass:cls selector:sel. |
|
4552 |
||
11610 | 4553 |
"Modified: / 19-07-2012 / 11:29:48 / cg" |
3269 | 4554 |
! |
4555 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4556 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4557 |
"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
|
4558 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4559 |
selectedContext isNil ifTrue:[ |
15413 | 4560 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4561 |
]. |
11610 | 4562 |
self withWaitCursorDo:[ |
15413 | 4563 |
UserPreferences systemBrowserClass |
4564 |
browseAllCallsOn:selectedContext selector. |
|
11610 | 4565 |
] |
4566 |
||
4567 |
"Modified: / 19-07-2012 / 11:43:02 / cg" |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4568 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4569 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4570 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4571 |
"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
|
4572 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4573 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4574 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4575 |
(sel := codeView selection) notNil ifTrue:[ |
15413 | 4576 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4577 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4578 |
initial isNil ifTrue:[ |
15413 | 4579 |
initial := selectedContext isNil |
4580 |
ifTrue:[nil] |
|
4581 |
ifFalse:[selectedContext selector]. |
|
10205 | 4582 |
]. |
4583 |
selector := Dialog |
|
15413 | 4584 |
requestSelector:'Selector to browse senders of:' |
4585 |
initialAnswer:initial. |
|
11610 | 4586 |
|
4587 |
selector notEmptyOrNil ifTrue:[ |
|
15413 | 4588 |
self withWaitCursorDo:[ |
4589 |
UserPreferences systemBrowserClass |
|
4590 |
browseAllCallsOn:selector asSymbol. |
|
4591 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4592 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4593 |
|
11610 | 4594 |
"Modified: / 19-07-2012 / 11:43:29 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4595 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4596 |
|
11391 | 4597 |
clearRememberedCallchain |
4598 |
"clear the remembered callchain." |
|
4599 |
||
4600 |
RememberedCallChain := nil |
|
4601 |
||
4602 |
"Created: / 08-03-2012 / 01:29:46 / cg" |
|
4603 |
! |
|
4604 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4605 |
closeAllDebuggers |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4606 |
(Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4607 |
ifFalse:[ |
15413 | 4608 |
^ self |
4609 |
]. |
|
4610 |
||
4611 |
self class allInstancesDo:[:debugger | |
|
4612 |
debugger ~~ self ifTrue:[ |
|
4613 |
debugger busy ifTrue:[ |
|
4614 |
debugger destroyWithConfirmation:true. |
|
4615 |
]. |
|
4616 |
]. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4617 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4618 |
self closeRequest. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4619 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4620 |
"Created: / 23-03-2012 / 12:40:22 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4621 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4622 |
|
9626 | 4623 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 4624 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 4625 |
LastExtent := self extent. |
4626 |
LastOrigin := self origin. |
|
4627 |
||
4628 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
4629 |
! |
|
4630 |
||
266 | 4631 |
copyWalkbackText |
4632 |
"place the contents of the walkback view into the copy-paste buffer. |
|
12884 | 4633 |
This allows pasting it into some other view for printing. |
4634 |
||
4635 |
Show the full verbose context without filtering." |
|
266 | 4636 |
|
10760 | 4637 |
|infoText| |
4638 |
||
12884 | 4639 |
firstContext isNil ifTrue:[ |
15413 | 4640 |
infoText := 'No context, no walkback'. |
10760 | 4641 |
] ifFalse:[ |
15413 | 4642 |
exceptionInfoLabel notNil ifTrue:[ |
4643 |
infoText := exceptionInfoLabel label , '\\' withCRs. |
|
4644 |
] ifFalse:[ |
|
4645 |
infoText := '' |
|
4646 |
]. |
|
4647 |
infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection. |
|
10760 | 4648 |
]. |
4649 |
||
4650 |
self setClipboardText:infoText |
|
266 | 4651 |
|
4652 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
4653 |
! |
|
4654 |
||
4655 |
doAbort |
|
1187 | 4656 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 4657 |
at save places (for example: in the event loop) and returns back |
4658 |
from whatever the process is doing, but does not terminate it." |
|
4659 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4660 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 4661 |
(self confirm:('Code modified - abort anyway ?')) |
4662 |
ifFalse:[ |
|
4663 |
^ self |
|
4664 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4665 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4666 |
|
266 | 4667 |
inspecting ifTrue:[ |
15413 | 4668 |
inspectedProcess isDead ifTrue:[ |
4669 |
self showTerminated. |
|
4670 |
^ self |
|
4671 |
]. |
|
4672 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4673 |
self showError:'** the process does not handle the abort signal **' |
|
4674 |
] ifTrue:[ |
|
4675 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
4676 |
]. |
|
4677 |
^ self |
|
266 | 4678 |
]. |
4679 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4680 |
steppedContext := wrapperContext := nil. |
266 | 4681 |
haveControl := false. |
4682 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4683 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4684 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4685 |
catchBlock notNil ifTrue:[ |
15413 | 4686 |
abortButton turnOff. |
4687 |
catchBlock value. |
|
4688 |
||
4689 |
"/ not reached |
|
4690 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
266 | 4691 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4692 |
|
266 | 4693 |
^ self. |
4694 |
||
3447 | 4695 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 4696 |
! |
4697 |
||
6487 | 4698 |
doAbortAll |
4699 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
4700 |
at save places (for example: in the event loop) and returns back |
|
4701 |
from whatever the process is doing, but does not terminate it." |
|
4702 |
||
4703 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
15413 | 4704 |
(self confirm:('Code modified - abort anyway ?')) |
4705 |
ifFalse:[ |
|
4706 |
^ self |
|
4707 |
] |
|
6487 | 4708 |
]. |
4709 |
||
4710 |
inspecting ifTrue:[ |
|
15413 | 4711 |
inspectedProcess isDead ifTrue:[ |
4712 |
self showTerminated. |
|
4713 |
^ self |
|
4714 |
]. |
|
4715 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4716 |
self showError:'** the process does not handle the abort signal **' |
|
4717 |
] ifTrue:[ |
|
4718 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
4719 |
]. |
|
4720 |
^ self |
|
6487 | 4721 |
]. |
4722 |
||
4723 |
steppedContext := wrapperContext := nil. |
|
4724 |
haveControl := false. |
|
4725 |
exitAction := #abortAll. |
|
4726 |
||
4727 |
"exit private event-loop" |
|
4728 |
catchBlock notNil ifTrue:[ |
|
15413 | 4729 |
abortButton turnOff. |
4730 |
catchBlock value. |
|
4731 |
||
4732 |
"/ not reached |
|
4733 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 4734 |
]. |
4735 |
||
4736 |
^ self. |
|
4737 |
||
4738 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
4739 |
! |
|
4740 |
||
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4741 |
doChangeProcessPriority |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4742 |
"ask for and change the process's priority" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4743 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4744 |
|oldPrio newPrio s| |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4745 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4746 |
oldPrio := (inspectedProcess ? Processor activeProcess) priority. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4747 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4748 |
[ |
15413 | 4749 |
s := Dialog |
4750 |
request:(resources stringWithCRs:'Change the processes priority to (proceed with prio):\\ 2 - system background\ 4 - user background\ 8 - normal\ 9 - high\ 16 - I/O (danger alert)\') |
|
4751 |
initialAnswer:oldPrio printString. |
|
4752 |
s isEmptyOrNil ifTrue:[^ self]. |
|
4753 |
newPrio := Integer readFrom:s onError:nil. |
|
4754 |
newPrio isNil |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4755 |
] whileTrue. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4756 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4757 |
newPrio := newPrio max:(Processor lowestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4758 |
newPrio := newPrio min:(Processor highestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4759 |
newPrio >= Processor highIOPriority ifTrue:[ |
15413 | 4760 |
(Dialog |
4761 |
confirm:(resources |
|
4762 |
stringWithCRs:'Attention: event handling takes place at prio 16.\An ever running high priority process\could block the system and make the UI unusable.\\Proceed?')) |
|
4763 |
ifFalse:[^ self]. |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4764 |
]. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4765 |
(inspectedProcess ? Processor activeProcess) priority:newPrio. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4766 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4767 |
"Created: / 07-03-2012 / 14:15:09 / cg" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4768 |
! |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4769 |
|
266 | 4770 |
doContinue |
4771 |
"continue from menu" |
|
4772 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
4773 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
4774 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4775 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 4776 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
4777 |
^ self |
|
4778 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4779 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4780 |
|
266 | 4781 |
inspecting ifTrue:[ |
15413 | 4782 |
self graphicsDevice hasColors ifTrue:[ |
4783 |
continueButton foregroundColor:Color red darkened. |
|
4784 |
]. |
|
4785 |
continueButton label:(resources string:'Stop'). |
|
4786 |
continueButton action:[self doStop]. |
|
4787 |
||
4788 |
self processPerform:#resume. |
|
4789 |
||
4790 |
^ self |
|
266 | 4791 |
]. |
4792 |
canContinue ifTrue:[ |
|
15413 | 4793 |
exContext := thisContext findSpecialHandle:false raise:true. |
4794 |
||
4795 |
(exContext notNil |
|
4796 |
and:[ (ex := exContext receiver) isLazyValue not |
|
4797 |
and:[ ex isException |
|
4798 |
and:[ ex creator == NoHandlerError |
|
4799 |
and:[ ex exception creator == RecursionError]]]]) |
|
4800 |
ifTrue:[ |
|
4801 |
"/ debug due to unhandled recursionInterrupt. |
|
4802 |
"/ ask if we should proceed with more stack. |
|
4803 |
||
4804 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
4805 |
answer == true ifTrue:[ |
|
4806 |
proc := Processor activeProcess. |
|
4807 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
4808 |
]. |
|
4809 |
]. |
|
4810 |
||
4811 |
steppedContext := wrapperContext := nil. |
|
4812 |
tracing := false. |
|
4813 |
haveControl := false. |
|
4814 |
exitAction := #continue. |
|
4815 |
||
4816 |
"exit private event-loop" |
|
4817 |
catchBlock value. |
|
4818 |
||
4819 |
"/ not reached. |
|
4820 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
4821 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4822 |
|
266 | 4823 |
] ifFalse:[ |
15413 | 4824 |
inspecting ifFalse:[ |
4825 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
4826 |
self showSelection:1. |
|
4827 |
self doReturn |
|
4828 |
] |
|
266 | 4829 |
] |
477 | 4830 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
4831 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 4832 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 4833 |
! |
4834 |
||
13351 | 4835 |
doContinueAfterDelay |
4836 |
Delay waitForSeconds:5. |
|
4837 |
self doContinue. |
|
4838 |
! |
|
4839 |
||
3187 | 4840 |
doDefine |
5955 | 4841 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4842 |
bagOfClassNames bagOfUsedClassNames implClass idx callee restart varName argName| |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
4843 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
4844 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
4845 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
4846 |
|
13488 | 4847 |
selectorToDefine notNil ifTrue:[ |
15413 | 4848 |
selector := selectorToDefine. |
4849 |
receiversClass := classToDefineIn. |
|
13488 | 4850 |
] ifFalse:[ |
15413 | 4851 |
selector := actualContext selector. |
4852 |
receiversClass := actualContext receiver class. |
|
13538 | 4853 |
]. |
4854 |
||
4855 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
|
4856 |
implClass notNil ifTrue:[ |
|
15413 | 4857 |
"/ must be a subclassResponsibility |
4858 |
||
4859 |
idx := contextArray identityIndexOf:actualContext. |
|
4860 |
idx > 1 ifTrue:[ |
|
4861 |
callee := contextArray at:idx-1. |
|
4862 |
||
4863 |
callee selector == #subclassResponsibility ifTrue:[ |
|
4864 |
restart := false. |
|
4865 |
] |
|
4866 |
]. |
|
13538 | 4867 |
]. |
4868 |
||
4869 |
"generate nice argument names" |
|
4870 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
4871 |
bagOfUsedClassNames := Bag new. |
|
4872 |
argNames := actualContext args |
|
15413 | 4873 |
collect: |
4874 |
[:eachArg | |
|
4875 |
|nm| |
|
4876 |
||
4877 |
nm := eachArg class nameWithoutPrefix. |
|
4878 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
4879 |
nm article , nm |
|
4880 |
] ifFalse:[ |
|
4881 |
bagOfUsedClassNames add:nm. |
|
4882 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
4883 |
]. |
|
4884 |
]. |
|
5955 | 4885 |
|
4886 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 4887 |
|
3447 | 4888 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
4889 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
4890 |
||
13488 | 4891 |
|
4892 |
( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[ |
|
15413 | 4893 |
(self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?') |
4894 |
ifFalse:[ |
|
4895 |
^ self |
|
4896 |
] |
|
3447 | 4897 |
]. |
4898 |
||
4899 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4900 |
"/ code for a getter |
3447 | 4901 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
15413 | 4902 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
4903 |
cat := 'accessing'. |
|
3447 | 4904 |
]. |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4905 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4906 |
"/ code for a setter |
3447 | 4907 |
(selector numArgs == 1 |
4908 |
and:[(selector endsWith:':') |
|
12716
062e27d32904
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12687
diff
changeset
|
4909 |
and:[receiversClass instVarNames includes:(selector copyButLast:1)]]) |
3447 | 4910 |
ifTrue:[ |
15413 | 4911 |
varName := selector copyButLast:1. |
4912 |
argName := argNames first. |
|
4913 |
code := '%1\' , haltStmtFix , '\ %3 := %4.'. |
|
4914 |
cat := 'accessing'. |
|
3447 | 4915 |
]. |
4916 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4917 |
"/ code for a tester |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4918 |
(selector numArgs == 0 |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4919 |
and:[(selector startsWith:'is') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4920 |
and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]]) |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4921 |
ifTrue:[ |
15413 | 4922 |
(receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[ |
4923 |
code := '%1\' , haltStmtFix , '\ ^ true.'. |
|
4924 |
] ifFalse:[ |
|
4925 |
code := '%1\' , haltStmtFix , '\ ^ false.'. |
|
4926 |
]. |
|
4927 |
cat := 'testing'. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4928 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4929 |
|
3447 | 4930 |
"/ actualContext receiver isClass ifTrue:[ |
4931 |
"/ selector == #new ifTrue:[ |
|
4932 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
4933 |
"/ ]. |
|
4934 |
"/ selector == #'new:' ifTrue:[ |
|
4935 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
4936 |
"/ ]. |
|
4937 |
"/ ]. |
|
4938 |
code isNil ifTrue:[ |
|
15413 | 4939 |
code := '%1\' , haltStmtDef |
10205 | 4940 |
]. |
4941 |
||
4942 |
self |
|
15413 | 4943 |
codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs |
4944 |
inClass:receiversClass |
|
4945 |
unwind:false |
|
4946 |
category:cat |
|
4947 |
onCancel:[^ self]. |
|
3269 | 4948 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
4949 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
4950 |
restart ifTrue:[ |
15413 | 4951 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
4952 |
] |
3427 | 4953 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4954 |
"Modified: / 23-03-2012 / 09:49:31 / cg" |
3187 | 4955 |
! |
4956 |
||
14523 | 4957 |
doGotoApplicationActionMethod |
4958 |
"select the first application-model context. |
|
4959 |
This is another great helper, when you hit an exception, |
|
4960 |
to quickly navigate to the responsible code of you application" |
|
4961 |
||
4962 |
contextArray keysAndValuesDo:[:i :c | |
|
15413 | 4963 |
|nextCon nextRcvr dialog| |
4964 |
||
4965 |
"/ find the first appModel context |
|
4966 |
nextCon := contextArray at:i+1. |
|
4967 |
"/ |
|
4968 |
"/ while not in the appModel |
|
4969 |
"/ |
|
4970 |
[ |
|
4971 |
nextRcvr := nextCon receiver. |
|
4972 |
(nextRcvr isKindOf:ApplicationModel) |
|
4973 |
] whileFalse:[ |
|
4974 |
nextCon := nextCon sender |
|
4975 |
]. |
|
4976 |
self selectContext:nextCon. |
|
4977 |
^ self. |
|
14523 | 4978 |
]. |
4979 |
"/ not found |
|
4980 |
gotoApplicationActionMethodButton disable. |
|
4981 |
! |
|
4982 |
||
13362 | 4983 |
doGotoDialogOpener |
14523 | 4984 |
"select the context where the dialog was opened. |
4985 |
This is a great helper, when you press interrupt while a modal dialog |
|
4986 |
is open, to quickly navigate to the corresponding opening code of you application" |
|
13362 | 4987 |
|
4988 |
contextArray keysAndValuesDo:[:i :c | |
|
15413 | 4989 |
|nextCon nextRcvr dialog| |
4990 |
||
4991 |
"/ find the openModal, then walk upward |
|
4992 |
((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[ |
|
4993 |
dialog := c receiver. |
|
4994 |
nextCon := contextArray at:i+1. |
|
4995 |
"/ |
|
4996 |
"/ while still in dialog code |
|
4997 |
"/ |
|
4998 |
[ |
|
4999 |
nextRcvr := nextCon receiver. |
|
5000 |
(nextRcvr == dialog) |
|
5001 |
or:[ nextRcvr == dialog class |
|
5002 |
or:[ nextRcvr == DialogBox ]] |
|
5003 |
] whileTrue:[ |
|
5004 |
(nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ |
|
5005 |
nextCon := nextCon methodHome |
|
5006 |
]. |
|
5007 |
nextCon := nextCon sender. |
|
5008 |
]. |
|
5009 |
"/ |
|
5010 |
"/ while still in a Notification |
|
5011 |
"/ |
|
5012 |
[ |
|
5013 |
nextRcvr := nextCon receiver. |
|
5014 |
(nextRcvr isKindOf:UserInformation) |
|
5015 |
or:[ nextRcvr isBehavior |
|
5016 |
and:[nextRcvr includesBehavior:UserInformation]] |
|
5017 |
] whileTrue:[ |
|
5018 |
nextCon := nextCon sender |
|
5019 |
]. |
|
5020 |
"/ |
|
5021 |
"/ while still in UIBuilder |
|
5022 |
"/ |
|
5023 |
[ |
|
5024 |
nextRcvr := nextCon receiver. |
|
5025 |
(nextRcvr isKindOf:WindowBuilder) |
|
5026 |
] whileTrue:[ |
|
5027 |
nextCon := nextCon sender |
|
5028 |
]. |
|
5029 |
"/ |
|
5030 |
"/ while still in SimpleDialog |
|
5031 |
"/ |
|
5032 |
[ |
|
5033 |
nextRcvr := nextCon receiver. |
|
5034 |
(nextRcvr class == SimpleDialog) |
|
5035 |
] whileTrue:[ |
|
5036 |
nextCon := nextCon sender |
|
5037 |
]. |
|
5038 |
"/ |
|
5039 |
"/ while still in applicationModel support code |
|
5040 |
"/ |
|
5041 |
[ |
|
5042 |
(nextCon selector startsWith:'openDialogSpec'). |
|
5043 |
] whileTrue:[ |
|
5044 |
nextCon := nextCon sender |
|
5045 |
]. |
|
5046 |
self selectContext:nextCon. |
|
5047 |
^ self. |
|
5048 |
] |
|
13362 | 5049 |
]. |
13388 | 5050 |
"/ not found |
13362 | 5051 |
gotoDialogOpenerButton disable. |
5052 |
! |
|
5053 |
||
12671 | 5054 |
doInspectProcess |
5055 |
(inspectedProcess ? Processor activeProcess) inspect. |
|
5056 |
! |
|
5057 |
||
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5058 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5059 |
"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
|
5060 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5061 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5062 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5063 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5064 |
(self confirm:('Code modified - step anyway ?')) |
5065 |
ifFalse:[ |
|
5066 |
^ self |
|
5067 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5068 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5069 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5070 |
canContinue ifTrue:[ |
15413 | 5071 |
steppedContext := wrapperContext := nil. |
5072 |
haveControl := false. |
|
5073 |
exitAction := #step. |
|
5074 |
||
5075 |
"exit private event-loop" |
|
5076 |
catchBlock value. |
|
5077 |
||
5078 |
"/ not reached |
|
5079 |
'DebugView [warning]: send failed' errorPrintCR. |
|
5080 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5081 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5082 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5083 |
"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
|
5084 |
"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
|
5085 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5086 |
|
266 | 5087 |
doNext |
1072 | 5088 |
"skip for next source-code line; entering blocks" |
266 | 5089 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5090 |
stepHow := #nextIn. |
266 | 5091 |
self doStep:nil |
790 | 5092 |
|
1072 | 5093 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5094 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5095 |
|
13351 | 5096 |
doNextAfterDelay |
5097 |
Delay waitForSeconds:5. |
|
5098 |
self doNext. |
|
5099 |
! |
|
5100 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5101 |
doNextOut |
1072 | 5102 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5103 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5104 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5105 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5106 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5107 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 5108 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5109 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5110 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5111 |
doNextOver |
1072 | 5112 |
"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
|
5113 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5114 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5115 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5116 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5117 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 5118 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 5119 |
! |
5120 |
||
5121 |
doNoTrace |
|
5122 |
traceView notNil ifTrue:[ |
|
15413 | 5123 |
traceView topView destroy. |
5124 |
traceView := nil. |
|
266 | 5125 |
]. |
5126 |
tracing := false |
|
5127 |
! |
|
5128 |
||
4356 | 5129 |
doOpenReportMailApp |
5130 |
"open a mail report tool" |
|
5131 |
||
5132 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5133 |
|
4356 | 5134 |
str := '' writeStream. |
5135 |
||
5136 |
str nextPutLine:('Error notification from ' |
|
15413 | 5137 |
, OperatingSystem getLoginName |
5138 |
, '@' |
|
5139 |
, OperatingSystem getHostName). |
|
4356 | 5140 |
str cr. |
5141 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
5142 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 5143 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
5144 |
str nextPutLine:('Description: ' , self label). |
|
5145 |
"/ str nextPutLine:('Error: ', printedException description). |
|
5146 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
5147 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
5148 |
str nextPutLine:'Backtrace:'. |
|
5149 |
str cr. |
|
5150 |
||
5151 |
firstContext notNil ifTrue:[ |
|
15413 | 5152 |
firstContext fullPrintAllOn:str. |
4356 | 5153 |
]. |
5154 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5155 |
|
10205 | 5156 |
SendMailTool |
15413 | 5157 |
openForMessage:(str contents) |
5158 |
withSubject:('STX Error:[', self label, ']') |
|
5159 |
preOpenBlock:[:inst| |
|
5160 |
inst recipientEntryField value:'error@exept.de' |
|
5161 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5162 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5163 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 5164 |
! |
5165 |
||
13360 | 5166 |
doResend |
5167 |
"resend - the selected context is unwound and its message resent. |
|
5168 |
To be done after a cde change, to get nto the new method" |
|
5169 |
||
5170 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
15413 | 5171 |
(self confirm:('Code modified - resend anyway ?')) ifFalse:[ |
5172 |
^ self |
|
5173 |
] |
|
13360 | 5174 |
]. |
5175 |
inspecting ifTrue:[ |
|
15413 | 5176 |
^ self showError:'** not avail in inspecting debugger **' |
13360 | 5177 |
]. |
5178 |
steppedContext := wrapperContext := nil. |
|
5179 |
haveControl := false. |
|
5180 |
exitAction := #resend. "exit private event-loop" |
|
5181 |
||
5182 |
catchBlock value. |
|
5183 |
||
5184 |
"/ normally not reached |
|
5185 |
||
5186 |
'DebugView [warning]: resend failed' errorPrintCR. |
|
5187 |
resendButton turnOff. |
|
5188 |
! |
|
5189 |
||
266 | 5190 |
doRestart |
5191 |
"restart - the selected context will be restarted" |
|
10205 | 5192 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5193 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5194 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
5195 |
^ self |
|
5196 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5197 |
]. |
266 | 5198 |
inspecting ifTrue:[ |
15413 | 5199 |
selectedContext isNil ifTrue:[ |
5200 |
^ self showError:'** select a context first **' |
|
5201 |
]. |
|
5202 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
5203 |
^ self |
|
266 | 5204 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5205 |
steppedContext := wrapperContext := nil. |
266 | 5206 |
haveControl := false. |
6365 | 5207 |
exitAction := #restart. "exit private event-loop" |
5208 |
||
5209 |
catchBlock value. |
|
5210 |
||
5211 |
"/ normally not reached |
|
10205 | 5212 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5213 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5214 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5215 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5216 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 5217 |
! |
5218 |
||
5219 |
doReturn |
|
5220 |
"return - the selected context will do a ^nil" |
|
5221 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5222 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5223 |
(self confirm:('Code modified - return anyway ?')) |
5224 |
ifFalse:[ |
|
5225 |
^ self |
|
5226 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5227 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5228 |
|
266 | 5229 |
inspecting ifTrue:[ |
15413 | 5230 |
selectedContext isNil ifTrue:[ |
5231 |
^ self showError:'** select a context first **' |
|
5232 |
]. |
|
5233 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
5234 |
^ self |
|
266 | 5235 |
]. |
5236 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5237 |
steppedContext := wrapperContext := nil. |
266 | 5238 |
haveControl := false. |
5239 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5240 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5241 |
"exit private event-loop" |
6365 | 5242 |
catchBlock value. |
477 | 5243 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5244 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5245 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5246 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5247 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5248 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 5249 |
! |
5250 |
||
5251 |
doSend |
|
5252 |
"single send; reenter with next message send" |
|
5253 |
||
1072 | 5254 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5255 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5256 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5257 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5258 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5259 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5260 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5261 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5262 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5263 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5264 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5265 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5266 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5267 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5268 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5269 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5270 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5271 |
|
1072 | 5272 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 5273 |
! |
5274 |
||
5275 |
doStep |
|
5276 |
"skip for next send in selected method" |
|
5277 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5278 |
stepHow := #step. |
790 | 5279 |
self doStep:-1 |
5280 |
||
1072 | 5281 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 5282 |
! |
5283 |
||
13197 | 5284 |
doStep:lineNrOrNilOrMinus1 |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5285 |
"common helper for step, skip & next. |
10205 | 5286 |
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
|
5287 |
or to next line (if nil) or to next send (if -1)" |
266 | 5288 |
|
5289 |
|con method| |
|
5290 |
||
5291 |
inspecting ifTrue:[^ self]. |
|
5292 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5293 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5294 |
(self confirm:('Code modified - step anyway ?')) |
5295 |
ifFalse:[ |
|
5296 |
^ self |
|
5297 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5298 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5299 |
|
266 | 5300 |
canContinue ifTrue:[ |
15413 | 5301 |
selectedContext notNil ifTrue:[ |
5302 |
con := actualContext. "/ selectedContext. |
|
5303 |
steppedContextLineno := actualContext lineNumber. |
|
5304 |
] ifFalse:[ |
|
5305 |
con := contextArray at:2. |
|
5306 |
steppedContextLineno := con lineNumber. |
|
5307 |
]. |
|
5308 |
||
5309 |
skipLineNr := lineNrOrNilOrMinus1. |
|
5310 |
||
5311 |
lineNrOrNilOrMinus1 == -1 ifTrue:[ |
|
5312 |
steppedContextLineno := skipLineNr := nil. |
|
5313 |
]. |
|
5314 |
||
5315 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
5316 |
steppedContext := contextArray at:1. |
|
5317 |
stepHow := #nextIn. |
|
5318 |
] ifFalse:[ |
|
5319 |
stepHow == #nextOut ifTrue:[ |
|
5320 |
steppedContext := con home. |
|
5321 |
] ifFalse:[ |
|
5322 |
steppedContext := con. |
|
5323 |
]. |
|
5324 |
]. |
|
5325 |
||
5326 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5327 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
5328 |
"/ ' 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
|
5329 |
|
15413 | 5330 |
" |
5331 |
if we step in a wrapped method, |
|
5332 |
prepare to skip the prolog ... |
|
5333 |
" |
|
5334 |
||
5335 |
inWrap := false. |
|
5336 |
method := con method. |
|
5337 |
(method notNil |
|
5338 |
and:[method isWrapped |
|
5339 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
5340 |
inWrap := true |
|
5341 |
]. |
|
5342 |
||
5343 |
lineNrOrNilOrMinus1 == #return ifTrue:[ |
|
5344 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
5345 |
]. |
|
5346 |
||
5347 |
con := nil. |
|
5348 |
bigStep := true. |
|
5349 |
haveControl := false. |
|
5350 |
exitAction := #step. |
|
5351 |
||
5352 |
"exit private event-loop" |
|
5353 |
catchBlock value. |
|
5354 |
||
5355 |
"/ not reached |
|
5356 |
'DebugView [warning]: step failed' errorPrintCR. |
|
5357 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 5358 |
] |
477 | 5359 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5360 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 5361 |
! |
5362 |
||
13351 | 5363 |
doStepAfterDelay |
5364 |
Delay waitForSeconds:5. |
|
5365 |
self doStep. |
|
5366 |
! |
|
5367 |
||
266 | 5368 |
doStop |
5369 |
"stop the process (if its running, otherwise this is a no-op)" |
|
5370 |
||
5371 |
inspecting ifTrue:[ |
|
15413 | 5372 |
self graphicsDevice hasColors ifTrue:[ |
5373 |
continueButton foregroundColor:Color green darkened darkened. |
|
5374 |
]. |
|
5375 |
continueButton label:(resources string:'Continue'). |
|
5376 |
continueButton action:[self doContinue]. |
|
5377 |
||
5378 |
self processPerform:#stop. |
|
5379 |
||
5380 |
^ self |
|
266 | 5381 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5382 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5383 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 5384 |
! |
5385 |
||
5386 |
doTerminate |
|
5387 |
"terminate - the process has a chance for cleanup" |
|
5388 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5389 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5390 |
(self confirm:('Code modified - terminate anyway ?')) |
5391 |
ifFalse:[ |
|
5392 |
^ self |
|
5393 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5394 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5395 |
|
266 | 5396 |
inspecting ifTrue:[ |
15413 | 5397 |
self processPerform:#terminate. |
5398 |
^ self |
|
266 | 5399 |
]. |
5400 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5401 |
steppedContext := wrapperContext := nil. |
266 | 5402 |
haveControl := false. |
10205 | 5403 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5404 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5405 |
"exit private event-loop" |
6365 | 5406 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5407 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5408 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5409 |
inspecting ifFalse:[ |
15413 | 5410 |
'DebugView [warning]: terminate failed' errorPrintCR. |
5411 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
5412 |
Debugger newDebugger. |
|
5413 |
Processor activeProcess terminate. |
|
5414 |
] |
|
266 | 5415 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5416 |
terminateButton turnOff. |
477 | 5417 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5418 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 5419 |
! |
5420 |
||
5421 |
doTrace |
|
5422 |
"tracing - not really implemented ..." |
|
5423 |
||
5424 |
self warn:'this function is not yet implemented'. |
|
5425 |
||
5426 |
"/ |v b| |
|
5427 |
"/ |
|
5428 |
"/ traceView isNil ifTrue:[ |
|
5429 |
"/ v := StandardSystemView on:Display. |
|
5430 |
"/ v label:'Debugger-Trace'. |
|
5431 |
"/ v icon:icon. |
|
5432 |
"/ |
|
5433 |
"/ b := Button label:'untrace' in:v. |
|
5434 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
5435 |
"/ b action:[ |
|
5436 |
"/ StepInterruptPending := nil. |
|
5437 |
"/ tracing := false. |
|
5438 |
"/ v unrealize. |
|
5439 |
"/ traceView := nil |
|
5440 |
"/ ]. |
|
5441 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
5442 |
"/ traceView origin:(0 @ (b height)) |
|
5443 |
"/ extent:[v width @ (v height - b height)] |
|
5444 |
"/ ]. |
|
5445 |
"/ v realize. |
|
5446 |
"/ |
|
5447 |
"/ tracing := true. |
|
5448 |
! |
|
5449 |
||
5450 |
doTraceStep |
|
5451 |
"tracestep - not implemented yet" |
|
5452 |
||
5453 |
canContinue ifTrue:[ |
|
15413 | 5454 |
tracing := true. |
5455 |
self doStep |
|
266 | 5456 |
] |
5457 |
! |
|
5458 |
||
5459 |
exit |
|
5460 |
"exit from menu: immediate exit from smalltalk" |
|
5461 |
||
14129 | 5462 |
OperatingSystem exit:10 |
266 | 5463 |
! |
5464 |
||
13388 | 5465 |
findContextForWhich:aBlock thenDo:additionalAction |
5466 |
|con| |
|
5467 |
||
5468 |
con := self selectedContext. |
|
5469 |
con isNil ifTrue:[^ self]. |
|
5470 |
||
5471 |
con := con sender. |
|
5472 |
[con notNil] whileTrue:[ |
|
15413 | 5473 |
(aBlock value:con) ifTrue:[ |
5474 |
(self selectContext:con) ifTrue:[ |
|
5475 |
additionalAction value:con. |
|
5476 |
^ self. |
|
5477 |
] |
|
5478 |
]. |
|
5479 |
con := con sender. |
|
13388 | 5480 |
]. |
5481 |
||
5482 |
Dialog information:'None found'. |
|
5483 |
! |
|
5484 |
||
5485 |
findContextWithStringInSource |
|
5486 |
|stringToSearch source| |
|
5487 |
||
5488 |
stringToSearch := Dialog request:'Search what:'. |
|
5489 |
stringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5490 |
||
15413 | 5491 |
self |
5492 |
findContextForWhich:[:con | |
|
5493 |
con method notNil |
|
5494 |
and:[ (source := con method source) notNil |
|
5495 |
and:[ (source includesString:stringToSearch) ]] |
|
5496 |
] |
|
5497 |
thenDo:[:con | |
|
5498 |
codeView searchFwd:stringToSearch. |
|
5499 |
] |
|
13388 | 5500 |
! |
5501 |
||
5502 |
findContextWithValueInVariable |
|
5503 |
|valueStringToSearch| |
|
5504 |
||
5505 |
valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'. |
|
5506 |
valueStringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5507 |
||
15413 | 5508 |
self |
5509 |
findContextForWhich:[:con | |
|
5510 |
con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase] |
|
5511 |
] |
|
5512 |
thenDo:[:con | ] |
|
13388 | 5513 |
! |
5514 |
||
11595 | 5515 |
findHandlerFor |
13388 | 5516 |
|exClass con| |
11595 | 5517 |
|
15413 | 5518 |
(con := self selectedContext) isNil ifTrue:[ |
5519 |
con := contextArray at:1 |
|
11595 | 5520 |
]. |
5521 |
con sender isNil ifTrue:[ |
|
15413 | 5522 |
self information:'Context has already returned'. |
5523 |
^ self |
|
5524 |
]. |
|
5525 |
||
5526 |
exClass := Dialog |
|
5527 |
choose:'Exception class:' |
|
5528 |
fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name]) |
|
5529 |
lines:25 |
|
5530 |
title:'Choose Exception class'. |
|
14523 | 5531 |
exClass isNil ifTrue:[^ self]. |
13388 | 5532 |
|
15413 | 5533 |
self |
5534 |
findContextForWhich:[:con | |
|
5535 |
con isHandleContext |
|
5536 |
and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] |
|
5537 |
] |
|
5538 |
thenDo:[:con | |
|
5539 |
self selectContext:con sender. |
|
5540 |
] |
|
13388 | 5541 |
! |
5542 |
||
15255 | 5543 |
findHomeContext |
5544 |
|con home| |
|
5545 |
||
5546 |
(con := self selectedContext) isNil ifTrue:[ |
|
15413 | 5547 |
self beep. |
5548 |
^ self. |
|
15255 | 5549 |
]. |
5550 |
(home := con home) isNil ifTrue:[ |
|
15413 | 5551 |
self beep. |
5552 |
^ self. |
|
15255 | 5553 |
]. |
5554 |
||
5555 |
"/ still have to find it - home could be elsewhere (another process) |
|
5556 |
"/ (i.e. cannot simply select it) |
|
5557 |
||
15413 | 5558 |
self |
5559 |
findContextForWhich:[:con | |
|
5560 |
con == home |
|
5561 |
] |
|
5562 |
thenDo:[:con | |
|
5563 |
self selectContext:con. |
|
5564 |
] |
|
15255 | 5565 |
! |
5566 |
||
13388 | 5567 |
findNextExceptionHandlerContext |
15413 | 5568 |
self |
5569 |
findContextForWhich:[:con | |
|
5570 |
con isHandleContext |
|
5571 |
] |
|
5572 |
thenDo:[:con | |
|
5573 |
self selectContext:con sender. |
|
5574 |
] |
|
11595 | 5575 |
! |
5576 |
||
266 | 5577 |
inspectContext |
5578 |
"launch an inspector on the currently selected context" |
|
5579 |
||
11595 | 5580 |
|con| |
5581 |
||
5582 |
(con := self selectedContext) notNil ifTrue:[ |
|
15413 | 5583 |
con inspect. |
266 | 5584 |
] |
11595 | 5585 |
|
5586 |
"Modified: / 17-07-2012 / 12:52:34 / cg" |
|
266 | 5587 |
! |
5588 |
||
15247 | 5589 |
inspectContextsMethod |
5590 |
"launch an inspector on the currently selected context's method" |
|
5591 |
||
5592 |
|con| |
|
5593 |
||
5594 |
(con := self selectedContext) notNil ifTrue:[ |
|
15413 | 5595 |
con method inspect. |
15247 | 5596 |
] |
5597 |
! |
|
5598 |
||
12840 | 5599 |
inspectWidgetHierarchy |
5600 |
|rcvr view| |
|
5601 |
||
5602 |
selectedContext isNil ifTrue:[ ^ self ]. |
|
5603 |
Tools::ViewTreeInspectorApplication isNil ifTrue:[ |
|
15413 | 5604 |
Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'. |
5605 |
^ self. |
|
12840 | 5606 |
]. |
5607 |
||
5608 |
rcvr := selectedContext receiver. |
|
5609 |
rcvr isView ifTrue:[ |
|
15413 | 5610 |
view := rcvr |
12840 | 5611 |
] ifFalse:[ |
15413 | 5612 |
view := rcvr window |
12840 | 5613 |
]. |
5614 |
Tools::ViewTreeInspectorApplication openOn:view |
|
5615 |
! |
|
5616 |
||
8142 | 5617 |
middleButtonMenu |
5618 |
<resource: #programMenu > |
|
5619 |
||
9488 | 5620 |
|items m nameOfExecutable| |
8142 | 5621 |
|
5622 |
exclusive ifTrue:[ |
|
15413 | 5623 |
items := #( |
5624 |
('Show More WalkBack' showMore ) |
|
5625 |
('-' ) |
|
5626 |
('Add Breakpoint' addBreakpoint ) |
|
5627 |
('Remove Breakpoint' removeBreakpoint ) |
|
5628 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
5629 |
('-' ) |
|
5630 |
). |
|
8142 | 5631 |
] ifFalse:[ |
15413 | 5632 |
items := #( |
5633 |
('Show More WalkBack' showMore ) |
|
5634 |
('-' ) |
|
5635 |
('Skip' skip ) |
|
5636 |
('Step Out' skipForReturn ) |
|
5637 |
('Skip until Entering...' skipUntilEntering ) |
|
5638 |
('-' ) |
|
8142 | 5639 |
" |
15413 | 5640 |
('Continue' doContinue ) |
5641 |
('Terminate' doTerminate ) |
|
5642 |
('Abort' doAbort ) |
|
5643 |
('-' ) |
|
5644 |
('Step' doStep ) |
|
5645 |
('Send' doSend ) |
|
5646 |
('-' ) |
|
5647 |
('Return' doReturn ) |
|
5648 |
('Restart' doRestart ) |
|
5649 |
('-' ) |
|
8142 | 5650 |
" |
15413 | 5651 |
('Add Breakpoint' addBreakpoint ) |
5652 |
('Remove Breakpoint' removeBreakpoint ) |
|
5653 |
('Remove all Break- & Tracepoints' removeAllBreakpoints ) |
|
5654 |
). |
|
11210 | 5655 |
|
12840 | 5656 |
"/ self allowBreakPointsInDebugger ifFalse:[ |
5657 |
"/ items := items , #( |
|
5658 |
"/ ('Allow Breakpoints & halt in Debugger' doNotIgnoreBreakpoints ) |
|
5659 |
"/ ). |
|
5660 |
"/ ] ifTrue:[ |
|
5661 |
"/ items := items , #( |
|
5662 |
"/ ('Ignore Breakpoints & halt in Debugger' doIgnoreBreakpoints ) |
|
5663 |
"/ ). |
|
5664 |
"/ ]. |
|
11210 | 5665 |
|
15413 | 5666 |
items := items , #( |
5667 |
('-' ) |
|
5668 |
('Browse Implementing Class' browseImplementingClass ) |
|
5669 |
('Browse Receiver''s Class' browseReceiversClass ) |
|
5670 |
('Browse Blocks''s Home' browseBlocksHome ) |
|
11610 | 5671 |
"/ ('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
5672 |
"/ ('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
15413 | 5673 |
('Implementors' browseImplementors ) |
5674 |
('Implementors Of...' browseImplementorsOf ) |
|
5675 |
('Senders' browseSenders ) |
|
5676 |
('Senders Of...' browseSendersOf ) |
|
5677 |
('-' ) |
|
5678 |
('Inspect Context' inspectContext ) |
|
5679 |
). |
|
8142 | 5680 |
]. |
5681 |
||
9488 | 5682 |
items := items , #( |
15413 | 5683 |
('Copy WalkBack Text' copyWalkbackText ) |
5684 |
('-' ) |
|
5685 |
('Hard Terminate (Danger)' quickTerminate ) |
|
5686 |
('=' )). |
|
9488 | 5687 |
|
5688 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
5689 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
5690 |
||
5691 |
items := items , { |
|
15413 | 5692 |
{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
10205 | 5693 |
|
5694 |
m := PopUpMenu |
|
15413 | 5695 |
itemList:items |
5696 |
resources:resources |
|
5697 |
receiver:self |
|
5698 |
for:contextView. |
|
8142 | 5699 |
|
5700 |
inspecting ifTrue:[ |
|
15413 | 5701 |
m notNil ifTrue:[ |
5702 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
5703 |
browseClassHierarchy browseFullClassProtocol |
|
5704 |
browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut). |
|
5705 |
]. |
|
8142 | 5706 |
]. |
5707 |
self updateMenuItems. |
|
5708 |
||
5709 |
^ m. |
|
9488 | 5710 |
|
13210 | 5711 |
"Modified: / 22-07-2013 / 15:30:05 / cg" |
8142 | 5712 |
! |
5713 |
||
15257 | 5714 |
notShowingDenseWalkbackHolder |
5715 |
^ BlockValue forLogicalNot: self showingDenseWalkbackHolder. |
|
5716 |
! |
|
5717 |
||
11573 | 5718 |
notShowingSupportCode |
5719 |
^ hideSupportCode == true. |
|
5720 |
||
5721 |
"Created: / 10-06-2012 / 21:27:24 / cg" |
|
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5722 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5723 |
|
3447 | 5724 |
openAboutThisApplication |
5725 |
"opens an about box for this application." |
|
5726 |
||
7112 | 5727 |
Dialog aboutClass:self class. |
5728 |
||
5729 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 5730 |
! |
5731 |
||
8620 | 5732 |
openSettingsDialog |
14559 | 5733 |
|settingsList| |
8620 | 5734 |
|
10205 | 5735 |
settingsList := |
15413 | 5736 |
#( |
5737 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
5738 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
5739 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
5740 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
5741 |
). |
|
5742 |
||
5743 |
SettingsDialog |
|
5744 |
openWithList:settingsList |
|
5745 |
label:(resources string:'Debugger Settings'). |
|
8620 | 5746 |
! |
5747 |
||
13488 | 5748 |
processesApplication |
5749 |
"if the debugged process is a GUI process, |
|
5750 |
AND it has an applicaiton, return it. |
|
5751 |
Otherwise, return nil" |
|
5752 |
||
14430 | 5753 |
|p wgs app nonModalWGs| |
13488 | 5754 |
|
5755 |
p := inspectedProcess ? Processor activeProcess. |
|
5756 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
|
15413 | 5757 |
wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p]. |
5758 |
nonModalWGs := wgs reject:[:wg | wg isModal]. |
|
5759 |
nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application]. |
|
5760 |
||
5761 |
wgs do:[:wg | |
|
5762 |
|wgi| |
|
5763 |
||
5764 |
wgi := wg. |
|
5765 |
[wgi notNil] whileTrue:[ |
|
5766 |
(app := wgi application) notNil ifTrue:[^ app]. |
|
5767 |
wgi isModal ifTrue:[ |
|
5768 |
wgi := wgi previousGroup |
|
5769 |
] ifFalse:[ |
|
5770 |
wgi := nil. |
|
5771 |
] |
|
5772 |
] |
|
5773 |
] |
|
13488 | 5774 |
]. |
5775 |
^ nil |
|
5776 |
! |
|
5777 |
||
266 | 5778 |
quickTerminate |
5779 |
"quick terminate - the process will get no chance for cleanup actions" |
|
5780 |
||
5781 |
inspecting ifTrue:[ |
|
15413 | 5782 |
self processPerform:#terminateNoSignal. |
5783 |
^ self |
|
266 | 5784 |
]. |
5785 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5786 |
steppedContext := wrapperContext := nil. |
266 | 5787 |
haveControl := false. |
5788 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5789 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5790 |
"exit private event-loop" |
6365 | 5791 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5792 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5793 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5794 |
inspecting ifFalse:[ |
15413 | 5795 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
5796 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
5797 |
Debugger newDebugger. |
|
5798 |
Processor activeProcess terminateNoSignal. |
|
5799 |
] |
|
266 | 5800 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5801 |
terminateButton turnOff. |
477 | 5802 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5803 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 5804 |
! |
5805 |
||
11391 | 5806 |
rememberCallchain |
5807 |
"remember the callchain in a classvar. |
|
5808 |
When entered the next time, highlight already entered contexts. |
|
5809 |
This makes it possible to identitfy the caller as the first common context |
|
5810 |
along the chain (i.e. the context which is responsible for the debugger to be entered)" |
|
5811 |
||
5812 |
RememberedCallChain := contextArray copy |
|
5813 |
||
5814 |
"Created: / 07-03-2012 / 23:07:07 / cg" |
|
5815 |
! |
|
5816 |
||
13388 | 5817 |
selectContext:aContext |
5818 |
|idx| |
|
5819 |
||
5820 |
idx := contextArray identityIndexOf:aContext. |
|
5821 |
idx == 0 ifTrue:[ |
|
15413 | 5822 |
"/ some contexts hidden? |
5823 |
(self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[ |
|
5824 |
Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'. |
|
5825 |
self showFullWalkback. |
|
5826 |
self showingDenseWalkback:false. |
|
5827 |
self showingSupportCode:true. |
|
5828 |
]. |
|
5829 |
idx := contextArray identityIndexOf:aContext. |
|
13388 | 5830 |
]. |
5831 |
idx ~~ 0 ifTrue:[ |
|
15413 | 5832 |
self selectContextWithIndex:idx. |
5833 |
^ true. |
|
13388 | 5834 |
]. |
5835 |
^ false |
|
5836 |
! |
|
5837 |
||
11595 | 5838 |
selectedContext |
5839 |
contextView selection notNil ifTrue:[ |
|
15413 | 5840 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
5841 |
^ (contextArray at:(contextView selection)). |
|
5842 |
] |
|
11595 | 5843 |
]. |
5844 |
^ nil |
|
5845 |
||
5846 |
"Created: / 17-07-2012 / 12:52:10 / cg" |
|
5847 |
! |
|
5848 |
||
11647 | 5849 |
showFullWalkback |
5850 |
"double the number of contexts shown" |
|
5851 |
||
5852 |
contextArray notNil ifTrue:[ |
|
15413 | 5853 |
nChainShown := 9999. |
5854 |
self redisplayBacktrace. |
|
11647 | 5855 |
] |
5856 |
||
5857 |
"Created: / 23-07-2012 / 12:24:02 / cg" |
|
5858 |
! |
|
5859 |
||
266 | 5860 |
showMore |
3447 | 5861 |
"double the number of contexts shown" |
266 | 5862 |
|
5863 |
contextArray notNil ifTrue:[ |
|
15413 | 5864 |
nChainShown := nChainShown * 2. |
5865 |
self redisplayBacktrace. |
|
266 | 5866 |
] |
563 | 5867 |
|
3447 | 5868 |
"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
|
5869 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5870 |
|
11573 | 5871 |
showSupportCode |
5872 |
hideSupportCode := false. |
|
5873 |
self redisplayBacktrace. |
|
5874 |
||
5875 |
"Created: / 10-06-2012 / 21:27:53 / cg" |
|
5876 |
! |
|
5877 |
||
3447 | 5878 |
showingDenseWalkback |
15257 | 5879 |
^ self verboseBacktraceHolder value not |
3447 | 5880 |
|
5881 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
5882 |
! |
|
5883 |
||
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5884 |
showingDenseWalkback:aBoolean |
15257 | 5885 |
self verboseBacktraceHolder value:aBoolean not. |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5886 |
self redisplayBacktrace. |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5887 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5888 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5889 |
! |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5890 |
|
15257 | 5891 |
showingDenseWalkbackHolder |
5892 |
^ BlockValue forLogicalNot:self verboseBacktraceHolder |
|
5893 |
! |
|
5894 |
||
11573 | 5895 |
showingSupportCode |
5896 |
^ hideSupportCode == false. |
|
5897 |
||
5898 |
"Created: / 10-06-2012 / 21:28:05 / cg" |
|
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5899 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5900 |
|
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5901 |
showingSupportCode:aBoolean |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5902 |
hideSupportCode := aBoolean not. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5903 |
self redisplayBacktrace. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5904 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5905 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5906 |
! |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
5907 |
|
3447 | 5908 |
showingVerboseWalkback |
15257 | 5909 |
^ self verboseBacktraceHolder value |
3447 | 5910 |
|
5911 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
5912 |
! |
|
5913 |
||
9626 | 5914 |
sizeChanged:how |
10205 | 5915 |
super sizeChanged:how. |
9626 | 5916 |
LastExtent := self extent. |
5917 |
||
5918 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
5919 |
! |
|
5920 |
||
266 | 5921 |
skip |
5922 |
"skip for cursor line in selected method" |
|
5923 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5924 |
stepHow := #skip. |
266 | 5925 |
self doStep:codeView cursorLine. |
790 | 5926 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5927 |
"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
|
5928 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5929 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5930 |
skipForReturn |
2581 | 5931 |
"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
|
5932 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5933 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5934 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5935 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5936 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 5937 |
! |
5938 |
||
5939 |
skipUntilEntering |
|
5940 |
"skip until some particular method is invoked." |
|
5941 |
||
5942 |
|selector| |
|
5943 |
||
10205 | 5944 |
selector := Dialog |
15413 | 5945 |
request:'Skip until entering what (matchpattern):' |
5946 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 5947 |
selector size == 0 ifTrue:[^ self]. |
5948 |
||
5949 |
stepUntilEntering := selector asSymbol. |
|
5950 |
stepHow := #send. |
|
5951 |
self doStep:-1. |
|
5952 |
||
5953 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 5954 |
! |
5955 |
||
11573 | 5956 |
toggleShowSupportCode |
5957 |
hideSupportCode ifTrue:[ |
|
15413 | 5958 |
self showSupportCode |
11645
4f39a925956d
changed: #toggleShowSupportCode
Stefan Vogel <sv@exept.de>
parents:
11636
diff
changeset
|
5959 |
] ifFalse:[ |
15413 | 5960 |
self hideSupportCode |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5961 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5962 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5963 |
"Modified: / 17-11-2001 / 20:07:45 / cg" |
11573 | 5964 |
"Created: / 10-06-2012 / 21:28:17 / cg" |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5965 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5966 |
|
3447 | 5967 |
toggleVerboseWalkback |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5968 |
self showingDenseWalkback:(self showingDenseWalkback not) |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5969 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
5970 |
"Modified: / 27-07-2012 / 15:00:15 / cg" |
11610 | 5971 |
! |
5972 |
||
5973 |
updateMenuItems |
|
13408 | 5974 |
"enable/disable some menu items, depending on the current selected context" |
5975 |
||
11610 | 5976 |
|m mthd cls mCls rCls| |
5977 |
||
5978 |
m := contextView middleButtonMenu. |
|
5979 |
m notNil ifTrue:[ |
|
15413 | 5980 |
m disable:#removeBreakpoint. |
5981 |
m disable:#addBreakpoint. |
|
5982 |
canShowMore ifFalse:[ |
|
5983 |
m disable:#showMore |
|
5984 |
]. |
|
5985 |
||
5986 |
selectedContext notNil ifTrue:[ |
|
5987 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
5988 |
||
5989 |
mthd := selectedContext method. |
|
5990 |
mthd notNil ifTrue:[ |
|
5991 |
cls := mCls := mthd containingClass. |
|
5992 |
mthd isBreakpointed ifTrue:[ |
|
5993 |
m enable:#removeBreakpoint. |
|
5994 |
] ifFalse:[ |
|
5995 |
m enable:#addBreakpoint. |
|
5996 |
] |
|
5997 |
]. |
|
5998 |
(selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[ |
|
5999 |
"/ a cheap block's context |
|
6000 |
] ifFalse:[ |
|
6001 |
rCls := selectedContext receiver class. |
|
6002 |
cls isNil ifTrue:[ |
|
6003 |
cls := rCls |
|
6004 |
]. |
|
6005 |
]. |
|
6006 |
cls notNil ifTrue:[ |
|
6007 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6008 |
rCls == mCls ifTrue:[ |
|
6009 |
m disable:#browseReceiversClass |
|
6010 |
]. |
|
6011 |
mCls isNil ifTrue:[ |
|
6012 |
m disable:#browseImplementingClass |
|
6013 |
] |
|
6014 |
||
6015 |
] ifFalse:[ |
|
6016 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6017 |
]. |
|
6018 |
mthd notNil ifTrue:[ |
|
6019 |
m enableAll:#(browseImplementingClass). |
|
6020 |
]. |
|
6021 |
selectedContext isCheapBlockContext ifTrue:[ |
|
6022 |
m disableAll:#(browseReceiversClass). |
|
6023 |
]. |
|
6024 |
selectedContext receiver isBlock ifTrue:[ |
|
6025 |
m enableAll:#(browseBlocksHome). |
|
6026 |
] ifFalse:[ |
|
6027 |
m disableAll:#(browseBlocksHome). |
|
6028 |
]. |
|
6029 |
] ifFalse:[ |
|
6030 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy |
|
6031 |
browseBlocksHome browseFullClassProtocol). |
|
6032 |
] |
|
11610 | 6033 |
] |
6034 |
||
6035 |
"Modified: / 19-07-2012 / 11:53:30 / cg" |
|
266 | 6036 |
! ! |
6037 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6038 |
!DebugView methodsFor:'menu & button actions-breakpoints'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6039 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6040 |
addBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6041 |
"add a breakpoint on the selected contexts method - if any" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6042 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6043 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6044 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6045 |
selectedContext isNil ifTrue:[ |
15413 | 6046 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6047 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6048 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
15413 | 6049 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6050 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6051 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6052 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6053 |
implementorClass notNil ifTrue:[ |
15413 | 6054 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6055 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
6056 |
method setBreakPoint |
|
6057 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6058 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6059 |
contextView middleButtonMenu disable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6060 |
contextView middleButtonMenu enable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6061 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6062 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6063 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6064 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6065 |
allowBreakPointsInDebugger |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6066 |
^ ignoreBreakpoints not |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6067 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6068 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6069 |
allowBreakPointsInDebugger:aBoolean |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6070 |
ignoreBreakpoints := aBoolean not. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6071 |
self initializeMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6072 |
self initializeContextViewsMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6073 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6074 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6075 |
doIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6076 |
self allowBreakPointsInDebugger:false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6077 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6078 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6079 |
doNotIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6080 |
self allowBreakPointsInDebugger:true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6081 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6082 |
|
14680 | 6083 |
ignoreAllHaltsForCurrentProcess |
15413 | 6084 |
self |
6085 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6086 |
orThisReceiverClass:false orCurrentProcess:true |
|
6087 |
orIfCalledFromMethod:nil |
|
6088 |
forAll:true. |
|
14680 | 6089 |
|
6090 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6091 |
! |
|
6092 |
||
6093 |
ignoreAllHaltsForThisReceiverClass |
|
15413 | 6094 |
self |
6095 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6096 |
orThisReceiverClass:true orCurrentProcess:false |
|
6097 |
orIfCalledFromMethod:nil |
|
6098 |
forAll:true. |
|
14680 | 6099 |
|
6100 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6101 |
! |
|
6102 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6103 |
ignoreAllHaltsForever |
15413 | 6104 |
self |
6105 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
|
6106 |
orThisReceiverClass:false orCurrentProcess:false |
|
6107 |
orIfCalledFromMethod:nil |
|
6108 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6109 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6110 |
"Created: / 08-05-2011 / 10:19:56 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6111 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6112 |
|
14680 | 6113 |
ignoreAllHaltsIfCalledFromMethod:aMethod |
15413 | 6114 |
self |
6115 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6116 |
orThisReceiverClass:false orCurrentProcess:false |
|
6117 |
orIfCalledFromMethod:aMethod |
|
6118 |
forAll:true. |
|
14680 | 6119 |
! |
6120 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6121 |
ignoreAllHaltsUntilShiftKeyIsPressed |
15413 | 6122 |
self |
6123 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6124 |
orThisReceiverClass:false orCurrentProcess:false |
|
6125 |
orIfCalledFromMethod:nil |
|
6126 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6127 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6128 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6129 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6130 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6131 |
ignoreBreakpointsWithThisParameterForever |
11370 | 6132 |
Object disableBreakPoint:breakPointParameter. |
6133 |
"/ self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:false. |
|
6134 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6135 |
"Created: / 06-03-2012 / 12:35:48 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6136 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6137 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6138 |
ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
15413 | 6139 |
self |
6140 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6141 |
orThisReceiverClass:false orCurrentProcess:false |
|
6142 |
orIfCalledFromMethod:nil |
|
6143 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6144 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6145 |
"Created: / 06-03-2012 / 12:35:22 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6146 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6147 |
|
12937 | 6148 |
ignoreHaltForCurrentProcess |
15413 | 6149 |
self |
6150 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6151 |
orThisReceiverClass:false orCurrentProcess:true |
|
6152 |
orIfCalledFromMethod:nil |
|
6153 |
forAll:false. |
|
12937 | 6154 |
|
6155 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6156 |
! |
|
6157 |
||
6158 |
ignoreHaltForThisReceiverClass |
|
15413 | 6159 |
self |
6160 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6161 |
orThisReceiverClass:true orCurrentProcess:false |
|
6162 |
orIfCalledFromMethod:nil |
|
6163 |
forAll:false. |
|
12937 | 6164 |
|
6165 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6166 |
! |
|
6167 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6168 |
ignoreHaltForever |
15413 | 6169 |
self |
6170 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
|
6171 |
orThisReceiverClass:false orCurrentProcess:false |
|
6172 |
orIfCalledFromMethod:nil |
|
6173 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6174 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6175 |
"Modified: / 27-01-2012 / 11:31:37 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6176 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6177 |
|
14608 | 6178 |
ignoreHaltIfCalledFromMethod:aMethod |
15413 | 6179 |
self |
6180 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6181 |
orThisReceiverClass:false orCurrentProcess:false |
|
6182 |
orIfCalledFromMethod:aMethod |
|
6183 |
forAll:false. |
|
14608 | 6184 |
! |
6185 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6186 |
ignoreHaltUntilShiftKeyIsPressed |
15413 | 6187 |
self |
6188 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6189 |
orThisReceiverClass:false orCurrentProcess:false |
|
6190 |
orIfCalledFromMethod:nil |
|
6191 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6192 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6193 |
"Created: / 27-01-2012 / 11:36:54 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6194 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6195 |
|
14680 | 6196 |
menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
6197 |
<resource: #programMenu > |
|
6198 |
||
6199 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:true |
|
6200 |
! |
|
6201 |
||
14608 | 6202 |
menuForIgnoreBreakpointIfCalledFromAnyOf |
6203 |
<resource: #programMenu > |
|
6204 |
||
14680 | 6205 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:false |
6206 |
! |
|
6207 |
||
6208 |
menuForIgnoreBreakpointIfCalledFromAnyOfForAll:forAllHaltsBoolean |
|
6209 |
<resource: #programMenu > |
|
6210 |
||
14608 | 6211 |
|m count already| |
6212 |
||
6213 |
m := Menu new. |
|
6214 |
count := 0. |
|
6215 |
already := IdentitySet new. |
|
6216 |
||
6217 |
contextArray do:[:con | |
|
15413 | 6218 |
|mthd cls sel| |
6219 |
||
6220 |
mthd := con method. |
|
6221 |
mthd notNil ifTrue:[ |
|
6222 |
mthd isWrapped ifFalse:[ |
|
6223 |
(already includes:already) ifFalse:[ |
|
6224 |
already add:mthd. |
|
6225 |
m addItem:(MenuItem |
|
6226 |
label: (mthd whoString) |
|
6227 |
itemValue: [ forAllHaltsBoolean |
|
6228 |
ifTrue:[self ignoreHaltIfCalledFromMethod:mthd] |
|
6229 |
ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd] |
|
6230 |
] |
|
6231 |
translateLabel: false). |
|
6232 |
count := count + 1. |
|
6233 |
(count > 20) ifTrue:[ |
|
6234 |
^ m |
|
6235 |
]. |
|
6236 |
] |
|
6237 |
] |
|
6238 |
] |
|
14608 | 6239 |
]. |
6240 |
^ m |
|
6241 |
! |
|
6242 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6243 |
openBreakPointBrowser |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6244 |
Tools::BreakpointBrowser open |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6245 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6246 |
"Created: / 27-10-2010 / 12:52:49 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6247 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6248 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6249 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6250 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6251 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6252 |
[ |
15413 | 6253 |
answer := Dialog |
6254 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
6255 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6256 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6257 |
||
6258 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6259 |
dT notNil ifTrue:[ |
|
6260 |
LastIgnoreHaltDuration := dT. |
|
6261 |
self |
|
6262 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6263 |
orThisReceiverClass:false orCurrentProcess:false |
|
6264 |
orIfCalledFromMethod:nil |
|
6265 |
forAll:true. |
|
6266 |
^ self. |
|
6267 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6268 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6269 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6270 |
"Created: / 08-05-2011 / 10:19:20 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6271 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6272 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6273 |
openIgnoreBreakpointsWithThisParameterNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6274 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6275 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6276 |
[ |
15413 | 6277 |
answer := Dialog |
6278 |
request:(resources |
|
6279 |
string:'How often should breakpoints with parameter "%1" be ignored ?' |
|
6280 |
with:breakPointParameter) |
|
6281 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6282 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6283 |
||
6284 |
n := Integer readFrom:answer onError:nil. |
|
6285 |
n notNil ifTrue:[ |
|
6286 |
LastIgnoreHaltNTimes := n. |
|
6287 |
self |
|
6288 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6289 |
orThisReceiverClass:false orCurrentProcess:false |
|
6290 |
orIfCalledFromMethod:nil |
|
6291 |
forAll:false. |
|
6292 |
^ self. |
|
6293 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6294 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6295 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6296 |
"Modified: / 27-01-2012 / 11:31:44 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6297 |
"Created: / 06-03-2012 / 12:28:51 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6298 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6299 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6300 |
openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6301 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6302 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6303 |
[ |
15413 | 6304 |
answer := Dialog |
6305 |
request:(resources |
|
6306 |
string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?' |
|
6307 |
with:breakPointParameter) |
|
6308 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6309 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6310 |
||
6311 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6312 |
dT notNil ifTrue:[ |
|
6313 |
LastIgnoreHaltDuration := dT. |
|
6314 |
self |
|
6315 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6316 |
orThisReceiverClass:false orCurrentProcess:false |
|
6317 |
orIfCalledFromMethod:nil |
|
6318 |
forAll:false. |
|
6319 |
^ self. |
|
6320 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6321 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6322 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6323 |
"Created: / 06-03-2012 / 12:03:36 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6324 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6325 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6326 |
openIgnoreHaltNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6327 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6328 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6329 |
[ |
15413 | 6330 |
answer := Dialog |
6331 |
request:(resources string:'How often should this halt be ignored ?') |
|
6332 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6333 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6334 |
||
6335 |
n := Integer readFrom:answer onError:nil. |
|
6336 |
n notNil ifTrue:[ |
|
6337 |
LastIgnoreHaltNTimes := n. |
|
6338 |
self |
|
6339 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6340 |
orThisReceiverClass:false orCurrentProcess:false |
|
6341 |
orIfCalledFromMethod:nil |
|
6342 |
forAll:false. |
|
6343 |
^ self. |
|
6344 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6345 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6346 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6347 |
"Modified: / 27-01-2012 / 11:31:44 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6348 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6349 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6350 |
openIgnoreHaltUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6351 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6352 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6353 |
[ |
15413 | 6354 |
answer := Dialog |
6355 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
6356 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6357 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6358 |
||
6359 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6360 |
dT notNil ifTrue:[ |
|
6361 |
LastIgnoreHaltDuration := dT. |
|
6362 |
self |
|
6363 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6364 |
orThisReceiverClass:false orCurrentProcess:false |
|
6365 |
orIfCalledFromMethod:nil |
|
6366 |
forAll:false. |
|
6367 |
^ self. |
|
6368 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6369 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6370 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6371 |
"Modified: / 27-01-2012 / 11:31:47 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6372 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6373 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6374 |
removeAllBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6375 |
"remove all trace & breakpoints - if any" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6376 |
|
14532 | 6377 |
self withExecuteCursorDo:[ |
15413 | 6378 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
6379 |
MessageTracer unwrapAllMethods |
|
6380 |
]. |
|
6381 |
(MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[ |
|
6382 |
MethodWithBreakpoints removeAllBreakpoints |
|
6383 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6384 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6385 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6386 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6387 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6388 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6389 |
removeBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6390 |
"remove breakpoint on the selected contexts method - if any" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6391 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6392 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6393 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6394 |
selectedContext isNil ifTrue:[ |
15413 | 6395 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6396 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6397 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
15413 | 6398 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6399 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6400 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6401 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6402 |
implementorClass notNil ifTrue:[ |
15413 | 6403 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6404 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
6405 |
method clearBreakPoint |
|
6406 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6407 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6408 |
contextView middleButtonMenu disable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6409 |
contextView middleButtonMenu enable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6410 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6411 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6412 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6413 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6414 |
stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6415 |
self class stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6416 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6417 |
|
266 | 6418 |
!DebugView methodsFor:'private'! |
6419 |
||
6487 | 6420 |
abortAllIsHandled |
9750 | 6421 |
^ AbortAllOperationWantedQuery query |
6422 |
||
6423 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 6424 |
! |
6425 |
||
266 | 6426 |
busy |
6427 |
^ busy |
|
6428 |
! |
|
6429 |
||
6430 |
exclusive:aBoolean |
|
6431 |
exclusive := aBoolean |
|
6432 |
! |
|
6433 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6434 |
explainSelection |
8212 | 6435 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6436 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6437 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6438 |
interval isEmpty ifTrue:[ |
15413 | 6439 |
crsrPos := codeView characterPositionOfCursor. |
6440 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
6441 |
crsrPos := (crsrPos - 1) max:1 |
|
6442 |
]. |
|
6443 |
interval := crsrPos to:crsrPos. |
|
10205 | 6444 |
]. |
6445 |
self |
|
15413 | 6446 |
withNodeValueAtInterval:interval |
6447 |
do:[:value :description | |
|
6448 |
self showValue:value |
|
6449 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6450 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6451 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6452 |
findNodeForInterval:interval |
8212 | 6453 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6454 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6455 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6456 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
6457 |
source := codeView contentsAsString string. |
10205 | 6458 |
"/ source := currentMethod notNil |
6459 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 6460 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
6461 |
source isNil ifTrue:[^ nil]. |
8214 | 6462 |
|
8212 | 6463 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
6464 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6465 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6466 |
|
7912 | 6467 |
findNodeIn:tree forInterval:interval |
6468 |
<resource: #obsolete> |
|
10205 | 6469 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6470 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6471 |
|
7912 | 6472 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6473 |
node := nil. |
10205 | 6474 |
tree nodesDo:[:each | |
15413 | 6475 |
(each intersectsInterval:interval) ifTrue:[ |
6476 |
(node isNil or:[node == each parent]) ifTrue:[ |
|
6477 |
node := each |
|
6478 |
] ifFalse:[ |
|
6479 |
(node parent notNil |
|
6480 |
and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
6481 |
] |
|
6482 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6483 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6484 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6485 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6486 |
|
2581 | 6487 |
goodSkipUntilSelector |
6488 |
|current| |
|
6489 |
||
6490 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
6491 |
selectedContext isNil ifTrue:[^ nil]. |
|
6492 |
current := selectedContext selector. |
|
6493 |
current isNil ifTrue:[^ nil]. |
|
6494 |
('change:*' match:current) ifTrue:[ |
|
15413 | 6495 |
^ 'update:*' |
2581 | 6496 |
]. |
6497 |
^ nil |
|
6498 |
! |
|
6499 |
||
8179 | 6500 |
haltSelectors |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6501 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break'). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6502 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6503 |
"Modified (format): / 27-01-2012 / 11:10:00 / cg" |
8179 | 6504 |
! |
6505 |
||
266 | 6506 |
interruptProcessWith:aBlock |
6507 |
"let inspected process do something, then update the context list" |
|
6508 |
||
6509 |
inspectedProcess isDead ifTrue:[ |
|
15413 | 6510 |
self showTerminated. |
6511 |
^ self |
|
266 | 6512 |
]. |
6513 |
inspectedProcess interruptWith:aBlock. |
|
6514 |
" |
|
6515 |
give the process a chance to run, then update |
|
6516 |
" |
|
6517 |
(Delay forSeconds:0.2) wait. |
|
6518 |
self setContext:(inspectedProcess suspendedContext). |
|
6519 |
! |
|
6520 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6521 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6522 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6523 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6524 |
|
8194 | 6525 |
openHTMLDocument: anHTMLFilename |
6526 |
"open a HTMLDocumentView on anHTMLFilename" |
|
6527 |
||
6528 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
6529 |
! |
|
6530 |
||
266 | 6531 |
processPerform:aMessage |
6532 |
"do something, then update the context list" |
|
6533 |
||
6534 |
inspectedProcess isDead ifTrue:[ |
|
15413 | 6535 |
self showTerminated. |
6536 |
^ self |
|
266 | 6537 |
]. |
6538 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
6539 |
|
266 | 6540 |
" |
6541 |
give the process a chance to run, then update |
|
6542 |
" |
|
6543 |
(Delay forSeconds:0.2) wait. |
|
6544 |
self setContext:(inspectedProcess suspendedContext). |
|
6545 |
! |
|
6546 |
||
939 | 6547 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6548 |
"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
|
6549 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6550 |
|
939 | 6551 |
|oldSelection oldContext con idx| |
6552 |
||
6553 |
contextArray notNil ifTrue:[ |
|
15413 | 6554 |
self withExecuteCursorDo:[ |
6555 |
oldSelection := contextView selection. |
|
6556 |
oldSelection notNil ifTrue:[ |
|
6557 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
6558 |
]. |
|
6559 |
||
6560 |
con := firstContext. |
|
950 | 6561 |
"/ con := contextArray at:1. |
15413 | 6562 |
"/ force redeisplay, even if same by changing the first entry |
6563 |
contextArray size > 0 ifTrue:[ |
|
6564 |
contextArray at:1 put:nil. |
|
6565 |
]. |
|
6566 |
self setContext:con. |
|
6567 |
||
6568 |
oldContext isNil ifTrue:[ |
|
6569 |
idx := oldSelection |
|
6570 |
] ifFalse:[ |
|
6571 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
6572 |
]. |
|
6573 |
contextView setSelection:idx. |
|
6574 |
idx notNil ifTrue:[ |
|
6575 |
self showSelection:idx |
|
6576 |
] |
|
6577 |
] |
|
939 | 6578 |
] |
6579 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6580 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 6581 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 6582 |
! |
6583 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6584 |
selectedInterval |
7912 | 6585 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6586 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6587 |
|
7823 | 6588 |
showError:message |
6589 |
codeView contents:(resources string:message). |
|
6590 |
shown ifTrue:[ |
|
15413 | 6591 |
exclusive ifTrue:[ |
6592 |
"/ consider this a kludge: |
|
6593 |
"/ if exclusive, cannot use flash, since it suspends |
|
6594 |
"/ (but we cannot suspend here ...) |
|
6595 |
codeView redrawInverted. self flush. |
|
6596 |
OperatingSystem millisecondDelay:200. |
|
6597 |
codeView redraw |
|
6598 |
] ifFalse:[ |
|
6599 |
codeView flash |
|
6600 |
] |
|
7823 | 6601 |
] |
6602 |
||
6603 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
6604 |
! |
|
6605 |
||
6606 |
showTerminated |
|
6607 |
self showError:'** the process has terminated **' |
|
6608 |
! |
|
6609 |
||
6610 |
showValue:aValue |
|
6611 |
"/ TODO: show value in info field |
|
6612 |
"/ Transcript showCR:aValue printString |
|
6613 |
! |
|
6614 |
||
10205 | 6615 |
stepping |
6616 |
^ stepping |
|
6617 |
! |
|
6618 |
||
6619 |
unstep |
|
7823 | 6620 |
stepping := false. |
6621 |
bigStep := false. |
|
6622 |
steppedContext := wrapperContext := nil. |
|
6623 |
exitAction := nil |
|
6624 |
||
6625 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
6626 |
! |
|
6627 |
||
10203 | 6628 |
updateButtonsAndMenuItemsForContext:aContext |
6629 |
|m| |
|
6630 |
||
6631 |
m := contextView middleButtonMenu. |
|
6632 |
m notNil ifTrue:[ |
|
15413 | 6633 |
self updateMenuItems. |
6634 |
||
6635 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
6636 |
abortButton enable. |
|
6637 |
m enable:#doAbort. |
|
6638 |
] ifFalse:[ |
|
6639 |
abortButton disable. |
|
6640 |
m disable:#doAbort. |
|
6641 |
]. |
|
6642 |
exclusive ifTrue:[ |
|
6643 |
terminateButton disable. |
|
6644 |
m disable:#doTerminate. |
|
6645 |
] ifFalse:[ |
|
6646 |
terminateButton enable. |
|
6647 |
m enable:#doTerminate. |
|
6648 |
]. |
|
10203 | 6649 |
]. |
6650 |
||
6651 |
mayProceed == false ifTrue:[ |
|
15413 | 6652 |
continueButton disable. |
6653 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 6654 |
] ifFalse:[ |
15413 | 6655 |
continueButton enable. |
6656 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 6657 |
]. |
6658 |
||
13363 | 6659 |
isStoppedInModalDialog ifTrue:[ |
15413 | 6660 |
gotoDialogOpenerButton enable. |
6661 |
gotoDialogOpenerButton beVisible. |
|
13362 | 6662 |
] ifFalse:[ |
15413 | 6663 |
gotoDialogOpenerButton beInvisible. |
13362 | 6664 |
]. |
6665 |
||
14523 | 6666 |
(isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[ |
15413 | 6667 |
gotoApplicationActionMethodButton enable. |
6668 |
gotoApplicationActionMethodButton beVisible. |
|
14523 | 6669 |
] ifFalse:[ |
15413 | 6670 |
gotoApplicationActionMethodButton beInvisible. |
14523 | 6671 |
]. |
6672 |
||
10203 | 6673 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
6674 |
! |
|
6675 |
||
7823 | 6676 |
updateContext |
6677 |
|oldContext idx| |
|
6678 |
||
6679 |
inspectedProcess state == #dead ifTrue:[ |
|
15413 | 6680 |
self showTerminated. |
6681 |
^ self |
|
7823 | 6682 |
]. |
6683 |
||
6684 |
oldContext := selectedContext. |
|
6685 |
[ |
|
15413 | 6686 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
6687 |
oldContext notNil ifTrue:[ |
|
6688 |
contextArray notNil ifTrue:[ |
|
6689 |
idx := contextArray identityIndexOf:oldContext. |
|
6690 |
idx ~~ 0 ifTrue:[ |
|
6691 |
self showSelection:idx |
|
6692 |
] ifFalse:[ |
|
6693 |
codeView contents:('** context returned **') |
|
6694 |
] |
|
6695 |
] |
|
6696 |
] |
|
6697 |
]. |
|
7823 | 6698 |
] valueUninterruptably. |
6699 |
||
6700 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 6701 |
! |
6702 |
||
6703 |
withNodeValueAtInterval:interval do:aBlock |
|
14122 | 6704 |
"helper for flyByHelp and explan-selection" |
6705 |
||
15413 | 6706 |
|node definingNode nm nmBold nameSymbol |
14122 | 6707 |
varIdx parentNode receiver con receiversNonMetaClass| |
6708 |
||
6709 |
"/ interval printCR. |
|
10205 | 6710 |
Error |
15413 | 6711 |
handle:[:ex | ] |
6712 |
do:[ |
|
6713 |
[ |
|
6714 |
node := self findNodeForInterval:interval |
|
6715 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
6716 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
6717 |
|
8212 | 6718 |
node isNil ifTrue:[ ^ self ]. |
10205 | 6719 |
node isVariable ifFalse:[ |
15413 | 6720 |
"/ Transcript showCR:node. |
6721 |
^ self |
|
8592 | 6722 |
]. |
8212 | 6723 |
|
6724 |
nm := node name. |
|
8214 | 6725 |
nmBold := nm allBold. |
8600 | 6726 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 6727 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 6728 |
receiver := actualContext methodHome receiver. |
8212 | 6729 |
|
6730 |
(nm = 'self') ifTrue:[ |
|
15413 | 6731 |
aBlock value:receiver value:'receiver' allBold. |
6732 |
^ self |
|
8212 | 6733 |
]. |
6734 |
(nm = 'super') ifTrue:[ |
|
15413 | 6735 |
aBlock value:receiver value:'receiver' allBold. |
6736 |
^ self |
|
8212 | 6737 |
]. |
6738 |
(nm = 'thisContext') ifTrue:[ |
|
15413 | 6739 |
aBlock value:actualContext value:'context' allBold. |
6740 |
^ self |
|
8212 | 6741 |
]. |
6742 |
||
6743 |
definingNode := node whoDefines:nm. |
|
6744 |
definingNode isNil ifTrue:[ |
|
15413 | 6745 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 6746 |
"/aBlock value:'xIII' value:'instVar'. |
15413 | 6747 |
receiver class isMetaclass ifTrue:[ |
6748 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
6749 |
] ifFalse:[ |
|
6750 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
6751 |
]. |
|
6752 |
^ self |
|
6753 |
]. |
|
6754 |
||
6755 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
6756 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
6757 |
aBlock value:'' value:'private class ',nmBold. |
|
6758 |
^ self |
|
6759 |
]. |
|
6760 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
6761 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
6762 |
^ self |
|
6763 |
]. |
|
6764 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
6765 |
|pool| |
|
6766 |
||
6767 |
pool := Smalltalk at:eachPoolName. |
|
6768 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
6769 |
(pool classVarNames includes:nm) ifTrue:[ |
|
6770 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
6771 |
^ self |
|
6772 |
]. |
|
6773 |
]. |
|
6774 |
nameSymbol := nm asSymbolIfInterned. |
|
6775 |
nameSymbol notNil ifTrue:[ |
|
6776 |
(Smalltalk includesKey:nameSymbol) ifTrue:[ |
|
6777 |
(Smalltalk at:nameSymbol) isClass ifTrue:[ |
|
6778 |
aBlock value:'class: ',nmBold value:nil. |
|
6779 |
] ifFalse:[ |
|
6780 |
aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold. |
|
6781 |
]. |
|
6782 |
^ self |
|
6783 |
]. |
|
6784 |
]. |
|
6785 |
aBlock value:'' value:'unknown'. |
|
6786 |
^ self |
|
8212 | 6787 |
]. |
6788 |
"/definingNode printCR. |
|
6789 |
||
6790 |
definingNode isMethod ifTrue:[ |
|
15413 | 6791 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
6792 |
varIdx ~~ 0 ifTrue:[ |
|
6793 |
Error |
|
6794 |
handle:[:ex | ] |
|
6795 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
6796 |
^ self |
|
6797 |
]. |
|
6798 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
6799 |
varIdx ~~ 0 ifTrue:[ |
|
6800 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
6801 |
Error |
|
6802 |
handle:[:ex | ] |
|
6803 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
6804 |
^ self |
|
6805 |
] |
|
6806 |
]. |
|
8212 | 6807 |
]. |
6808 |
||
6809 |
definingNode isBlock ifTrue:[ |
|
15413 | 6810 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
6811 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
6812 |
varIdx ~~ 0 ifTrue:[ |
|
6813 |
"/ am I in this block ? |
|
6814 |
(actualContext lineNumber notNil |
|
6815 |
and:[ definingNode lastLineNumber notNil |
|
6816 |
and:[ (actualContext lineNumber |
|
6817 |
between:definingNode firstLineNumber |
|
6818 |
and:definingNode lastLineNumber) |
|
6819 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
6820 |
ifTrue:[ |
|
6821 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
6822 |
^ self |
|
6823 |
]. |
|
6824 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
|
6825 |
^ self |
|
6826 |
] |
|
6827 |
]. |
|
8212 | 6828 |
]. |
6829 |
||
6830 |
parentNode := definingNode parent. |
|
6831 |
||
6832 |
[parentNode notNil] whileTrue:[ |
|
15413 | 6833 |
"/'isMethod ' print. parentNode isMethod printCR. |
6834 |
parentNode isMethod ifTrue:[ |
|
6835 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
6836 |
varIdx ~~ 0 ifTrue:[ |
|
6837 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
6838 |
Error |
|
6839 |
handle:[:ex | ] |
|
6840 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
6841 |
^ self |
|
6842 |
] |
|
6843 |
]. |
|
6844 |
]. |
|
6845 |
"/'isBlock ' print. parentNode isBlock printCR. |
|
6846 |
parentNode isBlock ifTrue:[ |
|
6847 |
"/ we don't have any information on the inlineability |
|
6848 |
"/ of this block here (RBParser does not know what |
|
6849 |
"/ the compiler does). |
|
6850 |
"/ therefore, it is questionable if we can use the |
|
6851 |
"/ context's home context here. |
|
6852 |
"/ am I in this block ? |
|
6853 |
con := actualContext. |
|
6854 |
[con notNil |
|
6855 |
and:[ parentNode lastLineNumber notNil |
|
6856 |
and:[ con lineNumber notNil |
|
6857 |
and:[ con lineNumber |
|
6858 |
between:parentNode firstLineNumber |
|
6859 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
6860 |
con := con sender. |
|
6861 |
]. |
|
6862 |
con notNil ifTrue:[ |
|
6863 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
6864 |
varIdx ~~ 0 ifTrue:[ |
|
6865 |
Error |
|
6866 |
handle:[:ex | ] |
|
6867 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
6868 |
^ self |
|
6869 |
]. |
|
6870 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
6871 |
varIdx ~~ 0 ifTrue:[ |
|
6872 |
Error |
|
6873 |
handle:[:ex | ] |
|
6874 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
6875 |
^ self |
|
6876 |
]. |
|
6877 |
]. |
|
6878 |
]. |
|
6879 |
parentNode := parentNode parent. |
|
8212 | 6880 |
]. |
8214 | 6881 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 6882 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
6883 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 6884 |
! ! |
6885 |
||
6886 |
!DebugView methodsFor:'private queries'! |
|
6887 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6888 |
canBrowseClassHierarchy |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6889 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6890 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6891 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6892 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6893 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6894 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6895 |
canBrowseFullClassProtocol |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6896 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6897 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6898 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6899 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6900 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6901 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6902 |
canBrowseImplementingClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6903 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6904 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6905 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6906 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6907 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6908 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6909 |
canBrowseProcessesApplication |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6910 |
|p| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6911 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6912 |
p := inspectedProcess ? Processor activeProcess. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6913 |
p isNil ifTrue:[^ false]. |
14430 | 6914 |
^ p isGUIProcess and:[self processesApplication notNil ]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6915 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6916 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6917 |
canBrowseReceiversClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6918 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6919 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6920 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6921 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6922 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6923 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6924 |
canCloseAllDebuggers |
15413 | 6925 |
self class allInstancesDo:[:debugger | |
6926 |
debugger ~~ self ifTrue:[ |
|
6927 |
debugger busy ifTrue:[^ true]. |
|
6928 |
] |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6929 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6930 |
^ false |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6931 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6932 |
"Created: / 23-03-2012 / 12:40:18 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6933 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
6934 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6935 |
canDefineMethod |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6936 |
^ defineButton isVisible |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6937 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6938 |
|
12840 | 6939 |
canInspectWidgetHierarchy |
6940 |
|rcvr| |
|
6941 |
||
6942 |
^ selectedContext notNil |
|
6943 |
and:[ (rcvr := selectedContext receiver) isView |
|
15413 | 6944 |
or:[ rcvr isKindOf: ApplicationModel ]] |
12840 | 6945 |
! |
6946 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6947 |
canRestart |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6948 |
^ restartButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6949 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6950 |
"Modified: / 17.11.2001 / 19:59:49 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6951 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6952 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6953 |
canReturn |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6954 |
^ returnButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6955 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6956 |
"Modified: / 17.11.2001 / 19:59:18 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6957 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6958 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6959 |
canSendEmail |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6960 |
^ SendMailTool notNil |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6961 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6962 |
"Created: / 15-10-2010 / 11:51:23 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6963 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6964 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6965 |
canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6966 |
^ canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6967 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6968 |
|
15255 | 6969 |
hasBlockContextSelected |
6970 |
^ contextView hasSelection |
|
6971 |
and:[ self selectedContext isBlockContext ] |
|
6972 |
! |
|
6973 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6974 |
hasContextSelected |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6975 |
^ contextView hasSelection |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6976 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6977 |
"Created: / 17.11.2001 / 19:57:03 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6978 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6979 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6980 |
hasHaltsToIgnore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6981 |
^ IgnoredHalts notEmptyOrNil |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6982 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6983 |
|
7823 | 6984 |
isAborting |
6985 |
^ exitAction == #abort |
|
6986 |
! |
|
6987 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6988 |
isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6989 |
^ isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6990 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6991 |
"Created: / 06-03-2012 / 12:16:56 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6992 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6993 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6994 |
isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6995 |
^ isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6996 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6997 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6998 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6999 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7000 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7001 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7002 |
selectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7003 |
|con mthd| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7004 |
|
11595 | 7005 |
(con := self selectedContext) notNil ifTrue:[ |
15413 | 7006 |
mthd := con method. |
7007 |
^ mthd notNil and:[mthd isWrapped] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7008 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7009 |
^ false. |
11595 | 7010 |
|
11610 | 7011 |
"Modified: / 19-07-2012 / 11:36:28 / cg" |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7012 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7013 |
|
7823 | 7014 |
setOfHiddenCallingSelectors |
7015 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
7016 |
! |
|
7017 |
||
7018 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
7019 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
7020 |
! ! |
|
7021 |
||
9922 | 7022 |
!DebugView methodsFor:'private-breakpoints'! |
7023 |
||
15413 | 7024 |
addIgnoredHaltForCount:countOrNil |
7025 |
orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7026 |
orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess |
|
7027 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
7028 |
forAll:aBoolean |
|
14608 | 7029 |
|
12937 | 7030 |
|haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil| |
9922 | 7031 |
|
7032 |
aBoolean ifTrue:[ |
|
15413 | 7033 |
haltingMethod := #all |
9922 | 7034 |
] ifFalse:[ |
15413 | 7035 |
haltingContext := self findHaltingContext. |
7036 |
haltingContext isNil ifTrue:[ |
|
7037 |
Transcript showCR:'no halting context found'. |
|
7038 |
^ self |
|
7039 |
]. |
|
7040 |
||
7041 |
haltingMethod := haltingContext method. |
|
7042 |
lineNrOfHalt := haltingContext lineNumber. |
|
7043 |
(lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ |
|
7044 |
Transcript showCR:'no halt lineNr found'. |
|
7045 |
^ self |
|
7046 |
]. |
|
7047 |
forThisReceiverClass ifTrue:[ |
|
7048 |
receiverClassOrNil := haltingContext receiver class |
|
7049 |
]. |
|
7050 |
forCurrentProcess ifTrue:[ |
|
7051 |
processOrNil := Processor activeProcess |
|
7052 |
]. |
|
9922 | 7053 |
]. |
7054 |
||
7055 |
self class |
|
15413 | 7056 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
7057 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7058 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
7059 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
11210 | 7060 |
|
7061 |
"Created: / 27-01-2012 / 11:31:12 / cg" |
|
9922 | 7062 |
! |
7063 |
||
7064 |
canAddBreakpoint |
|
7065 |
|m| |
|
7066 |
||
7067 |
m := contextView middleButtonMenu. |
|
7068 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
7069 |
! |
|
7070 |
||
7071 |
canRemoveBreakpoint |
|
7072 |
|m| |
|
7073 |
||
7074 |
m := contextView middleButtonMenu. |
|
7075 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
7076 |
! |
|
7077 |
||
7078 |
findHaltingContext |
|
7079 |
|haltSelectors| |
|
7080 |
||
7081 |
haltSelectors := self haltSelectors. |
|
7082 |
||
10205 | 7083 |
contextArray keysAndValuesDo:[:idx :con | |
15413 | 7084 |
|sel con2 sel2 method| |
7085 |
||
7086 |
sel := con selector. |
|
7087 |
(haltSelectors includes:sel) ifTrue:[ |
|
7088 |
(method := con method) notNil ifTrue:[ |
|
7089 |
method mclass == Object ifTrue:[ |
|
7090 |
con2 := contextArray at:idx+1. |
|
7091 |
sel2 := con2 selector. |
|
7092 |
(haltSelectors includes:sel2) ifTrue:[ |
|
7093 |
con2 method mclass == Object ifTrue:[ |
|
7094 |
^ contextArray at:idx+2. |
|
7095 |
] |
|
7096 |
]. |
|
7097 |
^ contextArray at:idx+1 |
|
7098 |
]. |
|
7099 |
method mclass == Breakpoint ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7100 |
(contextArray at:idx+1) infoPrintCR. |
15413 | 7101 |
^ contextArray at:idx+1 |
7102 |
]. |
|
7103 |
]. |
|
7104 |
]. |
|
7105 |
con method isWrapped ifTrue:[ |
|
7106 |
^ con |
|
7107 |
]. |
|
9922 | 7108 |
]. |
7109 |
^ nil |
|
7110 |
||
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7111 |
"Modified: / 27-01-2012 / 11:06:02 / cg" |
9922 | 7112 |
! |
7113 |
||
7114 |
ignoreBreakpoints |
|
7115 |
^ ignoreBreakpoints |
|
7116 |
||
7117 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
7118 |
! ! |
|
7119 |
||
7823 | 7120 |
!DebugView methodsFor:'private-cache handling'! |
7121 |
||
7122 |
cacheMyself |
|
7123 |
"remember myself for next debug session" |
|
7124 |
||
7125 |
"caching the last debugger will make the next debugger appear |
|
7126 |
faster, since no resources have to be allocated in the display. |
|
7127 |
We have to be careful to release all refs to the debuggee, though. |
|
7128 |
Otherwise, the GC will not be able to release it." |
|
7129 |
||
7130 |
windowGroup notNil ifTrue:[ |
|
15413 | 7131 |
windowGroup setProcess:nil. |
7823 | 7132 |
]. |
7133 |
||
7134 |
self releaseDebuggee. |
|
7135 |
||
7136 |
cachable ~~ true ifTrue:[^ self]. |
|
7137 |
||
7138 |
"/ |
|
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
7139 |
"/ only cache if I am on the Display (i.e. the default screen) |
7823 | 7140 |
"/ |
13965 | 7141 |
self graphicsDevice == Display ifTrue:[ |
15413 | 7142 |
exclusive ifTrue:[ |
7143 |
CachedExclusive := self |
|
7144 |
] ifFalse:[ |
|
7145 |
CachedDebugger := self |
|
7146 |
]. |
|
7823 | 7147 |
]. |
7148 |
||
7149 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
15413 | 7150 |
ObjectMemory stepInterruptHandler:nil |
7823 | 7151 |
]. |
7152 |
||
7153 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
7154 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
7155 |
! |
|
7156 |
||
7157 |
isCached |
|
13226 | 7158 |
"tell whether we are a cached debugger" |
7823 | 7159 |
|
7160 |
CachedExclusive == self ifTrue:[ |
|
15413 | 7161 |
^ true. |
7823 | 7162 |
]. |
7163 |
CachedDebugger == self ifTrue:[ |
|
15413 | 7164 |
^ true. |
7823 | 7165 |
]. |
7166 |
||
7167 |
^ false. |
|
7168 |
||
13226 | 7169 |
"Created: / 10-07-1997 / 15:22:43 / stefan" |
7170 |
"Modified (comment): / 27-07-2013 / 15:38:47 / cg" |
|
7823 | 7171 |
! |
7172 |
||
7173 |
uncacheMyself |
|
7174 |
"do not remember myself any longer for next debug session" |
|
7175 |
||
7176 |
cachable := false. |
|
7177 |
||
7178 |
CachedExclusive == self ifTrue:[ |
|
15413 | 7179 |
CachedExclusive := nil. |
7823 | 7180 |
]. |
7181 |
CachedDebugger == self ifTrue:[ |
|
15413 | 7182 |
CachedDebugger := nil. |
7823 | 7183 |
]. |
7184 |
OpenDebuggers notNil ifTrue:[ |
|
15413 | 7185 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 7186 |
]. |
7187 |
||
7188 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
7189 |
! ! |
|
7190 |
||
10628 | 7191 |
!DebugView methodsFor:'private-code view'! |
7192 |
||
7193 |
codeAspect |
|
11704 | 7194 |
^ SyntaxHighlighter codeAspectMethod |
10628 | 7195 |
|
7196 |
"Created: / 27-07-2011 / 13:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11704 | 7197 |
"Modified: / 27-07-2012 / 22:20:27 / cg" |
10628 | 7198 |
! ! |
7199 |
||
7823 | 7200 |
!DebugView methodsFor:'private-context handling'! |
7201 |
||
11391 | 7202 |
contextListEntryFor:aContext |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7203 |
^ Error |
15413 | 7204 |
handle:[:ex | '???' ] |
7205 |
do:[ |
|
7206 |
|s| |
|
7207 |
||
7208 |
aContext selector == #doIt ifTrue:[ |
|
7209 |
aContext receiver isNil ifTrue:[ |
|
7210 |
s := 'doIt' allBold |
|
7211 |
] |
|
7212 |
]. |
|
7213 |
||
7214 |
s := Text streamContents:[:s | aContext printOn:s ]. |
|
7215 |
RememberedCallChain notNil ifTrue:[ |
|
7216 |
(RememberedCallChain includesIdentical:aContext) ifTrue:[ |
|
7217 |
s := s colorizeAllWith:(Color red). |
|
7218 |
]. |
|
7219 |
]. |
|
7220 |
s |
|
7221 |
]. |
|
11391 | 7222 |
|
7223 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
7224 |
! |
|
7225 |
||
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7226 |
is:aHomeContext inCallingChainOf:aContext |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7227 |
|con| |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7228 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7229 |
con := aContext. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7230 |
[con notNil and:[con ~~ aHomeContext]] whileTrue:[ |
15413 | 7231 |
con := con sender |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7232 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7233 |
^ con notNil |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7234 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7235 |
"Created: / 10-06-2012 / 18:46:29 / cg" |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7236 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7237 |
|
11890 | 7238 |
isEnteredDueToBreakpointOrHalt |
7239 |
"see if we came here due to a step interrupt" |
|
7240 |
||
7241 |
|c cReceiver| |
|
7242 |
||
7243 |
"/ look for a breakpoint-wrapper's context |
|
7244 |
c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil. |
|
7245 |
c isNil ifTrue:[ |
|
15413 | 7246 |
^ true. |
11890 | 7247 |
]. |
7248 |
cReceiver := c receiver. |
|
7249 |
^ cReceiver == BreakPointInterrupt |
|
13293 | 7250 |
|
7251 |
"Modified: / 01-08-2013 / 23:34:01 / cg" |
|
11890 | 7252 |
! |
7253 |
||
7254 |
isHaltToBeIgnored |
|
7255 |
"see if the current halt (if any) is in the ignore-list" |
|
7256 |
||
13059 | 7257 |
|c cReceiver sender haltingMethod lineNrInHaltingMethod breakpointParameter |
7258 |
sReceiver| |
|
11890 | 7259 |
|
7260 |
"/ should a halt be ignored ? |
|
7261 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
7262 |
||
13059 | 7263 |
"/ look for a method breakpoint-wrapper's context |
11890 | 7264 |
c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
7265 |
c notNil ifTrue:[ |
|
15413 | 7266 |
((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[ |
7267 |
c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
|
7268 |
cReceiver := c receiver. |
|
7269 |
]. |
|
7270 |
(cReceiver isKindOf:BreakPointInterrupt) ifFalse:[ |
|
7271 |
c := nil |
|
7272 |
] ifTrue:[ |
|
7273 |
[ |
|
7274 |
sender := c sender. |
|
7275 |
((sReceiver := sender receiver) isKindOf:BreakPointInterrupt) |
|
7276 |
or:[ sReceiver == BreakPointInterrupt ] |
|
7277 |
] whileTrue:[ |
|
7278 |
c := sender |
|
7279 |
]. |
|
7280 |
[ (sender := c sender) isBlockContext ] whileTrue:[ |
|
7281 |
c := sender |
|
7282 |
]. |
|
7283 |
sender := nil. "/ avoid keeping a reference to this context |
|
7284 |
]. |
|
11890 | 7285 |
]. |
14993 | 7286 |
"/ Transcript showCR:c. |
11890 | 7287 |
c isNil ifTrue:[ |
15413 | 7288 |
"/ look for halts or explicit breakpoints |
7289 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
7290 |
c isNil ifTrue:[ |
|
7291 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
7292 |
c isNil ifTrue:[ |
|
7293 |
^ false |
|
7294 |
]. |
|
7295 |
breakpointParameter := c argAt:1. |
|
7296 |
(self class |
|
7297 |
isBreakpointToBeIgnoredForParameter:breakpointParameter |
|
7298 |
context:(c sender) |
|
7299 |
modifyEntryCount:true |
|
7300 |
) ifTrue:[ |
|
7301 |
^ true. |
|
7302 |
]. |
|
7303 |
]. |
|
11890 | 7304 |
]. |
7305 |
||
7306 |
c := c sender. |
|
7307 |
"/ a code-breakpoint ? |
|
7308 |
(c receiver isKindOf:Breakpoint) ifTrue:[ |
|
15413 | 7309 |
c := c sender. |
11890 | 7310 |
]. |
7311 |
haltingMethod := c method. |
|
7312 |
||
7313 |
haltingMethod isWrapped ifTrue:[ |
|
15413 | 7314 |
lineNrInHaltingMethod := 1. |
11890 | 7315 |
] ifFalse:[ |
15413 | 7316 |
lineNrInHaltingMethod := c lineNumber. |
7317 |
"/ Transcript showCR:c. |
|
11890 | 7318 |
]. |
7319 |
||
12562 | 7320 |
^ self class |
15413 | 7321 |
isHaltToBeIgnoredIn:haltingMethod |
7322 |
atLineNr:lineNrInHaltingMethod |
|
7323 |
context:c |
|
7324 |
modifyEntryCount:true. |
|
11890 | 7325 |
|
7326 |
"Created: / 22-10-2010 / 12:09:53 / cg" |
|
7327 |
"Modified: / 06-03-2012 / 12:54:09 / cg" |
|
7328 |
! |
|
7329 |
||
266 | 7330 |
setContext:aContext |
7331 |
"show calling chain from aContext in the walk-back listview" |
|
7332 |
||
641 | 7333 |
^ 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
|
7334 |
|
641 | 7335 |
"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
|
7336 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7337 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7338 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
7339 |
"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
|
7340 |
Most complications here arise from filtering less-interesting contexts |
15256 | 7341 |
if not in verbose-context mode or when hiding implementation contexts. |
15413 | 7342 |
There is a lot of heuristic magic here, to make the debugger as useful |
15256 | 7343 |
as possible for the user (but not particularly for the debugger-developer)" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7344 |
|
14531 | 7345 |
|con sel text method caller caller2 called called2 m count c cc sndr |
14523 | 7346 |
suspendContext calledBySuspendContext nm h calledContext show2 |
15257 | 7347 |
alreadyInApplicationCode verboseBacktrace| |
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7348 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7349 |
"/ (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7350 |
"/ "no change" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7351 |
"/ ^ false |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7352 |
"/ ]. |
266 | 7353 |
|
14523 | 7354 |
isStoppedAtHaltOrBreakPoint := isStoppedAtBreakPointWithParameter := false. |
7355 |
isStoppedInModalDialog := isStoppedInApplicationAction := alreadyInApplicationCode := false. |
|
14531 | 7356 |
isStoppedAtStatementBreakpoint := false. |
939 | 7357 |
firstContext := aContext. |
15257 | 7358 |
verboseBacktrace := self verboseBacktraceHolder value. |
939 | 7359 |
|
266 | 7360 |
m := contextView middleButtonMenu. |
7361 |
m notNil ifTrue:[ |
|
15497 | 7362 |
m disable:#showMore. |
266 | 7363 |
]. |
3269 | 7364 |
canShowMore := false. |
266 | 7365 |
|
7366 |
aContext isNil ifTrue:[ |
|
15497 | 7367 |
text := Array with:'** no context **'. |
7368 |
contextArray := nil. |
|
266 | 7369 |
] ifFalse:[ |
15497 | 7370 |
text := OrderedCollection new:nChainShown. |
7371 |
contextArray := OrderedCollection new:nChainShown. |
|
7372 |
||
7373 |
con := aContext. |
|
7374 |
calledContext := nil. |
|
7375 |
||
7376 |
DebuggingContextWalk == true ifTrue:[ |
|
7377 |
'======================================' print. con printCR. |
|
7378 |
]. |
|
7379 |
alreadyInApplicationCode := |
|
7380 |
con receiver isLazyValue not "/ careful to not force futures/lazy values |
|
7381 |
and:[con receiver isKindOf:ApplicationModel]. |
|
7382 |
||
7383 |
verboseBacktrace ~~ true ifTrue:[ |
|
7384 |
"/ with dense backtrace, hide the ProcessorScheduler |
|
7385 |
"/ contexts at the top; look for a Process>>suspend* |
|
7386 |
"/ context within the first 10 contexts |
|
7387 |
||
7388 |
suspendContext := nil. |
|
7389 |
c := con. |
|
7390 |
1 to:10 do:[:i | |
|
7391 |
|selector| |
|
7392 |
||
7393 |
c notNil ifTrue:[ |
|
7394 |
selector := c selector. |
|
7395 |
selector notNil ifTrue:[ |
|
7396 |
(selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[ |
|
7397 |
suspendContext := c. |
|
7398 |
calledBySuspendContext := cc. |
|
7399 |
]. |
|
7400 |
]. |
|
7401 |
cc := c. |
|
7402 |
c := c sender. |
|
7403 |
] |
|
7404 |
]. |
|
7405 |
suspendContext notNil ifTrue:[ |
|
7406 |
con := suspendContext. |
|
7407 |
calledContext := calledBySuspendContext. |
|
7408 |
suspendContext := nil |
|
7409 |
]. |
|
7410 |
]. |
|
7411 |
"/ Transcript show:'1 '; showCR:con. |
|
7412 |
con notNil ifTrue:[ |
|
7413 |
"/ hide the halt implementation |
|
7414 |
sel := con selector. |
|
7415 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7416 |
(method := con method) notNil ifTrue:[ |
|
7417 |
method mclass == Object ifTrue:[ |
|
7418 |
(sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[ |
|
7419 |
isStoppedAtBreakPointWithParameter := true. |
|
7420 |
breakPointParameter := con argAt:1. |
|
7421 |
]. |
|
7422 |
isStoppedAtHaltOrBreakPoint := true. |
|
7423 |
verboseBacktrace ~~ true ifTrue:[ |
|
7424 |
calledContext := con. |
|
7425 |
con := con sender. |
|
7426 |
] |
|
7427 |
] ifFalse:[ |
|
7428 |
method mclass == Breakpoint ifTrue:[ |
|
7429 |
isStoppedAtHaltOrBreakPoint := true. |
|
7430 |
isStoppedAtStatementBreakpoint := true. |
|
7431 |
verboseBacktrace ~~ true ifTrue:[ |
|
7432 |
calledContext := con. |
|
7433 |
con := con sender. |
|
7434 |
]. |
|
7435 |
"/ Transcript show:'2 '; showCR:con. |
|
7436 |
]. |
|
7437 |
]. |
|
7438 |
]. |
|
7439 |
]. |
|
7440 |
]. |
|
7441 |
||
7442 |
(verboseBacktrace not or:[ hideSupportCode]) ifTrue:[ |
|
7443 |
[ |
|
7444 |
con notNil |
|
7445 |
and:[ con isBlockContext not |
|
7446 |
and:[ con method notNil |
|
7447 |
and:[ (con method shouldBeSkippedInDebuggersWalkBack) |
|
7448 |
and:[ (self haltSelectors includes: con selector) not]]]] |
|
7449 |
] whileTrue:[ |
|
7450 |
"/ Transcript show:'xx '; showCR:con. |
|
7451 |
calledContext := con. |
|
7452 |
con := con sender |
|
7453 |
]. |
|
7454 |
]. |
|
7455 |
||
7456 |
" |
|
7457 |
get them all, by walking along the caller chain. |
|
7458 |
depending on the settings, skip some intermediate contexts |
|
7459 |
(such as collection enumeration implementations), which are usually not |
|
7460 |
of interest when debugging an application. |
|
7461 |
On the fly, gather some additional information |
|
7462 |
such as: are we at a halt/breakpoint, are we in a modal dialog opened, |
|
7463 |
are we coming from an application model's action etc. |
|
7464 |
" |
|
7465 |
count := 0. |
|
7466 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
|
7467 |
"/ remember any halt/breakpoint or openModal on the fly |
|
7468 |
DebuggingContextWalk == true ifTrue:[ '---' print. con printCR ]. |
|
7469 |
||
7470 |
sel := con selector. |
|
7471 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7472 |
(method := con method) notNil ifTrue:[ |
|
7473 |
method mclass == Object ifTrue:[ |
|
7474 |
(sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[ |
|
7475 |
isStoppedAtBreakPointWithParameter := true. |
|
7476 |
breakPointParameter := con argAt:1. |
|
7477 |
]. |
|
7478 |
isStoppedAtHaltOrBreakPoint := true. |
|
7479 |
] ifFalse:[ |
|
7480 |
method mclass == Breakpoint ifTrue:[ |
|
7481 |
isStoppedAtHaltOrBreakPoint := true. |
|
7482 |
]. |
|
7483 |
] |
|
7484 |
] |
|
7485 |
] ifFalse:[ |
|
7486 |
((sel == #openModal) or:[sel == #openModal:]) ifTrue:[ |
|
7487 |
isStoppedInModalDialog := true. |
|
7488 |
] ifFalse:[ |
|
7489 |
alreadyInApplicationCode ifFalse:[ |
|
7490 |
(con receiver isLazyValue not "/ careful to not force futures/lazy values |
|
7491 |
and:[con receiver isKindOf:ApplicationModel]) ifTrue:[ |
|
7492 |
isStoppedInApplicationAction := true. |
|
7493 |
] |
|
7494 |
] |
|
7495 |
] |
|
7496 |
]. |
|
7497 |
||
7498 |
[ |
|
7499 |
|show1| |
|
7500 |
||
7501 |
show1 := self showingContext1:con calling:calledContext. |
|
7502 |
DebuggingDebugger3 == true ifTrue:[ |
|
7503 |
'showingContext1: (' print. con print. ') --> ' print. show1 printCR. |
|
7504 |
]. |
|
7505 |
show1 |
|
7506 |
] whileFalse:[ |
|
7507 |
calledContext := con. |
|
7508 |
con := con sender. |
|
7509 |
]. |
|
7510 |
||
7511 |
show2 := self showingContext2:con nesting:count. |
|
7512 |
DebuggingDebugger3 == true ifTrue:[ |
|
7513 |
'showingContext2: (' print. con print. ') --> ' print. show2 printCR. |
|
7514 |
]. |
|
7515 |
||
7516 |
show2 ifTrue:[ |
|
7517 |
contextArray add:con. |
|
7518 |
||
7519 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
7520 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
7521 |
] ifFalse:[ |
|
7522 |
nm := self contextListEntryFor:con. |
|
7523 |
]. |
|
7524 |
text add:nm. |
|
7525 |
count := count + 1. |
|
7526 |
]. |
|
7527 |
||
7528 |
"/ with hidden support code, skip over internals of exceptions |
|
7529 |
hideSupportCode == true ifTrue:[ |
|
7530 |
"/ Transcript showCR:'x'. |
|
7531 |
(con isBlockContext |
|
7532 |
and:[ (h := con home) notNil |
|
7533 |
and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[ |
|
7534 |
|blocksReceiver| |
|
7535 |
blocksReceiver := con receiver. |
|
7536 |
c := con sender. |
|
7537 |
[ |
|
7538 |
c notNil |
|
7539 |
and:[ |
|
7540 |
sndr := c sender. |
|
7541 |
(sndr ~= h) |
|
7542 |
and:[ |
|
7543 |
blocksReceiver isCollection "/ skip collection implementations |
|
7544 |
or:[ ( #( #'handle:do:' "/ skip exception implementations |
|
7545 |
#'handleDo:' |
|
7546 |
#'answer:do:' |
|
7547 |
#'ensure:' ) includes: c selector ) |
|
7548 |
or:[ #'perform:*' "/ skip perform implementations |
|
7549 |
match: c selector ]] |
|
7550 |
] |
|
7551 |
] |
|
7552 |
] whileTrue:[ |
|
7553 |
c := sndr |
|
7554 |
]. |
|
7555 |
c notNil ifTrue:[ |
|
7556 |
con := c "sender". |
|
7557 |
]. |
|
7558 |
]. |
|
7559 |
]. |
|
7560 |
||
7561 |
"/ |
|
7562 |
"/ kludge: if it's a wrapped method, then hide the wrap-call |
|
7563 |
"/ |
|
7564 |
method := con method. |
|
7565 |
method notNil ifTrue:[ |
|
7566 |
called := con. |
|
7567 |
caller := con sender. |
|
7568 |
(caller notNil and:[caller receiver == method]) ifTrue:[ |
|
7569 |
called2 := caller. |
|
7570 |
caller2 := caller sender. |
|
7571 |
caller2 notNil ifTrue:[ |
|
7572 |
(caller2 method isWrapped |
|
7573 |
and:[ caller2 method originalMethod == method ]) ifTrue:[ |
|
7574 |
calledContext := called2. |
|
7575 |
con := caller2 |
|
7576 |
]. |
|
7577 |
]. |
|
7578 |
||
7579 |
]. |
|
7580 |
caller := caller2 := nil |
|
7581 |
]. |
|
7582 |
||
7583 |
"/ with dense backtrace, skip the doIt method's context |
|
7584 |
"/ (its dummy anyway) and fake that context's name |
|
7585 |
||
7586 |
verboseBacktrace ~~ true ifTrue:[ |
|
7587 |
(con isBlockContext |
|
7588 |
and:[(h := con home) == con sender |
|
7589 |
and:[h notNil |
|
7590 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
|
7591 |
and:[h method who isNil]]]]) ifTrue:[ |
|
7592 |
calledContext := con. |
|
7593 |
con := con sender. |
|
7594 |
text removeLast. |
|
7595 |
||
7596 |
text add:(self contextListEntryFor:con methodHome). |
|
7597 |
]. |
|
7598 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
|
7599 |
]. |
|
7600 |
||
7601 |
"/ with dense backtrace, don't show contexts below the doIt |
|
7602 |
( verboseBacktrace ~~ true |
|
7603 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
|
7604 |
con := nil. |
|
7605 |
] ifFalse:[ |
|
7606 |
calledContext := con. |
|
7607 |
con := con sender |
|
7608 |
]. |
|
7609 |
]. |
|
7610 |
||
7611 |
" |
|
7612 |
did we reach the end ? |
|
7613 |
" |
|
7614 |
(con isNil or:[con sender isNil]) ifTrue:[ |
|
7615 |
||
7616 |
"/ the very last one is the startup context |
|
7617 |
"/ (in main) - it has nil as receiver and nil as selector |
|
7618 |
||
7619 |
(contextArray notEmpty |
|
7620 |
and:[contextArray last selector isNil]) ifTrue:[ |
|
7621 |
contextArray removeLast. |
|
7622 |
text removeLast |
|
7623 |
]. |
|
7624 |
||
7625 |
verboseBacktrace ~~ true ifTrue:[ |
|
7626 |
"/ in dense mode, remove process startup contexts (if any) |
|
7627 |
||
7628 |
(contextArray size > 0 |
|
7629 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
7630 |
con selector == #start ifTrue:[ |
|
7631 |
contextArray removeLast. |
|
7632 |
text removeLast. |
|
7633 |
||
7634 |
[contextArray size > 0 |
|
7635 |
and:[contextArray last methodHome == con]] whileTrue:[ |
|
7636 |
contextArray removeLast. |
|
7637 |
text removeLast. |
|
7638 |
] |
|
7639 |
] |
|
7640 |
] |
|
7641 |
] |
|
7642 |
] ifFalse:[ |
|
7643 |
m notNil ifTrue:[ |
|
7644 |
m enable:#showMore. |
|
7645 |
]. |
|
7646 |
canShowMore := true. |
|
7647 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
|
7648 |
]. |
|
266 | 7649 |
]. |
7650 |
||
7651 |
contextView setList:text. |
|
944 | 7652 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7653 |
releaseInspectors ifTrue:[ |
15497 | 7654 |
receiverInspector release. |
7655 |
contextInspector release. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7656 |
]. |
266 | 7657 |
|
7658 |
m notNil ifTrue:[ |
|
15497 | 7659 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 7660 |
]. |
3511 | 7661 |
self updateMenuItems. |
266 | 7662 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7663 |
|
7797 | 7664 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7665 |
"Modified: / 27-07-2012 / 15:10:53 / cg" |
266 | 7666 |
! |
7667 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7668 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7669 |
"show calling chain from aContext in the walk-back listview. |
1213 | 7670 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7671 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7672 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7673 |
|
8152 | 7674 |
con := aContext. |
15257 | 7675 |
self verboseBacktraceHolder value ifFalse:[ |
15413 | 7676 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
7677 |
con := con sender. |
|
7678 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
7679 |
con := con sender. |
|
7680 |
]. |
|
7681 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7682 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7683 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7684 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7685 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7686 |
"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
|
7687 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7688 |
|
3447 | 7689 |
showingContext1:aContext calling:calledContext |
7823 | 7690 |
"return false, if this (top) context is to be skipped. |
10205 | 7691 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 7692 |
the set of methods which are suppressed is my (claus's) own choice." |
7693 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7694 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 7695 |
|
15257 | 7696 |
self verboseBacktraceHolder value ifTrue:[ ^true ]. |
3447 | 7697 |
aContext isNil ifTrue:[ ^true ]. |
7698 |
||
7699 |
sel := aContext selector. |
|
7700 |
rec := aContext receiver. |
|
7701 |
mthd := aContext method. |
|
7702 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
7703 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7704 |
"/ to avoid firing/waiting the lazy or future |
10205 | 7705 |
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
|
7706 |
aContext sender notNil ifTrue:[ |
15413 | 7707 |
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
|
7708 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7709 |
|
11636 | 7710 |
DebuggingDebugger3 == true ifTrue:[ |
15413 | 7711 |
'showingContext1: (' print. aContext print. |
7712 |
') calling: (' print. calledContext print. |
|
7713 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7714 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7715 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7716 |
(#(doCallHandler: doRaise |
3447 | 7717 |
) includes:sel) |
15413 | 7718 |
ifTrue:[ |
7719 |
recIsException ifTrue:[ ^ false]. |
|
7720 |
]. |
|
3447 | 7721 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7722 |
(#(raise raiseRequest |
3447 | 7723 |
) includes:sel) |
15413 | 7724 |
ifTrue:[ |
7725 |
recIsException ifTrue:[ |
|
7726 |
(senderRec isLazyValue not |
|
7727 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
7728 |
]. |
|
7729 |
]. |
|
3447 | 7730 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7731 |
(#(doWhile: |
3447 | 7732 |
) includes:sel) |
15413 | 7733 |
ifTrue:[ |
7734 |
rec isBlock ifTrue:[ |
|
7735 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
7736 |
]. |
|
7737 |
]. |
|
3447 | 7738 |
|
8620 | 7739 |
calledContext notNil ifTrue:[ |
15413 | 7740 |
calledSel := calledContext selector. |
7741 |
calledRec := calledContext receiver. |
|
7742 |
||
7743 |
calledRec isBlock ifTrue:[ |
|
7744 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
7745 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
7746 |
]. |
|
7747 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
7748 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8620 | 7749 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7750 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7751 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7752 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7753 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7754 |
"/ |
10205 | 7755 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7756 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7757 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7758 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7759 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7760 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7761 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7762 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7763 |
"/ ]. |
8620 | 7764 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7765 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7766 |
(#(handleDo:) includes:sel) |
15413 | 7767 |
ifTrue:[ |
7768 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
7769 |
]. |
|
10205 | 7770 |
(#( |
15413 | 7771 |
withCursor:do: |
7772 |
withWaitCursorDo: |
|
7773 |
withReadCursorDo: |
|
7774 |
withWriteCursorDo: |
|
7775 |
withSearchCursorDo: |
|
3447 | 7776 |
) includes:sel) |
15413 | 7777 |
ifTrue:[ |
7778 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
7779 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
7780 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
7781 |
]. |
|
10205 | 7782 |
|
7783 |
(#( |
|
15413 | 7784 |
wait |
7785 |
waitWithTimeout: |
|
7786 |
waitWithTimeoutMs: |
|
3447 | 7787 |
) includes:sel) |
15413 | 7788 |
ifTrue:[ |
7789 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
7790 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
7791 |
]. |
|
3447 | 7792 |
|
7793 |
^ true |
|
7794 |
||
9662 | 7795 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
11696 | 7796 |
"Modified: / 27-07-2012 / 17:30:18 / cg" |
3447 | 7797 |
! |
7798 |
||
7799 |
showingContext2:aContext nesting:nesting |
|
7823 | 7800 |
"return false, if this (intermediate) context is to be skipped. |
13455 | 7801 |
Here, we hide some well known methods, which are usually not too interesting; |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7802 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 7803 |
|
10205 | 7804 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7805 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7806 |
|
15257 | 7807 |
self verboseBacktraceHolder value ifTrue:[^ true]. |
3447 | 7808 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7809 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7810 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7811 |
sel := aContext selector. |
939 | 7812 |
mClass := aContext methodClass. |
7813 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7814 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7815 |
sender notNil ifTrue:[ |
15413 | 7816 |
senderSelector := sender selector. |
7817 |
senderReceiver := sender receiver. |
|
7818 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7819 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7820 |
|
939 | 7821 |
sel == #withCursor:do: ifTrue:[ |
15413 | 7822 |
(mClass == WindowGroup) ifTrue:[^ false]. |
7823 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 7824 |
]. |
7825 |
(sel == #withExecuteCursorDo: |
|
7826 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
15413 | 7827 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 7828 |
]. |
7829 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
7830 |
(sel == #do: |
6600 | 7831 |
or:[sel == #from:to:do: |
6601 | 7832 |
or:[sel == #keysAndValuesDo: |
7833 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
15413 | 7834 |
mClass == Array ifTrue:[^ false]. |
7835 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
7836 |
mClass == Set ifTrue:[^ false]. |
|
7837 |
mClass == Dictionary ifTrue:[^ false]. |
|
7838 |
mClass == Interval ifTrue:[^ false]. |
|
10205 | 7839 |
]. |
7840 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7841 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7842 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7843 |
or:[sel == #perform:with:with:with: |
11696 | 7844 |
or:[sel == #perform:with:with:with:with: |
7845 |
or:[sel == #perform:withArguments: |
|
7846 |
or:[sel == #perform:with:ifNotUnderstood: |
|
7847 |
or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]) |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7848 |
ifTrue:[ |
15413 | 7849 |
hideSupportCode == true ifTrue:[ |
7850 |
"/ 'x' printCR. |
|
7851 |
mClass == Object ifTrue:[^ false] |
|
7852 |
]. |
|
7853 |
nesting == 0 ifTrue:[^ true]. |
|
7854 |
mClass == Array ifTrue:[^ false]. |
|
7855 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7856 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7857 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7858 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7859 |
|
939 | 7860 |
(mClass == Object) ifTrue:[ |
15413 | 7861 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 7862 |
]. |
7863 |
||
7864 |
(mClass == Method) ifTrue:[ |
|
15413 | 7865 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 7866 |
]. |
7867 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
7868 |
(mClass == SmallInteger) ifTrue:[ |
15413 | 7869 |
(sel == #to:do:) ifTrue:[^ false]. |
7870 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
7871 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
7872 |
|
939 | 7873 |
(mClass == Block) ifTrue:[ |
15413 | 7874 |
sel == #ensure: ifTrue:[^ false]. |
7875 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
7876 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
7877 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
7878 |
sel == #on:do: ifTrue:[^ false]. |
|
7879 |
||
7880 |
sel == #value ifTrue:[^ false]. |
|
7881 |
sel == #value: ifTrue:[^ false]. |
|
7882 |
sel == #value:value: ifTrue:[^ false]. |
|
7883 |
sel == #value:value:value: ifTrue:[^ false]. |
|
7884 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
7885 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
7886 |
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
|
7887 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7888 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7889 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7890 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7891 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7892 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7893 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7894 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7895 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7896 |
"/ 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
|
7897 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7898 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7899 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7900 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7901 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7902 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7903 |
|
15413 | 7904 |
aContext home notNil ifTrue:[ |
7905 |
aContext home receiver isLazyValue ifFalse:[ |
|
7906 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
|
7907 |
(aContext home selector == #wait) ifTrue:[^ false]. |
|
7908 |
(aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
7909 |
] |
|
7910 |
] |
|
7911 |
] |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7912 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7913 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7914 |
(rec isExceptionHandler) ifTrue:[ |
15413 | 7915 |
sel == #handle:do: ifTrue:[^ false]. |
7916 |
sel == #handleDo: ifTrue:[^ false]. |
|
7917 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
7918 |
sel == #answer:do: ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
7919 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7920 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
15413 | 7921 |
sel == #doRaise ifTrue:[^ false]. |
7922 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
7923 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
7924 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
7925 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7926 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7927 |
(mClass == Context) ifTrue:[ |
15413 | 7928 |
sel == #unwind ifTrue:[^ false]. |
7929 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7930 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7931 |
(mClass == ProcessorScheduler) ifTrue:[ |
15413 | 7932 |
sel == #interruptActive ifTrue:[^ false]. |
7933 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
7934 |
sel == #suspend: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7935 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7936 |
mClass == Process ifTrue:[ |
15413 | 7937 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
7938 |
]. |
15256 | 7939 |
(sel == #break) ifTrue:[ |
15413 | 7940 |
(mClass == Breakpoint) ifTrue:[^ false]. |
15256 | 7941 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7942 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
7943 |
|
9662 | 7944 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
11696 | 7945 |
"Modified: / 27-07-2012 / 17:26:54 / cg" |
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
7946 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
7947 |
|
4859 | 7948 |
!DebugView methodsFor:'private-control loop'! |
266 | 7949 |
|
7950 |
controlLoop |
|
7951 |
"this is a kludge: |
|
15413 | 7952 |
start a dispatchloop which exits when |
7953 |
either continue, return or step is pressed |
|
266 | 7954 |
" |
7955 |
||
7956 |
haveControl := true. |
|
664 | 7957 |
[ |
15413 | 7958 |
[haveControl] whileTrue:[ |
13388 | 7959 |
AbortOperationRequest handle:[:ex | |
7960 |
] do:[ |
|
15413 | 7961 |
self controlLoopCatchingErrors |
13388 | 7962 |
] |
15413 | 7963 |
]. |
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
7964 |
] ensure:[ |
15413 | 7965 |
catchBlock := nil. |
7966 |
haveControl := false |
|
266 | 7967 |
]. |
664 | 7968 |
|
7969 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 7970 |
! |
7971 |
||
7972 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
7973 |
"this is the debuggers own private event handling loop; |
1187 | 7974 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
7975 |
|
266 | 7976 |
"setup a self removing catch-block" |
7977 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
7978 |
||
7979 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
15413 | 7980 |
"if we do not have multiple processes or its a system process |
7981 |
we start another dispatch loop, which exits when |
|
7982 |
either continue, return or step is pressed |
|
7983 |
or (via the catchBlock) if an error occurs. |
|
7984 |
Since our display is an extra exclusive one, |
|
7985 |
all processing for normal views stops here ... |
|
7986 |
" |
|
7987 |
||
7988 |
WindowGroup setActiveGroup:windowGroup. |
|
7989 |
SignalSet anySignal handle:[:ex | |
|
7990 |
|signal| |
|
7991 |
||
7992 |
signal := ex creator. |
|
7993 |
(UserInterruptSignal accepts:signal) ifTrue:[ |
|
14835 | 7994 |
Transcript showCR:'UserInterruptSignal'. |
15413 | 7995 |
self topView raiseDeiconified. |
7996 |
ex proceed. |
|
7997 |
]. |
|
7998 |
||
7999 |
(UserNotification accepts:signal) ifTrue:[ |
|
11890 | 8000 |
Transcript showCR:'UserNotification'. |
15413 | 8001 |
(signal ~~ ActivityNotificationSignal) ifTrue:[ |
8002 |
self showError:ex description. |
|
8003 |
]. |
|
8004 |
ex proceed. |
|
8005 |
]. |
|
8006 |
(HaltInterrupt accepts:signal) ifTrue:[ |
|
11890 | 8007 |
Transcript showCR:'HaltInterrupt'. |
15413 | 8008 |
Transcript showCR:'Halt/Break in debugger ignored'. |
8009 |
self topView raiseDeiconified. |
|
8010 |
ex proceed. |
|
8011 |
]. |
|
8012 |
||
8013 |
self showError:'*** Error in modal debugger: |
|
266 | 8014 |
|
334 | 8015 |
>>>> Signal: ' , signal printString , ' |
266 | 8016 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8017 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8018 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8019 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8020 |
>>>> : ' , 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
|
8021 |
>>>> : ' , 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
|
8022 |
>>>> : ' , 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
|
8023 |
>>>> : ' , 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
|
8024 |
>>>> : ' , 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
|
8025 |
>>>> : ' , 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
|
8026 |
>>>> : ' , 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
|
8027 |
>>>> : ' , 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
|
8028 |
>>>> : ' , 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
|
8029 |
>>>> : ' , 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
|
8030 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 8031 |
>>>> Message: ' , ex description , ' |
266 | 8032 |
|
1187 | 8033 |
caught & ignored.'. |
15413 | 8034 |
ex return. |
8035 |
] do:[ |
|
11890 | 8036 |
"/ UserNotification handle:[:ex | |
8037 |
"/ (ex signal == ActivityNotificationSignal) ifTrue:[ |
|
8038 |
"/ ex proceed |
|
8039 |
"/ ]. |
|
8040 |
"/ self showError:ex description. |
|
8041 |
"/ ex proceed. |
|
8042 |
"/ ] do:[ |
|
15413 | 8043 |
self graphicsDevice |
8044 |
dispatchModalWhile:[ |
|
8045 |
Processor activeProcess state:#debug. |
|
8046 |
haveControl]. |
|
11890 | 8047 |
"/ ] |
15413 | 8048 |
]. |
8049 |
WindowGroup setActiveGroup:nil. |
|
266 | 8050 |
] ifFalse:[ |
15413 | 8051 |
"we do have multiple processes - |
8052 |
simply enter the DebugViews-Windowgroup event loop. |
|
8053 |
effectively suspending event processing for the currently |
|
8054 |
active group. |
|
8055 |
" |
|
8056 |
SignalSet anySignal handle:[:ex | |
|
8057 |
|answer signal eMsg| |
|
8058 |
||
8059 |
signal := ex creator. |
|
8060 |
||
8061 |
DebuggingDebugger ~~ true ifTrue:[ |
|
8062 |
(signal == ActivityNotification) ifTrue:[ |
|
8063 |
ex proceed |
|
8064 |
]. |
|
8065 |
"/ |
|
8066 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
8067 |
"/ |
|
8068 |
ex catchInDebugger ifTrue:[ |
|
8069 |
'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR. |
|
8070 |
self destroy. |
|
8071 |
ex reject |
|
8072 |
]. |
|
8073 |
||
8074 |
"/ |
|
8075 |
"/ ignore recursive breakpoints |
|
8076 |
"/ |
|
8077 |
(signal isControlInterrupt) ifTrue:[ |
|
8078 |
ignoreBreakpoints == true ifTrue:[ |
|
8079 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
8080 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
8081 |
self topView raiseDeiconified. |
|
8082 |
ex proceed |
|
8083 |
]. |
|
8084 |
]. |
|
8085 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
8086 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
8087 |
answer := Dialog |
|
8088 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
8089 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
8090 |
values:#( #proceed #close ) |
|
8091 |
default:#close. |
|
8092 |
answer == #close ifTrue:[ |
|
8093 |
self destroy. |
|
8094 |
ex reject |
|
8095 |
]. |
|
8096 |
ex return. |
|
8097 |
]. |
|
8098 |
signal == RecursiveExceptionError ifTrue:[ |
|
8099 |
(ex exception creator == BreakPointInterrupt) |
|
8100 |
ifTrue:[ |
|
8101 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
8102 |
ex proceed. |
|
8103 |
]. |
|
8104 |
||
8105 |
self showError:'*** Recursive error in debugger: |
|
266 | 8106 |
|
12687
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8107 |
>>>> Signal: ' , ex creator printString , ' |
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8108 |
>>>> ' , ex parameter creator printString , ' |
266 | 8109 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8110 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8111 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8112 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8113 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 8114 |
>>>> Message: ' , ex description , ' |
266 | 8115 |
|
1187 | 8116 |
caught & ignored.'. |
15413 | 8117 |
ex return |
8118 |
]. |
|
8119 |
]. |
|
8120 |
||
8121 |
self topView raiseDeiconified. |
|
8122 |
||
8123 |
eMsg := ex description. |
|
8124 |
(signal isControlInterrupt) ifTrue:[ |
|
8125 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
8126 |
]. |
|
8127 |
Dialog aboutToOpenBoxNotificationSignal |
|
8128 |
handle:[:ex | ex proceed ] |
|
8129 |
do:[ |
|
8130 |
answer := Dialog |
|
8131 |
choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
|
8132 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
8133 |
values:#( #proceed #cancel #debug ) |
|
8134 |
default:#cancel. |
|
8135 |
]. |
|
8136 |
answer == #debug ifTrue:[ |
|
8137 |
'DebugView [info]: caught exception - debugging' infoPrintCR. |
|
8138 |
Debugger |
|
8139 |
enterUnconditional:(ex suspendedContext) |
|
8140 |
withMessage:(ex creator class name,' in debugger: ' , eMsg) |
|
8141 |
mayProceed:true. |
|
8142 |
ex proceed. |
|
8143 |
]. |
|
8144 |
answer == #proceed ifTrue:[ |
|
8145 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
8146 |
ex proceed. |
|
8147 |
]. |
|
8148 |
'DebugView [info]: caught exception - returning' infoPrintCR. |
|
8149 |
ex return. |
|
8150 |
] do:[ |
|
8151 |
"/ make certain that sub-debuggers, inspectors etc. |
|
8152 |
"/ come up on my device. |
|
8153 |
Screen currentScreenQuerySignal answer:self graphicsDevice |
|
8154 |
do:[ |
|
8155 |
Dialog aboutToOpenBoxNotificationSignal |
|
8156 |
handle:[:ex | ex proceed ] |
|
8157 |
do:[ |
|
8158 |
windowGroup |
|
8159 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
8160 |
true] |
|
8161 |
onLeave:[] |
|
8162 |
] |
|
8163 |
] |
|
8164 |
]. |
|
266 | 8165 |
]. |
8166 |
catchBlock := nil. |
|
8167 |
||
11818 | 8168 |
"Created: / 24-11-1995 / 20:33:45 / cg" |
8169 |
"Modified: / 26-09-2012 / 15:03:39 / cg" |
|
266 | 8170 |
! ! |
8171 |
||
13416 | 8172 |
!DebugView methodsFor:'queries'! |
8173 |
||
13488 | 8174 |
canDefineForCallee:callee |
8175 |
"again, pure heuristics here" |
|
8176 |
||
13489 | 8177 |
|mthd app heuristic selector| |
13488 | 8178 |
|
8179 |
classToDefineIn := selectorToDefine := nil. "/ sorry - left as info to define action |
|
8180 |
||
8181 |
callee notNil ifTrue:[ |
|
15413 | 8182 |
"/ clicked on an unimplemented method ? |
8183 |
callee sender notNil ifTrue:[ |
|
8184 |
mthd := callee sender method. |
|
8185 |
mthd isNil ifTrue:[ |
|
8186 |
callee sender isBlockContext ifFalse:[ |
|
8187 |
"/ an unimplemented method |
|
8188 |
selector := callee sender selector. |
|
8189 |
(callee sender receiver class canUnderstand:selector) ifFalse:[ |
|
8190 |
classToDefineIn := callee sender receiver class. |
|
8191 |
selectorToDefine := selector. |
|
8192 |
^ true |
|
8193 |
] |
|
8194 |
] |
|
8195 |
]. |
|
8196 |
]. |
|
8197 |
||
8198 |
mthd := callee method. |
|
8199 |
mthd notNil ifTrue:[ |
|
8200 |
(mthd selector == #subclassResponsibility) ifTrue:[ |
|
8201 |
classToDefineIn := callee sender receiver class. |
|
8202 |
selectorToDefine := callee sender selector. |
|
8203 |
^ true. |
|
8204 |
]. |
|
8205 |
||
8206 |
"/ that's a big hack, but I am tired of navigating to find the missing menu message... |
|
8207 |
"/ you will thank me!! |
|
8208 |
mthd selector == #error:mayProceed: ifTrue:[ |
|
8209 |
(callee receiver isKindOf:MenuPanel) ifTrue:[ |
|
8210 |
callee sender home notNil ifTrue:[ |
|
8211 |
(callee sender home selector startsWith:'accept:') ifTrue:[ |
|
8212 |
(inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[ |
|
8213 |
(app := self processesApplication) notNil ifTrue:[ |
|
8214 |
heuristic := callee sender home argsAndVars select:[:o | o isSymbol]. |
|
8215 |
heuristic size == 1 ifTrue:[ |
|
8216 |
classToDefineIn := app class. |
|
8217 |
selectorToDefine := heuristic first. |
|
8218 |
^ true |
|
8219 |
]. |
|
8220 |
]. |
|
8221 |
]. |
|
8222 |
]. |
|
8223 |
]. |
|
8224 |
]. |
|
8225 |
] |
|
8226 |
] |
|
13488 | 8227 |
]. |
8228 |
^ false |
|
8229 |
! |
|
8230 |
||
13489 | 8231 |
showingAlreadyModifiedCode |
8232 |
^ methodCodeToggle isVisible |
|
8233 |
and:[ methodCodeToggleSelectionHolder value = 2 ] |
|
8234 |
! ! |
|
8235 |
||
8236 |
!DebugView methodsFor:'user interaction'! |
|
8237 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8238 |
checkIfCodeIsReallyModified |
6616 | 8239 |
|source| |
8240 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8241 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8242 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8243 |
currentMethod isNil ifTrue:[ |
15413 | 8244 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8245 |
]. |
6616 | 8246 |
source := currentMethod source. |
8247 |
source notNil ifTrue:[ |
|
15413 | 8248 |
source string = codeView contents string ifTrue:[ |
8249 |
^ false |
|
8250 |
]. |
|
8251 |
(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
|
8252 |
^ false |
|
8253 |
]. |
|
6616 | 8254 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8255 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8256 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8257 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8258 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8259 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8260 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8261 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8262 |
checkSelectionChangeAllowed:newSelection |
13388 | 8263 |
|answer v| |
8264 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8265 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8266 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8267 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8268 |
and:[newSelection = contextView selection]) ifTrue:[ |
15413 | 8269 |
^ true |
8270 |
]. |
|
8271 |
||
8272 |
answer := Dialog |
|
8273 |
confirmWithCancel:('Code modified - change selection anyway ?') |
|
8274 |
labels:#('No' 'No, Show Diffs' 'Yes'). |
|
13388 | 8275 |
answer isNil ifTrue:[^ false]. |
8276 |
answer == false ifTrue:[ |
|
15413 | 8277 |
v := DiffCodeView |
8278 |
openOn:codeView contents |
|
8279 |
label:(resources string:'Changed code (to be accepted ?)') |
|
8280 |
and:currentMethod source |
|
8281 |
label:(resources string:'Method''s actual (maybe original) code'). |
|
8282 |
v label:(resources string:'Comparing method''s code'). |
|
8283 |
v waitUntilVisible. |
|
8284 |
^ false |
|
13388 | 8285 |
]. |
8286 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8287 |
codeView modified:false. |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8288 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8289 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8290 |
|
266 | 8291 |
codeAccept:someCode |
13394 | 8292 |
"user wants some code to be recompiled" |
8293 |
||
14640 | 8294 |
ParseError handle:[:ex | |
15413 | 8295 |
ex lineNumber notNil ifTrue:[ |
8296 |
codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition. |
|
8297 |
]. |
|
8298 |
Dialog information:ex description. |
|
14640 | 8299 |
"/ ParseError new |
8300 |
"/ errorMessage:aMessage startPosition:position endPosition:endPos; |
|
8301 |
"/ parameter:self; |
|
8302 |
"/ lineNumber:tokenLineNr; "lineNr" |
|
8303 |
"/ raiseRequest. |
|
15413 | 8304 |
] do:[ |
8305 |
^ self codeAccept:someCode unwind:false category:nil onCancel:nil |
|
14640 | 8306 |
]. |
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8307 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8308 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 8309 |
! |
8310 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8311 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
13394 | 8312 |
"user wants some code to be recompiled. |
8313 |
Optionally unwind stack to right above the changed method. |
|
13455 | 8314 |
This undwind option is a leftover from times, when the debugger had no chance to |
15413 | 8315 |
show the original code. |
8316 |
Now, it can, and got a choice-field to select between original and changed code. |
|
8317 |
So the undwind option is not longer used and probably completely obsolete now |
|
13455 | 8318 |
(aka: this method is always called with doUnwind==false, these days)" |
3427 | 8319 |
|
13842 | 8320 |
|con newMethod| |
3427 | 8321 |
|
8322 |
codeView withWaitCursorDo:[ |
|
15413 | 8323 |
" |
8324 |
find the method-home context for this one |
|
8325 |
" |
|
8326 |
doUnwind ifTrue:[ |
|
8327 |
con := selectedContext. |
|
8328 |
top := con. |
|
8329 |
[con notNil] whileTrue:[ |
|
8330 |
(con methodHome == selectedContext) ifTrue:[ |
|
8331 |
top := con |
|
8332 |
]. |
|
8333 |
con := con sender |
|
8334 |
]. |
|
8335 |
]. |
|
8336 |
||
8337 |
"/ |
|
8338 |
"/ provide the classes nameSpace and changefile-update answers; |
|
8339 |
"/ in case we accept while in another context, to not capture these settings again |
|
8340 |
"/ |
|
8341 |
(Class updateChangeFileQuerySignal, |
|
8342 |
Class updateChangeListQuerySignal, |
|
8343 |
Class updateHistoryLineQuerySignal) answer:true |
|
8344 |
do:[ |
|
8345 |
Class nameSpaceQuerySignal answer:(aClass nameSpace) |
|
8346 |
do:[ |
|
8347 |
"/ the compiler nowadays already cares for the package... |
|
8348 |
"/ no, actually, it does not in case we are in the middle of a fileIn, |
|
8349 |
"/ and packageQuery is already answered by someone else. |
|
8350 |
"/ Better make it unpackaged, in case the user makes changes to other |
|
8351 |
"/ classes here (actually, I often change compiler, debugger, inspector here) |
|
8352 |
Class packageQuerySignal |
|
8353 |
answer:nil |
|
8354 |
do:[ |
|
8355 |
codeView contents:someCode. |
|
8356 |
Class methodRedefinitionNotification |
|
8357 |
answer:#keep |
|
8358 |
do:[ |
|
8359 |
| breakpoints | |
|
8360 |
||
8361 |
breakpoints := nil. |
|
8362 |
codeView isCodeView2 ifTrue:[ |
|
8363 |
breakpoints := codeView breakpoints. |
|
8364 |
]. |
|
8365 |
||
8366 |
BreakpointQuery answer: breakpoints do:[ |
|
8367 |
"/ Use original method's programming language instead of class's one. |
|
8368 |
"/ In most cases it's the same, but it may be that the method edited |
|
8369 |
"/ and accepted was an extension method written in another languages |
|
8370 |
"/ (such as Smalltalk extension to Java class or Ruby extension to |
|
8371 |
"/ Smalltalk class. |
|
8372 |
newMethod := selectedContext programmingLanguage compilerClassForInteractiveTools |
|
8373 |
compile:someCode |
|
8374 |
forClass:aClass |
|
8375 |
inCategory:category |
|
8376 |
notifying:codeView. |
|
8377 |
"/ Kludge for accepting Java code in a debugger. The Java compiler |
|
8378 |
"/ does not compile single classes by always a full class and returns |
|
8379 |
"/ the compiled class(es) rather than a method. However, we need to update |
|
8380 |
"/ method holder of a codeView. |
|
8381 |
"/ |
|
8382 |
"/ So, here we check whether the retuned `newMethod` is really a method, |
|
8383 |
"/ if it's a class, try to search that class for a method with the |
|
8384 |
"/ same selector as selector of currently selected context. If found, |
|
8385 |
"/ thet's the 'new' method we are going to show. |
|
8386 |
newMethod isBehavior ifTrue:[ |
|
8387 |
| selector | |
|
8388 |
||
8389 |
selector := selectedContext selector. |
|
8390 |
newMethod := newMethod"actually a class" compiledMethodAt: selector ifAbsent: nil. |
|
8391 |
]. |
|
8392 |
]. |
|
8393 |
]. |
|
8394 |
]. |
|
8395 |
]. |
|
8396 |
]. |
|
8397 |
||
8398 |
methodCodeToggleSelectionHolder value:2. "/ showing current code |
|
8399 |
methodCodeToggle beVisible. |
|
8400 |
||
8401 |
inspecting ifFalse:[ |
|
8402 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
8403 |
codeView modified:false. |
|
8404 |
codeView isCodeView2 ifTrue:[ |
|
8405 |
codeView methodHolder value: newMethod. |
|
8406 |
]. |
|
8407 |
||
8408 |
doUnwind ifTrue:[ |
|
8409 |
"/ if it worked, and doUnwind is true, |
|
8410 |
"/ remove everything up to and including top |
|
8411 |
"/ from the context chain |
|
8412 |
||
8413 |
selectedContext canReturn ifTrue:[ |
|
8414 |
self setContext:(top "sender"). |
|
8415 |
exitAction := #restart. |
|
8416 |
selectedContext setLineNumber:1. |
|
8417 |
self doRestart. |
|
8418 |
] ifFalse:[ |
|
8419 |
self setContext:(top sender). |
|
8420 |
exitAction := #return. |
|
8421 |
]. |
|
8422 |
]. |
|
8423 |
] ifFalse:[ |
|
8424 |
^ cancelAction value |
|
8425 |
] |
|
8426 |
]. |
|
3427 | 8427 |
]. |
8428 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
8429 |
"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
|
8430 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
14713 | 8431 |
"Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3427 | 8432 |
! |
8433 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8434 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
13394 | 8435 |
"user wants some code to be recompiled" |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8436 |
|
12812 | 8437 |
|sel implementorClass receiverClass method category| |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8438 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8439 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8440 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8441 |
"/ 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
|
8442 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8443 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8444 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8445 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8446 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8447 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8448 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8449 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8450 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8451 |
|
15413 | 8452 |
" |
8453 |
use class&selector to find the method for the compilation |
|
8454 |
and compile. |
|
8455 |
" |
|
8456 |
category := givenCategoryOrNil. |
|
8457 |
sel := selectedContext selector. |
|
8458 |
implementorClass := selectedContext methodClass. |
|
8459 |
method := selectedContext method. |
|
8460 |
||
8461 |
implementorClass isNil ifTrue:[ |
|
8462 |
(method notNil and:[method mclass isNil and:[method wrapper notNil]]) ifTrue:[ |
|
8463 |
method := method wrapper. |
|
8464 |
]. |
|
8465 |
method notNil ifTrue:[ |
|
8466 |
implementorClass := method mclass. |
|
8467 |
implementorClass isNil ifTrue:[ |
|
8468 |
implementorClass := method getMclass |
|
8469 |
]. |
|
8470 |
]. |
|
8471 |
]. |
|
8472 |
implementorClass notNil ifTrue:[ |
|
8473 |
category isNil ifTrue:[ |
|
8474 |
method isNil ifTrue:[ |
|
8475 |
method := implementorClass compiledMethodAt:sel. |
|
8476 |
]. |
|
8477 |
category := method category |
|
8478 |
] |
|
8479 |
] ifFalse:[ |
|
8480 |
receiverClass := selectedContext receiver class. |
|
8481 |
implementorClass := receiverClass whichClassImplements:sel. |
|
8482 |
implementorClass := implementorClass ? receiverClass. |
|
8483 |
implementorClass ~~ Object ifTrue:[ |
|
8484 |
implementorClass := Dialog |
|
8485 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
8486 |
initialAnswer:implementorClass name |
|
8487 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
8488 |
implementorClass size == 0 ifTrue:[ |
|
8489 |
^ cancelAction value "/ cancelled |
|
8490 |
]. |
|
8491 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
8492 |
implementorClass isNil ifTrue:[ |
|
8493 |
Dialog warn:'No such class'. |
|
8494 |
^ cancelAction value "/ cancelled |
|
8495 |
]. |
|
8496 |
]. |
|
8497 |
]. |
|
8498 |
||
8499 |
self |
|
8500 |
codeAccept:someCode |
|
8501 |
inClass:implementorClass |
|
8502 |
unwind:doUnwind |
|
8503 |
category:category |
|
8504 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8505 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8506 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8507 |
"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
|
8508 |
"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
|
8509 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8510 |
|
7912 | 8511 |
codeCompletion |
15413 | 8512 |
"/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
14109 | 8513 |
"/ (can we move that to a utility - probably DoWhatIMeanSupport) |
8514 |
||
8515 |
|cls language| |
|
7912 | 8516 |
|
8212 | 8517 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 8518 |
|
7912 | 8519 |
cls := currentMethod mclass. |
15413 | 8520 |
cls notNil ifTrue:[ |
8521 |
language := cls programmingLanguage. |
|
14109 | 8522 |
]. |
8212 | 8523 |
|
7912 | 8524 |
UserInformation handle:[:ex | |
15413 | 8525 |
ex proceed. |
7912 | 8526 |
] do:[ |
15413 | 8527 |
DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:selectedContext codeView:codeView. |
13562
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8528 |
]. |
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8529 |
|
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8530 |
"Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7912 | 8531 |
! |
8532 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8533 |
confirm:aString |
6971 | 8534 |
"open a modal yes-no dialog. |
8535 |
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
|
8536 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8537 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
15413 | 8538 |
^ true |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8539 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8540 |
^ super confirm:aString. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8541 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8542 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
8543 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
8544 |
"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
|
8545 |
Also sent to autoselect an interesting context on entry." |
0 | 8546 |
|
9235 | 8547 |
HaltInterrupt handle:[:ex | |
15413 | 8548 |
ignoreBreakpoints ifFalse:[ex reject]. |
8549 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
8550 |
ex proceed |
|
3447 | 8551 |
] do:[ |
15413 | 8552 |
self updateForContext:lineNr |
3269 | 8553 |
]. |
8554 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
8555 |
|
3447 | 8556 |
"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
|
8557 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8558 |
|
10205 | 8559 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8560 |
stackInspector notNil ifTrue:[ |
15413 | 8561 |
stackInspector destroy. |
8562 |
stackInspector := nil. |
|
8563 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
8564 |
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
|
8565 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8566 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8567 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8568 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8569 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8570 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8571 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8572 |
sel notNil ifTrue:[ |
15413 | 8573 |
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
|
8574 |
] |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8575 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8576 |
"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
|
8577 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8578 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8579 |
processEvent:anEvent |
6129 | 8580 |
"filter keyboard events for popUp variable value display. |
8581 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8582 |
|
12106 | 8583 |
<resource: #keyboard (#CodeCompletion )> |
8584 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8585 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8586 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8587 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8588 |
evView notNil ifTrue:[ |
15413 | 8589 |
focusView := evView windowGroup focusView. |
8590 |
focusView isNil ifTrue:[ |
|
8591 |
focusView := evView. |
|
8592 |
]. |
|
8593 |
||
8594 |
anEvent isKeyPressEvent ifTrue:[ |
|
8595 |
key := anEvent key. |
|
8596 |
rawKey := anEvent rawKey. |
|
8597 |
||
8598 |
inCodeView := (focusView == codeView |
|
8599 |
or:[focusView isComponentOf:codeView]). |
|
8600 |
inCodeView ifTrue:[ |
|
8601 |
key == #CodeCompletion ifTrue:[ |
|
8602 |
"/ complete the word before/under the cursor. |
|
8603 |
self sensor |
|
8604 |
pushUserEvent:#codeCompletion |
|
8605 |
for:self |
|
8606 |
withArguments:#(). |
|
8607 |
^ true |
|
8608 |
]. |
|
8609 |
]. |
|
8610 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8611 |
|
3602 | 8612 |
false ifTrue:[ |
15413 | 8613 |
anEvent isButtonReleaseEvent ifTrue:[ |
8614 |
anEvent view == codeView ifTrue:[ |
|
8615 |
(RBParser notNil and:[RBParser isLoaded]) |
|
8616 |
ifTrue:[ |
|
8617 |
self sensor |
|
8618 |
pushEvent:anEvent. "/ must be first in queue |
|
8619 |
||
8620 |
self sensor |
|
8621 |
pushUserEvent:#explainSelection |
|
8622 |
for:self |
|
8623 |
withArguments:nil. |
|
8624 |
^ true "/ eaten |
|
8625 |
] |
|
8626 |
] |
|
8627 |
]. |
|
3602 | 8628 |
]. |
8629 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8630 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8631 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8632 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8633 |
|
8212 | 8634 |
setCurrentMethod:aMethodOrNil |
8635 |
currentMethod := aMethodOrNil. |
|
8636 |
! |
|
8637 |
||
15413 | 8638 |
showSelection:lineNr |
1327 | 8639 |
"user clicked on a header line - show selected code in textView. |
8640 |
Also sent to autoselect an interesting context on entry." |
|
15413 | 8641 |
|
8642 |
UserNotification |
|
8643 |
handle:[:ex | |
|
8644 |
"/ ex suspendedContext fullPrintAll. |
|
8645 |
Transcript showCR:ex description. |
|
8646 |
"/ Transcript showCR:ex parameter. |
|
8647 |
ex proceed |
|
8648 |
] |
|
8649 |
do:[ |
|
8650 |
Error |
|
8651 |
handle:[:ex | |
|
8652 |
|s con| |
|
8653 |
||
8654 |
ex creator isControlInterrupt ifTrue:[ |
|
8655 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' |
|
8656 |
infoPrintCR. |
|
8657 |
ex proceed |
|
8658 |
]. |
|
8659 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' |
|
8660 |
bindWith:ex suspendedContext) infoPrintCR. |
|
8661 |
s := '' writeStream. |
|
8662 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
8663 |
s nextPutLine:'****'. |
|
8664 |
s nextPutLine:'**** ',(ex description). |
|
8665 |
s nextPutLine:'****'. |
|
8666 |
con := ex suspendedContext. |
|
8667 |
s nextPutLine:'**** ',(con printString). |
|
8668 |
con := con sender. |
|
8669 |
HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ]. |
|
8670 |
||
5842 | 8671 |
"/ [con notNil] whileTrue:[ |
8672 |
"/ Error catch:[:ex | |
|
8673 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
8674 |
"/ ]. |
|
4947 | 8675 |
"/ |
5842 | 8676 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
8677 |
"/ con := nil |
|
8678 |
"/ ] ifFalse:[ |
|
8679 |
"/ con := con sender. |
|
8680 |
"/ ] |
|
8681 |
"/ ]. |
|
15413 | 8682 |
|
8683 |
codeView contents:(s contents). |
|
8684 |
ex return. |
|
8685 |
] |
|
8686 |
do:[ self doShowSelection:lineNr ] |
|
8687 |
] |
|
11610 | 8688 |
|
8689 |
"Modified: / 19-07-2012 / 10:56:58 / cg" |
|
1327 | 8690 |
! |
8691 |
||
10205 | 8692 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8693 |
stackInspector isNil ifTrue:[ |
15413 | 8694 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
8695 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
8696 |
stackInspector := InspectorView |
|
8697 |
origin:(0.6 @ 0.0) |
|
8698 |
corner:(1.0 @ 1.0) |
|
8699 |
in:contextInspector superView. |
|
8700 |
stackInspector realize. |
|
8701 |
stackInspector fieldListLabel:'Stack'. |
|
8702 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8703 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8704 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8705 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8706 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8707 |
|
12529 | 8708 |
updateContextInfoFor:aContext |
8709 |
"additional info as-per selected context; |
|
8710 |
for now: |
|
15413 | 8711 |
update:with:from: - show who was responsible |
12529 | 8712 |
" |
8713 |
||
12552 | 8714 |
|whatChanged changedObject receiver| |
12529 | 8715 |
|
8716 |
aContext selector == #'update:with:from:' ifTrue:[ |
|
15413 | 8717 |
receiver := aContext receiver. |
8718 |
whatChanged := aContext argAt:1. |
|
8719 |
changedObject := aContext argAt:3. |
|
8720 |
||
8721 |
changedObject isBehavior ifTrue:[ |
|
8722 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold). |
|
8723 |
^ self |
|
8724 |
]. |
|
8725 |
||
8726 |
receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm | |
|
8727 |
(receiver instVarAt:i) == changedObject ifTrue:[ |
|
8728 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold). |
|
8729 |
^ self |
|
8730 |
] |
|
8731 |
]. |
|
8732 |
||
8733 |
(receiver isKindOf:ApplicationModel) ifTrue:[ |
|
8734 |
receiver builder notNil ifTrue:[ |
|
8735 |
(receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue | |
|
8736 |
eachValue == changedObject ifTrue:[ |
|
8737 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold). |
|
8738 |
^ self |
|
8739 |
] |
|
8740 |
] |
|
8741 |
] |
|
8742 |
]. |
|
8743 |
||
8744 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold). |
|
8745 |
^self. |
|
12529 | 8746 |
]. |
8747 |
contextInfoLabel label:nil. |
|
8748 |
! |
|
8749 |
||
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8750 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8751 |
"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
|
8752 |
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
|
8753 |
|
56 | 8754 |
|con homeContext sel method code canAccept |
105 | 8755 |
implementorClass lineNrInMethod rec m line |
10205 | 8756 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 8757 |
codeSet highlighter evaluatorClass |
11912
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
8758 |
canDefine callee searchClass originalMethod cannotAcceptDueToOutdatedClass| |
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
8759 |
|
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
8760 |
canDefine := cannotAcceptDueToOutdatedClass := false. |
8212 | 8761 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
8762 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8763 |
contextArray notNil ifTrue:[ |
15413 | 8764 |
lineNr <= contextArray size ifTrue:[ |
8765 |
con := contextArray at:lineNr. |
|
8766 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
8767 |
]. |
|
8768 |
" |
|
8769 |
clicking on the '** ...'-line shows more ... |
|
8770 |
" |
|
8771 |
con isNil ifTrue:[ |
|
8772 |
line := contextView list at:lineNr. |
|
8773 |
(line startsWith:'**') ifTrue:[ |
|
8774 |
self showMore. |
|
8775 |
lineNr >= contextArray size ifTrue:[ |
|
8776 |
contextView setSelection:lineNr. |
|
8777 |
con := contextArray at:lineNr ifAbsent:nil |
|
8778 |
] |
|
8779 |
]. |
|
8780 |
con isNil ifTrue:[ |
|
8781 |
codeView contents:nil. |
|
8782 |
^ self |
|
8783 |
]. |
|
8784 |
]. |
|
8785 |
||
8786 |
selectedContext := con. |
|
8787 |
m := contextView middleButtonMenu. |
|
8788 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
8789 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
8790 |
]. |
|
8791 |
||
8792 |
self withExecuteCursorDo:[ |
|
8793 |
codeSet := false. |
|
8794 |
||
8795 |
" |
|
8796 |
give it to the (lower right) inspector |
|
8797 |
" |
|
8798 |
Error handle:[:ex | |
|
8799 |
'DebugView [warning]: error while accessing context: ' errorPrint. |
|
8800 |
ex description errorPrintCR. |
|
8801 |
contextInspector inspect:nil. |
|
8802 |
contextInspector fieldListLabel:('Context'). |
|
8803 |
ex suspendedContext fullPrintAllOn: Transcript. |
|
9479 | 8804 |
"/ ex reject. |
15413 | 8805 |
] do:[ |
8806 |
contextInspector inspect:con. |
|
8807 |
"/ contextInspector fieldListLabel:('Context: ',con method whoString). |
|
8808 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
8809 |
]. |
|
8810 |
||
8811 |
"/ show a stack inspector sometimes |
|
8812 |
||
8813 |
con hasStackToShow ifTrue:[ |
|
8814 |
self showStackInspectorFor:con |
|
8815 |
] ifFalse:[ |
|
8816 |
self hideStackInspector |
|
8817 |
]. |
|
8818 |
||
8819 |
homeContext := con methodHome. |
|
8820 |
con canReturn ifTrue:[ |
|
8821 |
returnButton enable. restartButton enable. |
|
8822 |
] ifFalse:[ |
|
8823 |
returnButton disable. restartButton disable. |
|
8824 |
]. |
|
8825 |
||
8826 |
lineNrInMethod := con lineNumber. |
|
8827 |
||
8828 |
canAccept := false. |
|
8829 |
||
8830 |
homeContext isNil ifTrue:[ |
|
8831 |
" |
|
8832 |
mhmh - an optimized block |
|
8833 |
should get the block here, and get the method from |
|
8834 |
that one ... |
|
8835 |
But in the current version, there is no easy way to get to the block |
|
8836 |
since that one is not in the context. |
|
8837 |
A future new block calling scheme will fix this |
|
8838 |
(passing the block instead of the home as block argument). |
|
8839 |
" |
|
8840 |
(method := con method) isNil ifTrue:[ |
|
8841 |
"temporary kludge - peek into the sender context. |
|
8842 |
If its a do-like method and there is a single block variable |
|
8843 |
in the args or temporaries, that must be the one. |
|
8844 |
This helps in some cases. |
|
8845 |
" |
|
8846 |
(sender := con sender) notNil ifTrue:[ |
|
8847 |
tryVars := false. |
|
8848 |
(selSender := sender selector) notNil ifTrue:[ |
|
8849 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
8850 |
tryVars := true. |
|
8851 |
] |
|
8852 |
]. |
|
8853 |
tryVars ifTrue:[ |
|
8854 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
8855 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
8856 |
possibleBlocks size == 1 ifTrue:[ |
|
8857 |
method := possibleBlocks first method. |
|
8858 |
]. |
|
8859 |
] |
|
8860 |
]. |
|
8861 |
] |
|
8862 |
] ifFalse:[ |
|
8863 |
"fetch rec here - so we won't need context in doItAction" |
|
8864 |
rec := homeContext receiver. |
|
8865 |
sel := homeContext selector. |
|
8866 |
sel notNil ifTrue:[ |
|
8867 |
canAccept := true. |
|
8868 |
||
8869 |
implementorClass := homeContext methodClass. |
|
8870 |
implementorClass isNil ifTrue:[ |
|
8871 |
homeContext method notNil ifTrue:[ |
|
8872 |
WrappedMethod allInstancesDo:[:wrapped | |
|
8873 |
wrapped originalMethod == homeContext method ifTrue:[ |
|
8874 |
implementorClass := wrapped mclass |
|
8875 |
] |
|
8876 |
]. |
|
8877 |
implementorClass isNil ifTrue:[ |
|
8878 |
(homeContext searchClass notNil |
|
8879 |
and:[homeContext searchClass isObsolete]) ifTrue:[ |
|
8880 |
cannotAcceptDueToOutdatedClass := true. |
|
8881 |
] |
|
8882 |
]. |
|
8883 |
]. |
|
8884 |
]. |
|
8885 |
implementorClass isNil ifTrue:[ |
|
8886 |
Error handle:[:ex | |
|
11890 | 8887 |
"/ not covered by Error, anyway |
8888 |
"/ ex signal == BreakPointInterrupt ifTrue:[ |
|
8889 |
"/ ex proceed. |
|
8890 |
"/ ]. |
|
15413 | 8891 |
code := 'error while asking method for its source'. |
8892 |
code := code , Character cr , ex creator printString. |
|
8893 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
8894 |
||
8895 |
canAccept := false. |
|
8896 |
ex return. |
|
8897 |
] do:[ |
|
8898 |
" |
|
8899 |
special: look if this context was created by |
|
8900 |
valueWithReceiver kind of method invocation; |
|
8901 |
if so, grab the method from the sender and show it |
|
8902 |
" |
|
8903 |
((sender := homeContext sender) notNil |
|
8904 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
8905 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
8906 |
method := sender receiver. |
|
8907 |
canAccept := false. |
|
8908 |
] ifFalse:[ |
|
8909 |
(method := con method) notNil ifTrue:[ |
|
8910 |
canAccept := false. |
|
8911 |
] |
|
8912 |
]. |
|
8913 |
] |
|
8914 |
] ifFalse:[ |
|
8915 |
method := implementorClass compiledMethodAt:sel. |
|
8916 |
]. |
|
8917 |
] |
|
8918 |
]. |
|
8919 |
||
8920 |
homeContext notNil ifTrue:[ |
|
8921 |
searchClass := homeContext searchClass ? rec class. |
|
8922 |
currentMethod := searchClass lookupMethodFor:sel. |
|
8923 |
]. |
|
8924 |
originalMethod := currentMethod. |
|
8925 |
(currentMethod notNil |
|
8926 |
and:[currentMethod ~~ method |
|
8927 |
and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]]) ifTrue:[ |
|
8928 |
originalMethod := method. |
|
8929 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
8930 |
method := originalMethod. "/ the one which is suspended / was executing |
|
8931 |
] ifFalse:[ |
|
8932 |
method := currentMethod. "/ the one which has already been accepted/modified. |
|
8933 |
lineNrInMethod := nil. |
|
8934 |
canAccept := true. |
|
8935 |
]. |
|
8936 |
methodCodeToggle beVisible. |
|
8937 |
] ifFalse:[ |
|
8938 |
methodCodeToggle beInvisible. |
|
8939 |
]. |
|
8940 |
||
8941 |
code isNil ifTrue:[ |
|
8942 |
errMsg := nil. |
|
8943 |
method isNil ifTrue:[ |
|
8944 |
"/ fall back heuristics (see how this was called, fetch block from caller) |
|
8945 |
sender := con sender. |
|
8946 |
con isBlockContext ifTrue:[ |
|
8947 |
(sender notNil |
|
8948 |
and:[((sender selector ? '') startsWith:'value') |
|
8949 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
8950 |
code := sender receiver source. |
|
8951 |
] |
|
8952 |
] ifFalse:[ |
|
8953 |
(sender notNil |
|
8954 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
8955 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
8956 |
method := sender receiver. |
|
8957 |
] |
|
8958 |
] |
|
8959 |
]. |
|
8960 |
method notNil ifTrue:[ |
|
8961 |
contextInspector fieldListLabel:(method selector "whoString"). |
|
8962 |
Error handle:[:ex | |
|
11890 | 8963 |
"/ not covered by Error, anyway |
8964 |
"/ ex signal isControlInterrupt ifTrue:[ |
|
8965 |
"/ ex proceed. |
|
8966 |
"/ ]. |
|
15413 | 8967 |
code := 'error while asking method for its source'. |
8968 |
code := code , Character cr , ex creator printString. |
|
8969 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
8970 |
||
8971 |
canAccept := false. |
|
8972 |
ex return. |
|
8973 |
] do:[ |
|
8974 |
self sensor shiftDown ifTrue:[ |
|
8975 |
code := method decompiledSource |
|
8976 |
] ifFalse:[ |
|
8977 |
code := method source. |
|
8978 |
]. |
|
8979 |
]. |
|
8980 |
||
8981 |
code isNil ifTrue:[ |
|
8982 |
method sourceFilename notNil ifTrue:[ |
|
8983 |
codeView contents:(resources |
|
8984 |
string:'** no sourcefile: %1 **' |
|
8985 |
with:method sourceFilename). |
|
8986 |
codeView realized ifTrue:[ |
|
8987 |
"codeView is not realized on initial startup" |
|
8988 |
codeView flash:'no source'. |
|
8989 |
]. |
|
8990 |
codeSet := true. |
|
8991 |
] ifFalse:[ |
|
8992 |
[ |
|
8993 |
|src| |
|
8994 |
||
8995 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
8996 |
codeView contents:src. |
|
8997 |
codeSet := true. |
|
8998 |
] on: Error do:[ |
|
8999 |
errMsg := '** no source **' |
|
9000 |
]. |
|
9001 |
] |
|
9002 |
]. |
|
9003 |
] ifFalse:[ |
|
9004 |
contextInspector fieldListLabel:'Context'. |
|
9005 |
homeContext isNil ifTrue:[ |
|
9006 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
9007 |
] ifFalse:[ |
|
9008 |
errMsg := '** no method - no source **'. |
|
9009 |
canDefine := false. "/ true. |
|
9010 |
] |
|
9011 |
]. |
|
9012 |
errMsg notNil ifTrue:[ |
|
9013 |
self showError:errMsg. |
|
9014 |
codeSet := true. |
|
9015 |
] |
|
9016 |
]. |
|
9017 |
||
9018 |
code isNil ifTrue:[ |
|
9019 |
"/ canAccept := false. |
|
9020 |
codeSet ifFalse:[ |
|
9021 |
codeView contents:nil. |
|
9022 |
] |
|
9023 |
] ifFalse:[ |
|
9024 |
lineNrInMethod notNil ifTrue:[ |
|
9025 |
lineNrInMethod == 0 ifTrue:[ |
|
9026 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
9027 |
lineNrInMethod := method lineNumber |
|
9028 |
]. |
|
9029 |
"/ guess lineNumber from sent-messages selector |
|
9030 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
9031 |
lineNrInMethod == 0 ifTrue:[ |
|
9032 |
|conIdx sentContext messages| |
|
9033 |
||
9034 |
conIdx := contextArray identityIndexOf:con. |
|
9035 |
conIdx > 1 ifTrue:[ |
|
9036 |
sentContext := contextArray at:conIdx-1. |
|
9037 |
sentContext isBlockContext ifFalse:[ |
|
9038 |
(method notNil and:[code notNil]) ifTrue:[ |
|
9039 |
messages := method messagesSent. |
|
9040 |
messages size == 1 ifTrue:[ |
|
9041 |
sentContext selector == messages first ifTrue:[ |
|
9042 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
9043 |
] |
|
9044 |
] |
|
9045 |
]. |
|
9046 |
]. |
|
9047 |
]. |
|
9048 |
]. |
|
9049 |
]. |
|
9050 |
]. |
|
9051 |
codeView isCodeView2 ifTrue:[ |
|
9052 |
codeView model |
|
9053 |
setValue: code; |
|
9054 |
changed. |
|
9055 |
codeView methodHolder value: method. |
|
9056 |
codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
|
9057 |
] ifFalse:[ |
|
9058 |
UserPreferences current syntaxColoring ifTrue:[ |
|
9059 |
implementorClass isNil ifTrue:[ |
|
9060 |
(con isBlockContext |
|
9061 |
and:[con home isNil |
|
9062 |
and:[con guessedHome notNil]]) |
|
9063 |
ifTrue:[ |
|
9064 |
implementorClass := con guessedHome mclass |
|
9065 |
] |
|
9066 |
]. |
|
9067 |
implementorClass notNil ifTrue:[ |
|
9068 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
9069 |
code size < 100000 ifTrue:[ |
|
9070 |
Error catch:[ |
|
9071 |
code := highlighter formatMethodSource:code in:implementorClass. |
|
9072 |
] |
|
9073 |
] |
|
9074 |
] |
|
9075 |
] |
|
9076 |
]. |
|
1555 | 9077 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9078 |
"/ code ~= (codeView contents) ifTrue:[ |
15413 | 9079 |
cannotAcceptDueToOutdatedClass ifTrue:[ |
9080 |
codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' colorizeAllWith:Color red),Character cr,Character cr,code asString). |
|
9081 |
] ifFalse:[ |
|
9082 |
codeView setContents:code. |
|
9083 |
]. |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9084 |
"/ ]. |
15413 | 9085 |
]. |
9086 |
(lineNrInMethod notNil |
|
9087 |
and:[lineNrInMethod ~~ 0 |
|
9088 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 9089 |
lineNrInMethod == 255 ifFalse:[ |
15413 | 9090 |
(lineNrInMethod == 255 |
9091 |
and:[method notNil |
|
9092 |
and:[method hasCode not]]) ifTrue:[ |
|
9093 |
"/ means: do not really know in interpreted methods |
|
9094 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
9095 |
] ifFalse:[ |
|
9096 |
codeView selectLine:lineNrInMethod. |
|
9097 |
]. |
|
9098 |
codeView makeSelectionVisible |
|
7000 | 9099 |
]. |
15413 | 9100 |
] ifFalse:[ |
9101 |
codeView unselect. |
|
9102 |
codeView scrollToTop |
|
9103 |
] |
|
9104 |
]. |
|
9105 |
||
9106 |
codeView acceptEnabled:canAccept. |
|
9107 |
canAccept ifTrue:[ |
|
9108 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
9109 |
] ifFalse:[ |
|
9110 |
codeView acceptAction:[:code | self beep] |
|
9111 |
]. |
|
9112 |
||
9113 |
receiverInspector inspect:rec. |
|
9114 |
receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle). |
|
9115 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
|
9116 |
||
9117 |
" |
|
9118 |
the one below is wrong: currently, the |
|
9119 |
evaluator cannot handle passed contexts. |
|
9120 |
Once it does, pass con as in:-arg |
|
9121 |
" |
|
9122 |
(rec isJavaObject |
|
9123 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
9124 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
9125 |
evaluatorClass := Parser. |
|
9126 |
codeView commentStrings:#( '//' ( '/*' '*/' ) ). |
|
9127 |
] ifFalse:[ |
|
9128 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
9129 |
evaluatorClass := method mclass evaluatorClass. |
|
9130 |
codeView commentStrings:method mclass programmingLanguage commentStrings. |
|
9131 |
] ifFalse:[ |
|
9132 |
evaluatorClass := rec class evaluatorClass. |
|
9133 |
codeView commentStrings:rec class programmingLanguage commentStrings. |
|
9134 |
]. |
|
9135 |
]. |
|
9136 |
||
9137 |
codeView |
|
9138 |
doItAction: |
|
9139 |
[:theCode | |
|
9140 |
evaluatorClass |
|
9141 |
evaluate:theCode |
|
9142 |
in:actualContext "/ (selectedContext ? actualContext) |
|
9143 |
receiver:rec |
|
9144 |
notifying:codeView |
|
9145 |
logged:true |
|
9146 |
ifFail:nil |
|
9147 |
]; |
|
9148 |
editedMethodOrClass:(method ? rec class). |
|
9149 |
||
9150 |
||
9151 |
self setCurrentMethod:method. |
|
9152 |
||
9153 |
selectedContext := homeContext ? con. |
|
9154 |
actualContext := con |
|
9155 |
]. |
|
4122 | 9156 |
] ifFalse:[ |
15413 | 9157 |
codeView contents:nil. |
4122 | 9158 |
]. |
9159 |
codeView modified:false. |
|
9160 |
||
9161 |
con isContext ifFalse:[ |
|
15413 | 9162 |
sendButton disable. |
4122 | 9163 |
] ifTrue:[ |
15413 | 9164 |
sendButton enable. |
10205 | 9165 |
]. |
12529 | 9166 |
self updateContextInfoFor:con. |
10205 | 9167 |
|
9168 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 9169 |
(due to the block held in codeView). |
9170 |
(not really needed, since stuff gets collected away sooner or later ... |
|
9171 |
... but this makes it a bit sooner) |
|
9172 |
" |
|
9173 |
con := nil. |
|
9174 |
homeContext := nil. |
|
9175 |
||
13488 | 9176 |
(canDefine or:[self canDefineForCallee:callee]) ifTrue:[ |
15413 | 9177 |
defineButton beVisible. |
4122 | 9178 |
] ifFalse:[ |
15413 | 9179 |
defineButton beInvisible. |
4122 | 9180 |
]. |
9181 |
||
12529 | 9182 |
"/ enable/disable some menu items |
4122 | 9183 |
self updateMenuItems |
9184 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
9185 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
10752 | 9186 |
"Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13394 | 9187 |
"Modified: / 28-08-2013 / 15:13:02 / cg" |
4122 | 9188 |
! ! |
9189 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9190 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'accessing'! |
8170 | 9191 |
|
9192 |
ignoreCount:something |
|
9193 |
ignoreCount := something. |
|
9194 |
! |
|
9195 |
||
9196 |
ignoreEndTime:something |
|
9197 |
ignoreEndTime := something. |
|
9198 |
! |
|
9199 |
||
12937 | 9200 |
ignoreForProcess:aProcess |
9201 |
ignoredProcesses isNil ifTrue:[ |
|
15413 | 9202 |
ignoredProcesses := WeakIdentitySet new. |
12937 | 9203 |
]. |
9204 |
ignoredProcesses add:aProcess |
|
9205 |
! |
|
9206 |
||
9207 |
ignoreForReceiverClass:aClass |
|
9208 |
ignoredReceiverClasses isNil ifTrue:[ |
|
15413 | 9209 |
ignoredReceiverClasses := WeakIdentitySet new. |
12937 | 9210 |
]. |
9211 |
ignoredReceiverClasses add:aClass |
|
9212 |
! |
|
9213 |
||
14608 | 9214 |
ignoreIfCalledFromMethod:aMethod |
9215 |
ignoredSendingClassAndSelectors isNil ifTrue:[ |
|
15413 | 9216 |
ignoredSendingClassAndSelectors := OrderedCollection new. |
14608 | 9217 |
]. |
9218 |
||
9219 |
"/ remember the method's name, not the method. |
|
9220 |
"/ so it can be recompiled and we still detect ignores |
|
9221 |
ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector } |
|
9222 |
! |
|
9223 |
||
11210 | 9224 |
ignoreUntilShiftKeyPressed:aBoolean |
9225 |
ignoreUntilShiftKeyPressed := aBoolean. |
|
9226 |
||
9227 |
"Created: / 27-01-2012 / 11:35:23 / cg" |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9228 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9229 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9230 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9231 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9232 |
decrementIgnoreCount |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9233 |
ignoreCount notNil ifTrue:[ |
15413 | 9234 |
ignoreCount > 0 ifTrue:[ |
9235 |
ignoreCount := ignoreCount - 1 |
|
9236 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9237 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9238 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9239 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9240 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9241 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9242 |
printConditionOn:aStream |
14608 | 9243 |
ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[ |
15413 | 9244 |
aStream nextPutAll:(' if called from %1 >> %2' |
9245 |
bindWith:ignoredSendingClassAndSelectors first first |
|
9246 |
with:ignoredSendingClassAndSelectors first second). |
|
9247 |
^ self. |
|
14608 | 9248 |
]. |
12937 | 9249 |
ignoredProcesses notEmptyOrNil ifTrue:[ |
15413 | 9250 |
aStream nextPutAll:(' in %1 processes (%2)' |
9251 |
bindWith:ignoredProcesses size |
|
9252 |
with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9253 |
^ self. |
|
14608 | 9254 |
]. |
9255 |
ignoredReceiverClasses notNil ifTrue:[ |
|
15413 | 9256 |
aStream nextPutAll:(' for %1 classes (%2)' |
9257 |
bindWith:ignoredReceiverClasses size |
|
9258 |
with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9259 |
^ self. |
|
14608 | 9260 |
]. |
9261 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
15413 | 9262 |
aStream nextPutAll:' until shiftKey pressed'. |
9263 |
^ self. |
|
14608 | 9264 |
]. |
9265 |
ignoreEndTime notNil ifTrue:[ |
|
15413 | 9266 |
aStream nextPutAll:' until '. |
9267 |
ignoreEndTime printOn:aStream. |
|
9268 |
^ self. |
|
14608 | 9269 |
]. |
9270 |
(ignoreCount notNil) ifTrue:[ |
|
15413 | 9271 |
(ignoreCount > 0) ifTrue:[ |
9272 |
aStream nextPutAll:' for '. |
|
9273 |
ignoreCount printOn:aStream. |
|
9274 |
^ self. |
|
9275 |
]. |
|
9276 |
(ignoreCount < 0) ifTrue:[ |
|
9277 |
aStream nextPutAll:' forEver'. |
|
9278 |
^ self. |
|
9279 |
]. |
|
9280 |
aStream nextPutAll:' no longer'. |
|
14608 | 9281 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9282 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9283 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9284 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9285 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9286 |
haltIgnoredInfoString |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9287 |
"some string describing why and how this halt is ignored; |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9288 |
nil if not ignored" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9289 |
|
12941 | 9290 |
^ String streamContents:[:s | |
15413 | 9291 |
s nextPutAll:'ignored '. |
9292 |
self printConditionOn:s |
|
12941 | 9293 |
]. |
9294 |
||
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9295 |
"/ ignoreCount notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9296 |
"/ ignoreCount > 0 ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9297 |
"/ ^ '%1 more calls ignored' bindWith:ignoreCount |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9298 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9299 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9300 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9301 |
"/ ignoreEndTime notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9302 |
"/ (ignoreEndTime > Timestamp now) ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9303 |
"/ ^ 'ignored until %1' bindWith:ignoreEndTime |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9304 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9305 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9306 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9307 |
"/ ignoreUntilShiftKeyPressed == true ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9308 |
"/ Screen current shiftDown ifFalse:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9309 |
"/ ^ 'ignored until shiftKey is pressed' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9310 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9311 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9312 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9313 |
"/ ignoredProcesses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9314 |
"/ ^ 'ignored in some processes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9315 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9316 |
"/ ignoredReceiverClasses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9317 |
"/ ^ 'ignored for some receiver classes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9318 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9319 |
"/ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9320 |
"/ ^ 'ignored until reenabled' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9321 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9322 |
"Modified: / 27-01-2012 / 11:35:48 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9323 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9324 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9325 |
isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9326 |
"true if this ignore-entry is still active" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9327 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9328 |
ignoreEndTime notNil ifTrue:[ |
15413 | 9329 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9330 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9331 |
ignoreCount notNil ifTrue:[ |
15413 | 9332 |
^ ignoreCount == -1 or:[ ignoreCount > 0 ] |
12562 | 9333 |
]. |
12941 | 9334 |
ignoredProcesses notNil ifTrue:[ |
15413 | 9335 |
ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]]. |
9336 |
ignoredProcesses isEmpty ifTrue:[ |
|
9337 |
ignoredProcesses := nil. |
|
9338 |
^ false |
|
9339 |
]. |
|
12941 | 9340 |
]. |
12562 | 9341 |
^ true |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9342 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9343 |
"Created: / 06-03-2012 / 12:39:46 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9344 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9345 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9346 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9347 |
^ false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9348 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9349 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9350 |
"Created: / 06-03-2012 / 12:47:02 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9351 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9352 |
|
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9353 |
isForBreakpointWithParameter:paramArg |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9354 |
^ false |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9355 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9356 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9357 |
"Created: / 06-03-2012 / 14:36:28 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9358 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9359 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9360 |
isHaltIgnored |
12941 | 9361 |
"true if this halt should be ignored (sometimes)" |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9362 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9363 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
15413 | 9364 |
^ Screen current shiftDown not |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9365 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9366 |
ignoreCount notNil ifTrue:[ |
15413 | 9367 |
^ ignoreCount > 0 |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9368 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9369 |
ignoreEndTime notNil ifTrue:[ |
15413 | 9370 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9371 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9372 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9373 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9374 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9375 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9376 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9377 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9378 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
11210 | 9379 |
|
8170 | 9380 |
method |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9381 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9382 |
|
9922 | 9383 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
9384 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9385 |
m := weakMethodHolder at:1. |
9796 | 9386 |
"/ wait until really gone (it could still be on the call stack |
9387 |
"/ |
|
9388 |
"/ m notNil ifTrue:[ |
|
9389 |
"/ m mclass isNil ifTrue:[ |
|
9390 |
"/ "/ no longer valid |
|
9391 |
"/ weakMethodHolder at:1 put:nil. |
|
9392 |
"/ ^ nil |
|
9393 |
"/ ]. |
|
9394 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9395 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9396 |
|
9922 | 9397 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 9398 |
! |
9399 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9400 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9401 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9402 |
|
9922 | 9403 |
methodArg == #all ifTrue:[ |
15413 | 9404 |
weakMethodHolder := methodArg |
9922 | 9405 |
] ifFalse:[ |
15413 | 9406 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 9407 |
]. |
8170 | 9408 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9409 |
|
9922 | 9410 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 9411 |
! ! |
9412 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9413 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9414 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9415 |
printOn:aStream |
9922 | 9416 |
|method| |
9417 |
||
9418 |
(method := self method) isNil ifTrue:[ |
|
15413 | 9419 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
9420 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9421 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9422 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9423 |
aStream nextPutAll:'Ignore '. |
11704 | 9424 |
method isSymbol ifTrue:[ |
15413 | 9425 |
method printOn:aStream. |
11704 | 9426 |
] ifFalse:[ |
15413 | 9427 |
method whoString printOn:aStream. |
11704 | 9428 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9429 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9430 |
|
11704 | 9431 |
"Modified: / 27-07-2012 / 23:04:42 / cg" |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9432 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9433 |
|
8170 | 9434 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
9435 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9436 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9437 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9438 |
|
12941 | 9439 |
self method isNil ifTrue:[self breakPoint:#cg. ^ false ]. "/ method no longer valid |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9440 |
^ super isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9441 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9442 |
"Modified: / 06-03-2012 / 12:40:20 / cg" |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9443 |
! |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9444 |
|
8170 | 9445 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9446 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 9447 |
weakMethodHolder == #all ifTrue:[^ true]. |
9448 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9449 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 9450 |
|
9451 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 9452 |
! |
9453 |
||
9454 |
isHaltIgnoredInMethod:aMethod line:line |
|
12937 | 9455 |
^ self isHaltIgnoredInMethod:aMethod line:line context:nil |
9456 |
! |
|
9457 |
||
9458 |
isHaltIgnoredInMethod:aMethod line:line context:context |
|
9095 | 9459 |
"/ 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
|
9460 |
|
13059 | 9461 |
"/ Transcript showCR:'-----------------------------'. |
9462 |
"/ Transcript showCR:aMethod. |
|
9463 |
"/ Transcript showCR:line. |
|
9464 |
"/ Transcript showCR:context. |
|
9465 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9466 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 9467 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 9468 |
|
12937 | 9469 |
context notNil ifTrue:[ |
15413 | 9470 |
ignoredReceiverClasses notNil ifTrue:[ |
9471 |
^ ignoredReceiverClasses includes:(context receiver class) |
|
9472 |
]. |
|
12941 | 9473 |
]. |
13059 | 9474 |
|
9475 |
"/ Transcript showCR:ignoredProcesses. |
|
9476 |
"/ Transcript showCR:Processor activeProcess. |
|
12941 | 9477 |
ignoredProcesses notNil ifTrue:[ |
15413 | 9478 |
^ ignoredProcesses includes:(Processor activeProcess) |
12937 | 9479 |
]. |
14608 | 9480 |
ignoredSendingClassAndSelectors notNil ifTrue:[ |
15413 | 9481 |
context withAllSendersDo:[:each | |
9482 |
|m className selector cls| |
|
9483 |
||
9484 |
(m := each method) notNil ifTrue:[ |
|
9485 |
cls := m mclass. |
|
9486 |
cls notNil ifTrue:[ |
|
9487 |
className := cls name. |
|
9488 |
selector := m selector. |
|
9489 |
(ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]]) |
|
9490 |
ifTrue:[^ true]. |
|
9491 |
]. |
|
9492 |
] |
|
9493 |
] |
|
14608 | 9494 |
]. |
9495 |
||
9496 |
^ self isHaltIgnored "/ unconditionally |
|
8170 | 9497 |
! ! |
9498 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9499 |
!DebugView::IgnoredBreakpoint methodsFor:'accessing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9500 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9501 |
parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9502 |
^ parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9503 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9504 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9505 |
parameter:something |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9506 |
parameter := something. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9507 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9508 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9509 |
!DebugView::IgnoredBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9510 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9511 |
printOn:aStream |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9512 |
aStream nextPutAll:'Ignore breakpoint:#', parameter. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9513 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9514 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9515 |
"Created: / 06-03-2012 / 12:42:10 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9516 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9517 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9518 |
!DebugView::IgnoredBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9519 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9520 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9521 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9522 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9523 |
"Created: / 06-03-2012 / 12:54:35 / cg" |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9524 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9525 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9526 |
isForBreakpointWithParameter:paramArg |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9527 |
^ paramArg = parameter |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9528 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9529 |
"Created: / 06-03-2012 / 14:36:21 / cg" |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9530 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9531 |
|
4122 | 9532 |
!DebugView class methodsFor:'documentation'! |
9533 |
||
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9534 |
version |
15497 | 9535 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.689 2015-03-02 13:39:16 cg Exp $' |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9536 |
! |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9537 |
|
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
9538 |
version_CVS |
15497 | 9539 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.689 2015-03-02 13:39:16 cg Exp $' |
10628 | 9540 |
! |
9541 |
||
9542 |
version_SVN |
|
15497 | 9543 |
^ '$Id: DebugView.st,v 1.689 2015-03-02 13:39:16 cg Exp $' |
4122 | 9544 |
! ! |
9545 |
||
12106 | 9546 |
|
4122 | 9547 |
DebugView initialize! |