author | Claus Gittinger <cg@exept.de> |
Sun, 30 Oct 2016 14:23:06 +0100 | |
changeset 16984 | 2333af91763e |
parent 16961 | 64ff32c6309b |
child 16985 | ce79de6db243 |
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 |
||
16750 | 162 |
CachedDebugger notNil ifTrue:[ |
163 |
CachedDebugger destroy. |
|
164 |
CachedDebugger := nil. |
|
165 |
]. |
|
10203 | 166 |
CachedExclusive := nil. |
167 |
OpenDebuggers := nil. |
|
11391 | 168 |
RememberedCallChain := nil. |
10203 | 169 |
|
170 |
" |
|
171 |
DebugView lowSpaceCleanup |
|
172 |
" |
|
173 |
||
11391 | 174 |
"Modified: / 08-03-2012 / 01:30:21 / cg" |
10203 | 175 |
! |
176 |
||
177 |
newDebugger |
|
13488 | 178 |
"force creation of a new debugger (give up cached debuggers). |
179 |
Call this, if you changed the debugger heavily, and you want to avoid |
|
180 |
that an old, cached debugger gets reused when the next error comes around." |
|
10203 | 181 |
|
16750 | 182 |
CachedDebugger notNil ifTrue:[ |
183 |
CachedDebugger destroy. |
|
184 |
CachedDebugger := nil. |
|
185 |
]. |
|
10203 | 186 |
CachedExclusive := nil. |
187 |
OpenDebuggers := nil. |
|
188 |
||
16262 | 189 |
"/ only assign to the global debugger, if it has not been redefined |
190 |
"/ to another class. |
|
10203 | 191 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
16262 | 192 |
Smalltalk at:#Debugger put:self |
10203 | 193 |
]. |
194 |
||
195 |
" |
|
196 |
DebugView newDebugger |
|
197 |
" |
|
198 |
! ! |
|
199 |
||
200 |
!DebugView class methodsFor:'defaults'! |
|
201 |
||
14695 | 202 |
debuggerOnMainDisplayOnly |
203 |
^ DebuggerOnMainDisplayOnly ? true |
|
204 |
! |
|
205 |
||
10203 | 206 |
defaultIcon |
207 |
"return the browsers default window icon" |
|
208 |
||
209 |
<resource: #programImage> |
|
210 |
||
10205 | 211 |
^ ToolbarIconLibrary debug22x22Icon |
10203 | 212 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
213 |
||
214 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
215 |
! |
|
216 |
||
217 |
defaultIconForAboutBox |
|
218 |
<resource: #programImage> |
|
219 |
||
10205 | 220 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
10203 | 221 |
! |
222 |
||
223 |
defaultVerboseBacktrace |
|
224 |
<resource: #obsolete> |
|
225 |
self obsoleteMethodWarning. |
|
226 |
^ UserPreferences current verboseBacktraceInDebugger |
|
227 |
||
228 |
"Created: 11.1.1997 / 12:14:35 / cg" |
|
229 |
! |
|
230 |
||
231 |
defaultVerboseBacktrace:aBoolean |
|
232 |
<resource: #obsolete> |
|
233 |
self obsoleteMethodWarning. |
|
234 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
235 |
! |
|
236 |
||
13111 | 237 |
maxNumberOfDebuggers |
238 |
"to prevent debuggers from flooding the screen, |
|
239 |
in case of an error in an ever-forked background process |
|
240 |
(such as tooltip process)" |
|
241 |
||
242 |
^ 10 |
|
243 |
! |
|
244 |
||
10203 | 245 |
updateStyleCache |
246 |
"extract values from the styleSheet and cache them in class variables" |
|
247 |
||
248 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
249 |
||
250 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
|
251 |
||
252 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
253 |
! ! |
|
254 |
||
255 |
!DebugView class methodsFor:'ignoring halts'! |
|
256 |
||
257 |
haltIgnoreInformationFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
258 |
"the information (if any) about the ignore-state of a halt" |
|
259 |
||
260 |
IgnoredHalts isNil ifTrue:[^ nil]. |
|
261 |
||
10205 | 262 |
IgnoredHalts do:[:ign | |
15413 | 263 |
(ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
264 |
"/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) |
|
265 |
ifTrue:[ |
|
266 |
^ ign |
|
267 |
]. |
|
10203 | 268 |
]. |
269 |
^ nil. |
|
270 |
! |
|
271 |
||
272 |
hasIgnoredHalts |
|
273 |
self removeInactiveIgnores. |
|
274 |
^ IgnoredHalts notEmptyOrNil |
|
275 |
! |
|
276 |
||
15413 | 277 |
ignoreBreakpointWithParameter:parameterOrNil |
278 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
279 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
14608 | 280 |
|
12937 | 281 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
282 |
or until some time has elapsed. |
|
283 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
|
284 |
||
15413 | 285 |
self |
286 |
ignoreHaltOrBreakpoint:#halt |
|
287 |
method:nil line:nil |
|
288 |
parameter:parameterOrNil |
|
289 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
290 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
291 |
orIfCalledFromMethod:nil |
|
292 |
! |
|
293 |
||
294 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
295 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
296 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
14608 | 297 |
|
12937 | 298 |
"remember to ignore a halt in some method for some number of invocations |
299 |
or until some time has elapsed. |
|
300 |
With nil count and time arguments, such an ignored halt is reactivated" |
|
301 |
||
15413 | 302 |
self |
303 |
ignoreHaltOrBreakpoint:#halt |
|
304 |
method:haltingMethod line:lineNrOfHalt |
|
305 |
parameter:nil |
|
306 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
307 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
308 |
orIfCalledFromMethod:nil |
|
309 |
! |
|
310 |
||
311 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
16434 | 312 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
313 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
314 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
14608 | 315 |
|
316 |
"remember to ignore a halt in some method for some number of invocations |
|
16434 | 317 |
or until some time has elapsed. |
318 |
With a count of -1, it is ignored forever (i.e. until reenabled via the |
|
319 |
settings). |
|
14608 | 320 |
With nil count and time arguments, such an ignored halt is reactivated" |
321 |
||
15413 | 322 |
self |
16434 | 323 |
ignoreHaltOrBreakpoint:#halt |
324 |
method:haltingMethod line:lineNrOfHalt |
|
325 |
parameter:nil |
|
326 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
327 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
328 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
15413 | 329 |
! |
330 |
||
331 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
|
332 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
333 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
12937 | 334 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
335 |
"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
|
336 |
or until some time has elapsed. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
337 |
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
|
338 |
|
14608 | 339 |
^ self |
15413 | 340 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
341 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
342 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
343 |
orIfCalledFromMethod:nil |
|
344 |
! |
|
345 |
||
346 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
|
16434 | 347 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
348 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
349 |
orIfCalledFromMethod:ifCalledFromMethodOrNil |
|
14608 | 350 |
|
351 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
|
352 |
or until some time has elapsed. |
|
353 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
|
354 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
355 |
|oldEntry ign| |
12947 | 356 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
357 |
IgnoredHalts notNil ifTrue:[ |
16434 | 358 |
self removeInactiveIgnores. |
359 |
type == #halt ifTrue:[ |
|
360 |
oldEntry := IgnoredHalts |
|
361 |
detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil] |
|
362 |
ifNone:nil. |
|
363 |
] ifFalse:[ |
|
364 |
oldEntry := IgnoredHalts |
|
365 |
detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil] |
|
366 |
ifNone:nil. |
|
367 |
]. |
|
368 |
oldEntry notNil ifTrue:[ |
|
369 |
(processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[ |
|
370 |
receiverClassOrNil notNil ifTrue:[ |
|
371 |
oldEntry ignoreForReceiverClass:receiverClassOrNil. |
|
372 |
]. |
|
373 |
processOrNil notNil ifTrue:[ |
|
374 |
oldEntry ignoreForProcess:processOrNil. |
|
375 |
]. |
|
376 |
^ self. |
|
377 |
]. |
|
378 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
379 |
] |
|
15413 | 380 |
]. |
381 |
||
382 |
(countOrNil notNil |
|
383 |
or:[dTOrNil notNil |
|
12937 | 384 |
or:[untilShiftKey == true |
385 |
or:[receiverClassOrNil notNil |
|
14608 | 386 |
or:[processOrNil notNil |
387 |
or:[ifCalledFromMethodOrNil notNil]]]]] |
|
12937 | 388 |
) ifTrue:[ |
16434 | 389 |
IgnoredHalts isNil ifTrue:[ |
390 |
IgnoredHalts := OrderedCollection new. |
|
391 |
]. |
|
392 |
type == #halt ifTrue:[ |
|
393 |
ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil. |
|
394 |
] ifFalse:[ |
|
395 |
ign := IgnoredHalt new breakpointWithParameter:parameterOrNil. |
|
396 |
]. |
|
397 |
||
398 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
399 |
ign ignoreCount:countOrNil. |
|
400 |
]. |
|
401 |
(dTOrNil notNil) ifTrue:[ |
|
402 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
403 |
]. |
|
404 |
untilShiftKey == true ifTrue:[ |
|
405 |
ign ignoreUntilShiftKeyPressed:true. |
|
406 |
]. |
|
407 |
receiverClassOrNil notNil ifTrue:[ |
|
408 |
ign ignoreForReceiverClass:receiverClassOrNil. |
|
409 |
]. |
|
410 |
processOrNil notNil ifTrue:[ |
|
411 |
ign ignoreForProcess:processOrNil. |
|
412 |
]. |
|
413 |
ifCalledFromMethodOrNil notNil ifTrue:[ |
|
414 |
ign ignoreIfCalledFromMethod:ifCalledFromMethodOrNil. |
|
415 |
]. |
|
416 |
IgnoredHalts add:ign. |
|
11366
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 |
Smalltalk changed:#ignoredHalts. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
419 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
420 |
"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
|
421 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
422 |
|
12937 | 423 |
isBreakpointToBeIgnoredForParameter:parameter context:aContext modifyEntryCount:modifyCount |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
424 |
"/ should a breakpoint be ignored ? |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
425 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
426 |
IgnoredHalts isNil ifTrue:[^ false]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
427 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
428 |
"/ 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
|
429 |
IgnoredHalts do:[:ign | |
15413 | 430 |
(ign isForBreakpointWithParameter:parameter) ifTrue:[ |
431 |
Transcript show:'Debugger [info]: break ignored for ', parameter. |
|
432 |
||
433 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
434 |
ign isHaltIgnored ifFalse:[ |
|
435 |
Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter. |
|
436 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
437 |
]. |
|
438 |
^ true. |
|
439 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
440 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
441 |
|
13162 | 442 |
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
|
443 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
444 |
^ false. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
445 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
446 |
"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
|
447 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
448 |
|
12937 | 449 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod context:aContext modifyEntryCount:modifyCount |
12562 | 450 |
"should a halt be ignored ?" |
451 |
||
452 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
453 |
||
454 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
|
455 |
IgnoredHalts do:[:ign | |
|
16376 | 456 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[ |
457 |
Transcript showCR:'Debugger [info]: halt/break ignored: %1' with:ign. |
|
458 |
||
459 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
460 |
ign isHaltIgnored ifFalse:[ |
|
461 |
Transcript showCR:'Debugger [info]: no longer ignored (rest count=0)'. |
|
462 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
463 |
]. |
|
464 |
^ true. |
|
465 |
]. |
|
12562 | 466 |
]. |
467 |
||
13162 | 468 |
IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty. |
12562 | 469 |
|
470 |
^ false. |
|
471 |
||
472 |
"Modified (comment): / 06-03-2012 / 12:51:43 / cg" |
|
473 |
! |
|
474 |
||
10203 | 475 |
removeInactiveIgnores |
476 |
IgnoredHalts notNil ifTrue:[ |
|
15413 | 477 |
IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
10203 | 478 |
]. |
479 |
! |
|
480 |
||
481 |
stopIgnoringHalts |
|
482 |
"forget about all ignored halts" |
|
483 |
||
484 |
IgnoredHalts := nil. |
|
485 |
Smalltalk changed:#ignoredHalts. |
|
15302 | 486 |
! |
487 |
||
488 |
stopIgnoringHaltsFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
489 |
"remove the information (if any) about the ignore-state of a halt; |
|
490 |
effectively reenables the breakpoint/halt" |
|
491 |
||
492 |
IgnoredHalts isNil ifTrue:[^ self]. |
|
493 |
||
494 |
IgnoredHalts := IgnoredHalts reject:[:ign | |
|
15413 | 495 |
(ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
15302 | 496 |
]. |
10203 | 497 |
! ! |
498 |
||
499 |
!DebugView class methodsFor:'instance creation / entering'! |
|
0 | 500 |
|
2421 | 501 |
enter |
502 |
"enter a debugger" |
|
503 |
||
5455 | 504 |
<context: #return> |
505 |
||
10205 | 506 |
^ self |
15413 | 507 |
enter:thisContext sender |
508 |
withMessage:'Debugger Entered' |
|
509 |
mayProceed:true. |
|
10205 | 510 |
! |
511 |
||
512 |
enter:aContext withMessage:aString |
|
2355 | 513 |
"enter a debugger" |
514 |
||
5455 | 515 |
<context: #return> |
516 |
||
2355 | 517 |
^ self |
15413 | 518 |
enter:aContext |
519 |
withMessage:aString |
|
520 |
mayProceed:true |
|
2355 | 521 |
! |
522 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
523 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 524 |
"enter a debugger; if this is a recursive invocation, enter |
525 |
a MiniDebugger instead. |
|
526 |
This is the standard way of entering the debugger; |
|
527 |
sent from error- and halt messages." |
|
0 | 528 |
|
3447 | 529 |
<context: #return> |
530 |
||
14695 | 531 |
|display| |
532 |
||
13111 | 533 |
(NumberOfDebuggers ? 0) > self maxNumberOfDebuggers ifTrue:[ |
15413 | 534 |
NumberOfDebuggers := self allInstances count:[:d | d isOpen]. |
535 |
NumberOfDebuggers > self maxNumberOfDebuggers ifTrue:[ |
|
536 |
MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true. |
|
537 |
]. |
|
13111 | 538 |
]. |
539 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
540 |
DebuggingDebugger == true ifTrue:[ |
15413 | 541 |
'==> enter1: (' print. aContext print. ')' printCR. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
542 |
]. |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
543 |
|
14695 | 544 |
display := (self debuggerOnMainDisplayOnly) |
15413 | 545 |
ifTrue:[ Display ] |
546 |
ifFalse:[ Screen current ]. |
|
14695 | 547 |
|
548 |
Screen currentScreenQuerySignal answer:display |
|
549 |
do:[ |
|
15413 | 550 |
StepInterruptPending := nil. |
551 |
ControlInterrupt handle:[:ex | |
|
552 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
|
553 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
554 |
ex proceed |
|
555 |
] do:[ |
|
556 |
|debugger| |
|
557 |
||
558 |
" |
|
559 |
well, it could be a stepping or sending debugger up there; |
|
560 |
in this case, return to it. This happens, when a stepping process |
|
561 |
runs into an error (for example, a halt). In this case, we want the |
|
562 |
stepping debugger to come up again instead of a new one. |
|
563 |
" |
|
564 |
(debugger := self openDebuggerForActiveProcess) notNil ifTrue:[ |
|
565 |
debugger unstep. |
|
566 |
debugger setLabelFor:aString in:Processor activeProcess. |
|
567 |
debugger mayProceed:mayProceed. |
|
568 |
^ debugger enter:aContext select:nil. |
|
569 |
]. |
|
570 |
]. |
|
571 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
|
14695 | 572 |
]. |
526 | 573 |
|
13666 | 574 |
"Modified: / 06-11-2013 / 20:58:54 / cg" |
53 | 575 |
! |
576 |
||
8347 | 577 |
enterException:ex |
578 |
"enter a debugger; if this is a recursive invocation, enter |
|
579 |
a MiniDebugger instead. |
|
580 |
This is the standard way of entering the debugger; |
|
581 |
sent from error- and halt messages." |
|
582 |
||
15730 | 583 |
"/ a quick check for ignored breakpoints here, |
584 |
"/ to shortcut the expensive debugger setup. |
|
585 |
"/ big speedup when many ignored breakpoints are reached. |
|
586 |
IgnoredHalts notNil ifTrue:[ |
|
587 |
((ex creator == NoHandlerError) |
|
588 |
and:[ ex exception creator == BreakPointInterrupt ]) ifTrue:[ |
|
589 |
(self |
|
590 |
isHaltToBeIgnoredIn:(ex suspendedContext method) |
|
591 |
atLineNr:1 |
|
592 |
context:(ex suspendedContext) |
|
593 |
modifyEntryCount:true |
|
594 |
) ifTrue:[ |
|
595 |
"/ Transcript showCR:'quick ignored'. |
|
596 |
^ true. |
|
597 |
]. |
|
598 |
]. |
|
599 |
]. |
|
8347 | 600 |
^ self |
15730 | 601 |
enter:ex returnableSuspendedContext |
602 |
withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger) |
|
603 |
mayProceed:(ex mayProceed). |
|
8347 | 604 |
! |
605 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
606 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 607 |
"enter a debugger - do not check for recursive invocation" |
608 |
||
5455 | 609 |
<context: #return> |
610 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
611 |
|aDebugger| |
266 | 612 |
|
613 |
StepInterruptPending := nil. |
|
13111 | 614 |
NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1. |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
615 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
616 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
617 |
"/ to avoid recursive debugging ... |
3447 | 618 |
ControlInterrupt handle:[:ex | |
15413 | 619 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
620 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
621 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
622 |
] do:[ |
15413 | 623 |
aDebugger := self new. |
3447 | 624 |
]. |
625 |
||
626 |
aDebugger isNil ifTrue:[ |
|
15413 | 627 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
628 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
629 |
mayProceed ifTrue:[ |
|
630 |
(Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs |
|
631 |
yesLabel:'Continue' noLabel:'Abort') |
|
632 |
ifTrue:[ |
|
633 |
^ nil |
|
634 |
]. |
|
635 |
] ifFalse:[ |
|
636 |
self information:'Error caught.\\Press OK to abort the operation.' withCRs. |
|
637 |
]. |
|
638 |
AbortOperationRequest raise. |
|
639 |
"not reached" |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
640 |
]. |
3447 | 641 |
|
642 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
643 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 644 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
645 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
646 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
647 |
" |
15413 | 648 |
nil halt |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
649 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
650 |
|
3447 | 651 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 652 |
! |
653 |
||
6430 | 654 |
enterWithMessage:message |
655 |
"enter a debugger" |
|
656 |
||
657 |
<context: #return> |
|
658 |
||
10205 | 659 |
^ self |
15413 | 660 |
enter:(thisContext sender) |
661 |
withMessage:message |
|
662 |
mayProceed:true. |
|
6430 | 663 |
! |
664 |
||
266 | 665 |
new |
10205 | 666 |
"return a new DebugView. |
2358 | 667 |
- return a cached debugger if it already exists. |
668 |
Also, care for remote displays on which no debugger is wanted |
|
669 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
670 |
||
14695 | 671 |
|debugger currentScreen debuggerScreen| |
2358 | 672 |
|
673 |
currentScreen := Screen current. |
|
14 | 674 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
675 |
currentScreen notNil ifTrue:[ |
15413 | 676 |
(currentScreen suppressDebugger) ifTrue:[ |
677 |
"/ no debuggers with that device - show an alertBox which aborts... |
|
678 |
^ nil. |
|
679 |
]. |
|
680 |
(currentScreen mayOpenDebugger) ifFalse:[ |
|
681 |
"/ no debugger on that device - but on the main screen |
|
682 |
currentScreen := Display ? Screen default. |
|
683 |
]. |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
684 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
685 |
|
266 | 686 |
" |
10205 | 687 |
need a blocking debugger if no processes or |
688 |
or if its a timing/interrupt process |
|
266 | 689 |
(because otherwise we would not get any events here ... |
690 |
" |
|
691 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
15413 | 692 |
((debugger := CachedExclusive) isNil |
693 |
or:[debugger device ~~ currentScreen |
|
694 |
or:[currentScreen isNil |
|
695 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
|
696 |
debugger := self newExclusive |
|
697 |
]. |
|
698 |
CachedExclusive := nil. |
|
266 | 699 |
] ifFalse:[ |
15413 | 700 |
CachedDebugger notNil ifTrue:[ |
701 |
(CachedDebugger device ~~ currentScreen |
|
702 |
or:[currentScreen isNil |
|
703 |
or:[currentScreen isOpen not |
|
704 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
|
705 |
CachedDebugger := nil |
|
706 |
] |
|
707 |
]. |
|
708 |
||
709 |
(debugger := CachedDebugger) notNil ifTrue:[ |
|
710 |
CachedDebugger := nil. |
|
711 |
] ifFalse:[ |
|
712 |
debuggerScreen := currentScreen. |
|
713 |
debuggerScreen isNil ifTrue:[ |
|
714 |
"/ use the default display |
|
715 |
debuggerScreen := Screen default. |
|
716 |
]. |
|
717 |
(debuggerScreen isNil |
|
718 |
or:[debuggerScreen isOpen not |
|
719 |
"/ or:[debuggerDevice mayOpenDebugger not] |
|
720 |
]) ifTrue:[ |
|
721 |
"/ no debugger |
|
722 |
^ nil. |
|
723 |
]. |
|
724 |
||
725 |
Screen currentScreenQuerySignal answer:debuggerScreen |
|
726 |
do:[ |
|
727 |
debugger := super new. |
|
728 |
]. |
|
729 |
debugger label:'Debugger'. |
|
730 |
debugger icon:self defaultIcon. |
|
731 |
] |
|
266 | 732 |
]. |
73 | 733 |
^ debugger |
875 | 734 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
735 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 736 |
! |
0 | 737 |
|
266 | 738 |
newExclusive |
739 |
"return a debugger for exclusive display access" |
|
740 |
||
741 |
|debugger| |
|
105 | 742 |
|
266 | 743 |
debugger := super new. |
744 |
debugger label:'Debugger'. |
|
875 | 745 |
debugger icon:self defaultIcon. |
266 | 746 |
debugger exclusive:true. |
747 |
^ debugger |
|
875 | 748 |
|
749 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 750 |
! |
751 |
||
13666 | 752 |
openDebuggerForActiveProcess |
753 |
"return an already open debugger for the active process, or nil, if there is none. |
|
754 |
Open debuggers exist when stepping only, as then, the debugger is left open until the step |
|
755 |
is reached, to avoid too much flickering and redrawing on the screen" |
|
756 |
||
757 |
|active| |
|
758 |
||
759 |
" |
|
760 |
well, it could be a stepping or sending debugger up there; |
|
761 |
in this case, return to it. This happens, when a stepping process |
|
762 |
runs into an error (for example, a halt). In this case, we want the |
|
763 |
stepping debugger to come up again instead of a new one. |
|
764 |
" |
|
765 |
OpenDebuggers notNil ifTrue:[ |
|
15413 | 766 |
active := Processor activeProcess. |
767 |
OpenDebuggers do:[:aDebugger | |
|
768 |
|debuggersProcess| |
|
769 |
||
770 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
|
771 |
debuggersProcess := aDebugger inspectedProcess. |
|
772 |
debuggersProcess == active ifTrue:[ |
|
773 |
aDebugger device isOpen ifTrue:[ |
|
774 |
DebuggingDebugger == true ifTrue:[ |
|
775 |
'reusing cached debugger' errorPrintCR. |
|
776 |
]. |
|
777 |
aDebugger unstep. |
|
778 |
^ aDebugger. |
|
779 |
] |
|
780 |
]. |
|
781 |
(debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[ |
|
782 |
aDebugger destroy. |
|
783 |
]. |
|
784 |
] |
|
785 |
] |
|
13666 | 786 |
]. |
787 |
^ nil |
|
788 |
||
789 |
"Created: / 06-11-2013 / 20:57:49 / cg" |
|
790 |
! |
|
791 |
||
29 | 792 |
openOn:aProcess |
793 |
"start a debugger on aProcess |
|
794 |
(actually not more than a good-looking inspector)" |
|
15 | 795 |
|
52 | 796 |
|aDebugger label nm| |
15 | 797 |
|
798 |
aDebugger := super new. |
|
875 | 799 |
aDebugger icon:self defaultIcon. |
29 | 800 |
aProcess notNil ifTrue:[ |
15413 | 801 |
nm := aProcess name. |
802 |
nm notNil ifTrue:[ |
|
803 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
804 |
] ifFalse:[ |
|
805 |
nm := aProcess id printString |
|
806 |
]. |
|
807 |
label := 'Debugger [' , nm , ']'. |
|
29 | 808 |
] ifFalse:[ |
15413 | 809 |
label := 'no process' |
29 | 810 |
]. |
1114 | 811 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 812 |
aDebugger openOn:aProcess. |
813 |
^ nil |
|
875 | 814 |
|
1114 | 815 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 816 |
! ! |
817 |
||
3269 | 818 |
!DebugView class methodsFor:'menu specs'! |
819 |
||
12437 | 820 |
breakPointMenuSpec |
821 |
"This resource specification was automatically generated |
|
822 |
by the MenuEditor of ST/X." |
|
823 |
||
824 |
"Do not manually edit this!! If it is corrupted, |
|
825 |
the MenuEditor may not be able to read the specification." |
|
826 |
||
827 |
||
828 |
" |
|
829 |
MenuEditor new openOnClass:DebugView andSelector:#breakPointMenuSpec |
|
830 |
(Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp |
|
831 |
" |
|
832 |
||
833 |
<resource: #menu> |
|
834 |
||
15413 | 835 |
^ |
12437 | 836 |
#(Menu |
15413 | 837 |
( |
838 |
(MenuItem |
|
839 |
enabled: canRemoveBreakpoint |
|
840 |
label: 'Remove Breakpoint' |
|
841 |
itemValue: removeBreakpoint |
|
842 |
) |
|
843 |
(MenuItem |
|
844 |
label: 'Remove all Breakpoints' |
|
845 |
itemValue: removeAllBreakpoints |
|
846 |
) |
|
847 |
(MenuItem |
|
848 |
label: '-' |
|
849 |
) |
|
850 |
(MenuItem |
|
851 |
label: 'Ignore this Halt/BreakPoint' |
|
852 |
submenu: |
|
853 |
(Menu |
|
854 |
( |
|
855 |
(MenuItem |
|
856 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
857 |
label: 'Forever (Until Ignoring is Stopped)' |
|
858 |
itemValue: ignoreHaltForever |
|
859 |
) |
|
860 |
(MenuItem |
|
861 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
862 |
label: 'For Some Time...' |
|
863 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
864 |
) |
|
865 |
(MenuItem |
|
866 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
867 |
label: 'For the Next N Times...' |
|
868 |
itemValue: openIgnoreHaltNTimesDialog |
|
869 |
) |
|
870 |
(MenuItem |
|
871 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
872 |
label: 'Until Shift-Key is Pressed' |
|
873 |
itemValue: ignoreHaltUntilShiftKeyIsPressed |
|
874 |
) |
|
875 |
(MenuItem |
|
876 |
label: '-' |
|
877 |
) |
|
878 |
(MenuItem |
|
879 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
880 |
label: 'In Current Process' |
|
881 |
itemValue: ignoreHaltForCurrentProcess |
|
882 |
) |
|
883 |
(MenuItem |
|
884 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
885 |
label: 'For this Receiver Class' |
|
886 |
itemValue: ignoreHaltForThisReceiverClass |
|
887 |
) |
|
888 |
(MenuItem |
|
889 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
890 |
label: 'If Called from Any Of' |
|
891 |
submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf |
|
892 |
) |
|
893 |
) |
|
894 |
nil |
|
895 |
nil |
|
896 |
) |
|
897 |
) |
|
898 |
(MenuItem |
|
899 |
enabled: isStoppedAtBreakPointWithParameter |
|
900 |
label: 'Ignore all BreakPoints with this Parameter' |
|
901 |
submenu: |
|
902 |
(Menu |
|
903 |
( |
|
904 |
(MenuItem |
|
905 |
enabled: isStoppedAtBreakPointWithParameter |
|
906 |
label: 'Forever (Reenable in BreakPoint-Browser)' |
|
907 |
itemValue: ignoreBreakpointsWithThisParameterForever |
|
908 |
) |
|
909 |
(MenuItem |
|
910 |
enabled: isStoppedAtBreakPointWithParameter |
|
911 |
label: 'For Some Time...' |
|
912 |
itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
|
913 |
) |
|
914 |
(MenuItem |
|
915 |
enabled: isStoppedAtBreakPointWithParameter |
|
916 |
label: 'For the Next N Times...' |
|
917 |
itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog |
|
918 |
) |
|
919 |
(MenuItem |
|
920 |
enabled: isStoppedAtBreakPointWithParameter |
|
921 |
label: 'Until Shift-Key is Pressed' |
|
922 |
itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
|
923 |
) |
|
924 |
(MenuItem |
|
925 |
label: '-' |
|
926 |
) |
|
927 |
(MenuItem |
|
928 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
929 |
label: 'In Current Process' |
|
930 |
itemValue: ignoreAllHaltsForCurrentProcess |
|
931 |
) |
|
932 |
(MenuItem |
|
933 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
934 |
label: 'For this Receiver Class' |
|
935 |
itemValue: ignoreAllHaltsForThisReceiverClass |
|
936 |
) |
|
937 |
(MenuItem |
|
938 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
939 |
label: 'If Called from Any Of' |
|
940 |
submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
|
941 |
) |
|
942 |
) |
|
943 |
nil |
|
944 |
nil |
|
945 |
) |
|
946 |
) |
|
947 |
(MenuItem |
|
948 |
label: 'Ignore all Halts/BreakPoints' |
|
949 |
submenu: |
|
950 |
(Menu |
|
951 |
( |
|
952 |
(MenuItem |
|
953 |
label: 'Forever (Until Ignoring is Stopped)' |
|
954 |
itemValue: ignoreAllHaltsForever |
|
955 |
) |
|
956 |
(MenuItem |
|
957 |
label: 'For Some Time...' |
|
958 |
itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
|
959 |
) |
|
960 |
(MenuItem |
|
961 |
label: 'Until Shift-Key is Pressed' |
|
962 |
itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
|
963 |
) |
|
964 |
) |
|
965 |
nil |
|
966 |
nil |
|
967 |
) |
|
968 |
) |
|
969 |
(MenuItem |
|
970 |
enabled: hasHaltsToIgnore |
|
971 |
label: 'Stop Ignoring' |
|
972 |
itemValue: stopIgnoringHalts |
|
973 |
) |
|
974 |
(MenuItem |
|
975 |
label: '-' |
|
976 |
) |
|
977 |
(MenuItem |
|
978 |
enabled: canAddBreakpoint |
|
979 |
label: 'Add Breakpoint' |
|
980 |
itemValue: addBreakpoint |
|
981 |
) |
|
982 |
(MenuItem |
|
983 |
label: 'Manage Breakpoints' |
|
984 |
itemValue: openBreakPointBrowser |
|
985 |
) |
|
986 |
(MenuItem |
|
987 |
label: '-' |
|
988 |
) |
|
989 |
(MenuItem |
|
990 |
label: 'Allow Halt in Debugger' |
|
991 |
itemValue: allowBreakPointsInDebugger: |
|
992 |
indication: allowBreakPointsInDebugger |
|
993 |
) |
|
994 |
) |
|
995 |
nil |
|
996 |
nil |
|
12437 | 997 |
) |
998 |
! |
|
999 |
||
1000 |
classMenuSpec |
|
1001 |
"This resource specification was automatically generated |
|
1002 |
by the MenuEditor of ST/X." |
|
1003 |
||
1004 |
"Do not manually edit this!! If it is corrupted, |
|
1005 |
the MenuEditor may not be able to read the specification." |
|
1006 |
||
1007 |
||
1008 |
" |
|
12840 | 1009 |
MenuEditor new openOnClass:DebugView andSelector:#receiverMenuSpec |
1010 |
(Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp |
|
12437 | 1011 |
" |
1012 |
||
1013 |
<resource: #menu> |
|
1014 |
||
15413 | 1015 |
^ |
12437 | 1016 |
#(Menu |
15413 | 1017 |
( |
1018 |
(MenuItem |
|
1019 |
enabled: canBrowseImplementingClass |
|
1020 |
label: 'Browse Implementing Class' |
|
1021 |
itemValue: browseImplementingClass |
|
1022 |
) |
|
1023 |
(MenuItem |
|
1024 |
enabled: canBrowseReceiversClass |
|
1025 |
label: 'Browse Receiver''s Class' |
|
1026 |
itemValue: browseReceiversClass |
|
1027 |
) |
|
1028 |
(MenuItem |
|
1029 |
enabled: canBrowseProcessesApplication |
|
1030 |
label: 'Browse Application Class' |
|
1031 |
itemValue: browseProcessesApplication |
|
1032 |
) |
|
1033 |
(MenuItem |
|
1034 |
label: '-' |
|
1035 |
) |
|
1036 |
(MenuItem |
|
1037 |
enabled: canBrowseClassHierarchy |
|
1038 |
label: 'Browse Receiver''s Class Hierarchy' |
|
1039 |
itemValue: browseClassHierarchy |
|
1040 |
isVisible: false |
|
1041 |
) |
|
1042 |
(MenuItem |
|
1043 |
enabled: canBrowseFullClassProtocol |
|
1044 |
label: 'Browse Receiver''s Full Protocol' |
|
1045 |
itemValue: browseFullClassProtocol |
|
1046 |
isVisible: false |
|
1047 |
) |
|
1048 |
(MenuItem |
|
1049 |
label: '-' |
|
1050 |
isVisible: false |
|
1051 |
) |
|
1052 |
(MenuItem |
|
1053 |
enabled: canInspectWidgetHierarchy |
|
1054 |
label: 'Inspect Widget Hierarchy' |
|
1055 |
itemValue: inspectWidgetHierarchy |
|
1056 |
) |
|
1057 |
) |
|
1058 |
nil |
|
1059 |
nil |
|
12437 | 1060 |
) |
1061 |
! |
|
1062 |
||
1063 |
contextMenuSpec |
|
1064 |
"This resource specification was automatically generated |
|
1065 |
by the MenuEditor of ST/X." |
|
1066 |
||
1067 |
"Do not manually edit this!! If it is corrupted, |
|
1068 |
the MenuEditor may not be able to read the specification." |
|
1069 |
||
1070 |
||
1071 |
" |
|
1072 |
MenuEditor new openOnClass:DebugView andSelector:#contextMenuSpec |
|
1073 |
(Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp |
|
1074 |
" |
|
1075 |
||
1076 |
<resource: #menu> |
|
1077 |
||
15413 | 1078 |
^ |
12437 | 1079 |
#(Menu |
15413 | 1080 |
( |
1081 |
(MenuItem |
|
1082 |
enabled: canReturn |
|
1083 |
label: 'Return' |
|
1084 |
itemValue: doReturn |
|
1085 |
) |
|
1086 |
(MenuItem |
|
1087 |
enabled: canRestart |
|
1088 |
label: 'Restart' |
|
1089 |
itemValue: doRestart |
|
1090 |
) |
|
1091 |
(MenuItem |
|
1092 |
label: '-' |
|
1093 |
) |
|
1094 |
(MenuItem |
|
1095 |
enabled: hasContextSelected |
|
1096 |
label: 'Inspect' |
|
1097 |
itemValue: inspectContext |
|
1098 |
) |
|
1099 |
(MenuItem |
|
1100 |
label: 'Copy WalkBack Text' |
|
1101 |
itemValue: copyWalkbackText |
|
1102 |
) |
|
1103 |
(MenuItem |
|
1104 |
label: 'Inspect Method' |
|
1105 |
itemValue: inspectContextsMethod |
|
1106 |
) |
|
1107 |
(MenuItem |
|
1108 |
label: 'Bookmark Method in SystemBrowser' |
|
1109 |
itemValue: addBrowserBookmark |
|
1110 |
) |
|
1111 |
(MenuItem |
|
1112 |
label: '-' |
|
1113 |
) |
|
1114 |
(MenuItem |
|
1115 |
enabled: hasBlockContextSelected |
|
1116 |
label: 'Find Home Context in Caller Chain...' |
|
1117 |
itemValue: findHomeContext |
|
1118 |
) |
|
1119 |
(MenuItem |
|
1120 |
enabled: hasContextSelected |
|
1121 |
label: 'Find Context with String in Source...' |
|
1122 |
itemValue: findContextWithStringInSource |
|
1123 |
) |
|
1124 |
(MenuItem |
|
1125 |
enabled: hasContextSelected |
|
1126 |
label: 'Find Context with Value in Variable...' |
|
1127 |
itemValue: findContextWithValueInVariable |
|
1128 |
) |
|
1129 |
(MenuItem |
|
1130 |
enabled: hasContextSelected |
|
1131 |
label: 'Find Next Exception Handler' |
|
1132 |
itemValue: findNextExceptionHandlerContext |
|
1133 |
) |
|
1134 |
(MenuItem |
|
1135 |
enabled: hasContextSelected |
|
1136 |
label: 'Find Handler For...' |
|
1137 |
itemValue: findHandlerFor |
|
1138 |
) |
|
1139 |
(MenuItem |
|
1140 |
label: 'Find Dialog Opener...' |
|
1141 |
itemValue: doGotoDialogOpener |
|
1142 |
) |
|
1143 |
(MenuItem |
|
1144 |
label: 'Find Application Action Method...' |
|
1145 |
itemValue: doGotoApplicationActionMethod |
|
1146 |
) |
|
1147 |
(MenuItem |
|
1148 |
label: '-' |
|
1149 |
) |
|
1150 |
(MenuItem |
|
1151 |
label: 'Remember Callchain && Highlight on Next Entry' |
|
1152 |
itemValue: rememberCallchain |
|
1153 |
) |
|
1154 |
(MenuItem |
|
1155 |
label: 'Clear Remembered Callchain' |
|
1156 |
itemValue: clearRememberedCallchain |
|
1157 |
) |
|
1158 |
) |
|
1159 |
nil |
|
1160 |
nil |
|
12437 | 1161 |
) |
1162 |
! |
|
1163 |
||
1164 |
fileMenuSpec |
|
1165 |
"This resource specification was automatically generated |
|
1166 |
by the MenuEditor of ST/X." |
|
1167 |
||
1168 |
"Do not manually edit this!! If it is corrupted, |
|
1169 |
the MenuEditor may not be able to read the specification." |
|
1170 |
||
1171 |
||
1172 |
" |
|
1173 |
MenuEditor new openOnClass:DebugView andSelector:#fileMenuSpec |
|
1174 |
(Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp |
|
1175 |
" |
|
1176 |
||
1177 |
<resource: #menu> |
|
1178 |
||
15413 | 1179 |
^ |
12437 | 1180 |
#(Menu |
15413 | 1181 |
( |
1182 |
(MenuItem |
|
1183 |
enabled: canSendEmail |
|
1184 |
label: 'Report a Bug via eMail...' |
|
1185 |
itemValue: doOpenReportMailApp |
|
1186 |
) |
|
1187 |
(MenuItem |
|
1188 |
label: '-' |
|
1189 |
) |
|
1190 |
(MenuItem |
|
1191 |
enabled: canCloseAllDebuggers |
|
1192 |
label: 'Close all Debuggers...' |
|
1193 |
itemValue: closeAllDebuggers |
|
1194 |
isVisible: isNotInspecting |
|
1195 |
) |
|
1196 |
(MenuItem |
|
1197 |
label: '-' |
|
1198 |
) |
|
1199 |
(MenuItem |
|
1200 |
label: 'Exit' |
|
1201 |
itemValue: closeRequest |
|
1202 |
isVisible: isInspecting |
|
1203 |
) |
|
1204 |
(MenuItem |
|
1205 |
label: 'Close Debugger and Abort' |
|
1206 |
itemValue: closeRequest |
|
1207 |
isVisible: isNotInspecting |
|
1208 |
) |
|
1209 |
) |
|
1210 |
nil |
|
1211 |
nil |
|
12437 | 1212 |
) |
1213 |
! |
|
1214 |
||
1215 |
helpMenuSpec |
|
1216 |
"This resource specification was automatically generated |
|
1217 |
by the MenuEditor of ST/X." |
|
1218 |
||
1219 |
"Do not manually edit this!! If it is corrupted, |
|
1220 |
the MenuEditor may not be able to read the specification." |
|
1221 |
||
1222 |
||
1223 |
" |
|
1224 |
MenuEditor new openOnClass:DebugView andSelector:#helpMenuSpec |
|
1225 |
(Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp |
|
1226 |
" |
|
1227 |
||
1228 |
<resource: #menu> |
|
1229 |
||
15413 | 1230 |
^ |
12437 | 1231 |
#(Menu |
15413 | 1232 |
( |
1233 |
(MenuItem |
|
1234 |
label: 'Debugger''s Documentation' |
|
1235 |
itemValue: openHTMLDocument: |
|
1236 |
argument: 'tools/debugger/TOP.html' |
|
1237 |
) |
|
1238 |
(MenuItem |
|
1239 |
label: '-' |
|
1240 |
) |
|
1241 |
(MenuItem |
|
1242 |
label: 'About DebugView...' |
|
1243 |
itemValue: openAboutThisApplication |
|
1244 |
) |
|
1245 |
) |
|
1246 |
nil |
|
1247 |
nil |
|
12437 | 1248 |
) |
1249 |
! |
|
1250 |
||
3269 | 1251 |
menuSpec |
1252 |
"This resource specification was automatically generated |
|
1253 |
by the MenuEditor of ST/X." |
|
1254 |
||
1255 |
"Do not manually edit this!! If it is corrupted, |
|
1256 |
the MenuEditor may not be able to read the specification." |
|
1257 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
1258 |
|
3269 | 1259 |
" |
1260 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
1261 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
1262 |
" |
|
1263 |
||
1264 |
<resource: #menu> |
|
1265 |
||
15413 | 1266 |
^ |
5875 | 1267 |
#(Menu |
15413 | 1268 |
( |
1269 |
(MenuItem |
|
1270 |
label: 'File' |
|
1271 |
submenuChannel: fileMenuSpec |
|
1272 |
) |
|
1273 |
(MenuItem |
|
1274 |
label: 'View' |
|
1275 |
submenuChannel: viewMenuSpec |
|
1276 |
) |
|
1277 |
(MenuItem |
|
1278 |
label: 'Process' |
|
1279 |
submenuChannel: processMenuSpec |
|
1280 |
) |
|
1281 |
(MenuItem |
|
1282 |
label: 'Context' |
|
1283 |
submenuChannel: contextMenuSpec |
|
1284 |
) |
|
1285 |
(MenuItem |
|
1286 |
label: 'Receiver' |
|
1287 |
submenuChannel: classMenuSpec |
|
1288 |
) |
|
1289 |
(MenuItem |
|
1290 |
label: 'Selector' |
|
1291 |
submenuChannel: selectorMenuSpec |
|
1292 |
) |
|
1293 |
(MenuItem |
|
1294 |
label: 'Breakpoint' |
|
1295 |
submenuChannel: breakPointMenuSpec |
|
1296 |
) |
|
1297 |
(MenuItem |
|
1298 |
label: 'MENU_Help' |
|
1299 |
startGroup: conditionalRight |
|
1300 |
submenuChannel: helpMenuSpec |
|
1301 |
) |
|
1302 |
) |
|
1303 |
nil |
|
1304 |
nil |
|
12437 | 1305 |
) |
1306 |
! |
|
1307 |
||
1308 |
processMenuSpec |
|
1309 |
"This resource specification was automatically generated |
|
1310 |
by the MenuEditor of ST/X." |
|
1311 |
||
1312 |
"Do not manually edit this!! If it is corrupted, |
|
1313 |
the MenuEditor may not be able to read the specification." |
|
1314 |
||
1315 |
||
1316 |
" |
|
1317 |
MenuEditor new openOnClass:DebugView andSelector:#processMenuSpec |
|
1318 |
(Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp |
|
1319 |
" |
|
1320 |
||
1321 |
<resource: #menu> |
|
1322 |
||
15413 | 1323 |
^ |
12437 | 1324 |
#(Menu |
15413 | 1325 |
( |
1326 |
(MenuItem |
|
1327 |
label: 'Continue' |
|
1328 |
itemValue: doContinue |
|
1329 |
) |
|
1330 |
(MenuItem |
|
1331 |
label: 'Next (Line-Step)' |
|
1332 |
itemValue: doNext |
|
1333 |
) |
|
1334 |
(MenuItem |
|
1335 |
label: 'Step' |
|
1336 |
itemValue: doStep |
|
1337 |
) |
|
1338 |
(MenuItem |
|
1339 |
label: '-' |
|
1340 |
) |
|
1341 |
(MenuItem |
|
1342 |
label: 'After 5 Seconds' |
|
1343 |
submenu: |
|
1344 |
(Menu |
|
1345 |
( |
|
1346 |
(MenuItem |
|
1347 |
label: 'Continue' |
|
1348 |
itemValue: doContinueAfterDelay |
|
1349 |
) |
|
1350 |
(MenuItem |
|
1351 |
label: 'Next (Line-Step)' |
|
1352 |
itemValue: doNextAfterDelay |
|
1353 |
) |
|
1354 |
(MenuItem |
|
1355 |
label: 'Step' |
|
1356 |
itemValue: doStepAfterDelay |
|
1357 |
) |
|
1358 |
) |
|
1359 |
nil |
|
1360 |
nil |
|
1361 |
) |
|
1362 |
) |
|
1363 |
(MenuItem |
|
1364 |
label: '-' |
|
1365 |
) |
|
1366 |
(MenuItem |
|
1367 |
label: 'Skip to Cursor Line' |
|
1368 |
itemValue: skip |
|
1369 |
) |
|
1370 |
(MenuItem |
|
1371 |
label: 'Step Out (Skip until Return)' |
|
1372 |
itemValue: skipForReturn |
|
1373 |
) |
|
1374 |
(MenuItem |
|
1375 |
label: 'Skip until Entering...' |
|
1376 |
itemValue: skipUntilEntering |
|
1377 |
) |
|
1378 |
(MenuItem |
|
1379 |
label: '-' |
|
1380 |
) |
|
1381 |
(MenuItem |
|
1382 |
label: 'Abort' |
|
1383 |
itemValue: doAbort |
|
1384 |
) |
|
1385 |
(MenuItem |
|
1386 |
enabled: abortAllIsHandled |
|
1387 |
label: 'Abort All' |
|
1388 |
itemValue: doAbortAll |
|
1389 |
) |
|
1390 |
(MenuItem |
|
1391 |
label: '-' |
|
1392 |
) |
|
1393 |
(MenuItem |
|
1394 |
label: 'Inspect' |
|
1395 |
itemValue: doInspectProcess |
|
1396 |
) |
|
1397 |
(MenuItem |
|
1398 |
label: 'Change Priority...' |
|
1399 |
itemValue: doChangeProcessPriority |
|
1400 |
) |
|
1401 |
(MenuItem |
|
1402 |
label: '-' |
|
1403 |
) |
|
1404 |
(MenuItem |
|
1405 |
label: 'Terminate' |
|
1406 |
itemValue: doTerminate |
|
1407 |
) |
|
1408 |
(MenuItem |
|
1409 |
label: 'Hard Terminate (Danger)' |
|
1410 |
itemValue: quickTerminate |
|
1411 |
isVisible: false |
|
1412 |
) |
|
1413 |
) |
|
1414 |
nil |
|
1415 |
nil |
|
12437 | 1416 |
) |
1417 |
! |
|
1418 |
||
1419 |
selectorMenuSpec |
|
1420 |
"This resource specification was automatically generated |
|
1421 |
by the MenuEditor of ST/X." |
|
1422 |
||
1423 |
"Do not manually edit this!! If it is corrupted, |
|
1424 |
the MenuEditor may not be able to read the specification." |
|
1425 |
||
1426 |
||
1427 |
" |
|
1428 |
MenuEditor new openOnClass:DebugView andSelector:#selectorMenuSpec |
|
1429 |
(Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp |
|
1430 |
" |
|
1431 |
||
1432 |
<resource: #menu> |
|
1433 |
||
15413 | 1434 |
^ |
12437 | 1435 |
#(Menu |
15413 | 1436 |
( |
1437 |
(MenuItem |
|
1438 |
label: 'Browse Implementors...' |
|
1439 |
itemValue: browseImplementorsOf |
|
1440 |
) |
|
1441 |
(MenuItem |
|
1442 |
label: 'Browse Senders...' |
|
1443 |
itemValue: browseSendersOf |
|
1444 |
) |
|
1445 |
(MenuItem |
|
1446 |
label: '-' |
|
1447 |
) |
|
1448 |
(MenuItem |
|
1449 |
enabled: canDefineMethod |
|
1450 |
label: 'Define Missing Method' |
|
1451 |
itemValue: doDefineMethod |
|
1452 |
) |
|
1453 |
) |
|
1454 |
nil |
|
1455 |
nil |
|
12437 | 1456 |
) |
1457 |
! |
|
1458 |
||
1459 |
viewMenuSpec |
|
1460 |
"This resource specification was automatically generated |
|
1461 |
by the MenuEditor of ST/X." |
|
1462 |
||
1463 |
"Do not manually edit this!! If it is corrupted, |
|
1464 |
the MenuEditor may not be able to read the specification." |
|
1465 |
||
1466 |
||
1467 |
" |
|
1468 |
MenuEditor new openOnClass:DebugView andSelector:#viewMenuSpec |
|
1469 |
(Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp |
|
1470 |
" |
|
1471 |
||
1472 |
<resource: #menu> |
|
1473 |
||
15413 | 1474 |
^ |
12437 | 1475 |
#(Menu |
15413 | 1476 |
( |
1477 |
(MenuItem |
|
1478 |
enabled: canShowMore |
|
1479 |
label: 'Show More WalkBack' |
|
1480 |
itemValue: showMoreWalkback |
|
1481 |
) |
|
1482 |
(MenuItem |
|
1483 |
enabled: canShowMore |
|
1484 |
label: 'Show Full WalkBack' |
|
1485 |
itemValue: showFullWalkback |
|
1486 |
) |
|
1487 |
(MenuItem |
|
1488 |
label: '-' |
|
1489 |
) |
|
1490 |
(MenuItem |
|
1491 |
label: 'Show Dense WalkBack' |
|
1492 |
itemValue: showingDenseWalkback: |
|
1493 |
hideMenuOnActivated: false |
|
1494 |
indication: showingDenseWalkback |
|
1495 |
) |
|
1496 |
(MenuItem |
|
1497 |
enabled: notShowingDenseWalkbackHolder |
|
1498 |
label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)' |
|
1499 |
itemValue: showingSupportCode: |
|
1500 |
hideMenuOnActivated: false |
|
1501 |
indication: showingSupportCode |
|
1502 |
) |
|
1503 |
(MenuItem |
|
1504 |
label: '-' |
|
1505 |
) |
|
1506 |
(MenuItem |
|
1507 |
label: 'Raise Debugger when Entering' |
|
1508 |
itemValue: autoRaiseView: |
|
1509 |
hideMenuOnActivated: false |
|
1510 |
indication: autoRaiseView |
|
1511 |
) |
|
1512 |
(MenuItem |
|
1513 |
label: '-' |
|
1514 |
) |
|
1515 |
(MenuItem |
|
1516 |
label: 'Settings...' |
|
1517 |
itemValue: openSettingsDialog |
|
1518 |
) |
|
1519 |
) |
|
1520 |
nil |
|
1521 |
nil |
|
3269 | 1522 |
) |
1523 |
! ! |
|
1524 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1525 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1526 |
|
4121 | 1527 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1528 |
"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
|
1529 |
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
|
1530 |
and Exception contexts, to present the context in which the error |
16801 | 1531 |
actually occurred. |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1532 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1533 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1534 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1535 |
|
12839 | 1536 |
"/ fetch some contexts... |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1537 |
someContexts := Array new:25. |
2042 | 1538 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1539 |
idx := 1. |
10205 | 1540 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
16801 | 1541 |
someContexts at:idx put:con. |
1542 |
con := con sender. |
|
1543 |
idx := idx + 1. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1544 |
]. |
12839 | 1545 |
"/ search... |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1546 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1547 |
^ someContexts at:idx. |
13398 | 1548 |
|
1549 |
"Modified: / 28-08-2013 / 20:12:47 / cg" |
|
3447 | 1550 |
! |
1551 |
||
10205 | 1552 |
interestingContextIndexIn:aContextArray |
12039 | 1553 |
"return an interesting context's index, or nil. |
1554 |
This is the context initially shown (selected) in the walkback. |
|
3447 | 1555 |
We move up the calling chain, skipping all intermediate Signal |
16801 | 1556 |
and Exception contexts, to present the context in which the error actually occurred. |
13398 | 1557 |
Just for your (my) convenience :-)" |
3447 | 1558 |
|
13309 | 1559 |
|con found offset sel prev rcvr nMax idx methodHome method| |
3447 | 1560 |
|
13398 | 1561 |
"/ Transcript showCR:'x'. |
7713 | 1562 |
"/ Transcript showCR:aContextArray. |
7648 | 1563 |
|
3447 | 1564 |
nMax := aContextArray size. |
1565 |
nMax <= 1 ifTrue:[^ 1]. |
|
1566 |
con := aContextArray at:1. |
|
1567 |
con isBlockContext ifTrue:[^ 1]. |
|
12039 | 1568 |
(con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1]. "/ we are already there |
3447 | 1569 |
|
1570 |
"/ somewhere, at the bottom, there must be a raise ... |
|
1571 |
"/ find the exception |
|
1572 |
1 to:5 do:[:i | |
|
16730 | 1573 |
found isNil ifTrue:[ |
1574 |
con := aContextArray at:i ifAbsent:nil. |
|
1575 |
con notNil ifTrue:[ |
|
1576 |
sel := con selector ? ''. |
|
1577 |
(sel isSymbol |
|
1578 |
and:[ (sel startsWith:'raise') |
|
1579 |
and:[ ((rcvr := con receiver) isLazyValue not) |
|
1580 |
and:[ rcvr isExceptionCreator]]]) ifTrue:[ |
|
1581 |
offset := i. |
|
1582 |
found := con. |
|
1583 |
||
1584 |
"/ if this is a noHandler exception, |
|
1585 |
"/ skip forward to the erroneous context |
|
1586 |
(rcvr isException) ifTrue:[ |
|
1587 |
rcvr creator == Signal noHandlerSignal ifTrue:[ |
|
1588 |
found := rcvr suspendedContext. |
|
1589 |
offset := aContextArray identityIndexOf:found. |
|
1590 |
] |
|
1591 |
]. |
|
1592 |
]. |
|
1593 |
]. |
|
1594 |
]. |
|
3447 | 1595 |
]. |
12039 | 1596 |
"/ Transcript showCR:con. |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1597 |
"/ Transcript show:'1 '; showCR:found. |
12839 | 1598 |
|
3447 | 1599 |
found isNil ifTrue:[ |
16730 | 1600 |
"/ this is a kludge, but convenient. |
1601 |
"/ show the place where the error (divisionByZero...) happend, |
|
1602 |
"/ not where the signal was raised. |
|
1603 |
con := (aContextArray at:1). |
|
1604 |
sel := con methodHome selector. |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1605 |
|
13398 | 1606 |
"/ Transcript show:'2 '; showCR:con. |
16730 | 1607 |
"/ typically a DivisionByZero - show caller of division |
1608 |
(sel == #// |
|
1609 |
or:[sel == #/ |
|
1610 |
or:[sel == #\\]]) ifTrue:[ |
|
1611 |
^ 2 |
|
1612 |
]. |
|
1613 |
||
1614 |
"/ show the place of the bad message; not where the Signal was raised... |
|
1615 |
(sel == #doesNotUnderstand:) ifTrue:[ |
|
1616 |
idx := 3. |
|
1617 |
nMax > 2 ifTrue:[ |
|
1618 |
sel := (aContextArray at:idx) selector ? ''. |
|
1619 |
sel == #doesNotUnderstand: ifTrue:[ |
|
1620 |
idx := 4 |
|
1621 |
]. |
|
1622 |
nMax > idx ifTrue:[ |
|
1623 |
sel := (aContextArray at:idx) selector ? ''. |
|
1624 |
"/ show the place of the perfor-send; not where the Signal was raised... |
|
1625 |
((sel == #perform:) |
|
1626 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
|
1627 |
idx := idx + 1 |
|
1628 |
]. |
|
1629 |
] |
|
1630 |
]. |
|
1631 |
^ idx min:nMax |
|
1632 |
]. |
|
1633 |
||
1634 |
"/ show the bad method; not where the Signal was raised... |
|
1635 |
(sel == #noByteCode) ifTrue:[ |
|
1636 |
^ 2 |
|
1637 |
]. |
|
3447 | 1638 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1639 |
"/ "/ 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
|
1640 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1641 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1642 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1643 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1644 |
"/ "/ 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
|
1645 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1646 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1647 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1648 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1649 |
"/ "/ 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
|
1650 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1651 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1652 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1653 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1654 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1655 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1656 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1657 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1658 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1659 |
"/ ]. |
7862 | 1660 |
|
16730 | 1661 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
1662 |
(sel == #signalInterrupt:) ifTrue:[ |
|
1663 |
^ 2 |
|
1664 |
]. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1665 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1666 |
"/ "/ 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
|
1667 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1668 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1669 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1670 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1671 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1672 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1673 |
"/ "/ 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
|
1674 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1675 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1676 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
1677 |
|
16730 | 1678 |
"/ show the place of the bad index; not where the Signal was raised... |
1679 |
( #(#notIndexed |
|
1680 |
#indexNotIntegerOrOutOfBounds: |
|
1681 |
#subscriptBoundsError: |
|
1682 |
#elementBoundsError: |
|
1683 |
"/ #subclassResponsibility |
|
1684 |
) includes:sel) ifTrue:[ |
|
1685 |
idx := 2. |
|
1686 |
[ idx <= 3 |
|
1687 |
and:[ |
|
1688 |
sel := (aContextArray at:idx) selector. |
|
1689 |
#(#notIndexed |
|
1690 |
#indexNotIntegerOrOutOfBounds: |
|
1691 |
#subscriptBoundsError: |
|
1692 |
#elementBoundsError: ) includes:sel |
|
1693 |
] |
|
1694 |
] whileTrue:[ idx := idx + 1 ]. |
|
1695 |
sel := (aContextArray at:idx) selector. |
|
1696 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1697 |
ifTrue:[ |
|
1698 |
sel := (aContextArray at:idx+1) selector. |
|
1699 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1700 |
ifTrue:[ |
|
1701 |
sel := (aContextArray at:idx+2) selector. |
|
1702 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1703 |
ifTrue:[ |
|
1704 |
^ idx+3 |
|
1705 |
]. |
|
1706 |
^ idx+2 |
|
1707 |
]. |
|
1708 |
^ idx+1 |
|
1709 |
]. |
|
1710 |
^ idx |
|
1711 |
]. |
|
1712 |
offset := 1. |
|
8152 | 1713 |
]. |
1714 |
||
1715 |
"/ the above is all too hard-coded; |
|
1716 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1717 |
"/ as more methods get flagged, remove code from above. |
|
1718 |
con := aContextArray at:offset ifAbsent:nil. |
|
13398 | 1719 |
"/ Transcript show:'2 '; showCR:con. |
10205 | 1720 |
[ |
16730 | 1721 |
con notNil |
1722 |
and:[ (methodHome := con methodHome) notNil |
|
1723 |
and:[ (method := methodHome method) notNil |
|
1724 |
and:[ method shouldBeSkippedInDebuggersWalkBack ]]] |
|
8152 | 1725 |
] whileTrue:[ |
1726 |
"/ Transcript showCR:con methodHome method. |
|
16730 | 1727 |
offset := offset + 1. |
1728 |
con := aContextArray at:offset ifAbsent:nil. |
|
8152 | 1729 |
]. |
13309 | 1730 |
methodHome := nil. "/ help GC |
3447 | 1731 |
|
1732 |
" |
|
1733 |
got it; move up, skipping all intermediate Signal and |
|
1734 |
Exception contexts |
|
1735 |
" |
|
1736 |
prev := nil. |
|
1737 |
rcvr := con receiver. |
|
10205 | 1738 |
[ |
16730 | 1739 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1740 |
] whileTrue:[ |
16730 | 1741 |
prev := con. |
1742 |
nMax > offset ifFalse:[^ offset]. |
|
1743 |
||
1744 |
offset := offset + 1. |
|
1745 |
con := aContextArray at:offset. |
|
1746 |
rcvr := con receiver. |
|
3447 | 1747 |
]. |
1748 |
||
1749 |
" |
|
1750 |
now, we are one above the raising context |
|
1751 |
" |
|
13398 | 1752 |
"/ Transcript show:'3 '; showCR:con. |
1753 |
||
1754 |
(con selector == #retry:coercing:) ifTrue:[ |
|
16730 | 1755 |
"/ show the operation which failed to coerce, not the coerce |
1756 |
^ offset + 1 |
|
13398 | 1757 |
]. |
3447 | 1758 |
|
1759 |
" |
|
13398 | 1760 |
if the sender-method of the raise is one of object's error methods ... |
3447 | 1761 |
" |
10205 | 1762 |
( #( halt halt: |
16730 | 1763 |
error error: |
1764 |
doesNotUnderstand: |
|
1765 |
subclassResponsibility |
|
1766 |
primitiveFailed) includes:con selector) |
|
3447 | 1767 |
ifTrue:[ |
16730 | 1768 |
con selector == #doesNotUnderstand: ifTrue:[ |
1769 |
" |
|
1770 |
one more up, to get to the originating context |
|
1771 |
" |
|
1772 |
con := aContextArray at:(offset + 1). |
|
1773 |
con isNil ifTrue:[^ offset]. |
|
1774 |
offset := offset + 1. |
|
1775 |
]. |
|
1776 |
con := aContextArray at:(offset + 1). |
|
1777 |
con isNil ifTrue:[^ offset]. |
|
1778 |
offset := offset + 1. |
|
3447 | 1779 |
] ifFalse:[ |
16730 | 1780 |
" |
1781 |
ok, got the raise - if its a BreakPoint, look for the sender |
|
1782 |
" |
|
1783 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
|
1784 |
offset := offset + 1 |
|
1785 |
]. |
|
3447 | 1786 |
]. |
1787 |
||
1788 |
^ offset |
|
1789 |
||
7713 | 1790 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
13398 | 1791 |
"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
|
1792 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1793 |
|
16434 | 1794 |
!DebugView class methodsFor:'utilities'! |
1795 |
||
1796 |
withOptionToIgnoreException:exceptionOrHandlerSet do:aBlock |
|
1797 |
"execute aBlock; |
|
1798 |
if any from exceptionOrHandlerSet is raised during the execution, |
|
1799 |
open a confitmation dialog, asking if the debugger should be entered. |
|
1800 |
For halts/breakpoints, honors the ignored halt/break list; |
|
1801 |
also, two checkboxes are added, to also ignore them in the future" |
|
1802 |
||
1803 |
^ exceptionOrHandlerSet |
|
1804 |
handle:[:ex | |
|
1805 |
|msg descr where whatError showIgnoreOptions |
|
1806 |
ignoreForSomeTimeHolder ignoreForEverHolder |
|
1807 |
lineNrOfHalt haltingMethod resources| |
|
1808 |
||
1809 |
showIgnoreOptions := false. |
|
1810 |
ignoreForSomeTimeHolder := false asValue. |
|
1811 |
ignoreForEverHolder := false asValue. |
|
1812 |
||
1813 |
(ControlInterrupt accepts:ex creator) ifTrue:[ |
|
1814 |
"/ also deal with ignored breakpoints here; |
|
1815 |
"/ otherwise, it is almost impossible to place a breakpoint into |
|
1816 |
"/ RB-code, and ignoring it... |
|
1817 |
||
1818 |
ex suspendedContext selector == #break ifTrue:[ |
|
1819 |
lineNrOfHalt := ex suspendedContext sender lineNumber. |
|
1820 |
haltingMethod := ex suspendedContext sender method. |
|
1821 |
] ifFalse:[ |
|
1822 |
lineNrOfHalt := ex suspendedContext sender lineNumber. |
|
1823 |
haltingMethod := ex suspendedContext sender method. |
|
1824 |
]. |
|
1825 |
"/ Transcript showCR:haltingMethod. |
|
1826 |
"/ Transcript showCR:lineNrOfHalt. |
|
1827 |
(self |
|
1828 |
isHaltToBeIgnoredIn:haltingMethod |
|
1829 |
atLineNr:lineNrOfHalt |
|
1830 |
context:nil |
|
1831 |
modifyEntryCount:false |
|
1832 |
) ifTrue:[ |
|
1833 |
Transcript showCR:'breakpoint ignored in background processing'. |
|
1834 |
^ ex proceed. |
|
1835 |
]. |
|
1836 |
showIgnoreOptions := true. |
|
1837 |
whatError := 'Halt/Breakpoint:' |
|
1838 |
] ifFalse:[ |
|
1839 |
whatError := 'Error encountered:' |
|
1840 |
]. |
|
1841 |
||
1842 |
resources := self resources. |
|
1843 |
descr := ex description allBold. |
|
1844 |
where := ex suspendedContext printString. |
|
1845 |
||
1846 |
Dialog modifyingBoxWith:[:box | |
|
1847 |
showIgnoreOptions ifTrue:[ |
|
1848 |
box verticalPanel |
|
1849 |
add:(View new height:20); |
|
1850 |
add:(CheckBox |
|
1851 |
label:(resources string:'Ignore this Halt/Break for some time (30s)') |
|
1852 |
model:ignoreForSomeTimeHolder); |
|
1853 |
add:(CheckBox |
|
16580 | 1854 |
label:(resources string:'Ignore this Halt/Break forever') |
16434 | 1855 |
model:ignoreForEverHolder). |
1856 |
]. |
|
1857 |
] do:[ |
|
16611 | 1858 |
|answer canRemove labels actions| |
1859 |
||
16811 | 1860 |
"/ cannot remove halts or coded breakpoints. |
1861 |
canRemove := haltingMethod notNil and:[haltingMethod isMethodWithBreakpoints or:[ haltingMethod isBreakpointed ]]. |
|
16611 | 1862 |
labels := #('Ignore' 'Remove Breakpoint' 'Debug' ). |
1863 |
actions := #(ignore remove debug). |
|
1864 |
canRemove ifFalse:[ |
|
1865 |
labels := #('Ignore' 'Debug' ). |
|
1866 |
actions := #(ignore debug). |
|
1867 |
]. |
|
1868 |
||
1869 |
answer := OptionBox |
|
1870 |
choose:(self resources |
|
16434 | 1871 |
stringWithCRs:'%1\%2\\%3' |
1872 |
with:whatError |
|
1873 |
with:descr |
|
1874 |
with:where) |
|
16611 | 1875 |
label:whatError |
1876 |
image:nil |
|
1877 |
labels:(resources array:labels) |
|
1878 |
values:actions |
|
1879 |
default:#ignore |
|
1880 |
onCancel:#ignore. |
|
1881 |
"/ answer := Dialog |
|
1882 |
"/ confirm:(self resources |
|
1883 |
"/ stringWithCRs:'%1\%2\\%3' |
|
1884 |
"/ with:whatError |
|
1885 |
"/ with:descr |
|
1886 |
"/ with:where) |
|
1887 |
"/ yesLabel:(resources string:'Debug') |
|
1888 |
"/ noLabel:(resources string:'Ignore'). |
|
16434 | 1889 |
|
1890 |
(ignoreForSomeTimeHolder value or:[ignoreForEverHolder value]) ifTrue:[ |
|
1891 |
self |
|
1892 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
1893 |
forCount:(ignoreForEverHolder value ifTrue:[-1] ifFalse:[nil]) |
|
1894 |
orTimeDuration:(ignoreForSomeTimeHolder value ifTrue:[30 seconds] ifFalse:[nil]) |
|
1895 |
orUntilShiftKey:false |
|
1896 |
orReceiverClass:nil orProcess:nil |
|
1897 |
orIfCalledFromMethod:nil. |
|
1898 |
]. |
|
1899 |
||
16611 | 1900 |
answer == #remove ifTrue:[ |
1901 |
haltingMethod isMethodWithBreakpoints ifTrue:[ |
|
1902 |
haltingMethod disableBreakpointInLine:lineNrOfHalt |
|
1903 |
] ifFalse:[ |
|
1904 |
haltingMethod isBreakpointed ifTrue:[ |
|
1905 |
haltingMethod clearBreakPoint |
|
1906 |
]. |
|
16623 | 1907 |
]. |
1908 |
ex proceed |
|
16611 | 1909 |
]. |
16623 | 1910 |
answer == #debug ifTrue:[ |
16434 | 1911 |
ex reject. |
16623 | 1912 |
]. |
1913 |
ex proceed |
|
16434 | 1914 |
] |
1915 |
] |
|
1916 |
do:aBlock. |
|
1917 |
||
1918 |
" |
|
1919 |
HaltInterrupt withOptionToIgnoreDo:[self halt] -- catches this |
|
1920 |
HaltInterrupt withOptionToIgnoreDo:[self error] -- but not this |
|
1921 |
||
1922 |
-- catches both, but disable buttons are only shown for halt/breaks |
|
1923 |
ControlInterrupt withOptionToIgnore:(HaltInterrupt,Error) do:[self halt] |
|
1924 |
ControlInterrupt withOptionToIgnore:(HaltInterrupt,Error) do:[self error] |
|
1925 |
" |
|
1926 |
! ! |
|
1927 |
||
14662 | 1928 |
!DebugView methodsFor:'accessing'! |
1929 |
||
1930 |
contextInspector |
|
1931 |
^ contextInspector |
|
1932 |
! |
|
1933 |
||
1934 |
inspectedProcess |
|
1935 |
^ inspectedProcess |
|
1936 |
! ! |
|
1937 |
||
15257 | 1938 |
!DebugView methodsFor:'aspects'! |
1939 |
||
1940 |
verboseBacktraceHolder |
|
1941 |
verboseBacktraceHolder isNil ifTrue:[ |
|
15413 | 1942 |
verboseBacktraceHolder := ValueHolder with:false |
15257 | 1943 |
]. |
1944 |
^ verboseBacktraceHolder |
|
1945 |
! ! |
|
1946 |
||
73 | 1947 |
!DebugView methodsFor:'basic'! |
1948 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1949 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1950 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1951 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1952 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1953 |
m notNil ifTrue:[ |
15413 | 1954 |
self updateMenuItems. |
1955 |
||
1956 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
|
1957 |
abortButton enable. |
|
1958 |
m enable:#doAbort. |
|
1959 |
] ifFalse:[ |
|
1960 |
abortButton disable. |
|
1961 |
m disable:#doAbort. |
|
1962 |
]. |
|
1963 |
exclusive ifTrue:[ |
|
1964 |
terminateButton disable. |
|
1965 |
m disable:#doTerminate. |
|
1966 |
] ifFalse:[ |
|
1967 |
terminateButton enable. |
|
1968 |
m enable:#doTerminate. |
|
1969 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1970 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1971 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1972 |
mayProceed == false ifTrue:[ |
15413 | 1973 |
continueButton disable. |
1974 |
m notNil ifTrue:[m disable:#doContinue]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1975 |
] ifFalse:[ |
15413 | 1976 |
continueButton enable. |
1977 |
m notNil ifTrue:[m enable:#doContinue] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1978 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1979 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1980 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1981 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1982 |
|
13842 | 1983 |
enter |
1984 |
"enter a debugger" |
|
1985 |
||
1986 |
<context: #return> |
|
1987 |
||
1988 |
^ self |
|
15413 | 1989 |
enter:thisContext sender |
1990 |
select: nil. |
|
13842 | 1991 |
|
1992 |
"Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1993 |
! |
|
1994 |
||
1364 | 1995 |
enter:aContext select:initialSelectionOrNil |
73 | 1996 |
"enter the debugger - get and display the context, then start an |
1997 |
exclusive event loop on top of eveything else" |
|
1998 |
||
3447 | 1999 |
<context: #return> |
2000 |
||
16058 | 2001 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c |
2002 |
userprefs logFile| |
|
3447 | 2003 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2004 |
DebuggingDebugger == true ifTrue:[ |
16058 | 2005 |
'==> enter2: (' print. aContext print. |
2006 |
') select: ' print. initialSelectionOrNil printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2007 |
]. |
3447 | 2008 |
thisContext isRecursive ifTrue:[ |
16058 | 2009 |
"/ care for the special case, were the Debugger was autoloaded. |
16860 | 2010 |
"/ in this case, thisContext IS recursive, but that's no error condition. |
16058 | 2011 |
foundNoByteCodeContext := false. |
2012 |
foundExitContext := false. |
|
2013 |
||
2014 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
2015 |
[ |
|
2016 |
foundNoByteCodeContext not |
|
2017 |
and:[ foundExitContext not |
|
2018 |
and:[c notNil |
|
2019 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
2020 |
]]]] |
|
2021 |
whileTrue:[ |
|
2022 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
2023 |
foundExitContext := true |
|
2024 |
]. |
|
2025 |
c selector == #noByteCode ifTrue:[ |
|
2026 |
foundNoByteCodeContext := true |
|
2027 |
]. |
|
2028 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
2029 |
]. |
|
2030 |
||
2031 |
(foundNoByteCodeContext not |
|
2032 |
and:[ foundExitContext not]) ifFalse:[ |
|
2033 |
('DebugView [warning]: reentered') errorPrintCR. |
|
2034 |
||
2035 |
^ MiniDebugger |
|
2036 |
enter:aContext |
|
2037 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
2038 |
mayProceed:mayProceed. |
|
2039 |
]. |
|
2040 |
foundExitContext ifTrue:[ |
|
2041 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
2042 |
^ self. |
|
2043 |
]. |
|
3447 | 2044 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
2045 |
|
10203 | 2046 |
"/'entering: ' print. aContext printCR. |
2047 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 2048 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
2049 |
||
11890 | 2050 |
(self isHaltToBeIgnored) ifTrue:[ |
16058 | 2051 |
^ self. |
8170 | 2052 |
]. |
11892 | 2053 |
"/ "/ does not work yet - but we should ignore any breakpoints while stepping |
2054 |
"/ (stepping and:[steppedContext notNil]) ifTrue:[ |
|
2055 |
"/ self isEnteredDueToBreakpointOrHalt ifTrue:[ |
|
2056 |
"/ 'DebugView [info]: ignored other interrupt while stepping' infoPrintCR. |
|
2057 |
"/ ^ self |
|
2058 |
"/ ]. |
|
2059 |
"/ ]. |
|
16058 | 2060 |
userprefs := UserPreferences current. |
2061 |
"/ optionally log this debugger entry |
|
2062 |
(logFile := userprefs debuggerLogFile) notNil ifTrue:[ |
|
2063 |
logFile asFilename appendingFileDo:[:s | |
|
2064 |
s cr. |
|
2065 |
s nextPutLine:'-----------------------'. |
|
2066 |
Timestamp now printOn:s. |
|
2067 |
s nextPutAll:' ['; nextPutAll:Processor activeProcess name; nextPutAll:']'; cr. |
|
2068 |
s cr. |
|
2069 |
aContext fullPrintAllOn:s |
|
2070 |
]. |
|
2071 |
]. |
|
2072 |
||
13965 | 2073 |
iAmNew := self drawableId isNil. |
73 | 2074 |
|
16058 | 2075 |
self verboseBacktraceHolder value:(userprefs verboseBacktraceInDebugger). |
939 | 2076 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
2077 |
busy := cachable := true. |
73 | 2078 |
inspecting := false. |
2079 |
inspectedProcess := Processor activeProcess. |
|
2080 |
stepping := false. |
|
2081 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2082 |
stepHow := nil. |
8148 | 2083 |
nChainShown := InitialNChainShown. |
73 | 2084 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2085 |
"/ if debugger is entered while a box has grabbed the |
9076 | 2086 |
"/ 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
|
2087 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2088 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2089 |
"/ 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
|
2090 |
"/ 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
|
2091 |
"/ 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
|
2092 |
Screen allScreens do:[:aScreen | |
16058 | 2093 |
aScreen ungrabPointer. |
2094 |
aScreen ungrabKeyboard. |
|
10205 | 2095 |
]. |
2096 |
||
2097 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
2098 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
16058 | 2099 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2100 |
] ifFalse:[ |
16058 | 2101 |
terminateButton enable. |
2102 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2103 |
]. |
73 | 2104 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
2105 |
iAmNew ifFalse:[ |
16058 | 2106 |
"/ not the first time - disable buttons & menus |
2107 |
"/ from the previous life |
|
2108 |
self turnOffAllButtons. |
|
2109 |
||
2110 |
m := contextView middleButtonMenu. |
|
2111 |
m notNil ifTrue:[ |
|
2112 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
2113 |
]. |
|
2114 |
self showingDenseWalkback:(self verboseBacktraceHolder value not). |
|
132 | 2115 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2116 |
self iconLabel:'Debugger'. |
132 | 2117 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2118 |
windowGroup isNil ifTrue:[ |
16058 | 2119 |
self windowGroup: WindowGroup new. |
2120 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2121 |
]. |
132 | 2122 |
exclusive ifFalse:[ |
16058 | 2123 |
"/ create a (modal) windowGroup for myself |
2124 |
||
2125 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2126 |
] ifTrue:[ |
16058 | 2127 |
"/ create a windowGroup with a synchronous sensor for me |
2128 |
||
2129 |
windowGroup beSynchronous. |
|
73 | 2130 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2131 |
windowGroup setProcess:Processor activeProcess. |
15027 | 2132 |
IsDebuggingQuery answer:true do:[ |
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2133 |
|
16058 | 2134 |
" |
2135 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
|
2136 |
" |
|
12039 | 2137 |
"/Transcript show:'0 '; showCR:aContext. |
2138 |
"/Transcript show:'0 '; showCR:thisContext sender. |
|
2139 |
"/Transcript show:'0 '; showCR:thisContext sender sender. |
|
2140 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender. |
|
2141 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender. |
|
2142 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender. |
|
2143 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender. |
|
2144 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender. |
|
2145 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender . |
|
2146 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender. |
|
2147 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender. |
|
2148 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender. |
|
2149 |
"/Transcript showCR:initialSelectionOrNil. |
|
16058 | 2150 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
2151 |
"/'after setContext; first is ' print. |
|
2152 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
2153 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
2154 |
||
2155 |
self updateButtonsAndMenuItemsForContext:aContext. |
|
2156 |
||
2157 |
" |
|
2158 |
If this is a new debugger, do a realize. |
|
2159 |
Otherwise, its probably better to do a map, which shows the |
|
2160 |
view at the previous position, without a need for the user to set the |
|
2161 |
position again |
|
2162 |
" |
|
2163 |
iAmNew ifTrue:[ |
|
2164 |
self realize. |
|
2165 |
] ifFalse:[ |
|
2166 |
self remap. |
|
2167 |
]. |
|
2168 |
self setForegroundWindow. |
|
2169 |
||
2170 |
exclusive ifTrue:[ |
|
2171 |
self showError:' |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2172 |
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
|
2173 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2174 |
This is a modal debugger - all event processing is stopped.. |
10205 | 2175 |
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
|
2176 |
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
|
2177 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2178 |
Also, there is no event processing (redraw) for other views.' |
16058 | 2179 |
]. |
2180 |
||
2181 |
self autoRaiseView ifTrue:[ |
|
2182 |
"/ self raise. |
|
2183 |
self raiseDeiconified. |
|
2184 |
self topView activate; setForegroundWindow; activate. |
|
2185 |
]. |
|
2186 |
||
2187 |
canContinue := true. |
|
2188 |
exitAction := nil. |
|
2189 |
||
2190 |
"/ enter private event handling loop. This is left (and we come back here again) |
|
2191 |
"/ when any button was pressed which requires continuation of the debuggee or |
|
2192 |
"/ closedown of the debugger. |
|
2193 |
[self controlLoop] ifCurtailed:[ |
|
2194 |
windowGroup notNil ifTrue:[ |
|
2195 |
windowGroup setProcess:nil. |
|
2196 |
]. |
|
2197 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
2198 |
self destroy |
|
2199 |
]. |
|
2200 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2201 |
]. |
10203 | 2202 |
"/ here after my own control loop is finished. |
2203 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2204 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2205 |
"/ 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
|
2206 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 2207 |
contextView contents:nil. |
2208 |
||
73 | 2209 |
codeView acceptAction:nil. |
942 | 2210 |
codeView doItAction:nil. |
73 | 2211 |
|
4892 | 2212 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
16058 | 2213 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 2214 |
]. |
2215 |
||
11911 | 2216 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
2217 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
2218 |
||
73 | 2219 |
(exitAction ~~ #step) ifTrue:[ |
16058 | 2220 |
"/ not stepping or continue - close window |
2221 |
self cacheMyself. |
|
2222 |
receiverInspector release. |
|
2223 |
contextInspector release. |
|
2224 |
||
2225 |
self unmap. |
|
2226 |
self flush. |
|
2227 |
||
2228 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
2229 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
2230 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
2231 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
2232 |
(exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ]. |
|
2233 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
2234 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
2235 |
exitAction isBlock ifTrue:[ |
|
2236 |
self exit_unwindThenDo:exitAction. |
|
2237 |
"does not return" |
|
2238 |
]. |
|
2239 |
"not reached" |
|
2240 |
^ self |
|
73 | 2241 |
]. |
2242 |
||
3447 | 2243 |
"/ stepping - window stays open |
940 | 2244 |
selectedContext := actualContext := firstContext := nil. |
73 | 2245 |
|
2472 | 2246 |
"/ restore the previous pointer grab |
73 | 2247 |
grabber notNil ifTrue:[ |
16253 | 2248 |
device grabPointerInView:grabber. |
16058 | 2249 |
grabber := nil. |
61 | 2250 |
]. |
73 | 2251 |
|
2252 |
(exitAction == #step) ifTrue:[ |
|
16058 | 2253 |
" |
2254 |
schedule another stepInterrupt |
|
2255 |
- must enter myself into the collection of open debuggers, |
|
2256 |
in case the stepping process comes back again via a halt or signal |
|
2257 |
before the step is finished. In this case, the stepping debugger should |
|
2258 |
come up (instead of a new one) |
|
2259 |
- must flush caches since optimized methods not always |
|
2260 |
look for pending interrupts |
|
2261 |
" |
|
2262 |
||
2263 |
"/ |
|
2264 |
"/ also must care for stepping into a return |
|
2265 |
"/ |
|
2266 |
steppedContext notNil ifTrue:[ |
|
2267 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
2268 |
]. |
|
2269 |
||
2270 |
OpenDebuggers isNil ifTrue:[ |
|
2271 |
OpenDebuggers := WeakIdentitySet new. |
|
2272 |
]. |
|
2273 |
OpenDebuggers add:self. |
|
2274 |
||
2275 |
self label:'single stepping - please wait ...'. |
|
2276 |
stepping := true. |
|
2277 |
||
2278 |
ObjectMemory stepInterruptHandler:self. |
|
2279 |
Processor activeProcess stepInterruptHandler:self. |
|
2280 |
ObjectMemory flushCaches. |
|
2281 |
||
2282 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
2283 |
Context singleStepInterruptRequest |
|
2284 |
raiseWith: |
|
2285 |
(("bigStep" steppedContextLineno notNil) |
|
2286 |
ifTrue:[#next] |
|
2287 |
ifFalse:[#step]) |
|
2288 |
] ifFalse:[ |
|
2289 |
"/ see if we came here through an interrupt-action |
|
2290 |
"/ (i.e. aProcess interruptWith:...) |
|
2291 |
||
2292 |
enteredByInterrupt := false. |
|
2293 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2294 |
[enteredByInterrupt not |
|
2295 |
and:[con notNil |
|
2296 |
and:[con ~~ aContext]]] whileTrue:[ |
|
2297 |
((sel := con selector) == #timerInterrupt |
|
2298 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
2299 |
enteredByInterrupt := true. |
|
2300 |
] ifFalse:[ |
|
2301 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2302 |
]. |
|
2303 |
]. |
|
2304 |
||
2305 |
ObjectMemory flushInlineCaches. |
|
2306 |
||
2307 |
DebuggingDebugger == true ifTrue:[ |
|
2308 |
enteredByInterrupt printCR. |
|
2309 |
]. |
|
2310 |
enteredByInterrupt ifTrue:[ |
|
2311 |
"/ don't want to step through all intermediate |
|
2312 |
"/ (scheduler-) contexts; place a return-trap on the |
|
2313 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2314 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2315 |
"/ 'special unwind return' printCR. |
16058 | 2316 |
con unwindThenDo:[ |
2317 |
Processor activeProcess stepInterruptHandler:self. |
|
2318 |
ObjectMemory stepInterruptHandler:self. |
|
2319 |
InStepInterrupt := nil. |
|
2320 |
StepInterruptPending := 1. |
|
2321 |
InterruptPending := 1]. |
|
2322 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2323 |
"/ 'normal step return' printCR. |
16058 | 2324 |
skipLineNr ~~ #return ifTrue:[ |
2325 |
StepInterruptPending := 1. |
|
2326 |
InterruptPending := 1. |
|
2327 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2328 |
"/ 'step for return' printCR. |
16058 | 2329 |
] |
2330 |
]. |
|
2331 |
InStepInterrupt := nil |
|
2332 |
] |
|
73 | 2333 |
] ifFalse:[ |
16058 | 2334 |
OpenDebuggers notNil ifTrue:[ |
2335 |
OpenDebuggers remove:self ifAbsent:[]. |
|
2336 |
]. |
|
2337 |
self cacheMyself. |
|
73 | 2338 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2339 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
2340 |
"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
|
2341 |
"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
|
2342 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
11697 | 2343 |
"Modified: / 27-07-2012 / 17:35:56 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2344 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2345 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2346 |
exit_abort |
5455 | 2347 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
2348 |
"/ that one would run on top of this context. |
|
2349 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2350 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2351 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2352 |
"/ done in the #enter:select method. |
5455 | 2353 |
"/ You are not expected to understand this. |
2354 |
||
6487 | 2355 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
2356 |
! |
|
2357 |
||
2358 |
exit_abortAll |
|
2359 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2360 |
"/ that one would run on top of this context. |
|
2361 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2362 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2363 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2364 |
"/ done in the #enter:select method. |
6487 | 2365 |
"/ You are not expected to understand this. |
2366 |
||
2367 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2368 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2369 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2370 |
exit_quickTerminate |
3447 | 2371 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2372 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2373 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2374 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 2375 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2376 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2377 |
|
13360 | 2378 |
exit_resend |
2379 |
|con| |
|
2380 |
||
2381 |
selectedContext notNil ifTrue:[ |
|
15413 | 2382 |
con := selectedContext. |
2383 |
self cacheMyself. |
|
2384 |
" |
|
2385 |
have to catch errors occuring in unwind-blocks |
|
2386 |
" |
|
2387 |
Error handle:[:ex | |
|
2388 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2389 |
ex description infoPrintCR. |
|
2390 |
ex proceed |
|
2391 |
] do:[ |
|
2392 |
^ con unwindThenResend. |
|
2393 |
]. |
|
2394 |
'DebugView [warning]: cannot resend selected context''s message' errorPrintCR |
|
13360 | 2395 |
] |
2396 |
! |
|
2397 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2398 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2399 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2400 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2401 |
selectedContext notNil ifTrue:[ |
15413 | 2402 |
con := selectedContext. |
2403 |
self cacheMyself. |
|
2404 |
" |
|
2405 |
have to catch errors occuring in unwind-blocks |
|
2406 |
" |
|
2407 |
Error handle:[:ex | |
|
2408 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2409 |
ex description infoPrintCR. |
|
2410 |
ex proceed |
|
2411 |
] do:[ |
|
2412 |
con unwindAndRestart. |
|
2413 |
]. |
|
2414 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2415 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2416 |
|
11818 | 2417 |
"Created: / 16-11-2001 / 17:23:17 / cg" |
11819 | 2418 |
"Modified: / 26-09-2012 / 15:09:52 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2419 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2420 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2421 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2422 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2423 |
|
14902 | 2424 |
retVal := nil. |
2425 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2426 |
selectedContext notNil ifTrue:[ |
15413 | 2427 |
" |
2428 |
if there is a selection in the codeView, |
|
2429 |
evaluate it and use the result as return value |
|
2430 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2431 |
"/ 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
|
2432 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2433 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2434 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2435 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2436 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2437 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2438 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2439 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2440 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2441 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2442 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2443 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2444 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2445 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2446 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2447 |
|
15413 | 2448 |
con := selectedContext. |
2449 |
self cacheMyself. |
|
2450 |
" |
|
2451 |
have to catch errors occuring in unwind-blocks |
|
2452 |
" |
|
2453 |
Error handle:[:ex | |
|
2454 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2455 |
ex description infoPrintCR. |
|
2456 |
ex proceed |
|
2457 |
] do:[ |
|
2458 |
con unwind:retVal. |
|
2459 |
]. |
|
2460 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2461 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2462 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2463 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 2464 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2465 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2466 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2467 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2468 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2469 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2470 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2471 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2472 |
Error handle:[:ex | |
15413 | 2473 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2474 |
ex description infoPrintCR. |
|
2475 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2476 |
] do:[ |
15413 | 2477 |
self cacheMyself. |
2478 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2479 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2480 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2481 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2482 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 2483 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
2484 |
! |
|
2485 |
||
6487 | 2486 |
exit_unwindThenDo:aBlock |
2487 |
|con| |
|
2488 |
||
2489 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2490 |
"/ that one would run on top of this context. |
|
2491 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2492 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2493 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2494 |
"/ done in the #enter:select method. |
6487 | 2495 |
"/ You are not expected to understand this. |
2496 |
||
2497 |
" |
|
2498 |
have to catch errors occuring in unwind-blocks |
|
2499 |
" |
|
2500 |
self cacheMyself. |
|
12743 | 2501 |
con := thisContext sender. |
6487 | 2502 |
|
2503 |
Error handle:[:ex | |
|
15413 | 2504 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2505 |
ex description infoPrintCR. |
|
2506 |
ex proceed |
|
6487 | 2507 |
] do:[ |
15413 | 2508 |
"/ find the enter:select context. |
2509 |
[(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ |
|
2510 |
con := con sender |
|
2511 |
]. |
|
2512 |
||
2513 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
2514 |
con sender receiver == self class ifTrue:[ |
|
2515 |
con := con sender. |
|
2516 |
con sender receiver == self class ifTrue:[ |
|
2517 |
con := con sender methodHome. |
|
2518 |
]. |
|
2519 |
]. |
|
2520 |
||
2521 |
con unwindThenDo:aBlock. |
|
6487 | 2522 |
]. |
2523 |
'DebugView [warning]: abort failed' errorPrintCR |
|
2524 |
||
2525 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
2526 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
2527 |
! |
|
2528 |
||
3447 | 2529 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
2530 |
|selection con1 con2 h| |
|
2531 |
||
2532 |
initialSelectionOrNil notNil ifTrue:[ |
|
16801 | 2533 |
^ initialSelectionOrNil |
3447 | 2534 |
]. |
2535 |
||
2536 |
" |
|
2537 |
and find the one context to show initially |
|
2538 |
- if we came here by a send (single step), its the top context; |
|
2539 |
- if we came here by a step (i.e. bigStep), its the top context |
|
2540 |
(for ifs and whiles) or the sender (for regular sends). |
|
2541 |
- otherwise, we came here by some signal raise, and we are interested |
|
16801 | 2542 |
in the context where the raise actually occurred. |
3447 | 2543 |
" |
2544 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
2545 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
12039 | 2546 |
"/ Transcript show:'x '; showCR:exitAction. |
2547 |
||
2548 |
"/ came here via a step? |
|
3447 | 2549 |
exitAction == #step ifTrue:[ |
16801 | 2550 |
selection := 1. |
2551 |
steppedContext notNil ifTrue:[ |
|
2552 |
||
2553 |
" |
|
2554 |
if we came here by a big-step, show the method where we are |
|
2555 |
" |
|
2556 |
con1 == steppedContext ifTrue:[ |
|
2557 |
selection := 1 |
|
2558 |
] ifFalse:[ |
|
2559 |
con2 == steppedContext ifTrue:[ |
|
2560 |
selection := 2 |
|
2561 |
] |
|
2562 |
]. |
|
2563 |
" |
|
2564 |
for bigStep, we could also be in a block below the actual method ... |
|
2565 |
" |
|
2566 |
((h := con1 home) notNil |
|
2567 |
and:[h == steppedContext]) ifTrue:[ |
|
2568 |
selection := 1 |
|
2569 |
] ifFalse:[ |
|
2570 |
(con2 notNil |
|
2571 |
and:[(h := con2 home) notNil |
|
2572 |
and:[h == steppedContext]]) ifTrue:[ |
|
2573 |
selection := 2 |
|
2574 |
] |
|
2575 |
]. |
|
2576 |
h := nil. |
|
2577 |
] |
|
3447 | 2578 |
] ifFalse:[ |
16801 | 2579 |
steppedContext isNil ifTrue:[ |
2580 |
" |
|
2581 |
preselect a more interesting context, (where halt/raise was ...) |
|
2582 |
" |
|
2583 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
2584 |
selection := self class interestingContextIndexIn:contextArray. |
|
12039 | 2585 |
"/ Transcript show:'x '; showCR:selection. |
16801 | 2586 |
selection := selection min:(contextArray size). |
2587 |
] ifFalse:[ |
|
2588 |
" |
|
2589 |
if we came here by a big-step, show the method where we are |
|
2590 |
" |
|
2591 |
con1 == steppedContext ifTrue:[ |
|
2592 |
selection := 1 |
|
2593 |
] ifFalse:[ |
|
2594 |
con2 == steppedContext ifTrue:[ |
|
2595 |
selection := 2. |
|
2596 |
] |
|
2597 |
] |
|
2598 |
] |
|
3447 | 2599 |
]. |
2600 |
^ selection |
|
2601 |
||
2602 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
2603 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 2604 |
! |
2605 |
||
5110 | 2606 |
isInspecting |
2607 |
^ inspecting |
|
2608 |
! |
|
2609 |
||
2610 |
isNotInspecting |
|
2611 |
^ inspecting not |
|
2612 |
! |
|
2613 |
||
73 | 2614 |
openOn:aProcess |
10205 | 2615 |
"enter the debugger on a process - |
73 | 2616 |
in this case, we are just inspecting the context chain of the process, |
2617 |
not running on top of the debugged process, but as a separate |
|
2618 |
one. (think of it as an inspector showing more detail, and offering |
|
2619 |
some more control operations)" |
|
2620 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2621 |
|bpanel dummy w| |
73 | 2622 |
|
15257 | 2623 |
self verboseBacktraceHolder value:( UserPreferences current verboseBacktraceInDebugger ). |
939 | 2624 |
|
73 | 2625 |
busy := true. |
2626 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2627 |
stepHow := nil. |
73 | 2628 |
inspecting := true. |
2629 |
inspectedProcess := aProcess. |
|
8148 | 2630 |
nChainShown := InitialNChainShown. |
73 | 2631 |
|
2632 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2633 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2634 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2635 |
"/ get the max size & freeze button |
6647 | 2636 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2637 |
w := continueButton preferredWidth. |
6647 | 2638 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2639 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2640 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2641 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2642 |
aProcess state == #run ifTrue:[ |
16253 | 2643 |
device hasColors ifTrue:[ |
2644 |
continueButton foregroundColor:Color red darkened. |
|
2645 |
]. |
|
2646 |
continueButton label:(resources string:'Stop'). |
|
2647 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2648 |
] ifFalse:[ |
16253 | 2649 |
device hasColors ifTrue:[ |
2650 |
continueButton foregroundColor:Color green darkened darkened. |
|
2651 |
]. |
|
2652 |
continueButton label:(resources string:'Continue'). |
|
2653 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2654 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2655 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 2656 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2657 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2658 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2659 |
|
92 | 2660 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 2661 |
dummy borderWidth:0; level:0. |
61 | 2662 |
|
73 | 2663 |
"/ stepButton destroy. |
2664 |
"/ sendButton destroy. |
|
2665 |
||
2666 |
updateButton := Button |
|
16253 | 2667 |
label:(resources string:'Update') |
2668 |
action:[self updateContext] |
|
2669 |
in:bpanel. |
|
73 | 2670 |
monitorToggle := Toggle in:bpanel. |
6647 | 2671 |
monitorToggle label:(resources string:'Monitor'). |
73 | 2672 |
monitorToggle pressAction:[self autoUpdateOn]. |
2673 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
2674 |
||
2675 |
"can only look into process - context chain is not active" |
|
2676 |
canContinue := true. |
|
2677 |
||
2678 |
terminateButton enable. |
|
2679 |
abortButton enable. |
|
2680 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2681 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2682 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2683 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2684 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2685 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 2686 |
|
2687 |
aProcess isNil ifTrue:[ |
|
16253 | 2688 |
terminateButton disable. |
2689 |
abortButton disable. |
|
2690 |
continueButton disable. |
|
2691 |
returnButton disable. |
|
2692 |
restartButton disable. |
|
73 | 2693 |
] ifFalse:[ |
16253 | 2694 |
(aProcess suspendedContext isNil |
2695 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
2696 |
terminateButton disable. |
|
2697 |
]. |
|
2698 |
||
2699 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
2700 |
||
2701 |
catchBlock := [ |
|
2702 |
catchBlock := nil. |
|
2703 |
contextArray := nil. |
|
2704 |
selectedContext := actualContext := firstContext := nil. |
|
2705 |
steppedContext := wrapperContext := nil. |
|
2706 |
||
2707 |
(exitAction == #terminate) ifTrue:[ |
|
2708 |
aProcess terminate. |
|
2709 |
]. |
|
2710 |
(exitAction == #quickTerminate) ifTrue:[ |
|
2711 |
aProcess terminateNoSignal. |
|
2712 |
]. |
|
2713 |
super destroy |
|
2714 |
]. |
|
73 | 2715 |
]. |
2716 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2717 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2718 |
"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
|
2719 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2720 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2721 |
|
13388 | 2722 |
selectContextWithIndex:index |
13362 | 2723 |
self showSelection:index. |
2724 |
contextView setSelection:index. |
|
2725 |
index > 1 ifTrue:[ |
|
15413 | 2726 |
contextView scrollToLine:(index - 1) |
13362 | 2727 |
]. |
2728 |
! |
|
2729 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2730 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 2731 |
|selection| |
2732 |
||
2733 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2734 |
selection notNil ifTrue:[ |
15413 | 2735 |
self selectContextWithIndex:selection |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2736 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2737 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2738 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 2739 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2740 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2741 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2742 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2743 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2744 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2745 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2746 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2747 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2748 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2749 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2750 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2751 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2752 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2753 |
! ! |
2754 |
||
2755 |
!DebugView methodsFor:'help'! |
|
2756 |
||
8212 | 2757 |
flyByHelpDependsOnPositionIn:aView |
2758 |
"subclasses where the help-text depends upon the pointer position might |
|
2759 |
want to redefine this" |
|
2760 |
||
2761 |
^ aView == codeView |
|
2762 |
! |
|
2763 |
||
3510 | 2764 |
flyByHelpTextFor:aComponent |
2765 |
|s| |
|
2766 |
||
15774 | 2767 |
aComponent == codeView ifTrue:[ |
2768 |
|point localPoint| |
|
2769 |
||
16253 | 2770 |
point := device pointerPosition. |
2771 |
localPoint := device translatePointFromRoot:point toView:codeView. |
|
15774 | 2772 |
((localPoint x between:0 and:codeView width) |
2773 |
and:[localPoint y between:0 and:codeView height]) |
|
2774 |
ifTrue:[ |
|
2775 |
^ self flyByHelpTextFor:codeView at:localPoint |
|
2776 |
]. |
|
2777 |
^ nil |
|
2778 |
]. |
|
2779 |
||
3510 | 2780 |
aComponent == abortButton ifTrue:[ |
15774 | 2781 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2782 |
]. |
2783 |
aComponent == terminateButton ifTrue:[ |
|
15774 | 2784 |
Processor activeProcess isGUIProcess ifTrue:[ |
16958 | 2785 |
s := 'Terminate the process.\Attention: closes view and shuts down application.' |
15774 | 2786 |
] ifFalse:[ |
16958 | 2787 |
s := 'Terminate the process.\Attention: do not kill a system thread' |
15774 | 2788 |
] |
3510 | 2789 |
]. |
2790 |
aComponent == continueButton ifTrue:[ |
|
15774 | 2791 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2792 |
s := 'Stop' |
|
2793 |
] ifFalse:[ |
|
2794 |
s := 'Continue execution' |
|
2795 |
] |
|
3510 | 2796 |
]. |
2797 |
aComponent == stepButton ifTrue:[ |
|
15774 | 2798 |
s := 'Step to next send in selected context (don''t enter into called methods)' |
3510 | 2799 |
]. |
2800 |
aComponent == nextButton ifTrue:[ |
|
15774 | 2801 |
s := 'Step to next line in selected context (don''t enter into called methods)' |
3510 | 2802 |
]. |
2803 |
aComponent == nextOverButton ifTrue:[ |
|
15774 | 2804 |
s := 'Step over to cursor-line' |
3510 | 2805 |
]. |
2806 |
aComponent == nextOutButton ifTrue:[ |
|
15774 | 2807 |
s := 'Step out to caller' |
3510 | 2808 |
]. |
2809 |
aComponent == sendButton ifTrue:[ |
|
15774 | 2810 |
s := 'Send next message (enter into called methods)' |
3510 | 2811 |
]. |
2812 |
aComponent == returnButton ifTrue:[ |
|
15774 | 2813 |
restartButton enabled ifTrue:[ |
2814 |
s := 'Return from the selected method' |
|
2815 |
] ifFalse:[ |
|
2816 |
s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2817 |
] |
|
3510 | 2818 |
]. |
2819 |
aComponent == restartButton ifTrue:[ |
|
15774 | 2820 |
restartButton enabled ifTrue:[ |
2821 |
s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again' |
|
2822 |
] ifFalse:[ |
|
2823 |
s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2824 |
] |
|
3510 | 2825 |
]. |
13361 | 2826 |
aComponent == resendButton ifTrue:[ |
15774 | 2827 |
resendButton enabled ifTrue:[ |
2828 |
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.' |
|
2829 |
] ifFalse:[ |
|
2830 |
s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2831 |
] |
|
13361 | 2832 |
]. |
3510 | 2833 |
aComponent == monitorToggle ifTrue:[ |
15774 | 2834 |
s := 'Toggle monitoring' |
3510 | 2835 |
]. |
2836 |
aComponent == updateButton ifTrue:[ |
|
15774 | 2837 |
s := 'Update' |
3510 | 2838 |
]. |
13464 | 2839 |
aComponent == defineButton ifTrue:[ |
15774 | 2840 |
s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then' |
13464 | 2841 |
]. |
8656 | 2842 |
aComponent == reportButton ifTrue:[ |
15774 | 2843 |
s := 'Send a defect report via eMail' |
8656 | 2844 |
]. |
3510 | 2845 |
s notNil ifTrue:[ |
15774 | 2846 |
^ resources stringWithCRs:s |
3510 | 2847 |
]. |
2848 |
^ nil |
|
2849 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2850 |
"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
|
2851 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2852 |
! |
2853 |
||
8212 | 2854 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2855 |
|s vline line col pos interval| |
8212 | 2856 |
|
2857 |
aComponent == codeView ifFalse:[^ nil]. |
|
2858 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2859 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2860 |
|
8396 | 2861 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2862 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2863 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2864 |
|
2865 |
pos := codeView characterPositionOfLine:line col:col. |
|
2866 |
interval := pos to:pos. |
|
2867 |
||
10205 | 2868 |
self |
15413 | 2869 |
withNodeValueAtInterval:interval |
2870 |
do:[:value :description | |
|
2871 |
|valueClassOrSizeString valueString| |
|
2872 |
||
2873 |
valueClassOrSizeString := valueString := ''. |
|
2874 |
||
2875 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2876 |
value isString ifTrue:[ |
|
2877 |
value isText ifTrue:[ |
|
2878 |
valueString := '"',(value contractTo:80),'"'. |
|
2879 |
] ifFalse:[ |
|
2880 |
valueString := value storeString contractTo:80. |
|
2881 |
]. |
|
2882 |
] ifFalse:[ |
|
2883 |
(value isBoolean |
|
2884 |
or:[ value isInteger |
|
2885 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2886 |
valueString := value printString. |
|
2887 |
] ifFalse:[ |
|
2888 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2889 |
||
2890 |
(value isArray |
|
2891 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2892 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2893 |
]. |
|
2894 |
||
2895 |
Error handle:[:ex | |
|
2896 |
valueString := '??? (',ex description,')' |
|
2897 |
] do:[ |
|
2898 |
[ |
|
2899 |
valueString := value printString contractTo:80. |
|
2900 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
|
2901 |
] |
|
2902 |
] |
|
2903 |
]. |
|
2904 |
description isEmptyOrNil ifTrue:[ |
|
2905 |
s := valueString , valueClassOrSizeString |
|
2906 |
] ifFalse:[ |
|
2907 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2908 |
]. |
|
2909 |
]. |
|
8592 | 2910 |
"/ Transcript showCR:s. |
2911 |
^ s |
|
9446 | 2912 |
|
2913 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2914 |
! |
2915 |
||
266 | 2916 |
helpTextFor:aComponent |
2917 |
|s| |
|
2918 |
||
2919 |
aComponent == abortButton ifTrue:[ |
|
15413 | 2920 |
s := 'HELP_ABORT' |
266 | 2921 |
]. |
2922 |
aComponent == terminateButton ifTrue:[ |
|
15413 | 2923 |
s := 'HELP_TERMINATE' |
266 | 2924 |
]. |
2925 |
aComponent == continueButton ifTrue:[ |
|
15413 | 2926 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2927 |
s := 'HELP_STOP' |
|
2928 |
] ifFalse:[ |
|
2929 |
s := 'HELP_CONTINUE' |
|
2930 |
] |
|
266 | 2931 |
]. |
2932 |
aComponent == stepButton ifTrue:[ |
|
15413 | 2933 |
s := 'HELP_STEP' |
266 | 2934 |
]. |
2935 |
aComponent == nextButton ifTrue:[ |
|
15413 | 2936 |
s := 'HELP_NEXT' |
266 | 2937 |
]. |
1065 | 2938 |
aComponent == nextOverButton ifTrue:[ |
15413 | 2939 |
s := 'HELP_NEXTOVER' |
1065 | 2940 |
]. |
2941 |
aComponent == nextOutButton ifTrue:[ |
|
15413 | 2942 |
s := 'HELP_NEXTOUT' |
1065 | 2943 |
]. |
266 | 2944 |
aComponent == stepButton ifTrue:[ |
15413 | 2945 |
s := 'HELP_STEP' |
266 | 2946 |
]. |
2947 |
aComponent == sendButton ifTrue:[ |
|
15413 | 2948 |
s := 'HELP_SEND' |
266 | 2949 |
]. |
2950 |
aComponent == returnButton ifTrue:[ |
|
15413 | 2951 |
returnButton enabled ifTrue:[ |
2952 |
s := 'HELP_RETURN' |
|
2953 |
] ifFalse:[ |
|
2954 |
s := 'HELP_RETURN_DISABLED' |
|
2955 |
]. |
|
266 | 2956 |
]. |
2957 |
aComponent == restartButton ifTrue:[ |
|
15413 | 2958 |
restartButton enabled ifTrue:[ |
2959 |
s := 'HELP_RESTART' |
|
2960 |
] ifFalse:[ |
|
2961 |
s := 'HELP_RESTART_DISABLED' |
|
2962 |
]. |
|
266 | 2963 |
]. |
13361 | 2964 |
aComponent == resendButton ifTrue:[ |
15413 | 2965 |
resendButton enabled ifTrue:[ |
2966 |
s := 'HELP_RESEND' |
|
2967 |
] ifFalse:[ |
|
2968 |
s := 'HELP_RESEND_DISABLED' |
|
2969 |
]. |
|
13361 | 2970 |
]. |
266 | 2971 |
aComponent == contextView ifTrue:[ |
15413 | 2972 |
s := 'HELP_WALKBACK' |
266 | 2973 |
]. |
2974 |
aComponent == codeView ifTrue:[ |
|
15413 | 2975 |
s := 'HELP_CODEVIEW' |
266 | 2976 |
]. |
2977 |
aComponent == monitorToggle ifTrue:[ |
|
15413 | 2978 |
s := 'HELP_MONITOR' |
266 | 2979 |
]. |
2980 |
aComponent == updateButton ifTrue:[ |
|
15413 | 2981 |
s := 'HELP_UPDATE' |
266 | 2982 |
]. |
14523 | 2983 |
aComponent == gotoDialogOpenerButton ifTrue:[ |
15413 | 2984 |
s := 'HELP_GOTO_DIALOG_OPENER' |
14523 | 2985 |
]. |
2986 |
aComponent == gotoApplicationActionMethodButton ifTrue:[ |
|
15413 | 2987 |
s := 'HELP_GOTO_APPLICATION_ACTION' |
14523 | 2988 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2989 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2990 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2991 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2992 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
15413 | 2993 |
s := 'HELP_REC_INSP' |
266 | 2994 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2995 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
15413 | 2996 |
s := 'HELP_CON_INSP' |
266 | 2997 |
]. |
2998 |
||
2999 |
s notNil ifTrue:[ |
|
15413 | 3000 |
^ resources stringWithCRs:s |
266 | 3001 |
]. |
3002 |
^ nil |
|
3003 |
||
3004 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 3005 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 3006 |
! ! |
3007 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3008 |
!DebugView methodsFor:'initialization & release'! |
266 | 3009 |
|
3010 |
addToCurrentProject |
|
3011 |
"ignored here" |
|
3012 |
||
3013 |
^ self |
|
3014 |
! |
|
3015 |
||
2115 | 3016 |
destroy |
3017 |
"closing the debugger implies an abort or continue" |
|
3018 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3019 |
self destroyWithConfirmation:true |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3020 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3021 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3022 |
"Modified: / 23-03-2012 / 12:50:01 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3023 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3024 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3025 |
destroyWithConfirmation:withConfirmation |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3026 |
"closing the debugger implies an abort or continue" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3027 |
|
2404 | 3028 |
|m| |
3029 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3030 |
withConfirmation ifTrue:[ |
16960 | 3031 |
self checkIfCodeIsReallyModified ifTrue:[ |
3032 |
(self confirm:('Code was modified.\\Exit anyway ?')) |
|
3033 |
ifFalse:[ |
|
3034 |
^ self |
|
3035 |
] |
|
3036 |
] |
|
2115 | 3037 |
]. |
3038 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
3039 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
3040 |
|
2404 | 3041 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 3042 |
inspecting ifFalse:[ |
16960 | 3043 |
"I am running on top of a process, abort or continue it" |
3044 |
||
3045 |
windowGroup notNil ifTrue:[ |
|
3046 |
windowGroup setProcess:nil. |
|
3047 |
]. |
|
3048 |
self uncacheMyself. |
|
3049 |
||
3050 |
"/ |
|
3051 |
"/ catch invalid return; |
|
3052 |
"/ this happens, when my process has somehow died (quickterminate) |
|
3053 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
3054 |
"/ #destroy-window function. |
|
3055 |
"/ |
|
3056 |
Context cannotReturnSignal handle:[:ex | |
|
3057 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
3058 |
self uncacheMyself. |
|
3059 |
Debugger newDebugger. |
|
3060 |
ex return. |
|
3061 |
] do:[ |
|
3062 |
AbortOperationRequest isHandled ifTrue:[ |
|
3063 |
self doAbort. |
|
3064 |
] ifFalse:[ |
|
3065 |
self doContinue |
|
3066 |
] |
|
3067 |
]. |
|
3068 |
"/ We don't reach this point normally |
|
3069 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2115 | 3070 |
]. |
3071 |
||
2299 | 3072 |
Debugger newDebugger. |
2115 | 3073 |
"/ since I am going to be destroyed, remove me from the cache |
3074 |
self uncacheMyself. |
|
3075 |
super destroy. |
|
3076 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3077 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3078 |
"Created: / 23-03-2012 / 12:49:50 / cg" |
2115 | 3079 |
! |
3080 |
||
266 | 3081 |
initialize |
10205 | 3082 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
12529 | 3083 |
newLayout v exceptionAndTogglePanel codeToggleLabels userPrefs| |
266 | 3084 |
|
3085 |
super initialize. |
|
3086 |
||
12529 | 3087 |
userPrefs := UserPreferences current. |
3088 |
||
15257 | 3089 |
self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger). |
3090 |
||
12529 | 3091 |
hideSupportCode := userPrefs hideSupportCodeInDebugger ? false. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3092 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
15413 | 3093 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
3094 |
|
266 | 3095 |
busy := false. |
3096 |
exclusive := false. |
|
3097 |
inspecting := false. |
|
3098 |
exitAction := nil. |
|
3099 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3100 |
stepHow := nil. |
266 | 3101 |
canContinue := false. |
3102 |
||
3269 | 3103 |
mH := 0. |
3104 |
||
3447 | 3105 |
menuPanel := MenuPanel in:self. |
8131 | 3106 |
menuPanel receiver:self. |
3447 | 3107 |
menuPanel verticalLayout:false. |
8131 | 3108 |
menu := self class menuSpec decodeAsLiteralArray. |
3109 |
menu findGuiResourcesIn:self. |
|
3110 |
menuPanel menu:menu. |
|
3447 | 3111 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
3112 |
mH := menuPanel preferredHeight. |
3447 | 3113 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
3114 |
||
12529 | 3115 |
newLayout := userPrefs useNewLayoutInDebugger. |
8148 | 3116 |
newLayout ifFalse:[ |
15413 | 3117 |
bpanel := HorizontalPanelView in:self. |
3118 |
||
3119 |
self initializeButtonsIn:bpanel. |
|
3120 |
||
3121 |
bH := bpanel preferredHeight + 5. |
|
3122 |
bpanel origin:(0.0 @ mH) |
|
3123 |
extent:(1.0 @ bH). |
|
3124 |
panel := VariableVerticalPanel |
|
3125 |
origin:(0.0 @ (mH + bH)) |
|
3126 |
corner:(1.0 @ 1.0) |
|
3127 |
in:self. |
|
3128 |
||
3129 |
v := self initializeContextListViewIn:panel. |
|
3130 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
3131 |
||
3132 |
codePanel := View in:panel. |
|
3133 |
v := self initializeCodeViewIn:codePanel. |
|
3134 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3135 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3136 |
||
3137 |
v := self initializeInspectorViewsIn:panel. |
|
3138 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3139 |
|
8148 | 3140 |
] ifTrue:[ |
15413 | 3141 |
bpanel1 := HorizontalPanelView in:self. |
3142 |
self initializeButtons1In:bpanel1. |
|
3143 |
||
3144 |
contextInfoLabel := Label label:''. |
|
3145 |
contextInfoLabel adjust:#left. |
|
3146 |
bpanel1 add:contextInfoLabel. |
|
3147 |
||
3148 |
bH1 := bpanel1 preferredHeight + 5. |
|
3149 |
bpanel1 origin:(0.0 @ mH) |
|
3150 |
extent:(1.0 @ bH1). |
|
3151 |
panel := VariableVerticalPanel |
|
3152 |
origin:(0.0 @ (mH + bH1)) |
|
3153 |
corner:(1.0 @ 1.0) |
|
3154 |
in:self. |
|
3155 |
"/ panel showHandle:true. |
|
3156 |
"/ panel handlePosition:#left. |
|
3157 |
||
3158 |
v := self initializeContextListViewIn:panel. |
|
3159 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
3160 |
||
3161 |
codePanel := View in:panel. |
|
3162 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
3163 |
self initializeButtons2In:bpanel2. |
|
3164 |
||
3165 |
bH2 := bpanel2 preferredHeight + 5. |
|
3166 |
bpanel2 origin:(0.0 @ 0.0) |
|
3167 |
extent:(1.0 @ bH2). |
|
3168 |
||
3169 |
exceptionInfoLabel := Label label:''. |
|
3170 |
exceptionInfoLabel adjust:#left. |
|
3171 |
||
3172 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
3173 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
3174 |
exceptionAndTogglePanel |
|
3175 |
geometryLayout: |
|
3176 |
((LayoutFrame |
|
3177 |
origin:(0.0 @ 0.0) |
|
3178 |
corner:(1.0 @ 0.0)) |
|
3179 |
topOffset:bH2; |
|
3180 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
3181 |
rightOffset:-2). |
|
3182 |
||
3183 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
3184 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
3185 |
codeToggleLabels := resources array:{ |
|
3186 |
'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
|
3187 |
'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
|
3188 |
}. |
|
3189 |
methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
|
3190 |
methodCodeToggle list:codeToggleLabels. |
|
3191 |
methodCodeToggle useIndex:true. |
|
3192 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
3193 |
methodCodeToggle beInvisible. |
|
3194 |
||
3195 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
3196 |
||
3197 |
v := self initializeCodeViewIn:codePanel. |
|
3198 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
3199 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3200 |
||
3201 |
v := self initializeInspectorViewsIn:panel. |
|
3202 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3203 |
]. |
3204 |
||
3387 | 3205 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
15413 | 3206 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3207 |
]. |
9626 | 3208 |
LastExtent notNil ifTrue:[ |
15413 | 3209 |
self extent:LastExtent. |
9626 | 3210 |
]. |
3211 |
LastOrigin notNil ifTrue:[ |
|
15413 | 3212 |
self origin:LastOrigin. |
9626 | 3213 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3214 |
|
3269 | 3215 |
" |
3216 |
Debugger newDebugger |
|
3217 |
" |
|
3447 | 3218 |
|
11693 | 3219 |
"Modified: / 27-07-2012 / 14:46:07 / cg" |
3269 | 3220 |
! |
3221 |
||
10205 | 3222 |
initializeAbortButtonIn:bpanel |
3223 |
abortButton := Button |
|
16134 | 3224 |
label:(resources string:'Abort') |
3225 |
action:[ |
|
3226 |
abortButton turnOffWithoutRedraw. |
|
3227 |
self doAbort |
|
3228 |
] |
|
3229 |
in:bpanel. |
|
3230 |
||
3231 |
abortButton name:'abortButton'. |
|
3447 | 3232 |
|
3233 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
3234 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
3235 |
! |
|
3236 |
||
10205 | 3237 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3238 |
"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
|
3239 |
|
16958 | 3240 |
|separator buttonWidth| |
3241 |
||
3242 |
buttonWidth := 170. |
|
3243 |
||
10205 | 3244 |
bpanel horizontalLayout:#left. |
3447 | 3245 |
bpanel verticalLayout:#centerMax. |
3246 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3247 |
||
8194 | 3248 |
self initializeContinueButtonIn:bpanel. |
16958 | 3249 |
continueButton width:buttonWidth. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3250 |
|
9131 | 3251 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
3252 |
"/ separator borderWidth:0; level:0. |
|
3447 | 3253 |
self initializeAbortButtonIn:bpanel. |
16958 | 3254 |
abortButton width:buttonWidth. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3255 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3256 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3257 |
separator borderWidth:0; level:0. |
3269 | 3258 |
|
3447 | 3259 |
self initializeTerminateButtonIn:bpanel. |
3260 |
||
9131 | 3261 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 3262 |
separator borderWidth:0; level:0. |
3263 |
||
13362 | 3264 |
self initializeGotoDialogOpenerButtonIn:bpanel. |
14523 | 3265 |
self initializeGotoApplicationActionMethodButtonIn:bpanel. |
3447 | 3266 |
self initializeDefineButtonIn:bpanel. |
14523 | 3267 |
|
4356 | 3268 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
16958 | 3269 |
separator := View extent:(10 @ 5) in:bpanel. |
3270 |
separator borderWidth:0; level:0. |
|
3271 |
self initializeReportButtonIn:bpanel. |
|
4356 | 3272 |
]. |
3447 | 3273 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 3274 |
! |
3275 |
||
10205 | 3276 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3277 |
"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
|
3278 |
|
16958 | 3279 |
|separator buttonWidth| |
3280 |
||
3281 |
buttonWidth := 130. |
|
3269 | 3282 |
|
9131 | 3283 |
bpanel horizontalLayout:#left. |
3269 | 3284 |
bpanel verticalLayout:#centerMax. |
3285 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3286 |
||
3447 | 3287 |
self initializeNextButtonIn:bpanel. |
16958 | 3288 |
nextButton width:buttonWidth. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3289 |
|
3447 | 3290 |
self initializeStepButtonIn:bpanel. |
16958 | 3291 |
stepButton width:buttonWidth. |
3447 | 3292 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3293 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3294 |
"/ 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
|
3295 |
"/ 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
|
3296 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3297 |
|
3269 | 3298 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3299 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3300 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3301 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3302 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3303 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3304 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3305 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3306 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3307 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3308 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3309 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3310 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3311 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3312 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3313 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3314 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3315 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3316 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3317 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3318 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3319 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3320 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3321 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3322 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3323 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3324 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3325 |
|
3447 | 3326 |
self initializeSendButtonIn:bpanel. |
16958 | 3327 |
sendButton width:buttonWidth. |
3447 | 3328 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3329 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3330 |
separator borderWidth:0; level:0. |
3269 | 3331 |
|
3447 | 3332 |
self initializeReturnButtonIn:bpanel. |
16958 | 3333 |
returnButton width:buttonWidth. |
3447 | 3334 |
self initializeRestartButtonIn:bpanel. |
16958 | 3335 |
restartButton width:buttonWidth. |
13360 | 3336 |
self initializeResendButtonIn:bpanel. |
16958 | 3337 |
resendButton width:buttonWidth. |
3447 | 3338 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
3339 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 3340 |
! |
3341 |
||
10205 | 3342 |
initializeButtonsIn:bpanel |
3269 | 3343 |
|separator| |
3344 |
||
3345 |
bpanel horizontalLayout:#left. |
|
3346 |
bpanel verticalLayout:#centerMax. |
|
3347 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3348 |
||
3447 | 3349 |
self initializeAbortButtonIn:bpanel. |
3350 |
||
3269 | 3351 |
separator := View extent:(10 @ 5) in:bpanel. |
3352 |
separator borderWidth:0; level:0. |
|
3353 |
||
3447 | 3354 |
self initializeContinueButtonIn:bpanel. |
3269 | 3355 |
|
3356 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3357 |
separator borderWidth:0; level:0. |
|
3358 |
||
10205 | 3359 |
self initializeReturnButtonIn:bpanel. |
3360 |
self initializeRestartButtonIn:bpanel. |
|
13360 | 3361 |
self initializeResendButtonIn:bpanel. |
3269 | 3362 |
|
3363 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3364 |
separator borderWidth:0; level:0. |
|
3365 |
||
3447 | 3366 |
self initializeNextButtonIn:bpanel. |
3367 |
self initializeStepButtonIn:bpanel. |
|
3368 |
||
3269 | 3369 |
"/ cg: |
3370 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
3371 |
"/ they do not work relyable with inlined blocks yet. |
|
3372 |
"/ |
|
3373 |
||
3374 |
||
3375 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
3376 |
"/ img isNil ifTrue:[ |
|
3377 |
"/ img := (resources at:'next') |
|
3378 |
"/ ]. |
|
3379 |
"/ nextButton := Button |
|
3380 |
"/ label:img |
|
3381 |
"/ action:[stepButton turnOff. self doNext] |
|
3382 |
"/ in:bpanel. |
|
3383 |
"/ |
|
3384 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
3385 |
"/ img isNil ifTrue:[ |
|
3386 |
"/ img := (resources at:'over') |
|
3387 |
"/ ]. |
|
3388 |
"/ nextOverButton := Button |
|
3389 |
"/ label:img |
|
3390 |
"/ action:[stepButton turnOff. self doNextOver] |
|
3391 |
"/ in:bpanel. |
|
3392 |
"/ |
|
3393 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
3394 |
"/ img isNil ifTrue:[ |
|
3395 |
"/ img := (resources at:'out') |
|
3396 |
"/ ]. |
|
3397 |
"/ nextOutButton := Button |
|
3398 |
"/ label:img |
|
3399 |
"/ action:[stepButton turnOff. self doNextOut] |
|
3400 |
"/ in:bpanel. |
|
3401 |
||
3447 | 3402 |
self initializeSendButtonIn:bpanel. |
3403 |
||
3187 | 3404 |
separator := View extent:(30 @ 5) in:bpanel. |
3405 |
separator borderWidth:0; level:0. |
|
3269 | 3406 |
|
3447 | 3407 |
self initializeTerminateButtonIn:bpanel. |
3408 |
||
3269 | 3409 |
separator := View extent:(30 @ 5) in:bpanel. |
3410 |
separator borderWidth:0; level:0. |
|
3411 |
||
3447 | 3412 |
self initializeDefineButtonIn:bpanel. |
4356 | 3413 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
15413 | 3414 |
self initializeReportButtonIn:bpanel. |
4356 | 3415 |
]. |
3416 |
||
3447 | 3417 |
|
3418 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
3419 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 3420 |
! |
3421 |
||
3422 |
initializeCodeViewIn:panel |
|
13519 | 3423 |
|scrollableCodeView| |
3269 | 3424 |
|
10628 | 3425 |
(UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
15413 | 3426 |
scrollableCodeView := codeView := Tools::CodeView2 new. |
3427 |
codeView model: ValueHolder new. |
|
3428 |
codeView methodHolder: ValueHolder new. |
|
3429 |
codeView classHolder: ValueHolder new. |
|
10628 | 3430 |
] ifFalse:[ |
15413 | 3431 |
scrollableCodeView := HVScrollableView |
3432 |
for:CodeView |
|
3433 |
miniScrollerH:true |
|
3434 |
miniScrollerV:false |
|
3435 |
in:panel. |
|
3436 |
||
3437 |
codeView := scrollableCodeView scrolledView. |
|
3438 |
codeView enableMotionEvents. "/ for active help |
|
3439 |
]. |
|
3440 |
||
3441 |
(UserPreferences current showAcceptCancelBarInBrowser |
|
3442 |
and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
|
3443 |
ViewWithAcceptAndCancelBar notNil ifTrue:[ |
|
3444 |
|v| |
|
3445 |
||
3446 |
v := ViewWithAcceptAndCancelBar new. |
|
3447 |
v slaveView:scrollableCodeView. |
|
3448 |
v reallyModifiedHolder:(codeView isCodeView2 |
|
3449 |
ifTrue:[ codeView reallyModifiedChannel ] |
|
3450 |
ifFalse:[ |
|
3451 |
BlockValue |
|
3452 |
with:[:m | |
|
3453 |
|same| |
|
3454 |
||
3455 |
same := (codeView contentsAsString string = currentMethod source string). |
|
3456 |
codeView modifiedChannel setValue:false. "/ so it triggers again |
|
3457 |
same not. |
|
3458 |
] |
|
3459 |
argument:codeView modifiedChannel |
|
3460 |
]). |
|
3461 |
v cancelAction: |
|
3462 |
[ |
|
3463 |
"/ codeView setClipboardText:(codeView contents). "/ for undo |
|
3464 |
codeView device rememberInCopyBufferHistory:(codeView contents). "/ for undo |
|
3465 |
codeView contents:(currentMethod source). |
|
3466 |
codeView modifiedChannel setValue:false; changed. "/ trigger |
|
3467 |
codeView requestFocus. |
|
3468 |
]. |
|
3469 |
v compareAction: |
|
3470 |
[ |
|
3471 |
v := DiffCodeView |
|
3472 |
openOn:codeView contentsAsString |
|
3473 |
label:(resources string:'Changed definition (to be accepted ?)') |
|
3474 |
and:currentMethod source |
|
3475 |
label:(resources string:'Method''s Original Code'). |
|
3476 |
v label:(resources string:'Changed Code in Debugger'). |
|
3477 |
v waitUntilVisible. |
|
3478 |
"/ codeView requestFocus |
|
3479 |
]. |
|
3480 |
scrollableCodeView := v. |
|
3481 |
] |
|
13519 | 3482 |
]. |
3483 |
||
3484 |
panel add:scrollableCodeView. |
|
3485 |
^ scrollableCodeView |
|
10628 | 3486 |
|
13842 | 3487 |
"Modified: / 06-12-2013 / 17:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3269 | 3488 |
! |
3489 |
||
3490 |
initializeContextListViewIn:panel |
|
3491 |
|v| |
|
266 | 3492 |
|
10205 | 3493 |
v := HVScrollableView |
15413 | 3494 |
for:SelectionInListView |
3495 |
miniScrollerH:true |
|
3496 |
miniScrollerV:false |
|
3497 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
3498 |
v autoHideHorizontalScrollBar:true. |
266 | 3499 |
|
3500 |
contextView := v scrolledView. |
|
3501 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 3502 |
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
|
3503 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 3504 |
|
10205 | 3505 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 3506 |
|
3269 | 3507 |
^ v |
3508 |
! |
|
3509 |
||
5453 | 3510 |
initializeContextViewsMiddleButtonMenu |
3511 |
<resource: #programMenu > |
|
3512 |
||
10205 | 3513 |
contextView middleButtonMenu:(self middleButtonMenu). |
3514 |
! |
|
3515 |
||
3516 |
initializeContinueButtonIn:bpanel |
|
3517 |
continueButton := Button |
|
16134 | 3518 |
label:(resources string:'Continue') |
3519 |
action:[ |
|
3520 |
continueButton turnOffWithoutRedraw. |
|
3521 |
self doContinue |
|
3522 |
] |
|
3523 |
in:bpanel. |
|
3524 |
||
3525 |
continueButton name:'continueButton'. |
|
3447 | 3526 |
|
3527 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
3528 |
! |
|
3529 |
||
10205 | 3530 |
initializeDefineButtonIn:bpanel |
3531 |
defineButton := Button |
|
16134 | 3532 |
label:(resources string:'Define') |
3533 |
action:[ |
|
3534 |
defineButton turnOffWithoutRedraw. |
|
3535 |
self doDefine |
|
3536 |
] |
|
3537 |
in:bpanel. |
|
3538 |
||
3539 |
defineButton name:'defineButton'. |
|
3447 | 3540 |
defineButton beInvisible |
3541 |
||
3542 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
3543 |
! |
|
3544 |
||
14523 | 3545 |
initializeGotoApplicationActionMethodButtonIn:bpanel |
3546 |
gotoApplicationActionMethodButton := Button |
|
16134 | 3547 |
label:(resources string:'Goto Responsible Application Method') |
3548 |
action:[ |
|
3549 |
gotoApplicationActionMethodButton turnOffWithoutRedraw. |
|
3550 |
self doGotoApplicationActionMethod |
|
3551 |
] |
|
3552 |
in:bpanel. |
|
3553 |
||
3554 |
gotoApplicationActionMethodButton name:'gotoAppMethodButton'. |
|
14523 | 3555 |
gotoApplicationActionMethodButton beInvisible |
3556 |
! |
|
3557 |
||
13362 | 3558 |
initializeGotoDialogOpenerButtonIn:bpanel |
3559 |
gotoDialogOpenerButton := Button |
|
16134 | 3560 |
label:(resources string:'Goto Dialog Opener') |
3561 |
action:[ |
|
3562 |
gotoDialogOpenerButton turnOffWithoutRedraw. |
|
3563 |
self doGotoDialogOpener |
|
3564 |
] |
|
3565 |
in:bpanel. |
|
3566 |
||
3567 |
gotoDialogOpenerButton name:'gotoDialogOpenerButton'. |
|
13362 | 3568 |
gotoDialogOpenerButton beInvisible |
3569 |
! |
|
3570 |
||
3269 | 3571 |
initializeInspectorViewsIn:panel |
3572 |
|hpanel| |
|
266 | 3573 |
|
3574 |
hpanel := VariableHorizontalPanel in:panel. |
|
3575 |
||
3576 |
receiverInspector := InspectorView |
|
15413 | 3577 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
3578 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3579 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 3580 |
|
3581 |
contextInspector := ContextInspectorView |
|
15413 | 3582 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
3583 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3584 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3585 |
|
3269 | 3586 |
^ hpanel |
266 | 3587 |
! |
3588 |
||
10205 | 3589 |
initializeNextButtonIn:bpanel |
3590 |
nextButton := Button |
|
16134 | 3591 |
label:(resources string:'Debug_Next') |
3592 |
action:[ |
|
3593 |
stepButton turnOff. |
|
3594 |
self doNext |
|
3595 |
] |
|
3596 |
in:bpanel. |
|
3597 |
||
3598 |
nextButton name:'nextButton'. |
|
3599 |
||
3600 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
3447 | 3601 |
! |
3602 |
||
10205 | 3603 |
initializeReportButtonIn:bpanel |
3604 |
reportButton := Button |
|
16134 | 3605 |
label:(resources string:'Report by Mail...') |
3606 |
action:[ |
|
3607 |
reportButton turnOffWithoutRedraw. |
|
3608 |
self doOpenReportMailApp. |
|
3609 |
] |
|
3610 |
in:bpanel. |
|
3611 |
||
3612 |
reportButton name:'reportButton'. |
|
4356 | 3613 |
|
3614 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
3615 |
! |
|
3616 |
||
13360 | 3617 |
initializeResendButtonIn:bpanel |
3618 |
resendButton := Button |
|
16134 | 3619 |
label:(resources string:'Resend') |
3620 |
action:[ |
|
3621 |
resendButton turnOff. |
|
3622 |
self doResend |
|
3623 |
] |
|
3624 |
in:bpanel. |
|
3625 |
||
3626 |
resendButton name:'resendButton'. |
|
13490 | 3627 |
|
3628 |
"/ if we have this, we do not need the restart button |
|
3629 |
restartButton beInvisible. |
|
13360 | 3630 |
! |
3631 |
||
10205 | 3632 |
initializeRestartButtonIn:bpanel |
3633 |
restartButton := Button |
|
16134 | 3634 |
label:(resources string:'Restart') |
3635 |
action:[ |
|
3636 |
restartButton turnOff. |
|
3637 |
self doRestart |
|
3638 |
] |
|
3639 |
in:bpanel. |
|
3640 |
||
3641 |
restartButton name:'restartButton' |
|
3642 |
||
3447 | 3643 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
3644 |
! |
|
3645 |
||
10205 | 3646 |
initializeReturnButtonIn:bpanel |
3647 |
returnButton := Button |
|
16134 | 3648 |
label:(resources string:'Return') |
3649 |
action:[ |
|
3650 |
returnButton turnOff. |
|
3651 |
self doReturn |
|
3652 |
] |
|
3653 |
in:bpanel. |
|
3654 |
||
3655 |
returnButton name:'returnButton'. |
|
3447 | 3656 |
|
3657 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
3658 |
! |
|
3659 |
||
10205 | 3660 |
initializeSendButtonIn:bpanel |
3661 |
sendButton := Button |
|
16134 | 3662 |
label:(resources string:'Send') |
3663 |
action:[ |
|
3664 |
sendButton turnOff. |
|
3665 |
self doSend |
|
3666 |
] |
|
3667 |
in:bpanel. |
|
3668 |
||
3669 |
sendButton name:'sendButton'. |
|
3447 | 3670 |
|
3671 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
3672 |
! |
|
3673 |
||
10205 | 3674 |
initializeStepButtonIn:bpanel |
3675 |
stepButton := Button |
|
16134 | 3676 |
label:(resources string:'Debug_Step') |
3677 |
action:[ |
|
3678 |
stepButton turnOff. |
|
3679 |
self doStep |
|
3680 |
] |
|
3681 |
in:bpanel. |
|
3682 |
||
3683 |
stepButton name:'stepButton'. |
|
3447 | 3684 |
|
3685 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
3686 |
! |
|
3687 |
||
10205 | 3688 |
initializeTerminateButtonIn:bpanel |
3689 |
terminateButton := Button |
|
16134 | 3690 |
label:(resources string:'Debug_Terminate') |
3691 |
action:[ |
|
3692 |
terminateButton turnOffWithoutRedraw. |
|
3693 |
self doTerminate |
|
3694 |
] |
|
3695 |
in:bpanel. |
|
3696 |
||
3697 |
terminateButton name:'terminateButton'. |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3698 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3699 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3700 |
|
3447 | 3701 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 3702 |
! |
3703 |
||
1249 | 3704 |
postRealize |
3705 |
super postRealize. |
|
266 | 3706 |
|
3707 |
inspecting ifTrue:[ |
|
15413 | 3708 |
inspectedProcess notNil ifTrue:[ |
3709 |
" |
|
3710 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
3711 |
to run between mine and the debugged processes prio) |
|
3712 |
" |
|
3713 |
Processor activeProcess |
|
3714 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
3715 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3716 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3717 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3718 |
self sensor addEventListener:self. |
1249 | 3719 |
|
3720 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 3721 |
! |
3722 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3723 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3724 |
"/ 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
|
3725 |
"/ 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
|
3726 |
|
13965 | 3727 |
self drawableId notNil ifTrue:[ |
15413 | 3728 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3729 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3730 |
"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
|
3731 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3732 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3733 |
|
11818 | 3734 |
releaseDebuggee |
3735 |
"We have to be careful to release all refs to the debuggee, |
|
3736 |
because we may be in the cache. |
|
3737 |
Otherwise, the GC will not be able to release it" |
|
3738 |
||
3739 |
busy := false. |
|
3740 |
||
3741 |
codeView acceptAction:nil. |
|
3742 |
codeView doItAction:nil. |
|
3743 |
codeView contents:nil. |
|
3744 |
||
3745 |
receiverInspector release. |
|
3746 |
contextInspector release. |
|
3747 |
inspectedProcess := nil. |
|
3748 |
contextArray := nil. |
|
13361 | 3749 |
((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[ |
15413 | 3750 |
selectedContext := nil. |
11818 | 3751 |
]. |
3752 |
actualContext := firstContext := nil. |
|
3753 |
steppedContext := wrapperContext := nil. |
|
3754 |
catchBlock := nil. |
|
3755 |
grabber := nil. |
|
3756 |
self autoUpdateOff. |
|
3757 |
||
3758 |
"Created: / 10-07-1997 / 14:57:51 / stefan" |
|
3759 |
"Modified: / 26-09-2012 / 15:08:21 / cg" |
|
3760 |
! |
|
3761 |
||
266 | 3762 |
setLabelFor:aMessage in:aProcess |
16984 | 3763 |
|l lines processNameOrNil pidOrNil osPidString colorUsed| |
6821 | 3764 |
|
3765 |
lines := aMessage asStringCollection. |
|
3766 |
lines size > 1 ifTrue:[ |
|
16501 | 3767 |
l := lines first |
6821 | 3768 |
] ifFalse:[ |
16501 | 3769 |
l := aMessage. |
6821 | 3770 |
]. |
3771 |
||
3772 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
3773 |
Error handle:[:ex | |
16501 | 3774 |
l := l , '???' |
1030 | 3775 |
] do:[ |
16501 | 3776 |
processNameOrNil := aProcess name. |
3777 |
processNameOrNil notNil ifTrue:[ |
|
3778 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
3779 |
]. |
|
3780 |
pidOrNil := aProcess id printString. |
|
3781 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 3782 |
]. |
1030 | 3783 |
l := l , ')'. |
266 | 3784 |
self label:l. |
6821 | 3785 |
|
10205 | 3786 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
16501 | 3787 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
9403 | 3788 |
]. |
3789 |
||
8305 | 3790 |
exceptionInfoLabel notNil ifTrue:[ |
16984 | 3791 |
colorUsed := isStoppedAtHaltOrBreakPoint |
3792 |
ifTrue:[ Color orange ] |
|
3793 |
ifFalse:[ Color red ]. |
|
3794 |
||
3795 |
(exceptionInfoLabel backgroundColor brightness dist:colorUsed brightness) < 0.5 |
|
3796 |
ifTrue:[ |
|
3797 |
exceptionInfoLabel backgroundColor brightness > 0.5 ifTrue:[ |
|
3798 |
colorUsed := colorUsed slightlyDarkened. |
|
3799 |
] ifFalse:[ |
|
3800 |
colorUsed := colorUsed slightlyLigntened. |
|
3801 |
]. |
|
3802 |
]. |
|
3803 |
||
16501 | 3804 |
exceptionInfoLabel |
3805 |
label:(resources |
|
3806 |
string:'%1 in process %2 [%3]%4' |
|
16984 | 3807 |
with:(lines first withColor:colorUsed) |
16501 | 3808 |
with:(processNameOrNil ? '') |
3809 |
with:(pidOrNil ? '') |
|
3810 |
with:(osPidString ? '')) |
|
8305 | 3811 |
]. |
3812 |
||
6821 | 3813 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 3814 |
! ! |
3815 |
||
3816 |
!DebugView methodsFor:'interrupt handling'! |
|
3817 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3818 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3819 |
DebuggingDebugger == true ifTrue:[ |
15413 | 3820 |
'contextIRQ' printCR. |
3821 |
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
|
3822 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3823 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3824 |
|
1364 | 3825 |
"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
|
3826 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3827 |
|
0 | 3828 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3829 |
DebuggingDebugger == true ifTrue:[ |
15413 | 3830 |
'stepIRQ' print. |
3831 |
"/ ' in ' print. thisContext sender fullPrint. |
|
3832 |
'' printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3833 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
3834 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3835 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3836 |
|
11636 | 3837 |
"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
|
3838 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3839 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3840 |
stepOrNext |
15413 | 3841 |
|where here con s isWrap method wrappedMethod |
11636 | 3842 |
originalMethodOfWrappedMethod originalMethodsContext |
3843 |
inBlock subBlockLeft ignore contextBelow wrapContext |
|
10205 | 3844 |
leftWrap enteredWrap anyStepBlocks |
16373 | 3845 |
oneMore initiallyShown inBlockBelow receiver processName |
3846 |
inBreakPointHandlingCode bpntReceiver| |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3847 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3848 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3849 |
"/ DebuggingDebugger := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3850 |
"/ DebuggingDebugger2 := true |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3851 |
"/ DebuggingDebugger2 := false |
11636 | 3852 |
"/ DebuggingDebugger3 := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3853 |
"/ '' printCR |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3854 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3855 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3856 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3857 |
skipLineNr == #return ifTrue:[ |
16373 | 3858 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
3859 |
here := thisContext sender sender. |
|
3860 |
here setLineNumber:nil. |
|
3861 |
here := nil. |
|
3862 |
con := thisContext sender sender sender. |
|
3863 |
||
3864 |
HaltInterrupt handle:[:ex | |
|
3865 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
3866 |
ex proceed |
|
3867 |
] do:[ |
|
3868 |
self enter:con select:nil. |
|
3869 |
]. |
|
3870 |
con := nil. |
|
3871 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3872 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3873 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3874 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3875 |
"/ "/ 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
|
3876 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3877 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3878 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3879 |
"/ 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
|
3880 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3881 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3882 |
|
52 | 3883 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
16373 | 3884 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
3885 |
^ self |
|
52 | 3886 |
]. |
3887 |
||
29 | 3888 |
here := thisContext. "stepInterrupt" |
10205 | 3889 |
here := here sender. "the caller; step- or contextIRQ" |
3890 |
here := here sender. "the interrupted context" |
|
29 | 3891 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3892 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 3893 |
'***************************' printCR. |
3894 |
'here in ' print. |
|
3895 |
inWrap ifTrue:['(wrap) ' print.]. |
|
3896 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
3897 |
here selector printCR. |
|
3898 |
'stepping in ' print. |
|
3899 |
steppedContext notNil ifTrue:[ |
|
3900 |
((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print. |
|
3901 |
]. |
|
3902 |
steppedContext printCR. |
|
3903 |
]. |
|
3904 |
||
3905 |
(inBreakPointHandlingCode := (here selector == #break)) ifTrue:[ |
|
3906 |
bpntReceiver := here receiver. |
|
3907 |
] ifFalse:[ |
|
3908 |
(inBreakPointHandlingCode := (here sender selector == #break)) ifTrue:[ |
|
3909 |
bpntReceiver := here sender receiver. |
|
3910 |
] |
|
3911 |
]. |
|
3912 |
||
13197 | 3913 |
"/ when single stepping, ignore breakpoints |
16373 | 3914 |
inBreakPointHandlingCode ifTrue:[ |
16376 | 3915 |
(bpntReceiver notNil and:[ bpntReceiver isKindOf:Breakpoint ]) ifTrue:[ |
16373 | 3916 |
false "here receiver isEnabled" ifFalse:[ |
3917 |
con := nil. |
|
3918 |
where := nil. here := nil. |
|
3919 |
StepInterruptPending := 1. |
|
3920 |
InterruptPending := 1. |
|
3921 |
InStepInterrupt := nil. |
|
3922 |
^ self |
|
3923 |
] |
|
3924 |
]. |
|
13197 | 3925 |
]. |
3926 |
||
3927 |
"/ kludge: a bug-workaround; |
|
3928 |
"/ I should not see those... |
|
2581 | 3929 |
|
3930 |
here selector == #ioInterrupt ifTrue:[ |
|
16373 | 3931 |
DebuggingDebugger2 == true ifTrue:[ |
3932 |
'oops - should not get that one' printCR. |
|
3933 |
]. |
|
3934 |
Processor ioInterrupt. |
|
3935 |
StepInterruptPending := 1. |
|
3936 |
InterruptPending := 1. |
|
3937 |
where := nil. here := nil. |
|
3938 |
InStepInterrupt := nil. |
|
3939 |
^ self |
|
2581 | 3940 |
]. |
3941 |
||
3942 |
stepUntilEntering notNil ifTrue:[ |
|
16373 | 3943 |
DebuggingDebugger2 == true ifTrue:[ |
3944 |
'check if entering ' print. stepUntilEntering printCR. |
|
3945 |
]. |
|
3946 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
3947 |
DebuggingDebugger2 == true ifTrue:[ |
|
3948 |
'entering...' printCR. |
|
3949 |
]. |
|
3950 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
3951 |
||
3952 |
lastStepUntilEntering := stepUntilEntering. |
|
3953 |
stepUntilEntering := nil. |
|
3954 |
self enter:here select:nil. |
|
3955 |
con := nil. |
|
3956 |
^ self |
|
3957 |
]. |
|
3958 |
"/ see if stepping context is still active ... |
|
3959 |
||
3960 |
con := here. |
|
3961 |
||
3962 |
DebuggingDebugger2 == true ifTrue:[ |
|
3963 |
'start searching at: ' print. |
|
3964 |
con fullPrint. |
|
3965 |
]. |
|
3966 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
3967 |
con := con sender |
|
3968 |
]. |
|
3969 |
con notNil ifTrue:[ |
|
3970 |
DebuggingDebugger2 == true ifTrue:[ |
|
3971 |
'steppingContext still active - continue stepping' printCR. |
|
3972 |
]. |
|
3973 |
con := nil. |
|
3974 |
where := nil. here := nil. |
|
3975 |
StepInterruptPending := 1. |
|
3976 |
InterruptPending := 1. |
|
3977 |
InStepInterrupt := nil. |
|
3978 |
^ self |
|
3979 |
]. |
|
3980 |
stepUntilEntering := nil. |
|
2581 | 3981 |
]. |
3982 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
3983 |
" |
11636 | 3984 |
kludge to hide breakpoint wrappers in the context list and when single stepping: |
16373 | 3985 |
check if we are in a wrapper method's hidden setup-sequence |
3986 |
if so, ignore the interrupt and continue single sending. |
|
3987 |
Assume we are in a wrappers setup code, if there is another context above, |
|
3988 |
which is for the wrapper method (i.e. if there is context with an originalmethod |
|
3989 |
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
|
3990 |
" |
29 | 3991 |
isWrap := false. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3992 |
subBlockLeft := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3993 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3994 |
|
57 | 3995 |
inWrap ifTrue:[ |
16373 | 3996 |
"/ situation1: |
3997 |
"/ valueWithReceiver or other |
|
3998 |
"/ foo (wrapped) <- wrapContext |
|
3999 |
"/ |
|
4000 |
"/ situation2: |
|
4001 |
"/ foo (original) <- originalMethodsContext |
|
4002 |
"/ valueWithReceiver |
|
4003 |
"/ foo (wrapped) <- wrapContext |
|
4004 |
"/ |
|
4005 |
"/ situation3: |
|
4006 |
"/ other |
|
4007 |
"/ foo (original) <- originalMethodsContext |
|
4008 |
"/ valueWithReceiver |
|
4009 |
"/ foo (wrapped) <- wrapContext |
|
4010 |
"/ |
|
4011 |
"/ situation4: |
|
4012 |
"/ ... many-contexts ... (more than 8) |
|
4013 |
"/ possibly foo (original) |
|
4014 |
"/ valueWithReceiver or other |
|
4015 |
"/ foo (wrapped) |
|
4016 |
"/ |
|
4017 |
||
4018 |
"/ search for the wrapped method's context and extract the original method |
|
4019 |
where := here. |
|
4020 |
8 timesRepeat:[ |
|
4021 |
wrapContext isNil ifTrue:[ |
|
4022 |
where notNil ifTrue:[ |
|
4023 |
DebuggingDebugger2 == true ifTrue:[ |
|
4024 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
4025 |
where printCR |
|
4026 |
]. |
|
4027 |
where isBlockContext ifFalse:[ |
|
4028 |
method := where method. |
|
4029 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4030 |
originalMethodOfWrappedMethod := method originalMethod. |
|
4031 |
wrappedMethod := method. |
|
4032 |
wrapContext := where. |
|
4033 |
]. |
|
4034 |
]. |
|
4035 |
where := where sender |
|
4036 |
] |
|
4037 |
] |
|
4038 |
]. |
|
4039 |
DebuggingDebugger2 == true ifTrue:[ |
|
4040 |
'wrap-context is: ' print. |
|
4041 |
wrapContext notNil ifTrue:[ |
|
4042 |
((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print. |
|
4043 |
]. |
|
4044 |
wrapContext printCR |
|
4045 |
]. |
|
4046 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
4047 |
'oops no wrap?' errorPrintCR. |
|
4048 |
]. |
|
11636 | 4049 |
]. |
4050 |
||
4051 |
(inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[ |
|
16373 | 4052 |
isWrap := false. |
4053 |
"/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ]. |
|
4054 |
where := here. |
|
4055 |
8 timesRepeat:[ |
|
4056 |
originalMethodsContext isNil ifTrue:[ |
|
4057 |
where notNil ifTrue:[ |
|
4058 |
DebuggingDebugger2 ifTrue:[ |
|
4059 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
4060 |
where printCR |
|
4061 |
]. |
|
4062 |
where isBlockContext ifFalse:[ |
|
4063 |
method := where method. |
|
4064 |
method == originalMethodOfWrappedMethod ifTrue:[ |
|
4065 |
originalMethodsContext := here. |
|
4066 |
where == here ifTrue:[ |
|
4067 |
"/ situation2 |
|
4068 |
DebuggingDebugger2 ifTrue:[ 's2' printCR ]. |
|
4069 |
isWrap := true. |
|
4070 |
"/ here setSender:(wrapContext sender). --- leads to a crash |
|
4071 |
] ifFalse: [ |
|
4072 |
"/ situation3 |
|
4073 |
DebuggingDebugger2 ifTrue:[ 's3' printCR ]. |
|
4074 |
inWrap := false. |
|
4075 |
isWrap := false. |
|
4076 |
]. |
|
4077 |
steppedContext := where |
|
11636 | 4078 |
"/ ] ifFalse:[ |
4079 |
"/ where selector == wrapContext selector ifTrue:[ |
|
4080 |
"/ where receiver == wrapContext receiver ifTrue:[ |
|
4081 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
4082 |
"/ method printCR. |
|
4083 |
"/ method originalMethod printCR. |
|
4084 |
"/ originalMethodOfWrappedMethod printCR. |
|
4085 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
4086 |
"/ ]. |
|
4087 |
"/ ]. |
|
16373 | 4088 |
]. |
4089 |
where := where sender |
|
4090 |
]. |
|
4091 |
]. |
|
4092 |
]. |
|
4093 |
]. |
|
4094 |
DebuggingDebugger2 ifTrue:[ |
|
4095 |
'original method-context is: ' print. |
|
4096 |
originalMethodsContext notNil ifTrue:[ |
|
4097 |
((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print. |
|
4098 |
]. |
|
4099 |
originalMethodsContext printCR |
|
4100 |
]. |
|
4101 |
originalMethodsContext isNil ifTrue:[ |
|
4102 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
4103 |
"/ situation4 |
|
4104 |
DebuggingDebugger2 ifTrue:[ 's4' printCR ]. |
|
4105 |
DebuggingDebugger2 ifTrue:[ steppedContext printCR ]. |
|
4106 |
isWrap := false. |
|
4107 |
] ifFalse:[ |
|
4108 |
"/ situation1 |
|
4109 |
DebuggingDebugger2 ifTrue:[ 's1' printCR ]. |
|
4110 |
isWrap := true. |
|
4111 |
"/ steppedContext := wrapContext |
|
4112 |
]. |
|
4113 |
]. |
|
29 | 4114 |
]. |
4115 |
||
4116 |
isWrap ifTrue:[ |
|
16373 | 4117 |
DebuggingDebugger2 == true ifTrue:[ |
4118 |
'ignore wrap' printCR. |
|
4119 |
]. |
|
4120 |
||
4121 |
"/ |
|
4122 |
"/ ignore, while in wrappers hidden setup |
|
4123 |
"/ |
|
4124 |
where := nil. here := nil. |
|
4125 |
ObjectMemory flushInlineCaches. |
|
4126 |
||
4127 |
DebuggingDebugger2 == true ifTrue:[ |
|
4128 |
skipLineNr == #return ifTrue:[ |
|
4129 |
'skipRet in wrap' printCR. |
|
4130 |
] |
|
4131 |
]. |
|
4132 |
||
4133 |
StepInterruptPending := 1. |
|
4134 |
InterruptPending := 1. |
|
4135 |
InStepInterrupt := nil. |
|
4136 |
^ self |
|
29 | 4137 |
]. |
4138 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4139 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 4140 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4141 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4142 |
'bigStep is: ' print. bigStep printCR. |
4143 |
'steppedContext is: ' print. steppedContext printCR. |
|
4144 |
]. |
|
4145 |
||
4146 |
s := 'Debugger: after step'. |
|
2581 | 4147 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4148 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4149 |
"/ 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
|
4150 |
"/ |
16373 | 4151 |
(bigStep and:[steppedContext notNil]) ifTrue:[ |
4152 |
" |
|
4153 |
a step or next - ignore all contexts below the interesting one |
|
4154 |
" |
|
4155 |
where := here. "the interrupted context" |
|
4156 |
contextBelow := nil. |
|
4157 |
||
4158 |
where home notNil ifTrue:[ |
|
4159 |
"/ |
|
4160 |
"/ in a block called by 'our' context ? |
|
4161 |
"/ |
|
4162 |
where home == steppedContext ifTrue:[ |
|
4163 |
"/ '*block*' printCR. |
|
4164 |
inBlock := true |
|
4165 |
] |
|
4166 |
]. |
|
4167 |
(where == steppedContext) ifFalse:[ |
|
4168 |
where := where sender. |
|
4169 |
||
4170 |
where notNil ifTrue:[ |
|
4171 |
where home == steppedContext ifTrue:[ |
|
4172 |
"/ '*block*' printCR. |
|
4173 |
inBlock := true. |
|
4174 |
] |
|
4175 |
]. |
|
57 | 4176 |
|
4177 |
"/ 'looking for ' print. |
|
3055 | 4178 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 4179 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4180 |
"/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
|
4181 |
"/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
|
4182 |
|
16373 | 4183 |
where == steppedContext ifFalse:[ |
4184 |
||
4185 |
"/ check if we are in a context below steppedContext |
|
4186 |
"/ (i.e. if steppedContext can be reached from |
|
4187 |
"/ interrupted context. Not using context-ref but its |
|
4188 |
"/ address to avoid creation of many useless contexts.) |
|
4189 |
||
4190 |
(inBlock) ifFalse:[ |
|
4191 |
[where notNil] whileTrue:[ |
|
4192 |
||
4193 |
"/ if either the receiver or any arg of this context |
|
4194 |
"/ is a block of the steppedContext, we must really |
|
4195 |
"/ do a single step. Otherwise, stepping through a |
|
4196 |
"/ do:-loop would be very difficult. |
|
4197 |
receiver := where receiver. |
|
13197 | 4198 |
where selector == #critical: ifTrue:[ |
4199 |
anyStepBlocks := true. |
|
4200 |
] ifFalse:[ |
|
16373 | 4201 |
(receiver isBlock |
4202 |
and:[(receiver isKindOf:Block) |
|
4203 |
and:[receiver homeMethod == steppedContext method |
|
4204 |
"receiver home == steppedContext"]]) |
|
4205 |
ifTrue:[ |
|
4206 |
anyStepBlocks := true. |
|
4207 |
] ifFalse:[ |
|
4208 |
where args do:[:arg | |
|
4209 |
(arg isBlock |
|
4210 |
and:[(arg isKindOf:Block) |
|
4211 |
and:[arg homeMethod == steppedContext method |
|
4212 |
"arg home == steppedContext"]]) |
|
4213 |
ifTrue:[ |
|
4214 |
anyStepBlocks := true. |
|
4215 |
] ifFalse:[ |
|
4216 |
(where methodHome notNil |
|
4217 |
and:[where methodHome receiver isBlock |
|
4218 |
and:[(where methodHome receiver isKindOf:Block) |
|
4219 |
and:[where methodHome receiver homeMethod == steppedContext method |
|
4220 |
"where methodHome receiver home == steppedContext"]]]) |
|
4221 |
ifTrue:[ |
|
4222 |
anyStepBlocks := true. |
|
4223 |
] |
|
4224 |
]. |
|
4225 |
] |
|
4226 |
]. |
|
13197 | 4227 |
]. |
16373 | 4228 |
DebuggingDebugger2 == true ifTrue:[ |
4229 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
4230 |
where selector printCR. |
|
4231 |
]. |
|
4232 |
||
4233 |
where == steppedContext ifTrue:[ |
|
3055 | 4234 |
"/ 'found it - below; ignore' printCR. |
16373 | 4235 |
" |
4236 |
found the interesting context somwehere up in the |
|
4237 |
chain. We seem to be still below the interesting one ... |
|
4238 |
" |
|
4239 |
tracing == true ifTrue:[ |
|
4240 |
here printString printCR |
|
4241 |
]. |
|
4242 |
" |
|
4243 |
yes, a context below |
|
4244 |
- continue and schedule another stepInterrupt. |
|
4245 |
Must flush caches since optimized methods not always |
|
4246 |
look for pending interrupts |
|
4247 |
" |
|
4248 |
||
4249 |
contextBelow notNil ifTrue:[ |
|
3055 | 4250 |
"/ '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
|
4251 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4252 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4253 |
"/ 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
|
4254 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4255 |
|
16373 | 4256 |
DebuggingDebugger2 == true ifTrue:[ |
4257 |
'below stepCon; continue until unwind of: ' print. |
|
4258 |
contextBelow printCR. |
|
4259 |
]. |
|
4260 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
4261 |
StepInterruptPending := nil. |
|
4262 |
] ifFalse:[ |
|
4263 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4264 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4265 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4266 |
"/ 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
|
4267 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4268 |
|
16373 | 4269 |
DebuggingDebugger2 == true ifTrue:[ |
4270 |
'in stepCon; continue single stepping' printCR. |
|
4271 |
]. |
|
4272 |
StepInterruptPending := 1. |
|
4273 |
InterruptPending := 1. |
|
4274 |
]. |
|
4275 |
where := nil. here := nil. |
|
4276 |
InStepInterrupt := nil. |
|
4277 |
||
4278 |
^ self |
|
4279 |
]. |
|
4280 |
||
4281 |
(steppedContext notNil and:[ |
|
4282 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
4283 |
inBlockBelow := true. |
|
4284 |
]. |
|
4285 |
||
4286 |
anyStepBlocks ifFalse:[ |
|
4287 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4288 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4289 |
"/ 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
|
4290 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4291 |
where isBlockContext ifFalse:[ |
16373 | 4292 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4293 |
]. |
16373 | 4294 |
] |
4295 |
]. |
|
4296 |
where := where sender |
|
4297 |
]. |
|
4298 |
s := 'Debugger: context returned'. |
|
4299 |
subBlockLeft := true. |
|
4300 |
]. |
|
4301 |
] ifTrue:[ |
|
3055 | 4302 |
"/ 'found it right in sender' printCR. |
16373 | 4303 |
s := 'Debugger: after step' |
4304 |
]. |
|
4305 |
] ifTrue:[ |
|
3055 | 4306 |
"/ 'found it right away' printCR. |
16373 | 4307 |
s := 'Debugger: after step' |
4308 |
]. |
|
0 | 4309 |
] ifFalse:[ |
3055 | 4310 |
"/ ' send' printCR. |
16373 | 4311 |
" |
4312 |
a send |
|
4313 |
" |
|
4314 |
DebuggingDebugger2 == true ifTrue:[ |
|
4315 |
'clear steppedContext' printCR. |
|
4316 |
]. |
|
4317 |
steppedContext := nil. |
|
4318 |
s := 'Debugger: after send' |
|
0 | 4319 |
]. |
7 | 4320 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4321 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4322 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
16373 | 4323 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4324 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4325 |
|
790 | 4326 |
"/ handle the case, when a subBlock leaves; |
4327 |
"/ continue stepping in the home context. |
|
4328 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4329 |
subBlockLeft ifTrue:[ |
16373 | 4330 |
steppedContext home notNil ifTrue:[ |
4331 |
steppedContext := steppedContext home. |
|
4332 |
s := 'Debugger: after step'. |
|
4333 |
subBlockLeft := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4334 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4335 |
|
16373 | 4336 |
] |
790 | 4337 |
]. |
4338 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4339 |
" |
10205 | 4340 |
kludge to hide breakpoint wrappers in the context list: |
16373 | 4341 |
check if we are in a wrapper methods hidden exit-sequence |
4342 |
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
|
4343 |
" |
10205 | 4344 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4345 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4346 |
ifTrue:[ |
16373 | 4347 |
"/ did not find our steppedContext along the chain; |
4348 |
"/ could be in a wrappedMethods exitBlock ... |
|
4349 |
||
4350 |
leftWrap ifFalse:[ |
|
4351 |
where := here. |
|
4352 |
wrappedMethod := nil. |
|
4353 |
5 timesRepeat:[ |
|
4354 |
where notNil ifTrue:[ |
|
4355 |
where isBlockContext ifFalse:[ |
|
4356 |
method := where method. |
|
4357 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4358 |
where == wrapperContext ifTrue:[ |
|
4359 |
DebuggingDebugger2 == true ifTrue:[ |
|
4360 |
'change stepCon fromWrapped: ' print. |
|
4361 |
steppedContext print. |
|
4362 |
' to: ' print. |
|
4363 |
wrapperContext printCR. |
|
4364 |
]. |
|
4365 |
||
4366 |
inWrap := true. |
|
4367 |
enteredWrap := true. |
|
4368 |
steppedContext := wrapperContext. |
|
4369 |
wrapperContext := nil. |
|
4370 |
] |
|
4371 |
]. |
|
4372 |
]. |
|
4373 |
where := where sender |
|
4374 |
] |
|
4375 |
]. |
|
4376 |
]. |
|
4377 |
enteredWrap ifTrue:[ |
|
4378 |
ignore := true |
|
4379 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4380 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4381 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4382 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4383 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4384 |
subBlockLeft ifTrue:[ |
16373 | 4385 |
"/ special care for stepInterrupt in send, |
4386 |
"/ when created a dummy context (lineNr == 1) |
|
4387 |
||
4388 |
steppedContext lineNumber isNil ifTrue:[ |
|
4389 |
steppedContext selector == here sender selector ifTrue:[ |
|
4390 |
subBlockLeft := false. |
|
4391 |
s := 'Debugger: after step'. |
|
4392 |
steppedContext := here sender. |
|
4393 |
]. |
|
4394 |
]. |
|
4395 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4396 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4397 |
|
57 | 4398 |
inBlock ifTrue:[ |
16376 | 4399 |
DebuggingDebugger2 == true ifTrue:[ 'inBlock' printCR ]. |
16373 | 4400 |
s := 'Debugger: in block'. |
57 | 4401 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4402 |
inBlockBelow ifTrue:[ |
16376 | 4403 |
DebuggingDebugger2 == true ifTrue:[ 'inBlockBelow' printCR ]. |
16373 | 4404 |
ignore := true |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4405 |
]. |
57 | 4406 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4407 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4408 |
where notNil ifTrue:[ |
4409 |
'(' print. steppedContextLineno print. ') ' print. |
|
4410 |
where printCR. |
|
4411 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
4412 |
]. |
57 | 4413 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4414 |
ignore ifFalse:[ |
16373 | 4415 |
(bigStep |
4416 |
and:[steppedContextLineno notNil |
|
4417 |
and:[where notNil |
|
4418 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
4419 |
(here isBlockContext |
|
4420 |
and:[(here methodHome == steppedContext) |
|
4421 |
or:[here home == steppedContext]]) ifTrue:[ |
|
4422 |
DebuggingDebugger2 == true ifTrue:[ |
|
4423 |
'same line but in block' printCR. |
|
4424 |
]. |
|
4425 |
||
4426 |
steppedContext := actualContext := here. |
|
4427 |
steppedContextLineno := here lineNumber. |
|
4428 |
] ifFalse:[ |
|
4429 |
"/ kludge - I only have the info for up to 255 lines |
|
4430 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
4431 |
DebuggingDebugger2 == true ifTrue:[ |
|
4432 |
'same line - ignored' printCR. |
|
4433 |
]. |
|
4434 |
ignore := true |
|
4435 |
]. |
|
4436 |
]. |
|
4437 |
]. |
|
4438 |
||
4439 |
(subBlockLeft not |
|
4440 |
and:[skipLineNr notNil |
|
4441 |
and:[where notNil |
|
4442 |
and:[where lineNumber notNil |
|
4443 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
4444 |
DebuggingDebugger2 == true ifTrue:[ |
|
4445 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
4446 |
]. |
|
4447 |
ignore := true |
|
4448 |
]. |
|
4449 |
||
4450 |
(steppedContextLineno isNil |
|
4451 |
and:[skipLineNr isNil |
|
4452 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
4453 |
DebuggingDebugger2 == true ifTrue:[ |
|
4454 |
'same line2 (after conIRQ) - ignored' printCR. |
|
4455 |
]. |
|
4456 |
ignore := true |
|
4457 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4458 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4459 |
|
57 | 4460 |
ignore ifTrue:[ |
3055 | 4461 |
"/' ' printCR. |
16373 | 4462 |
where := nil. here := nil. |
4463 |
" |
|
4464 |
yes, a context below |
|
4465 |
- continue and schedule another stepInterrupt. |
|
4466 |
Must flush caches since optimized methods not always |
|
4467 |
look for pending interrupts |
|
4468 |
" |
|
4469 |
ObjectMemory flushInlineCaches. |
|
4470 |
StepInterruptPending := 1. |
|
4471 |
InterruptPending := 1. |
|
4472 |
InStepInterrupt := nil. |
|
4473 |
^ self |
|
57 | 4474 |
]. |
4475 |
||
3055 | 4476 |
"/ ' ' printCR. |
57 | 4477 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4478 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 4479 |
|
57 | 4480 |
tracing := false. |
4481 |
bigStep := false. |
|
4482 |
||
0 | 4483 |
"release refs to context" |
4484 |
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
|
4485 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4486 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4487 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4488 |
'==> 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
|
4489 |
]. |
1364 | 4490 |
|
4491 |
initiallyShown := nil. |
|
4492 |
(oneMore == true) ifTrue:[ |
|
16373 | 4493 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
4494 |
initiallyShown := 2 |
|
4495 |
] ifFalse:[ |
|
4496 |
initiallyShown := 1 |
|
4497 |
] |
|
1364 | 4498 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4499 |
con := thisContext sender sender. |
3435 | 4500 |
|
9235 | 4501 |
HaltInterrupt handle:[:ex | |
16373 | 4502 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
4503 |
ex proceed |
|
3435 | 4504 |
] do:[ |
16373 | 4505 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4506 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4507 |
con := nil |
1364 | 4508 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4509 |
"Created: / 14-10-1996 / 12:53:39 / cg" |
16373 | 4510 |
"Modified: / 30-04-2016 / 11:47:01 / cg" |
0 | 4511 |
! ! |
4512 |
||
4867 | 4513 |
!DebugView methodsFor:'menu & button actions'! |
266 | 4514 |
|
5875 | 4515 |
addBrowserBookmark |
4516 |
"add a browser-bookmark for the selected contexts method" |
|
4517 |
||
4518 |
|cls sel| |
|
4519 |
||
4520 |
selectedContext isNil ifTrue:[^ self]. |
|
4521 |
||
4522 |
cls := selectedContext receiver class. |
|
4523 |
sel := selectedContext selector. |
|
4524 |
(cls includesSelector:sel) ifFalse:[ |
|
15413 | 4525 |
sel := nil |
5875 | 4526 |
]. |
4527 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
4528 |
! |
|
4529 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4530 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4531 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4532 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4533 |
"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
|
4534 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4535 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4536 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4537 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4538 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4539 |
"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
|
4540 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4541 |
|
266 | 4542 |
autoUpdateOff |
4543 |
"stop the update process" |
|
4544 |
||
4545 |
updateProcess notNil ifTrue:[ |
|
15413 | 4546 |
monitorToggle lampColor:(Color yellow). |
4547 |
updateProcess terminate. |
|
4548 |
updateProcess := nil |
|
266 | 4549 |
] |
4550 |
! |
|
4551 |
||
4552 |
autoUpdateOn |
|
4553 |
"fork a subprocess which updates the contextList in regular intervals" |
|
4554 |
||
4555 |
updateProcess isNil ifTrue:[ |
|
15413 | 4556 |
updateProcess := |
4557 |
[ |
|
4558 |
[true] whileTrue:[ |
|
4559 |
monitorToggle showLamp ifTrue:[ |
|
4560 |
monitorToggle lampColor:(Color yellow). |
|
4561 |
] ifFalse:[ |
|
4562 |
monitorToggle activeForegroundColor:Color black. |
|
4563 |
]. |
|
4564 |
(Delay forSeconds:0.25) wait. |
|
4565 |
self updateContext. |
|
4566 |
monitorToggle showLamp ifTrue:[ |
|
4567 |
monitorToggle lampColor:(Color red). |
|
4568 |
] ifFalse:[ |
|
4569 |
monitorToggle activeForegroundColor:Color red. |
|
4570 |
]. |
|
4571 |
(Delay forSeconds:0.25) wait. |
|
4572 |
self updateContext. |
|
4573 |
] |
|
4574 |
] forkAt:(Processor activePriority - 1) |
|
266 | 4575 |
] |
4576 |
||
4577 |
! |
|
4578 |
||
13408 | 4579 |
browseBlocksHome |
4580 |
"browse the receiver block's home method (if a value-like send is selected)" |
|
4581 |
||
13414 | 4582 |
|cls sel block mthd| |
13408 | 4583 |
|
4584 |
selectedContext isNil ifTrue:[^ self]. |
|
4585 |
(block := selectedContext receiver) isBlock ifFalse:[ ^ self ]. |
|
4586 |
||
13414 | 4587 |
mthd := block method. |
4588 |
cls := mthd mclass. |
|
4589 |
sel := mthd selector. |
|
4590 |
||
4591 |
(cls notNil and:[(cls includesSelector:sel)]) ifTrue:[ |
|
15835 | 4592 |
cls browserClass openInClass:cls selector:sel. |
4593 |
^ self |
|
13414 | 4594 |
]. |
4595 |
||
4596 |
mthd source notEmptyOrNil ifTrue:[ |
|
15835 | 4597 |
(Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs) |
4598 |
ifTrue:[ |
|
4599 |
SystemBrowser default browseMethods:{ mthd } title:'Unbound Method' sort:false |
|
4600 |
"/ TextView openWith:mthd source title:'Unbound Method''s Source'. |
|
4601 |
]. |
|
4602 |
^ self |
|
13414 | 4603 |
]. |
4604 |
cls notNil ifTrue:[ |
|
15835 | 4605 |
(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) |
4606 |
ifTrue:[ |
|
4607 |
cls browserClass openInClass:cls selector:nil. |
|
4608 |
]. |
|
4609 |
^ self |
|
13414 | 4610 |
]. |
4611 |
Dialog information:'Block''s home method is (no longer) present in any class.'. |
|
13408 | 4612 |
! |
4613 |
||
3269 | 4614 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4615 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4616 |
|
4617 |
|cls sel| |
|
4618 |
||
4619 |
selectedContext isNil ifTrue:[^ self]. |
|
4620 |
||
4621 |
cls := selectedContext receiver class. |
|
4622 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4623 |
(cls includesSelector:sel) ifFalse:[ |
15413 | 4624 |
sel := nil |
3269 | 4625 |
]. |
4626 |
cls browserClass openInClass:cls selector:sel. |
|
4627 |
||
4628 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
4629 |
! |
|
4630 |
||
4631 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4632 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 4633 |
|
4634 |
|cls mthd| |
|
4635 |
||
4636 |
selectedContext isNil ifTrue:[^ self]. |
|
4637 |
||
4638 |
mthd := selectedContext method. |
|
3447 | 4639 |
mthd notNil ifTrue:[ |
16373 | 4640 |
cls := mthd containingClass. |
4641 |
"/ still nil if unbound - then use receiver's class |
|
3447 | 4642 |
]. |
4643 |
cls isNil ifTrue:[ |
|
16373 | 4644 |
cls := selectedContext receiver class |
3269 | 4645 |
]. |
4646 |
cls browserClass browseClassHierarchy:cls. |
|
4647 |
||
16373 | 4648 |
"Modified: / 17-11-2001 / 19:43:06 / cg" |
4649 |
"Modified (comment): / 30-04-2016 / 15:51:28 / cg" |
|
3269 | 4650 |
! |
4651 |
||
4652 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4653 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 4654 |
|
4655 |
|cls mthd| |
|
4656 |
||
4657 |
selectedContext isNil ifTrue:[^ self]. |
|
4658 |
||
4659 |
mthd := selectedContext method. |
|
3447 | 4660 |
mthd notNil ifTrue:[ |
16373 | 4661 |
cls := mthd containingClass. |
4662 |
"/ still nil if unbound - then use receiver's class |
|
3447 | 4663 |
]. |
4664 |
cls isNil ifTrue:[ |
|
16373 | 4665 |
cls := selectedContext receiver class |
3269 | 4666 |
]. |
4667 |
cls browserClass browseFullClassProtocol:cls. |
|
4668 |
||
16373 | 4669 |
"Modified: / 17-11-2001 / 19:43:43 / cg" |
4670 |
"Modified (comment): / 30-04-2016 / 15:51:32 / cg" |
|
3269 | 4671 |
! |
4672 |
||
4673 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4674 |
"browse the implementing class (of the selected context's message)" |
3269 | 4675 |
|
11610 | 4676 |
|con mthd who sel cls home| |
4677 |
||
4678 |
con := selectedContext ? actualContext. |
|
4679 |
con isNil ifTrue:[^ self]. |
|
4680 |
||
4681 |
mthd := con method. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4682 |
mthd notNil ifTrue:[ |
15413 | 4683 |
who := mthd who. |
4684 |
who notNil ifTrue:[ |
|
4685 |
cls := who methodClass. |
|
4686 |
sel := who methodSelector. |
|
4687 |
] ifFalse:[ |
|
4688 |
"might have been re-accepted" |
|
4689 |
(home := con methodHome) notNil ifTrue:[ |
|
4690 |
(sel := home selector) notNil ifTrue:[ |
|
4691 |
cls := home receiver class |
|
4692 |
whichClassImplements:selectedContext selector. |
|
4693 |
cls notNil ifTrue:[ |
|
4694 |
Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
|
4695 |
]. |
|
4696 |
] |
|
4697 |
]. |
|
4698 |
]. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4699 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4700 |
cls isNil ifTrue:[ |
15413 | 4701 |
"/ class not found - try receiver |
4702 |
cls := con receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4703 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4704 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4705 |
cls browserClass openInClass:cls selector:sel. |
266 | 4706 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
4707 |
"Created: / 22-11-1995 / 21:27:01 / cg" |
11610 | 4708 |
"Modified: / 19-07-2012 / 11:27:32 / cg" |
266 | 4709 |
! |
4710 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4711 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4712 |
"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
|
4713 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4714 |
selectedContext isNil ifTrue:[ |
15413 | 4715 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4716 |
]. |
4153 | 4717 |
"/ selectedContext receiver class browserClass |
11610 | 4718 |
self withWaitCursorDo:[ |
15413 | 4719 |
UserPreferences systemBrowserClass |
4720 |
browseImplementorsOf:selectedContext selector. |
|
11610 | 4721 |
] |
4722 |
||
4723 |
"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
|
4724 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4725 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4726 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4727 |
"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
|
4728 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4729 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4730 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4731 |
(sel := codeView selection) notNil ifTrue:[ |
15413 | 4732 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4733 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4734 |
initial isNil ifTrue:[ |
15413 | 4735 |
initial := selectedContext isNil |
4736 |
ifTrue:[nil] |
|
4737 |
ifFalse:[selectedContext selector]. |
|
10205 | 4738 |
]. |
4739 |
selector := Dialog |
|
15413 | 4740 |
requestSelector:'Selector to browse implementors of:' |
4741 |
initialAnswer:initial. |
|
11610 | 4742 |
|
4743 |
selector notEmptyOrNil ifTrue:[ |
|
15413 | 4744 |
self withWaitCursorDo:[ |
4745 |
UserPreferences systemBrowserClass |
|
4746 |
browseImplementorsMatching:selector. |
|
4747 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4748 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4749 |
|
11610 | 4750 |
"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
|
4751 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4752 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4753 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4754 |
"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
|
4755 |
|
13488 | 4756 |
|app appClass| |
4757 |
||
4758 |
(app := self processesApplication) notNil ifTrue:[ |
|
15413 | 4759 |
appClass := app class. |
4760 |
appClass browserClass openInClass:appClass selector:nil. |
|
4761 |
^ self |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4762 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4763 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4764 |
|
3269 | 4765 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4766 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4767 |
|
4768 |
|cls sel| |
|
4769 |
||
4770 |
selectedContext isNil ifTrue:[^ self]. |
|
4771 |
||
11610 | 4772 |
selectedContext isCheapBlockContext ifTrue:[ |
15413 | 4773 |
cls := selectedContext method mclass. |
4774 |
sel := selectedContext method selector. |
|
11610 | 4775 |
] ifFalse:[ |
15413 | 4776 |
cls := selectedContext receiver class. |
4777 |
sel := selectedContext selector. |
|
11610 | 4778 |
]. |
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4779 |
(cls includesSelector:sel) ifFalse:[ |
15413 | 4780 |
sel := nil |
3269 | 4781 |
]. |
4782 |
cls browserClass openInClass:cls selector:sel. |
|
4783 |
||
11610 | 4784 |
"Modified: / 19-07-2012 / 11:29:48 / cg" |
3269 | 4785 |
! |
4786 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4787 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4788 |
"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
|
4789 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4790 |
selectedContext isNil ifTrue:[ |
15413 | 4791 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4792 |
]. |
11610 | 4793 |
self withWaitCursorDo:[ |
15413 | 4794 |
UserPreferences systemBrowserClass |
4795 |
browseAllCallsOn:selectedContext selector. |
|
11610 | 4796 |
] |
4797 |
||
4798 |
"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
|
4799 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4800 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4801 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4802 |
"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
|
4803 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4804 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4805 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4806 |
(sel := codeView selection) notNil ifTrue:[ |
15413 | 4807 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4808 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4809 |
initial isNil ifTrue:[ |
15413 | 4810 |
initial := selectedContext isNil |
4811 |
ifTrue:[nil] |
|
4812 |
ifFalse:[selectedContext selector]. |
|
10205 | 4813 |
]. |
4814 |
selector := Dialog |
|
15413 | 4815 |
requestSelector:'Selector to browse senders of:' |
4816 |
initialAnswer:initial. |
|
11610 | 4817 |
|
4818 |
selector notEmptyOrNil ifTrue:[ |
|
15413 | 4819 |
self withWaitCursorDo:[ |
4820 |
UserPreferences systemBrowserClass |
|
4821 |
browseAllCallsOn:selector asSymbol. |
|
4822 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4823 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4824 |
|
11610 | 4825 |
"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
|
4826 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4827 |
|
11391 | 4828 |
clearRememberedCallchain |
4829 |
"clear the remembered callchain." |
|
4830 |
||
4831 |
RememberedCallChain := nil |
|
4832 |
||
4833 |
"Created: / 08-03-2012 / 01:29:46 / cg" |
|
4834 |
! |
|
4835 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4836 |
closeAllDebuggers |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4837 |
(Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4838 |
ifFalse:[ |
15413 | 4839 |
^ self |
4840 |
]. |
|
4841 |
||
4842 |
self class allInstancesDo:[:debugger | |
|
4843 |
debugger ~~ self ifTrue:[ |
|
4844 |
debugger busy ifTrue:[ |
|
4845 |
debugger destroyWithConfirmation:true. |
|
4846 |
]. |
|
4847 |
]. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4848 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4849 |
self closeRequest. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4850 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4851 |
"Created: / 23-03-2012 / 12:40:22 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4852 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4853 |
|
9626 | 4854 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 4855 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 4856 |
LastExtent := self extent. |
4857 |
LastOrigin := self origin. |
|
4858 |
||
4859 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
4860 |
! |
|
4861 |
||
266 | 4862 |
copyWalkbackText |
4863 |
"place the contents of the walkback view into the copy-paste buffer. |
|
12884 | 4864 |
This allows pasting it into some other view for printing. |
4865 |
||
4866 |
Show the full verbose context without filtering." |
|
266 | 4867 |
|
10760 | 4868 |
|infoText| |
4869 |
||
12884 | 4870 |
firstContext isNil ifTrue:[ |
15413 | 4871 |
infoText := 'No context, no walkback'. |
10760 | 4872 |
] ifFalse:[ |
15413 | 4873 |
exceptionInfoLabel notNil ifTrue:[ |
4874 |
infoText := exceptionInfoLabel label , '\\' withCRs. |
|
4875 |
] ifFalse:[ |
|
4876 |
infoText := '' |
|
4877 |
]. |
|
4878 |
infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection. |
|
10760 | 4879 |
]. |
4880 |
||
4881 |
self setClipboardText:infoText |
|
266 | 4882 |
|
4883 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
4884 |
! |
|
4885 |
||
4886 |
doAbort |
|
1187 | 4887 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 4888 |
at save places (for example: in the event loop) and returns back |
4889 |
from whatever the process is doing, but does not terminate it." |
|
4890 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4891 |
self checkIfCodeIsReallyModified ifTrue:[ |
16960 | 4892 |
(self confirm:('Code was modified.\\Abort anyway ?')) |
4893 |
ifFalse:[ |
|
4894 |
^ self |
|
4895 |
] |
|
4896 |
]. |
|
4897 |
^ self doAbortWithoutConfirmation |
|
266 | 4898 |
! |
4899 |
||
6487 | 4900 |
doAbortAll |
4901 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
4902 |
at save places (for example: in the event loop) and returns back |
|
4903 |
from whatever the process is doing, but does not terminate it." |
|
4904 |
||
4905 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
15413 | 4906 |
(self confirm:('Code modified - abort anyway ?')) |
4907 |
ifFalse:[ |
|
4908 |
^ self |
|
4909 |
] |
|
6487 | 4910 |
]. |
4911 |
||
4912 |
inspecting ifTrue:[ |
|
15413 | 4913 |
inspectedProcess isDead ifTrue:[ |
4914 |
self showTerminated. |
|
4915 |
^ self |
|
4916 |
]. |
|
4917 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4918 |
self showError:'** the process does not handle the abort signal **' |
|
4919 |
] ifTrue:[ |
|
4920 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
4921 |
]. |
|
4922 |
^ self |
|
6487 | 4923 |
]. |
4924 |
||
4925 |
steppedContext := wrapperContext := nil. |
|
4926 |
haveControl := false. |
|
4927 |
exitAction := #abortAll. |
|
4928 |
||
4929 |
"exit private event-loop" |
|
4930 |
catchBlock notNil ifTrue:[ |
|
15413 | 4931 |
abortButton turnOff. |
4932 |
catchBlock value. |
|
4933 |
||
4934 |
"/ not reached |
|
4935 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 4936 |
]. |
4937 |
||
4938 |
^ self. |
|
4939 |
||
4940 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
4941 |
! |
|
4942 |
||
16960 | 4943 |
doAbortWithoutConfirmation |
4944 |
"abort - send Object>>abortSignal, which is usually caught |
|
4945 |
at save places (for example: in the event loop) and returns back |
|
4946 |
from whatever the process is doing, but does not terminate it." |
|
4947 |
||
4948 |
inspecting ifTrue:[ |
|
4949 |
inspectedProcess isDead ifTrue:[ |
|
4950 |
self showTerminated. |
|
4951 |
^ self |
|
4952 |
]. |
|
4953 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4954 |
self showError:'** the process does not handle the abort signal **' |
|
4955 |
] ifTrue:[ |
|
4956 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
4957 |
]. |
|
4958 |
^ self |
|
4959 |
]. |
|
4960 |
||
4961 |
steppedContext := wrapperContext := nil. |
|
4962 |
haveControl := false. |
|
4963 |
exitAction := #abort. |
|
4964 |
||
4965 |
"exit private event-loop" |
|
4966 |
catchBlock notNil ifTrue:[ |
|
4967 |
abortButton turnOff. |
|
4968 |
catchBlock value. |
|
4969 |
||
4970 |
"/ not reached |
|
4971 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
4972 |
]. |
|
4973 |
||
4974 |
^ self. |
|
4975 |
||
4976 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
4977 |
! |
|
4978 |
||
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4979 |
doChangeProcessPriority |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4980 |
"ask for and change the process's priority" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4981 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4982 |
|oldPrio newPrio s| |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4983 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4984 |
oldPrio := (inspectedProcess ? Processor activeProcess) priority. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4985 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4986 |
[ |
15413 | 4987 |
s := Dialog |
4988 |
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)\') |
|
4989 |
initialAnswer:oldPrio printString. |
|
4990 |
s isEmptyOrNil ifTrue:[^ self]. |
|
4991 |
newPrio := Integer readFrom:s onError:nil. |
|
4992 |
newPrio isNil |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4993 |
] whileTrue. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4994 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4995 |
newPrio := newPrio max:(Processor lowestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4996 |
newPrio := newPrio min:(Processor highestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4997 |
newPrio >= Processor highIOPriority ifTrue:[ |
15413 | 4998 |
(Dialog |
4999 |
confirm:(resources |
|
5000 |
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?')) |
|
5001 |
ifFalse:[^ self]. |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5002 |
]. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5003 |
(inspectedProcess ? Processor activeProcess) priority:newPrio. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5004 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5005 |
"Created: / 07-03-2012 / 14:15:09 / cg" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5006 |
! |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5007 |
|
266 | 5008 |
doContinue |
5009 |
"continue from menu" |
|
5010 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
5011 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
5012 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5013 |
self checkIfCodeIsReallyModified ifTrue:[ |
16253 | 5014 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
5015 |
^ self |
|
5016 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5017 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5018 |
|
266 | 5019 |
inspecting ifTrue:[ |
16253 | 5020 |
device hasColors ifTrue:[ |
5021 |
continueButton foregroundColor:Color red darkened. |
|
5022 |
]. |
|
5023 |
continueButton label:(resources string:'Stop'). |
|
5024 |
continueButton action:[self doStop]. |
|
5025 |
||
5026 |
self processPerform:#resume. |
|
5027 |
||
5028 |
^ self |
|
266 | 5029 |
]. |
5030 |
canContinue ifTrue:[ |
|
16253 | 5031 |
exContext := thisContext findSpecialHandle:false raise:true. |
5032 |
||
5033 |
(exContext notNil |
|
5034 |
and:[ (ex := exContext receiver) isLazyValue not |
|
5035 |
and:[ ex isException |
|
5036 |
and:[ ex creator == NoHandlerError |
|
5037 |
and:[ ex exception creator == RecursionError]]]]) |
|
5038 |
ifTrue:[ |
|
5039 |
"/ debug due to unhandled recursionInterrupt. |
|
5040 |
"/ ask if we should proceed with more stack. |
|
5041 |
||
5042 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
5043 |
answer == true ifTrue:[ |
|
5044 |
proc := Processor activeProcess. |
|
5045 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
5046 |
]. |
|
5047 |
]. |
|
5048 |
||
5049 |
steppedContext := wrapperContext := nil. |
|
5050 |
tracing := false. |
|
5051 |
haveControl := false. |
|
5052 |
exitAction := #continue. |
|
5053 |
||
5054 |
"exit private event-loop" |
|
5055 |
catchBlock value. |
|
5056 |
||
5057 |
"/ not reached. |
|
5058 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
5059 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5060 |
|
266 | 5061 |
] ifFalse:[ |
16253 | 5062 |
inspecting ifFalse:[ |
5063 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
5064 |
self showSelection:1. |
|
5065 |
self doReturn |
|
5066 |
] |
|
266 | 5067 |
] |
477 | 5068 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
5069 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 5070 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 5071 |
! |
5072 |
||
13351 | 5073 |
doContinueAfterDelay |
5074 |
Delay waitForSeconds:5. |
|
5075 |
self doContinue. |
|
5076 |
! |
|
5077 |
||
3187 | 5078 |
doDefine |
5955 | 5079 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5080 |
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
|
5081 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5082 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5083 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5084 |
|
13488 | 5085 |
selectorToDefine notNil ifTrue:[ |
15413 | 5086 |
selector := selectorToDefine. |
5087 |
receiversClass := classToDefineIn. |
|
13488 | 5088 |
] ifFalse:[ |
15413 | 5089 |
selector := actualContext selector. |
5090 |
receiversClass := actualContext receiver class. |
|
13538 | 5091 |
]. |
5092 |
||
5093 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
|
5094 |
implClass notNil ifTrue:[ |
|
15413 | 5095 |
"/ must be a subclassResponsibility |
5096 |
||
5097 |
idx := contextArray identityIndexOf:actualContext. |
|
5098 |
idx > 1 ifTrue:[ |
|
5099 |
callee := contextArray at:idx-1. |
|
5100 |
||
5101 |
callee selector == #subclassResponsibility ifTrue:[ |
|
5102 |
restart := false. |
|
5103 |
] |
|
5104 |
]. |
|
13538 | 5105 |
]. |
5106 |
||
5107 |
"generate nice argument names" |
|
5108 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
5109 |
bagOfUsedClassNames := Bag new. |
|
5110 |
argNames := actualContext args |
|
15413 | 5111 |
collect: |
5112 |
[:eachArg | |
|
5113 |
|nm| |
|
5114 |
||
5115 |
nm := eachArg class nameWithoutPrefix. |
|
5116 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
5117 |
nm article , nm |
|
5118 |
] ifFalse:[ |
|
5119 |
bagOfUsedClassNames add:nm. |
|
5120 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
5121 |
]. |
|
5122 |
]. |
|
5955 | 5123 |
|
5124 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 5125 |
|
3447 | 5126 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
5127 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
5128 |
||
13488 | 5129 |
|
5130 |
( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[ |
|
15413 | 5131 |
(self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?') |
5132 |
ifFalse:[ |
|
5133 |
^ self |
|
5134 |
] |
|
3447 | 5135 |
]. |
5136 |
||
5137 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5138 |
"/ code for a getter |
3447 | 5139 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
15413 | 5140 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
5141 |
cat := 'accessing'. |
|
3447 | 5142 |
]. |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5143 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5144 |
"/ code for a setter |
3447 | 5145 |
(selector numArgs == 1 |
5146 |
and:[(selector endsWith:':') |
|
12716
062e27d32904
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12687
diff
changeset
|
5147 |
and:[receiversClass instVarNames includes:(selector copyButLast:1)]]) |
3447 | 5148 |
ifTrue:[ |
15413 | 5149 |
varName := selector copyButLast:1. |
5150 |
argName := argNames first. |
|
5151 |
code := '%1\' , haltStmtFix , '\ %3 := %4.'. |
|
5152 |
cat := 'accessing'. |
|
3447 | 5153 |
]. |
5154 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5155 |
"/ code for a tester |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5156 |
(selector numArgs == 0 |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5157 |
and:[(selector startsWith:'is') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5158 |
and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]]) |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5159 |
ifTrue:[ |
15413 | 5160 |
(receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[ |
5161 |
code := '%1\' , haltStmtFix , '\ ^ true.'. |
|
5162 |
] ifFalse:[ |
|
5163 |
code := '%1\' , haltStmtFix , '\ ^ false.'. |
|
5164 |
]. |
|
5165 |
cat := 'testing'. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5166 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5167 |
|
3447 | 5168 |
"/ actualContext receiver isClass ifTrue:[ |
5169 |
"/ selector == #new ifTrue:[ |
|
5170 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
5171 |
"/ ]. |
|
5172 |
"/ selector == #'new:' ifTrue:[ |
|
5173 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
5174 |
"/ ]. |
|
5175 |
"/ ]. |
|
5176 |
code isNil ifTrue:[ |
|
15413 | 5177 |
code := '%1\' , haltStmtDef |
10205 | 5178 |
]. |
5179 |
||
5180 |
self |
|
15413 | 5181 |
codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs |
5182 |
inClass:receiversClass |
|
5183 |
unwind:false |
|
5184 |
category:cat |
|
5185 |
onCancel:[^ self]. |
|
3269 | 5186 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5187 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5188 |
restart ifTrue:[ |
15413 | 5189 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5190 |
] |
3427 | 5191 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5192 |
"Modified: / 23-03-2012 / 09:49:31 / cg" |
3187 | 5193 |
! |
5194 |
||
14523 | 5195 |
doGotoApplicationActionMethod |
5196 |
"select the first application-model context. |
|
5197 |
This is another great helper, when you hit an exception, |
|
5198 |
to quickly navigate to the responsible code of you application" |
|
5199 |
||
5200 |
contextArray keysAndValuesDo:[:i :c | |
|
15413 | 5201 |
|nextCon nextRcvr dialog| |
5202 |
||
5203 |
"/ find the first appModel context |
|
5204 |
nextCon := contextArray at:i+1. |
|
5205 |
"/ |
|
5206 |
"/ while not in the appModel |
|
5207 |
"/ |
|
5208 |
[ |
|
5209 |
nextRcvr := nextCon receiver. |
|
5210 |
(nextRcvr isKindOf:ApplicationModel) |
|
5211 |
] whileFalse:[ |
|
5212 |
nextCon := nextCon sender |
|
5213 |
]. |
|
5214 |
self selectContext:nextCon. |
|
5215 |
^ self. |
|
14523 | 5216 |
]. |
5217 |
"/ not found |
|
5218 |
gotoApplicationActionMethodButton disable. |
|
5219 |
! |
|
5220 |
||
13362 | 5221 |
doGotoDialogOpener |
14523 | 5222 |
"select the context where the dialog was opened. |
5223 |
This is a great helper, when you press interrupt while a modal dialog |
|
5224 |
is open, to quickly navigate to the corresponding opening code of you application" |
|
13362 | 5225 |
|
5226 |
contextArray keysAndValuesDo:[:i :c | |
|
15413 | 5227 |
|nextCon nextRcvr dialog| |
5228 |
||
5229 |
"/ find the openModal, then walk upward |
|
5230 |
((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[ |
|
5231 |
dialog := c receiver. |
|
5232 |
nextCon := contextArray at:i+1. |
|
5233 |
"/ |
|
5234 |
"/ while still in dialog code |
|
5235 |
"/ |
|
5236 |
[ |
|
5237 |
nextRcvr := nextCon receiver. |
|
5238 |
(nextRcvr == dialog) |
|
5239 |
or:[ nextRcvr == dialog class |
|
5240 |
or:[ nextRcvr == DialogBox ]] |
|
5241 |
] whileTrue:[ |
|
5242 |
(nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ |
|
5243 |
nextCon := nextCon methodHome |
|
5244 |
]. |
|
5245 |
nextCon := nextCon sender. |
|
5246 |
]. |
|
5247 |
"/ |
|
5248 |
"/ while still in a Notification |
|
5249 |
"/ |
|
5250 |
[ |
|
5251 |
nextRcvr := nextCon receiver. |
|
5252 |
(nextRcvr isKindOf:UserInformation) |
|
5253 |
or:[ nextRcvr isBehavior |
|
5254 |
and:[nextRcvr includesBehavior:UserInformation]] |
|
5255 |
] whileTrue:[ |
|
5256 |
nextCon := nextCon sender |
|
5257 |
]. |
|
5258 |
"/ |
|
5259 |
"/ while still in UIBuilder |
|
5260 |
"/ |
|
5261 |
[ |
|
5262 |
nextRcvr := nextCon receiver. |
|
5263 |
(nextRcvr isKindOf:WindowBuilder) |
|
5264 |
] whileTrue:[ |
|
5265 |
nextCon := nextCon sender |
|
5266 |
]. |
|
5267 |
"/ |
|
5268 |
"/ while still in SimpleDialog |
|
5269 |
"/ |
|
5270 |
[ |
|
5271 |
nextRcvr := nextCon receiver. |
|
5272 |
(nextRcvr class == SimpleDialog) |
|
5273 |
] whileTrue:[ |
|
5274 |
nextCon := nextCon sender |
|
5275 |
]. |
|
5276 |
"/ |
|
5277 |
"/ while still in applicationModel support code |
|
5278 |
"/ |
|
5279 |
[ |
|
5280 |
(nextCon selector startsWith:'openDialogSpec'). |
|
5281 |
] whileTrue:[ |
|
5282 |
nextCon := nextCon sender |
|
5283 |
]. |
|
5284 |
self selectContext:nextCon. |
|
5285 |
^ self. |
|
5286 |
] |
|
13362 | 5287 |
]. |
13388 | 5288 |
"/ not found |
13362 | 5289 |
gotoDialogOpenerButton disable. |
5290 |
! |
|
5291 |
||
12671 | 5292 |
doInspectProcess |
5293 |
(inspectedProcess ? Processor activeProcess) inspect. |
|
5294 |
! |
|
5295 |
||
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5296 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5297 |
"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
|
5298 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5299 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5300 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5301 |
self checkIfCodeIsReallyModified ifTrue:[ |
16961 | 5302 |
(self confirm:('Code was modified.\\Step anyway ?')) |
5303 |
ifFalse:[ |
|
5304 |
^ self |
|
5305 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5306 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5307 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5308 |
canContinue ifTrue:[ |
16961 | 5309 |
steppedContext := wrapperContext := nil. |
5310 |
haveControl := false. |
|
5311 |
exitAction := #step. |
|
5312 |
||
5313 |
"exit private event-loop" |
|
5314 |
catchBlock value. |
|
5315 |
||
5316 |
"/ not reached |
|
5317 |
'DebugView [warning]: send failed' errorPrintCR. |
|
5318 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5319 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5320 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5321 |
"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
|
5322 |
"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
|
5323 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5324 |
|
266 | 5325 |
doNext |
1072 | 5326 |
"skip for next source-code line; entering blocks" |
266 | 5327 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5328 |
stepHow := #nextIn. |
266 | 5329 |
self doStep:nil |
790 | 5330 |
|
1072 | 5331 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5332 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5333 |
|
13351 | 5334 |
doNextAfterDelay |
5335 |
Delay waitForSeconds:5. |
|
5336 |
self doNext. |
|
5337 |
! |
|
5338 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5339 |
doNextOut |
1072 | 5340 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5341 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5342 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5343 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5344 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5345 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 5346 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5347 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5348 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5349 |
doNextOver |
1072 | 5350 |
"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
|
5351 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5352 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5353 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5354 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5355 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 5356 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 5357 |
! |
5358 |
||
5359 |
doNoTrace |
|
5360 |
traceView notNil ifTrue:[ |
|
15413 | 5361 |
traceView topView destroy. |
5362 |
traceView := nil. |
|
266 | 5363 |
]. |
5364 |
tracing := false |
|
5365 |
! |
|
5366 |
||
4356 | 5367 |
doOpenReportMailApp |
5368 |
"open a mail report tool" |
|
5369 |
||
5370 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5371 |
|
4356 | 5372 |
str := '' writeStream. |
5373 |
||
5374 |
str nextPutLine:('Error notification from ' |
|
15413 | 5375 |
, OperatingSystem getLoginName |
5376 |
, '@' |
|
5377 |
, OperatingSystem getHostName). |
|
4356 | 5378 |
str cr. |
5379 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
5380 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 5381 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
5382 |
str nextPutLine:('Description: ' , self label). |
|
5383 |
"/ str nextPutLine:('Error: ', printedException description). |
|
5384 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
5385 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
5386 |
str nextPutLine:'Backtrace:'. |
|
5387 |
str cr. |
|
5388 |
||
5389 |
firstContext notNil ifTrue:[ |
|
15413 | 5390 |
firstContext fullPrintAllOn:str. |
4356 | 5391 |
]. |
5392 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5393 |
|
10205 | 5394 |
SendMailTool |
15413 | 5395 |
openForMessage:(str contents) |
5396 |
withSubject:('STX Error:[', self label, ']') |
|
5397 |
preOpenBlock:[:inst| |
|
5398 |
inst recipientEntryField value:'error@exept.de' |
|
5399 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5400 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5401 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 5402 |
! |
5403 |
||
13360 | 5404 |
doResend |
5405 |
"resend - the selected context is unwound and its message resent. |
|
5406 |
To be done after a cde change, to get nto the new method" |
|
5407 |
||
5408 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
15413 | 5409 |
(self confirm:('Code modified - resend anyway ?')) ifFalse:[ |
5410 |
^ self |
|
5411 |
] |
|
13360 | 5412 |
]. |
5413 |
inspecting ifTrue:[ |
|
15413 | 5414 |
^ self showError:'** not avail in inspecting debugger **' |
13360 | 5415 |
]. |
5416 |
steppedContext := wrapperContext := nil. |
|
5417 |
haveControl := false. |
|
5418 |
exitAction := #resend. "exit private event-loop" |
|
5419 |
||
5420 |
catchBlock value. |
|
5421 |
||
5422 |
"/ normally not reached |
|
5423 |
||
5424 |
'DebugView [warning]: resend failed' errorPrintCR. |
|
5425 |
resendButton turnOff. |
|
5426 |
! |
|
5427 |
||
266 | 5428 |
doRestart |
5429 |
"restart - the selected context will be restarted" |
|
10205 | 5430 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5431 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5432 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
5433 |
^ self |
|
5434 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5435 |
]. |
266 | 5436 |
inspecting ifTrue:[ |
15413 | 5437 |
selectedContext isNil ifTrue:[ |
5438 |
^ self showError:'** select a context first **' |
|
5439 |
]. |
|
5440 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
5441 |
^ self |
|
266 | 5442 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5443 |
steppedContext := wrapperContext := nil. |
266 | 5444 |
haveControl := false. |
6365 | 5445 |
exitAction := #restart. "exit private event-loop" |
5446 |
||
5447 |
catchBlock value. |
|
5448 |
||
5449 |
"/ normally not reached |
|
10205 | 5450 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5451 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5452 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5453 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5454 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 5455 |
! |
5456 |
||
5457 |
doReturn |
|
5458 |
"return - the selected context will do a ^nil" |
|
5459 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5460 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5461 |
(self confirm:('Code modified - return anyway ?')) |
5462 |
ifFalse:[ |
|
5463 |
^ self |
|
5464 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5465 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5466 |
|
266 | 5467 |
inspecting ifTrue:[ |
15413 | 5468 |
selectedContext isNil ifTrue:[ |
5469 |
^ self showError:'** select a context first **' |
|
5470 |
]. |
|
5471 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
5472 |
^ self |
|
266 | 5473 |
]. |
5474 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5475 |
steppedContext := wrapperContext := nil. |
266 | 5476 |
haveControl := false. |
5477 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5478 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5479 |
"exit private event-loop" |
6365 | 5480 |
catchBlock value. |
477 | 5481 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5482 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5483 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5484 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5485 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5486 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 5487 |
! |
5488 |
||
5489 |
doSend |
|
5490 |
"single send; reenter with next message send" |
|
5491 |
||
1072 | 5492 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5493 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5494 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5495 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5496 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5497 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5498 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5499 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5500 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5501 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5502 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5503 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5504 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5505 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5506 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5507 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5508 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5509 |
|
1072 | 5510 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 5511 |
! |
5512 |
||
5513 |
doStep |
|
5514 |
"skip for next send in selected method" |
|
5515 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5516 |
stepHow := #step. |
790 | 5517 |
self doStep:-1 |
5518 |
||
1072 | 5519 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 5520 |
! |
5521 |
||
13197 | 5522 |
doStep:lineNrOrNilOrMinus1 |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5523 |
"common helper for step, skip & next. |
10205 | 5524 |
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
|
5525 |
or to next line (if nil) or to next send (if -1)" |
266 | 5526 |
|
5527 |
|con method| |
|
5528 |
||
5529 |
inspecting ifTrue:[^ self]. |
|
5530 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5531 |
self checkIfCodeIsReallyModified ifTrue:[ |
16961 | 5532 |
(self confirm:('Code was modified\\Step anyway ?')) |
5533 |
ifFalse:[ |
|
5534 |
^ self |
|
5535 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5536 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5537 |
|
266 | 5538 |
canContinue ifTrue:[ |
16961 | 5539 |
selectedContext notNil ifTrue:[ |
5540 |
con := actualContext. "/ selectedContext. |
|
5541 |
steppedContextLineno := actualContext lineNumber. |
|
5542 |
] ifFalse:[ |
|
5543 |
con := contextArray at:2. |
|
5544 |
steppedContextLineno := con lineNumber. |
|
5545 |
]. |
|
5546 |
||
5547 |
skipLineNr := lineNrOrNilOrMinus1. |
|
5548 |
||
5549 |
lineNrOrNilOrMinus1 == -1 ifTrue:[ |
|
5550 |
steppedContextLineno := skipLineNr := nil. |
|
5551 |
]. |
|
5552 |
||
5553 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
5554 |
steppedContext := contextArray at:1. |
|
5555 |
stepHow := #nextIn. |
|
5556 |
] ifFalse:[ |
|
5557 |
stepHow == #nextOut ifTrue:[ |
|
5558 |
steppedContext := con home. |
|
5559 |
] ifFalse:[ |
|
5560 |
steppedContext := con. |
|
5561 |
]. |
|
5562 |
]. |
|
5563 |
||
5564 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5565 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
5566 |
"/ ' 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
|
5567 |
|
16961 | 5568 |
" |
5569 |
if we step in a wrapped method, |
|
5570 |
prepare to skip the prolog ... |
|
5571 |
" |
|
5572 |
||
5573 |
inWrap := false. |
|
5574 |
method := con method. |
|
5575 |
(method notNil |
|
5576 |
and:[method isWrapped |
|
5577 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
5578 |
inWrap := true |
|
5579 |
]. |
|
5580 |
||
5581 |
lineNrOrNilOrMinus1 == #return ifTrue:[ |
|
5582 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
5583 |
]. |
|
5584 |
||
5585 |
con := nil. |
|
5586 |
bigStep := true. |
|
5587 |
haveControl := false. |
|
5588 |
exitAction := #step. |
|
5589 |
||
5590 |
"exit private event-loop" |
|
5591 |
catchBlock value. |
|
5592 |
||
5593 |
"/ not reached |
|
5594 |
'DebugView [warning]: step failed' errorPrintCR. |
|
5595 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 5596 |
] |
477 | 5597 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5598 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 5599 |
! |
5600 |
||
13351 | 5601 |
doStepAfterDelay |
5602 |
Delay waitForSeconds:5. |
|
5603 |
self doStep. |
|
5604 |
! |
|
5605 |
||
266 | 5606 |
doStop |
5607 |
"stop the process (if its running, otherwise this is a no-op)" |
|
5608 |
||
5609 |
inspecting ifTrue:[ |
|
16253 | 5610 |
device hasColors ifTrue:[ |
5611 |
continueButton foregroundColor:Color green darkened darkened. |
|
5612 |
]. |
|
5613 |
continueButton label:(resources string:'Continue'). |
|
5614 |
continueButton action:[self doContinue]. |
|
5615 |
||
5616 |
self processPerform:#stop. |
|
5617 |
||
5618 |
^ self |
|
266 | 5619 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5620 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5621 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 5622 |
! |
5623 |
||
5624 |
doTerminate |
|
5625 |
"terminate - the process has a chance for cleanup" |
|
5626 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5627 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5628 |
(self confirm:('Code modified - terminate anyway ?')) |
5629 |
ifFalse:[ |
|
5630 |
^ self |
|
5631 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5632 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5633 |
|
266 | 5634 |
inspecting ifTrue:[ |
15413 | 5635 |
self processPerform:#terminate. |
5636 |
^ self |
|
266 | 5637 |
]. |
5638 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5639 |
steppedContext := wrapperContext := nil. |
266 | 5640 |
haveControl := false. |
10205 | 5641 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5642 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5643 |
"exit private event-loop" |
6365 | 5644 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5645 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5646 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5647 |
inspecting ifFalse:[ |
15413 | 5648 |
'DebugView [warning]: terminate failed' errorPrintCR. |
5649 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
5650 |
Debugger newDebugger. |
|
5651 |
Processor activeProcess terminate. |
|
5652 |
] |
|
266 | 5653 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5654 |
terminateButton turnOff. |
477 | 5655 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5656 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 5657 |
! |
5658 |
||
5659 |
doTrace |
|
5660 |
"tracing - not really implemented ..." |
|
5661 |
||
5662 |
self warn:'this function is not yet implemented'. |
|
5663 |
||
5664 |
"/ |v b| |
|
5665 |
"/ |
|
5666 |
"/ traceView isNil ifTrue:[ |
|
5667 |
"/ v := StandardSystemView on:Display. |
|
5668 |
"/ v label:'Debugger-Trace'. |
|
5669 |
"/ v icon:icon. |
|
5670 |
"/ |
|
5671 |
"/ b := Button label:'untrace' in:v. |
|
5672 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
5673 |
"/ b action:[ |
|
5674 |
"/ StepInterruptPending := nil. |
|
5675 |
"/ tracing := false. |
|
5676 |
"/ v unrealize. |
|
5677 |
"/ traceView := nil |
|
5678 |
"/ ]. |
|
5679 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
5680 |
"/ traceView origin:(0 @ (b height)) |
|
5681 |
"/ extent:[v width @ (v height - b height)] |
|
5682 |
"/ ]. |
|
5683 |
"/ v realize. |
|
5684 |
"/ |
|
5685 |
"/ tracing := true. |
|
5686 |
! |
|
5687 |
||
5688 |
doTraceStep |
|
5689 |
"tracestep - not implemented yet" |
|
5690 |
||
5691 |
canContinue ifTrue:[ |
|
15413 | 5692 |
tracing := true. |
5693 |
self doStep |
|
266 | 5694 |
] |
5695 |
! |
|
5696 |
||
5697 |
exit |
|
5698 |
"exit from menu: immediate exit from smalltalk" |
|
5699 |
||
14129 | 5700 |
OperatingSystem exit:10 |
266 | 5701 |
! |
5702 |
||
13388 | 5703 |
findContextForWhich:aBlock thenDo:additionalAction |
5704 |
|con| |
|
5705 |
||
5706 |
con := self selectedContext. |
|
5707 |
con isNil ifTrue:[^ self]. |
|
5708 |
||
5709 |
con := con sender. |
|
5710 |
[con notNil] whileTrue:[ |
|
15413 | 5711 |
(aBlock value:con) ifTrue:[ |
5712 |
(self selectContext:con) ifTrue:[ |
|
5713 |
additionalAction value:con. |
|
5714 |
^ self. |
|
5715 |
] |
|
5716 |
]. |
|
5717 |
con := con sender. |
|
13388 | 5718 |
]. |
5719 |
||
5720 |
Dialog information:'None found'. |
|
5721 |
! |
|
5722 |
||
5723 |
findContextWithStringInSource |
|
5724 |
|stringToSearch source| |
|
5725 |
||
5726 |
stringToSearch := Dialog request:'Search what:'. |
|
5727 |
stringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5728 |
||
15413 | 5729 |
self |
5730 |
findContextForWhich:[:con | |
|
5731 |
con method notNil |
|
5732 |
and:[ (source := con method source) notNil |
|
5733 |
and:[ (source includesString:stringToSearch) ]] |
|
5734 |
] |
|
5735 |
thenDo:[:con | |
|
5736 |
codeView searchFwd:stringToSearch. |
|
5737 |
] |
|
13388 | 5738 |
! |
5739 |
||
5740 |
findContextWithValueInVariable |
|
5741 |
|valueStringToSearch| |
|
5742 |
||
5743 |
valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'. |
|
5744 |
valueStringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5745 |
||
15413 | 5746 |
self |
5747 |
findContextForWhich:[:con | |
|
5748 |
con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase] |
|
5749 |
] |
|
5750 |
thenDo:[:con | ] |
|
13388 | 5751 |
! |
5752 |
||
11595 | 5753 |
findHandlerFor |
13388 | 5754 |
|exClass con| |
11595 | 5755 |
|
15413 | 5756 |
(con := self selectedContext) isNil ifTrue:[ |
5757 |
con := contextArray at:1 |
|
11595 | 5758 |
]. |
5759 |
con sender isNil ifTrue:[ |
|
15413 | 5760 |
self information:'Context has already returned'. |
5761 |
^ self |
|
5762 |
]. |
|
5763 |
||
5764 |
exClass := Dialog |
|
5765 |
choose:'Exception class:' |
|
5766 |
fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name]) |
|
5767 |
lines:25 |
|
5768 |
title:'Choose Exception class'. |
|
14523 | 5769 |
exClass isNil ifTrue:[^ self]. |
13388 | 5770 |
|
15413 | 5771 |
self |
5772 |
findContextForWhich:[:con | |
|
5773 |
con isHandleContext |
|
5774 |
and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] |
|
5775 |
] |
|
5776 |
thenDo:[:con | |
|
5777 |
self selectContext:con sender. |
|
5778 |
] |
|
13388 | 5779 |
! |
5780 |
||
15255 | 5781 |
findHomeContext |
5782 |
|con home| |
|
5783 |
||
5784 |
(con := self selectedContext) isNil ifTrue:[ |
|
15413 | 5785 |
self beep. |
5786 |
^ self. |
|
15255 | 5787 |
]. |
5788 |
(home := con home) isNil ifTrue:[ |
|
15413 | 5789 |
self beep. |
5790 |
^ self. |
|
15255 | 5791 |
]. |
5792 |
||
5793 |
"/ still have to find it - home could be elsewhere (another process) |
|
5794 |
"/ (i.e. cannot simply select it) |
|
5795 |
||
15413 | 5796 |
self |
5797 |
findContextForWhich:[:con | |
|
5798 |
con == home |
|
5799 |
] |
|
5800 |
thenDo:[:con | |
|
5801 |
self selectContext:con. |
|
5802 |
] |
|
15255 | 5803 |
! |
5804 |
||
13388 | 5805 |
findNextExceptionHandlerContext |
15413 | 5806 |
self |
5807 |
findContextForWhich:[:con | |
|
5808 |
con isHandleContext |
|
5809 |
] |
|
5810 |
thenDo:[:con | |
|
5811 |
self selectContext:con sender. |
|
5812 |
] |
|
11595 | 5813 |
! |
5814 |
||
266 | 5815 |
inspectContext |
5816 |
"launch an inspector on the currently selected context" |
|
5817 |
||
11595 | 5818 |
|con| |
5819 |
||
5820 |
(con := self selectedContext) notNil ifTrue:[ |
|
15413 | 5821 |
con inspect. |
266 | 5822 |
] |
11595 | 5823 |
|
5824 |
"Modified: / 17-07-2012 / 12:52:34 / cg" |
|
266 | 5825 |
! |
5826 |
||
15247 | 5827 |
inspectContextsMethod |
5828 |
"launch an inspector on the currently selected context's method" |
|
5829 |
||
5830 |
|con| |
|
5831 |
||
5832 |
(con := self selectedContext) notNil ifTrue:[ |
|
15413 | 5833 |
con method inspect. |
15247 | 5834 |
] |
5835 |
! |
|
5836 |
||
12840 | 5837 |
inspectWidgetHierarchy |
5838 |
|rcvr view| |
|
5839 |
||
5840 |
selectedContext isNil ifTrue:[ ^ self ]. |
|
5841 |
Tools::ViewTreeInspectorApplication isNil ifTrue:[ |
|
15413 | 5842 |
Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'. |
5843 |
^ self. |
|
12840 | 5844 |
]. |
5845 |
||
5846 |
rcvr := selectedContext receiver. |
|
5847 |
rcvr isView ifTrue:[ |
|
15413 | 5848 |
view := rcvr |
12840 | 5849 |
] ifFalse:[ |
15413 | 5850 |
view := rcvr window |
12840 | 5851 |
]. |
5852 |
Tools::ViewTreeInspectorApplication openOn:view |
|
5853 |
! |
|
5854 |
||
8142 | 5855 |
middleButtonMenu |
5856 |
<resource: #programMenu > |
|
5857 |
||
9488 | 5858 |
|items m nameOfExecutable| |
8142 | 5859 |
|
5860 |
exclusive ifTrue:[ |
|
15413 | 5861 |
items := #( |
5862 |
('Show More WalkBack' showMore ) |
|
5863 |
('-' ) |
|
5864 |
('Add Breakpoint' addBreakpoint ) |
|
5865 |
('Remove Breakpoint' removeBreakpoint ) |
|
5866 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
5867 |
('-' ) |
|
5868 |
). |
|
8142 | 5869 |
] ifFalse:[ |
15413 | 5870 |
items := #( |
5871 |
('Show More WalkBack' showMore ) |
|
5872 |
('-' ) |
|
5873 |
('Skip' skip ) |
|
5874 |
('Step Out' skipForReturn ) |
|
5875 |
('Skip until Entering...' skipUntilEntering ) |
|
5876 |
('-' ) |
|
8142 | 5877 |
" |
15413 | 5878 |
('Continue' doContinue ) |
5879 |
('Terminate' doTerminate ) |
|
5880 |
('Abort' doAbort ) |
|
5881 |
('-' ) |
|
5882 |
('Step' doStep ) |
|
5883 |
('Send' doSend ) |
|
5884 |
('-' ) |
|
5885 |
('Return' doReturn ) |
|
5886 |
('Restart' doRestart ) |
|
5887 |
('-' ) |
|
8142 | 5888 |
" |
15413 | 5889 |
('Add Breakpoint' addBreakpoint ) |
5890 |
('Remove Breakpoint' removeBreakpoint ) |
|
5891 |
('Remove all Break- & Tracepoints' removeAllBreakpoints ) |
|
5892 |
). |
|
11210 | 5893 |
|
12840 | 5894 |
"/ self allowBreakPointsInDebugger ifFalse:[ |
5895 |
"/ items := items , #( |
|
5896 |
"/ ('Allow Breakpoints & halt in Debugger' doNotIgnoreBreakpoints ) |
|
5897 |
"/ ). |
|
5898 |
"/ ] ifTrue:[ |
|
5899 |
"/ items := items , #( |
|
5900 |
"/ ('Ignore Breakpoints & halt in Debugger' doIgnoreBreakpoints ) |
|
5901 |
"/ ). |
|
5902 |
"/ ]. |
|
11210 | 5903 |
|
15413 | 5904 |
items := items , #( |
5905 |
('-' ) |
|
5906 |
('Browse Implementing Class' browseImplementingClass ) |
|
5907 |
('Browse Receiver''s Class' browseReceiversClass ) |
|
5908 |
('Browse Blocks''s Home' browseBlocksHome ) |
|
11610 | 5909 |
"/ ('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
5910 |
"/ ('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
15413 | 5911 |
('Implementors' browseImplementors ) |
5912 |
('Implementors Of...' browseImplementorsOf ) |
|
5913 |
('Senders' browseSenders ) |
|
5914 |
('Senders Of...' browseSendersOf ) |
|
5915 |
('-' ) |
|
5916 |
('Inspect Context' inspectContext ) |
|
5917 |
). |
|
8142 | 5918 |
]. |
5919 |
||
9488 | 5920 |
items := items , #( |
15413 | 5921 |
('Copy WalkBack Text' copyWalkbackText ) |
5922 |
('-' ) |
|
5923 |
('Hard Terminate (Danger)' quickTerminate ) |
|
5924 |
('=' )). |
|
9488 | 5925 |
|
5926 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
5927 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
5928 |
||
5929 |
items := items , { |
|
15413 | 5930 |
{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
10205 | 5931 |
|
5932 |
m := PopUpMenu |
|
15413 | 5933 |
itemList:items |
5934 |
resources:resources |
|
5935 |
receiver:self |
|
5936 |
for:contextView. |
|
8142 | 5937 |
|
5938 |
inspecting ifTrue:[ |
|
15413 | 5939 |
m notNil ifTrue:[ |
5940 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
5941 |
browseClassHierarchy browseFullClassProtocol |
|
5942 |
browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut). |
|
5943 |
]. |
|
8142 | 5944 |
]. |
5945 |
self updateMenuItems. |
|
5946 |
||
5947 |
^ m. |
|
9488 | 5948 |
|
13210 | 5949 |
"Modified: / 22-07-2013 / 15:30:05 / cg" |
8142 | 5950 |
! |
5951 |
||
15257 | 5952 |
notShowingDenseWalkbackHolder |
5953 |
^ BlockValue forLogicalNot: self showingDenseWalkbackHolder. |
|
5954 |
! |
|
5955 |
||
11573 | 5956 |
notShowingSupportCode |
5957 |
^ hideSupportCode == true. |
|
5958 |
||
5959 |
"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
|
5960 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5961 |
|
3447 | 5962 |
openAboutThisApplication |
5963 |
"opens an about box for this application." |
|
5964 |
||
7112 | 5965 |
Dialog aboutClass:self class. |
5966 |
||
5967 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 5968 |
! |
5969 |
||
8620 | 5970 |
openSettingsDialog |
14559 | 5971 |
|settingsList| |
8620 | 5972 |
|
10205 | 5973 |
settingsList := |
15413 | 5974 |
#( |
5975 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
5976 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
5977 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
5978 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
5979 |
). |
|
5980 |
||
5981 |
SettingsDialog |
|
5982 |
openWithList:settingsList |
|
5983 |
label:(resources string:'Debugger Settings'). |
|
8620 | 5984 |
! |
5985 |
||
13488 | 5986 |
processesApplication |
5987 |
"if the debugged process is a GUI process, |
|
5988 |
AND it has an applicaiton, return it. |
|
5989 |
Otherwise, return nil" |
|
5990 |
||
14430 | 5991 |
|p wgs app nonModalWGs| |
13488 | 5992 |
|
5993 |
p := inspectedProcess ? Processor activeProcess. |
|
5994 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
|
15413 | 5995 |
wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p]. |
5996 |
nonModalWGs := wgs reject:[:wg | wg isModal]. |
|
5997 |
nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application]. |
|
5998 |
||
5999 |
wgs do:[:wg | |
|
6000 |
|wgi| |
|
6001 |
||
6002 |
wgi := wg. |
|
6003 |
[wgi notNil] whileTrue:[ |
|
6004 |
(app := wgi application) notNil ifTrue:[^ app]. |
|
6005 |
wgi isModal ifTrue:[ |
|
6006 |
wgi := wgi previousGroup |
|
6007 |
] ifFalse:[ |
|
6008 |
wgi := nil. |
|
6009 |
] |
|
6010 |
] |
|
6011 |
] |
|
13488 | 6012 |
]. |
6013 |
^ nil |
|
6014 |
! |
|
6015 |
||
266 | 6016 |
quickTerminate |
6017 |
"quick terminate - the process will get no chance for cleanup actions" |
|
6018 |
||
6019 |
inspecting ifTrue:[ |
|
15413 | 6020 |
self processPerform:#terminateNoSignal. |
6021 |
^ self |
|
266 | 6022 |
]. |
6023 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
6024 |
steppedContext := wrapperContext := nil. |
266 | 6025 |
haveControl := false. |
6026 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6027 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6028 |
"exit private event-loop" |
6365 | 6029 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6030 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6031 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6032 |
inspecting ifFalse:[ |
15413 | 6033 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
6034 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
6035 |
Debugger newDebugger. |
|
6036 |
Processor activeProcess terminateNoSignal. |
|
6037 |
] |
|
266 | 6038 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6039 |
terminateButton turnOff. |
477 | 6040 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6041 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 6042 |
! |
6043 |
||
11391 | 6044 |
rememberCallchain |
6045 |
"remember the callchain in a classvar. |
|
6046 |
When entered the next time, highlight already entered contexts. |
|
6047 |
This makes it possible to identitfy the caller as the first common context |
|
6048 |
along the chain (i.e. the context which is responsible for the debugger to be entered)" |
|
6049 |
||
6050 |
RememberedCallChain := contextArray copy |
|
6051 |
||
6052 |
"Created: / 07-03-2012 / 23:07:07 / cg" |
|
6053 |
! |
|
6054 |
||
13388 | 6055 |
selectContext:aContext |
6056 |
|idx| |
|
6057 |
||
6058 |
idx := contextArray identityIndexOf:aContext. |
|
6059 |
idx == 0 ifTrue:[ |
|
15413 | 6060 |
"/ some contexts hidden? |
6061 |
(self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[ |
|
6062 |
Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'. |
|
6063 |
self showFullWalkback. |
|
6064 |
self showingDenseWalkback:false. |
|
6065 |
self showingSupportCode:true. |
|
6066 |
]. |
|
6067 |
idx := contextArray identityIndexOf:aContext. |
|
13388 | 6068 |
]. |
6069 |
idx ~~ 0 ifTrue:[ |
|
15413 | 6070 |
self selectContextWithIndex:idx. |
6071 |
^ true. |
|
13388 | 6072 |
]. |
6073 |
^ false |
|
6074 |
! |
|
6075 |
||
11595 | 6076 |
selectedContext |
15960 | 6077 |
|selIdx| |
6078 |
||
6079 |
(selIdx := contextView selection) notNil ifTrue:[ |
|
6080 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
|
6081 |
^ (contextArray at:selIdx). |
|
6082 |
] |
|
11595 | 6083 |
]. |
6084 |
^ nil |
|
6085 |
||
6086 |
"Created: / 17-07-2012 / 12:52:10 / cg" |
|
6087 |
! |
|
6088 |
||
11647 | 6089 |
showFullWalkback |
6090 |
"double the number of contexts shown" |
|
6091 |
||
6092 |
contextArray notNil ifTrue:[ |
|
15413 | 6093 |
nChainShown := 9999. |
6094 |
self redisplayBacktrace. |
|
11647 | 6095 |
] |
6096 |
||
6097 |
"Created: / 23-07-2012 / 12:24:02 / cg" |
|
6098 |
! |
|
6099 |
||
266 | 6100 |
showMore |
3447 | 6101 |
"double the number of contexts shown" |
266 | 6102 |
|
6103 |
contextArray notNil ifTrue:[ |
|
15413 | 6104 |
nChainShown := nChainShown * 2. |
6105 |
self redisplayBacktrace. |
|
266 | 6106 |
] |
563 | 6107 |
|
3447 | 6108 |
"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
|
6109 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6110 |
|
11573 | 6111 |
showSupportCode |
6112 |
hideSupportCode := false. |
|
6113 |
self redisplayBacktrace. |
|
6114 |
||
6115 |
"Created: / 10-06-2012 / 21:27:53 / cg" |
|
6116 |
! |
|
6117 |
||
3447 | 6118 |
showingDenseWalkback |
15257 | 6119 |
^ self verboseBacktraceHolder value not |
3447 | 6120 |
|
6121 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
6122 |
! |
|
6123 |
||
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6124 |
showingDenseWalkback:aBoolean |
15257 | 6125 |
self verboseBacktraceHolder value:aBoolean not. |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6126 |
self redisplayBacktrace. |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6127 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6128 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6129 |
! |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6130 |
|
15257 | 6131 |
showingDenseWalkbackHolder |
6132 |
^ BlockValue forLogicalNot:self verboseBacktraceHolder |
|
6133 |
! |
|
6134 |
||
11573 | 6135 |
showingSupportCode |
6136 |
^ hideSupportCode == false. |
|
6137 |
||
6138 |
"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
|
6139 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6140 |
|
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6141 |
showingSupportCode:aBoolean |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6142 |
hideSupportCode := aBoolean not. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6143 |
self redisplayBacktrace. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6144 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6145 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6146 |
! |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6147 |
|
3447 | 6148 |
showingVerboseWalkback |
15257 | 6149 |
^ self verboseBacktraceHolder value |
3447 | 6150 |
|
6151 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
6152 |
! |
|
6153 |
||
9626 | 6154 |
sizeChanged:how |
10205 | 6155 |
super sizeChanged:how. |
9626 | 6156 |
LastExtent := self extent. |
6157 |
||
6158 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
6159 |
! |
|
6160 |
||
266 | 6161 |
skip |
6162 |
"skip for cursor line in selected method" |
|
6163 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6164 |
stepHow := #skip. |
266 | 6165 |
self doStep:codeView cursorLine. |
790 | 6166 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6167 |
"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
|
6168 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6169 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6170 |
skipForReturn |
2581 | 6171 |
"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
|
6172 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6173 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6174 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6175 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6176 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 6177 |
! |
6178 |
||
6179 |
skipUntilEntering |
|
6180 |
"skip until some particular method is invoked." |
|
6181 |
||
6182 |
|selector| |
|
6183 |
||
10205 | 6184 |
selector := Dialog |
15413 | 6185 |
request:'Skip until entering what (matchpattern):' |
6186 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 6187 |
selector size == 0 ifTrue:[^ self]. |
6188 |
||
6189 |
stepUntilEntering := selector asSymbol. |
|
6190 |
stepHow := #send. |
|
6191 |
self doStep:-1. |
|
6192 |
||
6193 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 6194 |
! |
6195 |
||
11573 | 6196 |
toggleShowSupportCode |
6197 |
hideSupportCode ifTrue:[ |
|
15413 | 6198 |
self showSupportCode |
11645
4f39a925956d
changed: #toggleShowSupportCode
Stefan Vogel <sv@exept.de>
parents:
11636
diff
changeset
|
6199 |
] ifFalse:[ |
15413 | 6200 |
self hideSupportCode |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6201 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6202 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6203 |
"Modified: / 17-11-2001 / 20:07:45 / cg" |
11573 | 6204 |
"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
|
6205 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6206 |
|
3447 | 6207 |
toggleVerboseWalkback |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6208 |
self showingDenseWalkback:(self showingDenseWalkback not) |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6209 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6210 |
"Modified: / 27-07-2012 / 15:00:15 / cg" |
11610 | 6211 |
! |
6212 |
||
6213 |
updateMenuItems |
|
13408 | 6214 |
"enable/disable some menu items, depending on the current selected context" |
6215 |
||
11610 | 6216 |
|m mthd cls mCls rCls| |
6217 |
||
6218 |
m := contextView middleButtonMenu. |
|
6219 |
m notNil ifTrue:[ |
|
15413 | 6220 |
m disable:#removeBreakpoint. |
6221 |
m disable:#addBreakpoint. |
|
6222 |
canShowMore ifFalse:[ |
|
6223 |
m disable:#showMore |
|
6224 |
]. |
|
6225 |
||
6226 |
selectedContext notNil ifTrue:[ |
|
6227 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
6228 |
||
6229 |
mthd := selectedContext method. |
|
6230 |
mthd notNil ifTrue:[ |
|
6231 |
cls := mCls := mthd containingClass. |
|
6232 |
mthd isBreakpointed ifTrue:[ |
|
6233 |
m enable:#removeBreakpoint. |
|
6234 |
] ifFalse:[ |
|
6235 |
m enable:#addBreakpoint. |
|
6236 |
] |
|
6237 |
]. |
|
6238 |
(selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[ |
|
6239 |
"/ a cheap block's context |
|
6240 |
] ifFalse:[ |
|
6241 |
rCls := selectedContext receiver class. |
|
6242 |
cls isNil ifTrue:[ |
|
6243 |
cls := rCls |
|
6244 |
]. |
|
6245 |
]. |
|
6246 |
cls notNil ifTrue:[ |
|
6247 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6248 |
rCls == mCls ifTrue:[ |
|
6249 |
m disable:#browseReceiversClass |
|
6250 |
]. |
|
6251 |
mCls isNil ifTrue:[ |
|
6252 |
m disable:#browseImplementingClass |
|
6253 |
] |
|
6254 |
||
6255 |
] ifFalse:[ |
|
6256 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6257 |
]. |
|
6258 |
mthd notNil ifTrue:[ |
|
6259 |
m enableAll:#(browseImplementingClass). |
|
6260 |
]. |
|
6261 |
selectedContext isCheapBlockContext ifTrue:[ |
|
6262 |
m disableAll:#(browseReceiversClass). |
|
6263 |
]. |
|
6264 |
selectedContext receiver isBlock ifTrue:[ |
|
6265 |
m enableAll:#(browseBlocksHome). |
|
6266 |
] ifFalse:[ |
|
6267 |
m disableAll:#(browseBlocksHome). |
|
6268 |
]. |
|
6269 |
] ifFalse:[ |
|
6270 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy |
|
6271 |
browseBlocksHome browseFullClassProtocol). |
|
6272 |
] |
|
11610 | 6273 |
] |
6274 |
||
6275 |
"Modified: / 19-07-2012 / 11:53:30 / cg" |
|
266 | 6276 |
! ! |
6277 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6278 |
!DebugView methodsFor:'menu & button actions-breakpoints'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6279 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6280 |
addBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6281 |
"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
|
6282 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6283 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6284 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6285 |
selectedContext isNil ifTrue:[ |
15413 | 6286 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6287 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6288 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
15413 | 6289 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6290 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6291 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6292 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6293 |
implementorClass notNil ifTrue:[ |
15413 | 6294 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6295 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
6296 |
method setBreakPoint |
|
6297 |
] |
|
11366
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 |
contextView middleButtonMenu disable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6300 |
contextView middleButtonMenu enable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6301 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6302 |
"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
|
6303 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6304 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6305 |
allowBreakPointsInDebugger |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6306 |
^ ignoreBreakpoints not |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6307 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6308 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6309 |
allowBreakPointsInDebugger:aBoolean |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6310 |
ignoreBreakpoints := aBoolean not. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6311 |
self initializeMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6312 |
self initializeContextViewsMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6313 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6314 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6315 |
doIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6316 |
self allowBreakPointsInDebugger:false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6317 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6318 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6319 |
doNotIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6320 |
self allowBreakPointsInDebugger:true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6321 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6322 |
|
14680 | 6323 |
ignoreAllHaltsForCurrentProcess |
15413 | 6324 |
self |
6325 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6326 |
orThisReceiverClass:false orCurrentProcess:true |
|
6327 |
orIfCalledFromMethod:nil |
|
6328 |
forAll:true. |
|
14680 | 6329 |
|
6330 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6331 |
! |
|
6332 |
||
6333 |
ignoreAllHaltsForThisReceiverClass |
|
15413 | 6334 |
self |
6335 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6336 |
orThisReceiverClass:true orCurrentProcess:false |
|
6337 |
orIfCalledFromMethod:nil |
|
6338 |
forAll:true. |
|
14680 | 6339 |
|
6340 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6341 |
! |
|
6342 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6343 |
ignoreAllHaltsForever |
15413 | 6344 |
self |
6345 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
|
6346 |
orThisReceiverClass:false orCurrentProcess:false |
|
6347 |
orIfCalledFromMethod:nil |
|
6348 |
forAll:true. |
|
11366
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 |
"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
|
6351 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6352 |
|
14680 | 6353 |
ignoreAllHaltsIfCalledFromMethod:aMethod |
15413 | 6354 |
self |
6355 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6356 |
orThisReceiverClass:false orCurrentProcess:false |
|
6357 |
orIfCalledFromMethod:aMethod |
|
6358 |
forAll:true. |
|
14680 | 6359 |
! |
6360 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6361 |
ignoreAllHaltsUntilShiftKeyIsPressed |
15413 | 6362 |
self |
6363 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6364 |
orThisReceiverClass:false orCurrentProcess:false |
|
6365 |
orIfCalledFromMethod:nil |
|
6366 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6367 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6368 |
"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
|
6369 |
! |
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 |
ignoreBreakpointsWithThisParameterForever |
11370 | 6372 |
Object disableBreakPoint:breakPointParameter. |
6373 |
"/ self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:false. |
|
6374 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6375 |
"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
|
6376 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6377 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6378 |
ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
15413 | 6379 |
self |
6380 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6381 |
orThisReceiverClass:false orCurrentProcess:false |
|
6382 |
orIfCalledFromMethod:nil |
|
6383 |
forAll:false. |
|
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 |
"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
|
6386 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6387 |
|
12937 | 6388 |
ignoreHaltForCurrentProcess |
15413 | 6389 |
self |
6390 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6391 |
orThisReceiverClass:false orCurrentProcess:true |
|
6392 |
orIfCalledFromMethod:nil |
|
6393 |
forAll:false. |
|
12937 | 6394 |
|
6395 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6396 |
! |
|
6397 |
||
6398 |
ignoreHaltForThisReceiverClass |
|
15413 | 6399 |
self |
6400 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6401 |
orThisReceiverClass:true orCurrentProcess:false |
|
6402 |
orIfCalledFromMethod:nil |
|
6403 |
forAll:false. |
|
12937 | 6404 |
|
6405 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6406 |
! |
|
6407 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6408 |
ignoreHaltForever |
15413 | 6409 |
self |
6410 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
|
6411 |
orThisReceiverClass:false orCurrentProcess:false |
|
6412 |
orIfCalledFromMethod:nil |
|
6413 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6414 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6415 |
"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
|
6416 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6417 |
|
14608 | 6418 |
ignoreHaltIfCalledFromMethod:aMethod |
15413 | 6419 |
self |
6420 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6421 |
orThisReceiverClass:false orCurrentProcess:false |
|
6422 |
orIfCalledFromMethod:aMethod |
|
6423 |
forAll:false. |
|
14608 | 6424 |
! |
6425 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6426 |
ignoreHaltUntilShiftKeyIsPressed |
15413 | 6427 |
self |
6428 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6429 |
orThisReceiverClass:false orCurrentProcess:false |
|
6430 |
orIfCalledFromMethod:nil |
|
6431 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6432 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6433 |
"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
|
6434 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6435 |
|
14680 | 6436 |
menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
6437 |
<resource: #programMenu > |
|
6438 |
||
6439 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:true |
|
6440 |
! |
|
6441 |
||
14608 | 6442 |
menuForIgnoreBreakpointIfCalledFromAnyOf |
6443 |
<resource: #programMenu > |
|
6444 |
||
14680 | 6445 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:false |
6446 |
! |
|
6447 |
||
6448 |
menuForIgnoreBreakpointIfCalledFromAnyOfForAll:forAllHaltsBoolean |
|
6449 |
<resource: #programMenu > |
|
6450 |
||
14608 | 6451 |
|m count already| |
6452 |
||
6453 |
m := Menu new. |
|
6454 |
count := 0. |
|
6455 |
already := IdentitySet new. |
|
6456 |
||
6457 |
contextArray do:[:con | |
|
15413 | 6458 |
|mthd cls sel| |
6459 |
||
6460 |
mthd := con method. |
|
6461 |
mthd notNil ifTrue:[ |
|
6462 |
mthd isWrapped ifFalse:[ |
|
6463 |
(already includes:already) ifFalse:[ |
|
6464 |
already add:mthd. |
|
6465 |
m addItem:(MenuItem |
|
6466 |
label: (mthd whoString) |
|
6467 |
itemValue: [ forAllHaltsBoolean |
|
6468 |
ifTrue:[self ignoreHaltIfCalledFromMethod:mthd] |
|
6469 |
ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd] |
|
6470 |
] |
|
6471 |
translateLabel: false). |
|
6472 |
count := count + 1. |
|
6473 |
(count > 20) ifTrue:[ |
|
6474 |
^ m |
|
6475 |
]. |
|
6476 |
] |
|
6477 |
] |
|
6478 |
] |
|
14608 | 6479 |
]. |
6480 |
^ m |
|
6481 |
! |
|
6482 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6483 |
openBreakPointBrowser |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6484 |
Tools::BreakpointBrowser open |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6485 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6486 |
"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
|
6487 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6488 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6489 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6490 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6491 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6492 |
[ |
15413 | 6493 |
answer := Dialog |
6494 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
6495 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6496 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6497 |
||
6498 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6499 |
dT notNil ifTrue:[ |
|
6500 |
LastIgnoreHaltDuration := dT. |
|
6501 |
self |
|
6502 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6503 |
orThisReceiverClass:false orCurrentProcess:false |
|
6504 |
orIfCalledFromMethod:nil |
|
6505 |
forAll:true. |
|
6506 |
^ self. |
|
6507 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6508 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6509 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6510 |
"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
|
6511 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6512 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6513 |
openIgnoreBreakpointsWithThisParameterNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6514 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6515 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6516 |
[ |
15413 | 6517 |
answer := Dialog |
6518 |
request:(resources |
|
6519 |
string:'How often should breakpoints with parameter "%1" be ignored ?' |
|
6520 |
with:breakPointParameter) |
|
6521 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6522 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6523 |
||
6524 |
n := Integer readFrom:answer onError:nil. |
|
6525 |
n notNil ifTrue:[ |
|
6526 |
LastIgnoreHaltNTimes := n. |
|
6527 |
self |
|
6528 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6529 |
orThisReceiverClass:false orCurrentProcess:false |
|
6530 |
orIfCalledFromMethod:nil |
|
6531 |
forAll:false. |
|
6532 |
^ self. |
|
6533 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6534 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6535 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6536 |
"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
|
6537 |
"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
|
6538 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6539 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6540 |
openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6541 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6542 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6543 |
[ |
15413 | 6544 |
answer := Dialog |
6545 |
request:(resources |
|
6546 |
string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?' |
|
6547 |
with:breakPointParameter) |
|
6548 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6549 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6550 |
||
6551 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6552 |
dT notNil ifTrue:[ |
|
6553 |
LastIgnoreHaltDuration := dT. |
|
6554 |
self |
|
6555 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6556 |
orThisReceiverClass:false orCurrentProcess:false |
|
6557 |
orIfCalledFromMethod:nil |
|
6558 |
forAll:false. |
|
6559 |
^ self. |
|
6560 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6561 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6562 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6563 |
"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
|
6564 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6565 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6566 |
openIgnoreHaltNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6567 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6568 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6569 |
[ |
15413 | 6570 |
answer := Dialog |
6571 |
request:(resources string:'How often should this halt be ignored ?') |
|
6572 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6573 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6574 |
||
6575 |
n := Integer readFrom:answer onError:nil. |
|
6576 |
n notNil ifTrue:[ |
|
6577 |
LastIgnoreHaltNTimes := n. |
|
6578 |
self |
|
6579 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6580 |
orThisReceiverClass:false orCurrentProcess:false |
|
6581 |
orIfCalledFromMethod:nil |
|
6582 |
forAll:false. |
|
6583 |
^ self. |
|
6584 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6585 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6586 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6587 |
"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
|
6588 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6589 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6590 |
openIgnoreHaltUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6591 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6592 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6593 |
[ |
15413 | 6594 |
answer := Dialog |
6595 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
6596 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6597 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6598 |
||
6599 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6600 |
dT notNil ifTrue:[ |
|
6601 |
LastIgnoreHaltDuration := dT. |
|
6602 |
self |
|
6603 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6604 |
orThisReceiverClass:false orCurrentProcess:false |
|
6605 |
orIfCalledFromMethod:nil |
|
6606 |
forAll:false. |
|
6607 |
^ self. |
|
6608 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6609 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6610 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6611 |
"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
|
6612 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6613 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6614 |
removeAllBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6615 |
"remove all trace & breakpoints - if any" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6616 |
|
14532 | 6617 |
self withExecuteCursorDo:[ |
15413 | 6618 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
6619 |
MessageTracer unwrapAllMethods |
|
6620 |
]. |
|
6621 |
(MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[ |
|
6622 |
MethodWithBreakpoints removeAllBreakpoints |
|
6623 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6624 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6625 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6626 |
"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
|
6627 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6628 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6629 |
removeBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6630 |
"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
|
6631 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6632 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6633 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6634 |
selectedContext isNil ifTrue:[ |
15413 | 6635 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6636 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6637 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
15413 | 6638 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6639 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6640 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6641 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6642 |
implementorClass notNil ifTrue:[ |
15413 | 6643 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6644 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
6645 |
method clearBreakPoint |
|
6646 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6647 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6648 |
contextView middleButtonMenu disable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6649 |
contextView middleButtonMenu enable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6650 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6651 |
"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
|
6652 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6653 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6654 |
stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6655 |
self class stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6656 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6657 |
|
266 | 6658 |
!DebugView methodsFor:'private'! |
6659 |
||
6487 | 6660 |
abortAllIsHandled |
9750 | 6661 |
^ AbortAllOperationWantedQuery query |
6662 |
||
6663 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 6664 |
! |
6665 |
||
266 | 6666 |
busy |
6667 |
^ busy |
|
6668 |
! |
|
6669 |
||
6670 |
exclusive:aBoolean |
|
6671 |
exclusive := aBoolean |
|
6672 |
! |
|
6673 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6674 |
explainSelection |
8212 | 6675 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6676 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6677 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6678 |
interval isEmpty ifTrue:[ |
15413 | 6679 |
crsrPos := codeView characterPositionOfCursor. |
6680 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
6681 |
crsrPos := (crsrPos - 1) max:1 |
|
6682 |
]. |
|
6683 |
interval := crsrPos to:crsrPos. |
|
10205 | 6684 |
]. |
6685 |
self |
|
15413 | 6686 |
withNodeValueAtInterval:interval |
6687 |
do:[:value :description | |
|
6688 |
self showValue:value |
|
6689 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6690 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6691 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6692 |
findNodeForInterval:interval |
8212 | 6693 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6694 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6695 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6696 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
6697 |
source := codeView contentsAsString string. |
10205 | 6698 |
"/ source := currentMethod notNil |
6699 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 6700 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
6701 |
source isNil ifTrue:[^ nil]. |
8214 | 6702 |
|
8212 | 6703 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
6704 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6705 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6706 |
|
7912 | 6707 |
findNodeIn:tree forInterval:interval |
6708 |
<resource: #obsolete> |
|
10205 | 6709 |
|
16933 | 6710 |
self obsoleteMethodWarning. |
6711 |
^ DoWhatIMeanSupport findNodeIn:tree forInterval:interval |
|
6712 |
"/ |node| |
|
6713 |
"/ |
|
6714 |
"/ node := nil. |
|
6715 |
"/ tree nodesDo:[:each | |
|
6716 |
"/ (each intersectsInterval:interval) ifTrue:[ |
|
6717 |
"/ (node isNil or:[node == each parent]) ifTrue:[ |
|
6718 |
"/ node := each |
|
6719 |
"/ ] ifFalse:[ |
|
6720 |
"/ (node parent notNil |
|
6721 |
"/ and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
6722 |
"/ ] |
|
6723 |
"/ ] |
|
6724 |
"/ ]. |
|
6725 |
"/ ^ node |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6726 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6727 |
|
2581 | 6728 |
goodSkipUntilSelector |
6729 |
|current| |
|
6730 |
||
6731 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
6732 |
selectedContext isNil ifTrue:[^ nil]. |
|
6733 |
current := selectedContext selector. |
|
6734 |
current isNil ifTrue:[^ nil]. |
|
6735 |
('change:*' match:current) ifTrue:[ |
|
15413 | 6736 |
^ 'update:*' |
2581 | 6737 |
]. |
6738 |
^ nil |
|
6739 |
! |
|
6740 |
||
8179 | 6741 |
haltSelectors |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6742 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break'). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6743 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6744 |
"Modified (format): / 27-01-2012 / 11:10:00 / cg" |
8179 | 6745 |
! |
6746 |
||
266 | 6747 |
interruptProcessWith:aBlock |
6748 |
"let inspected process do something, then update the context list" |
|
6749 |
||
6750 |
inspectedProcess isDead ifTrue:[ |
|
15413 | 6751 |
self showTerminated. |
6752 |
^ self |
|
266 | 6753 |
]. |
6754 |
inspectedProcess interruptWith:aBlock. |
|
6755 |
" |
|
6756 |
give the process a chance to run, then update |
|
6757 |
" |
|
6758 |
(Delay forSeconds:0.2) wait. |
|
6759 |
self setContext:(inspectedProcess suspendedContext). |
|
6760 |
! |
|
6761 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6762 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6763 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6764 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6765 |
|
8194 | 6766 |
openHTMLDocument: anHTMLFilename |
6767 |
"open a HTMLDocumentView on anHTMLFilename" |
|
6768 |
||
6769 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
6770 |
! |
|
6771 |
||
266 | 6772 |
processPerform:aMessage |
6773 |
"do something, then update the context list" |
|
6774 |
||
6775 |
inspectedProcess isDead ifTrue:[ |
|
15413 | 6776 |
self showTerminated. |
6777 |
^ self |
|
266 | 6778 |
]. |
6779 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
6780 |
|
266 | 6781 |
" |
6782 |
give the process a chance to run, then update |
|
6783 |
" |
|
6784 |
(Delay forSeconds:0.2) wait. |
|
6785 |
self setContext:(inspectedProcess suspendedContext). |
|
6786 |
! |
|
6787 |
||
939 | 6788 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6789 |
"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
|
6790 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6791 |
|
939 | 6792 |
|oldSelection oldContext con idx| |
6793 |
||
6794 |
contextArray notNil ifTrue:[ |
|
16065 | 6795 |
self withExecuteCursorDo:[ |
6796 |
oldSelection := contextView selection. |
|
6797 |
oldSelection notNil ifTrue:[ |
|
6798 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
6799 |
]. |
|
6800 |
||
6801 |
con := firstContext. |
|
950 | 6802 |
"/ con := contextArray at:1. |
16065 | 6803 |
"/ force redisplay, even if same by changing the first entry |
6804 |
contextArray size > 0 ifTrue:[ |
|
6805 |
contextArray at:1 put:nil. |
|
6806 |
]. |
|
6807 |
self setContext:con. |
|
6808 |
||
6809 |
oldContext isNil ifTrue:[ |
|
6810 |
idx := oldSelection |
|
6811 |
] ifFalse:[ |
|
6812 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
6813 |
]. |
|
6814 |
contextView setSelection:idx. |
|
6815 |
idx notNil ifTrue:[ |
|
6816 |
self showSelection:idx |
|
6817 |
] |
|
6818 |
] |
|
939 | 6819 |
] |
6820 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6821 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 6822 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 6823 |
! |
6824 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6825 |
selectedInterval |
7912 | 6826 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6827 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6828 |
|
7823 | 6829 |
showError:message |
6830 |
codeView contents:(resources string:message). |
|
6831 |
shown ifTrue:[ |
|
15413 | 6832 |
exclusive ifTrue:[ |
6833 |
"/ consider this a kludge: |
|
6834 |
"/ if exclusive, cannot use flash, since it suspends |
|
6835 |
"/ (but we cannot suspend here ...) |
|
6836 |
codeView redrawInverted. self flush. |
|
6837 |
OperatingSystem millisecondDelay:200. |
|
6838 |
codeView redraw |
|
6839 |
] ifFalse:[ |
|
6840 |
codeView flash |
|
6841 |
] |
|
7823 | 6842 |
] |
6843 |
||
6844 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
6845 |
! |
|
6846 |
||
6847 |
showTerminated |
|
6848 |
self showError:'** the process has terminated **' |
|
6849 |
! |
|
6850 |
||
6851 |
showValue:aValue |
|
6852 |
"/ TODO: show value in info field |
|
6853 |
"/ Transcript showCR:aValue printString |
|
6854 |
! |
|
6855 |
||
10205 | 6856 |
stepping |
6857 |
^ stepping |
|
6858 |
! |
|
6859 |
||
6860 |
unstep |
|
7823 | 6861 |
stepping := false. |
6862 |
bigStep := false. |
|
6863 |
steppedContext := wrapperContext := nil. |
|
6864 |
exitAction := nil |
|
6865 |
||
6866 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
6867 |
! |
|
6868 |
||
10203 | 6869 |
updateButtonsAndMenuItemsForContext:aContext |
6870 |
|m| |
|
6871 |
||
6872 |
m := contextView middleButtonMenu. |
|
6873 |
m notNil ifTrue:[ |
|
15413 | 6874 |
self updateMenuItems. |
6875 |
||
6876 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
6877 |
abortButton enable. |
|
6878 |
m enable:#doAbort. |
|
6879 |
] ifFalse:[ |
|
6880 |
abortButton disable. |
|
6881 |
m disable:#doAbort. |
|
6882 |
]. |
|
6883 |
exclusive ifTrue:[ |
|
6884 |
terminateButton disable. |
|
6885 |
m disable:#doTerminate. |
|
6886 |
] ifFalse:[ |
|
6887 |
terminateButton enable. |
|
6888 |
m enable:#doTerminate. |
|
6889 |
]. |
|
10203 | 6890 |
]. |
6891 |
||
6892 |
mayProceed == false ifTrue:[ |
|
15413 | 6893 |
continueButton disable. |
6894 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 6895 |
] ifFalse:[ |
15413 | 6896 |
continueButton enable. |
6897 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 6898 |
]. |
6899 |
||
13363 | 6900 |
isStoppedInModalDialog ifTrue:[ |
15413 | 6901 |
gotoDialogOpenerButton enable. |
6902 |
gotoDialogOpenerButton beVisible. |
|
13362 | 6903 |
] ifFalse:[ |
15413 | 6904 |
gotoDialogOpenerButton beInvisible. |
13362 | 6905 |
]. |
6906 |
||
14523 | 6907 |
(isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[ |
15413 | 6908 |
gotoApplicationActionMethodButton enable. |
6909 |
gotoApplicationActionMethodButton beVisible. |
|
14523 | 6910 |
] ifFalse:[ |
15413 | 6911 |
gotoApplicationActionMethodButton beInvisible. |
14523 | 6912 |
]. |
6913 |
||
10203 | 6914 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
6915 |
! |
|
6916 |
||
7823 | 6917 |
updateContext |
6918 |
|oldContext idx| |
|
6919 |
||
6920 |
inspectedProcess state == #dead ifTrue:[ |
|
15413 | 6921 |
self showTerminated. |
6922 |
^ self |
|
7823 | 6923 |
]. |
6924 |
||
6925 |
oldContext := selectedContext. |
|
6926 |
[ |
|
15413 | 6927 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
6928 |
oldContext notNil ifTrue:[ |
|
6929 |
contextArray notNil ifTrue:[ |
|
6930 |
idx := contextArray identityIndexOf:oldContext. |
|
6931 |
idx ~~ 0 ifTrue:[ |
|
6932 |
self showSelection:idx |
|
6933 |
] ifFalse:[ |
|
6934 |
codeView contents:('** context returned **') |
|
6935 |
] |
|
6936 |
] |
|
6937 |
] |
|
6938 |
]. |
|
7823 | 6939 |
] valueUninterruptably. |
6940 |
||
6941 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 6942 |
! |
6943 |
||
6944 |
withNodeValueAtInterval:interval do:aBlock |
|
14122 | 6945 |
"helper for flyByHelp and explan-selection" |
6946 |
||
15413 | 6947 |
|node definingNode nm nmBold nameSymbol |
14122 | 6948 |
varIdx parentNode receiver con receiversNonMetaClass| |
6949 |
||
6950 |
"/ interval printCR. |
|
10205 | 6951 |
Error |
15413 | 6952 |
handle:[:ex | ] |
6953 |
do:[ |
|
6954 |
[ |
|
6955 |
node := self findNodeForInterval:interval |
|
6956 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
6957 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
6958 |
|
8212 | 6959 |
node isNil ifTrue:[ ^ self ]. |
10205 | 6960 |
node isVariable ifFalse:[ |
15413 | 6961 |
"/ Transcript showCR:node. |
6962 |
^ self |
|
8592 | 6963 |
]. |
8212 | 6964 |
|
6965 |
nm := node name. |
|
8214 | 6966 |
nmBold := nm allBold. |
8600 | 6967 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 6968 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 6969 |
receiver := actualContext methodHome receiver. |
8212 | 6970 |
|
6971 |
(nm = 'self') ifTrue:[ |
|
15413 | 6972 |
aBlock value:receiver value:'receiver' allBold. |
6973 |
^ self |
|
8212 | 6974 |
]. |
6975 |
(nm = 'super') ifTrue:[ |
|
15413 | 6976 |
aBlock value:receiver value:'receiver' allBold. |
6977 |
^ self |
|
8212 | 6978 |
]. |
6979 |
(nm = 'thisContext') ifTrue:[ |
|
15413 | 6980 |
aBlock value:actualContext value:'context' allBold. |
6981 |
^ self |
|
8212 | 6982 |
]. |
6983 |
||
6984 |
definingNode := node whoDefines:nm. |
|
6985 |
definingNode isNil ifTrue:[ |
|
15413 | 6986 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 6987 |
"/aBlock value:'xIII' value:'instVar'. |
15413 | 6988 |
receiver class isMetaclass ifTrue:[ |
6989 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
6990 |
] ifFalse:[ |
|
6991 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
6992 |
]. |
|
6993 |
^ self |
|
6994 |
]. |
|
6995 |
||
6996 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
6997 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
6998 |
aBlock value:'' value:'private class ',nmBold. |
|
6999 |
^ self |
|
7000 |
]. |
|
7001 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
7002 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
7003 |
^ self |
|
7004 |
]. |
|
7005 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
7006 |
|pool| |
|
7007 |
||
7008 |
pool := Smalltalk at:eachPoolName. |
|
7009 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
7010 |
(pool classVarNames includes:nm) ifTrue:[ |
|
7011 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
7012 |
^ self |
|
7013 |
]. |
|
7014 |
]. |
|
7015 |
nameSymbol := nm asSymbolIfInterned. |
|
7016 |
nameSymbol notNil ifTrue:[ |
|
7017 |
(Smalltalk includesKey:nameSymbol) ifTrue:[ |
|
7018 |
(Smalltalk at:nameSymbol) isClass ifTrue:[ |
|
7019 |
aBlock value:'class: ',nmBold value:nil. |
|
7020 |
] ifFalse:[ |
|
7021 |
aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold. |
|
7022 |
]. |
|
7023 |
^ self |
|
7024 |
]. |
|
7025 |
]. |
|
7026 |
aBlock value:'' value:'unknown'. |
|
7027 |
^ self |
|
8212 | 7028 |
]. |
7029 |
"/definingNode printCR. |
|
7030 |
||
7031 |
definingNode isMethod ifTrue:[ |
|
15413 | 7032 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
7033 |
varIdx ~~ 0 ifTrue:[ |
|
7034 |
Error |
|
7035 |
handle:[:ex | ] |
|
7036 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
7037 |
^ self |
|
7038 |
]. |
|
7039 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
7040 |
varIdx ~~ 0 ifTrue:[ |
|
7041 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
7042 |
Error |
|
7043 |
handle:[:ex | ] |
|
7044 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
7045 |
^ self |
|
7046 |
] |
|
7047 |
]. |
|
8212 | 7048 |
]. |
7049 |
||
7050 |
definingNode isBlock ifTrue:[ |
|
15413 | 7051 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
7052 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
7053 |
varIdx ~~ 0 ifTrue:[ |
|
7054 |
"/ am I in this block ? |
|
7055 |
(actualContext lineNumber notNil |
|
7056 |
and:[ definingNode lastLineNumber notNil |
|
7057 |
and:[ (actualContext lineNumber |
|
7058 |
between:definingNode firstLineNumber |
|
7059 |
and:definingNode lastLineNumber) |
|
7060 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
7061 |
ifTrue:[ |
|
7062 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
7063 |
^ self |
|
7064 |
]. |
|
7065 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
|
7066 |
^ self |
|
7067 |
] |
|
7068 |
]. |
|
8212 | 7069 |
]. |
7070 |
||
7071 |
parentNode := definingNode parent. |
|
7072 |
||
7073 |
[parentNode notNil] whileTrue:[ |
|
15413 | 7074 |
"/'isMethod ' print. parentNode isMethod printCR. |
7075 |
parentNode isMethod ifTrue:[ |
|
7076 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
7077 |
varIdx ~~ 0 ifTrue:[ |
|
7078 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
7079 |
Error |
|
7080 |
handle:[:ex | ] |
|
7081 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
7082 |
^ self |
|
7083 |
] |
|
7084 |
]. |
|
7085 |
]. |
|
7086 |
"/'isBlock ' print. parentNode isBlock printCR. |
|
7087 |
parentNode isBlock ifTrue:[ |
|
7088 |
"/ we don't have any information on the inlineability |
|
7089 |
"/ of this block here (RBParser does not know what |
|
7090 |
"/ the compiler does). |
|
7091 |
"/ therefore, it is questionable if we can use the |
|
7092 |
"/ context's home context here. |
|
7093 |
"/ am I in this block ? |
|
7094 |
con := actualContext. |
|
7095 |
[con notNil |
|
7096 |
and:[ parentNode lastLineNumber notNil |
|
7097 |
and:[ con lineNumber notNil |
|
7098 |
and:[ con lineNumber |
|
7099 |
between:parentNode firstLineNumber |
|
7100 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
7101 |
con := con sender. |
|
7102 |
]. |
|
7103 |
con notNil ifTrue:[ |
|
7104 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
7105 |
varIdx ~~ 0 ifTrue:[ |
|
7106 |
Error |
|
7107 |
handle:[:ex | ] |
|
7108 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
7109 |
^ self |
|
7110 |
]. |
|
7111 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
7112 |
varIdx ~~ 0 ifTrue:[ |
|
7113 |
Error |
|
7114 |
handle:[:ex | ] |
|
7115 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
7116 |
^ self |
|
7117 |
]. |
|
7118 |
]. |
|
7119 |
]. |
|
7120 |
parentNode := parentNode parent. |
|
8212 | 7121 |
]. |
8214 | 7122 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 7123 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
7124 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 7125 |
! ! |
7126 |
||
7127 |
!DebugView methodsFor:'private queries'! |
|
7128 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7129 |
canBrowseClassHierarchy |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7130 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7131 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7132 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7133 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7134 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7135 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7136 |
canBrowseFullClassProtocol |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7137 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7138 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7139 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7140 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7141 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7142 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7143 |
canBrowseImplementingClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7144 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7145 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7146 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7147 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7148 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7149 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7150 |
canBrowseProcessesApplication |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7151 |
|p| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7152 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7153 |
p := inspectedProcess ? Processor activeProcess. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7154 |
p isNil ifTrue:[^ false]. |
14430 | 7155 |
^ p isGUIProcess and:[self processesApplication notNil ]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7156 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7157 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7158 |
canBrowseReceiversClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7159 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7160 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7161 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7162 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7163 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7164 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7165 |
canCloseAllDebuggers |
15413 | 7166 |
self class allInstancesDo:[:debugger | |
7167 |
debugger ~~ self ifTrue:[ |
|
7168 |
debugger busy ifTrue:[^ true]. |
|
7169 |
] |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7170 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7171 |
^ false |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7172 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7173 |
"Created: / 23-03-2012 / 12:40:18 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7174 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7175 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7176 |
canDefineMethod |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7177 |
^ defineButton isVisible |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7178 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7179 |
|
12840 | 7180 |
canInspectWidgetHierarchy |
7181 |
|rcvr| |
|
7182 |
||
7183 |
^ selectedContext notNil |
|
7184 |
and:[ (rcvr := selectedContext receiver) isView |
|
15413 | 7185 |
or:[ rcvr isKindOf: ApplicationModel ]] |
12840 | 7186 |
! |
7187 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7188 |
canRestart |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7189 |
^ restartButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7190 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7191 |
"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
|
7192 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7193 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7194 |
canReturn |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7195 |
^ returnButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7196 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7197 |
"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
|
7198 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7199 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7200 |
canSendEmail |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7201 |
^ SendMailTool notNil |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7202 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7203 |
"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
|
7204 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7205 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7206 |
canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7207 |
^ canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7208 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7209 |
|
15255 | 7210 |
hasBlockContextSelected |
7211 |
^ contextView hasSelection |
|
7212 |
and:[ self selectedContext isBlockContext ] |
|
7213 |
! |
|
7214 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7215 |
hasContextSelected |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7216 |
^ contextView hasSelection |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7217 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7218 |
"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
|
7219 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7220 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7221 |
hasHaltsToIgnore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7222 |
^ IgnoredHalts notEmptyOrNil |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7223 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7224 |
|
7823 | 7225 |
isAborting |
7226 |
^ exitAction == #abort |
|
7227 |
! |
|
7228 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7229 |
isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7230 |
^ isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7231 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7232 |
"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
|
7233 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7234 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7235 |
isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7236 |
^ isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7237 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7238 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7239 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7240 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7241 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7242 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7243 |
selectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7244 |
|con mthd| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7245 |
|
11595 | 7246 |
(con := self selectedContext) notNil ifTrue:[ |
15413 | 7247 |
mthd := con method. |
7248 |
^ mthd notNil and:[mthd isWrapped] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7249 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7250 |
^ false. |
11595 | 7251 |
|
11610 | 7252 |
"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
|
7253 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7254 |
|
7823 | 7255 |
setOfHiddenCallingSelectors |
7256 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
7257 |
! |
|
7258 |
||
7259 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
7260 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
7261 |
! ! |
|
7262 |
||
9922 | 7263 |
!DebugView methodsFor:'private-breakpoints'! |
7264 |
||
15413 | 7265 |
addIgnoredHaltForCount:countOrNil |
7266 |
orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7267 |
orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess |
|
7268 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
7269 |
forAll:aBoolean |
|
14608 | 7270 |
|
12937 | 7271 |
|haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil| |
9922 | 7272 |
|
7273 |
aBoolean ifTrue:[ |
|
15413 | 7274 |
haltingMethod := #all |
9922 | 7275 |
] ifFalse:[ |
15413 | 7276 |
haltingContext := self findHaltingContext. |
7277 |
haltingContext isNil ifTrue:[ |
|
7278 |
Transcript showCR:'no halting context found'. |
|
7279 |
^ self |
|
7280 |
]. |
|
7281 |
||
7282 |
haltingMethod := haltingContext method. |
|
7283 |
lineNrOfHalt := haltingContext lineNumber. |
|
7284 |
(lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ |
|
7285 |
Transcript showCR:'no halt lineNr found'. |
|
7286 |
^ self |
|
7287 |
]. |
|
7288 |
forThisReceiverClass ifTrue:[ |
|
7289 |
receiverClassOrNil := haltingContext receiver class |
|
7290 |
]. |
|
7291 |
forCurrentProcess ifTrue:[ |
|
7292 |
processOrNil := Processor activeProcess |
|
7293 |
]. |
|
9922 | 7294 |
]. |
7295 |
||
7296 |
self class |
|
15413 | 7297 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
7298 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7299 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
7300 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
11210 | 7301 |
|
7302 |
"Created: / 27-01-2012 / 11:31:12 / cg" |
|
9922 | 7303 |
! |
7304 |
||
7305 |
canAddBreakpoint |
|
7306 |
|m| |
|
7307 |
||
7308 |
m := contextView middleButtonMenu. |
|
7309 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
7310 |
! |
|
7311 |
||
7312 |
canRemoveBreakpoint |
|
7313 |
|m| |
|
7314 |
||
7315 |
m := contextView middleButtonMenu. |
|
7316 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
7317 |
! |
|
7318 |
||
7319 |
findHaltingContext |
|
7320 |
|haltSelectors| |
|
7321 |
||
7322 |
haltSelectors := self haltSelectors. |
|
7323 |
||
10205 | 7324 |
contextArray keysAndValuesDo:[:idx :con | |
15413 | 7325 |
|sel con2 sel2 method| |
7326 |
||
7327 |
sel := con selector. |
|
7328 |
(haltSelectors includes:sel) ifTrue:[ |
|
7329 |
(method := con method) notNil ifTrue:[ |
|
7330 |
method mclass == Object ifTrue:[ |
|
7331 |
con2 := contextArray at:idx+1. |
|
7332 |
sel2 := con2 selector. |
|
7333 |
(haltSelectors includes:sel2) ifTrue:[ |
|
7334 |
con2 method mclass == Object ifTrue:[ |
|
7335 |
^ contextArray at:idx+2. |
|
7336 |
] |
|
7337 |
]. |
|
7338 |
^ contextArray at:idx+1 |
|
7339 |
]. |
|
7340 |
method mclass == Breakpoint ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7341 |
(contextArray at:idx+1) infoPrintCR. |
15413 | 7342 |
^ contextArray at:idx+1 |
7343 |
]. |
|
7344 |
]. |
|
7345 |
]. |
|
7346 |
con method isWrapped ifTrue:[ |
|
7347 |
^ con |
|
7348 |
]. |
|
9922 | 7349 |
]. |
7350 |
^ nil |
|
7351 |
||
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7352 |
"Modified: / 27-01-2012 / 11:06:02 / cg" |
9922 | 7353 |
! |
7354 |
||
7355 |
ignoreBreakpoints |
|
7356 |
^ ignoreBreakpoints |
|
7357 |
||
7358 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
7359 |
! ! |
|
7360 |
||
7823 | 7361 |
!DebugView methodsFor:'private-cache handling'! |
7362 |
||
7363 |
cacheMyself |
|
7364 |
"remember myself for next debug session" |
|
7365 |
||
7366 |
"caching the last debugger will make the next debugger appear |
|
7367 |
faster, since no resources have to be allocated in the display. |
|
7368 |
We have to be careful to release all refs to the debuggee, though. |
|
7369 |
Otherwise, the GC will not be able to release it." |
|
7370 |
||
7371 |
windowGroup notNil ifTrue:[ |
|
16253 | 7372 |
windowGroup setProcess:nil. |
7823 | 7373 |
]. |
7374 |
||
7375 |
self releaseDebuggee. |
|
7376 |
||
7377 |
cachable ~~ true ifTrue:[^ self]. |
|
7378 |
||
7379 |
"/ |
|
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
7380 |
"/ only cache if I am on the Display (i.e. the default screen) |
7823 | 7381 |
"/ |
16253 | 7382 |
device == Display ifTrue:[ |
7383 |
exclusive ifTrue:[ |
|
7384 |
CachedExclusive := self |
|
7385 |
] ifFalse:[ |
|
7386 |
CachedDebugger := self |
|
7387 |
]. |
|
7823 | 7388 |
]. |
7389 |
||
7390 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
16253 | 7391 |
ObjectMemory stepInterruptHandler:nil |
7823 | 7392 |
]. |
7393 |
||
7394 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
7395 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
7396 |
! |
|
7397 |
||
7398 |
isCached |
|
13226 | 7399 |
"tell whether we are a cached debugger" |
7823 | 7400 |
|
7401 |
CachedExclusive == self ifTrue:[ |
|
15413 | 7402 |
^ true. |
7823 | 7403 |
]. |
7404 |
CachedDebugger == self ifTrue:[ |
|
15413 | 7405 |
^ true. |
7823 | 7406 |
]. |
7407 |
||
7408 |
^ false. |
|
7409 |
||
13226 | 7410 |
"Created: / 10-07-1997 / 15:22:43 / stefan" |
7411 |
"Modified (comment): / 27-07-2013 / 15:38:47 / cg" |
|
7823 | 7412 |
! |
7413 |
||
7414 |
uncacheMyself |
|
7415 |
"do not remember myself any longer for next debug session" |
|
7416 |
||
7417 |
cachable := false. |
|
7418 |
||
7419 |
CachedExclusive == self ifTrue:[ |
|
15413 | 7420 |
CachedExclusive := nil. |
7823 | 7421 |
]. |
7422 |
CachedDebugger == self ifTrue:[ |
|
15413 | 7423 |
CachedDebugger := nil. |
7823 | 7424 |
]. |
7425 |
OpenDebuggers notNil ifTrue:[ |
|
15413 | 7426 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 7427 |
]. |
7428 |
||
7429 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
7430 |
! ! |
|
7431 |
||
10628 | 7432 |
!DebugView methodsFor:'private-code view'! |
7433 |
||
7434 |
codeAspect |
|
11704 | 7435 |
^ SyntaxHighlighter codeAspectMethod |
10628 | 7436 |
|
7437 |
"Created: / 27-07-2011 / 13:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11704 | 7438 |
"Modified: / 27-07-2012 / 22:20:27 / cg" |
10628 | 7439 |
! ! |
7440 |
||
7823 | 7441 |
!DebugView methodsFor:'private-context handling'! |
7442 |
||
11391 | 7443 |
contextListEntryFor:aContext |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7444 |
^ Error |
16501 | 7445 |
handle:[:ex | '???' ] |
7446 |
do:[ |
|
7447 |
|s| |
|
7448 |
||
7449 |
aContext selector == #doIt ifTrue:[ |
|
7450 |
aContext receiver isNil ifTrue:[ |
|
7451 |
s := 'doIt' allBold |
|
7452 |
] |
|
7453 |
]. |
|
7454 |
||
7455 |
s := Text streamContents:[:s | aContext printOn:s ]. |
|
7456 |
RememberedCallChain notNil ifTrue:[ |
|
7457 |
(RememberedCallChain includesIdentical:aContext) ifTrue:[ |
|
7458 |
s := s withColor:#red. |
|
7459 |
]. |
|
7460 |
]. |
|
7461 |
s |
|
7462 |
]. |
|
11391 | 7463 |
|
7464 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
7465 |
! |
|
7466 |
||
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7467 |
is:aHomeContext inCallingChainOf:aContext |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7468 |
|con| |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7469 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7470 |
con := aContext. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7471 |
[con notNil and:[con ~~ aHomeContext]] whileTrue:[ |
15413 | 7472 |
con := con sender |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7473 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7474 |
^ con notNil |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7475 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7476 |
"Created: / 10-06-2012 / 18:46:29 / cg" |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7477 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7478 |
|
11890 | 7479 |
isEnteredDueToBreakpointOrHalt |
7480 |
"see if we came here due to a step interrupt" |
|
7481 |
||
7482 |
|c cReceiver| |
|
7483 |
||
7484 |
"/ look for a breakpoint-wrapper's context |
|
7485 |
c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil. |
|
7486 |
c isNil ifTrue:[ |
|
15413 | 7487 |
^ true. |
11890 | 7488 |
]. |
7489 |
cReceiver := c receiver. |
|
7490 |
^ cReceiver == BreakPointInterrupt |
|
13293 | 7491 |
|
7492 |
"Modified: / 01-08-2013 / 23:34:01 / cg" |
|
11890 | 7493 |
! |
7494 |
||
7495 |
isHaltToBeIgnored |
|
7496 |
"see if the current halt (if any) is in the ignore-list" |
|
7497 |
||
13059 | 7498 |
|c cReceiver sender haltingMethod lineNrInHaltingMethod breakpointParameter |
7499 |
sReceiver| |
|
11890 | 7500 |
|
7501 |
"/ should a halt be ignored ? |
|
7502 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
7503 |
||
13059 | 7504 |
"/ look for a method breakpoint-wrapper's context |
11890 | 7505 |
c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
7506 |
c notNil ifTrue:[ |
|
15413 | 7507 |
((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[ |
7508 |
c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
|
7509 |
cReceiver := c receiver. |
|
7510 |
]. |
|
7511 |
(cReceiver isKindOf:BreakPointInterrupt) ifFalse:[ |
|
7512 |
c := nil |
|
7513 |
] ifTrue:[ |
|
7514 |
[ |
|
7515 |
sender := c sender. |
|
7516 |
((sReceiver := sender receiver) isKindOf:BreakPointInterrupt) |
|
7517 |
or:[ sReceiver == BreakPointInterrupt ] |
|
7518 |
] whileTrue:[ |
|
7519 |
c := sender |
|
7520 |
]. |
|
7521 |
[ (sender := c sender) isBlockContext ] whileTrue:[ |
|
7522 |
c := sender |
|
7523 |
]. |
|
7524 |
sender := nil. "/ avoid keeping a reference to this context |
|
7525 |
]. |
|
11890 | 7526 |
]. |
14993 | 7527 |
"/ Transcript showCR:c. |
11890 | 7528 |
c isNil ifTrue:[ |
15413 | 7529 |
"/ look for halts or explicit breakpoints |
7530 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
7531 |
c isNil ifTrue:[ |
|
7532 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
7533 |
c isNil ifTrue:[ |
|
7534 |
^ false |
|
7535 |
]. |
|
7536 |
breakpointParameter := c argAt:1. |
|
7537 |
(self class |
|
7538 |
isBreakpointToBeIgnoredForParameter:breakpointParameter |
|
7539 |
context:(c sender) |
|
7540 |
modifyEntryCount:true |
|
7541 |
) ifTrue:[ |
|
7542 |
^ true. |
|
7543 |
]. |
|
7544 |
]. |
|
11890 | 7545 |
]. |
7546 |
||
7547 |
c := c sender. |
|
7548 |
"/ a code-breakpoint ? |
|
7549 |
(c receiver isKindOf:Breakpoint) ifTrue:[ |
|
15413 | 7550 |
c := c sender. |
11890 | 7551 |
]. |
7552 |
haltingMethod := c method. |
|
7553 |
||
7554 |
haltingMethod isWrapped ifTrue:[ |
|
15413 | 7555 |
lineNrInHaltingMethod := 1. |
11890 | 7556 |
] ifFalse:[ |
15413 | 7557 |
lineNrInHaltingMethod := c lineNumber. |
7558 |
"/ Transcript showCR:c. |
|
11890 | 7559 |
]. |
7560 |
||
12562 | 7561 |
^ self class |
15413 | 7562 |
isHaltToBeIgnoredIn:haltingMethod |
7563 |
atLineNr:lineNrInHaltingMethod |
|
7564 |
context:c |
|
7565 |
modifyEntryCount:true. |
|
11890 | 7566 |
|
7567 |
"Created: / 22-10-2010 / 12:09:53 / cg" |
|
7568 |
"Modified: / 06-03-2012 / 12:54:09 / cg" |
|
7569 |
! |
|
7570 |
||
266 | 7571 |
setContext:aContext |
7572 |
"show calling chain from aContext in the walk-back listview" |
|
7573 |
||
641 | 7574 |
^ 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
|
7575 |
|
641 | 7576 |
"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
|
7577 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7578 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7579 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
7580 |
"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
|
7581 |
Most complications here arise from filtering less-interesting contexts |
15256 | 7582 |
if not in verbose-context mode or when hiding implementation contexts. |
15413 | 7583 |
There is a lot of heuristic magic here, to make the debugger as useful |
15256 | 7584 |
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
|
7585 |
|
14531 | 7586 |
|con sel text method caller caller2 called called2 m count c cc sndr |
14523 | 7587 |
suspendContext calledBySuspendContext nm h calledContext show2 |
15257 | 7588 |
alreadyInApplicationCode verboseBacktrace| |
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7589 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7590 |
"/ (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7591 |
"/ "no change" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7592 |
"/ ^ false |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7593 |
"/ ]. |
266 | 7594 |
|
14523 | 7595 |
isStoppedAtHaltOrBreakPoint := isStoppedAtBreakPointWithParameter := false. |
7596 |
isStoppedInModalDialog := isStoppedInApplicationAction := alreadyInApplicationCode := false. |
|
14531 | 7597 |
isStoppedAtStatementBreakpoint := false. |
939 | 7598 |
firstContext := aContext. |
15257 | 7599 |
verboseBacktrace := self verboseBacktraceHolder value. |
939 | 7600 |
|
266 | 7601 |
m := contextView middleButtonMenu. |
7602 |
m notNil ifTrue:[ |
|
15497 | 7603 |
m disable:#showMore. |
266 | 7604 |
]. |
3269 | 7605 |
canShowMore := false. |
266 | 7606 |
|
7607 |
aContext isNil ifTrue:[ |
|
15497 | 7608 |
text := Array with:'** no context **'. |
7609 |
contextArray := nil. |
|
266 | 7610 |
] ifFalse:[ |
15497 | 7611 |
text := OrderedCollection new:nChainShown. |
7612 |
contextArray := OrderedCollection new:nChainShown. |
|
7613 |
||
7614 |
con := aContext. |
|
7615 |
calledContext := nil. |
|
7616 |
||
7617 |
DebuggingContextWalk == true ifTrue:[ |
|
7618 |
'======================================' print. con printCR. |
|
7619 |
]. |
|
7620 |
alreadyInApplicationCode := |
|
7621 |
con receiver isLazyValue not "/ careful to not force futures/lazy values |
|
7622 |
and:[con receiver isKindOf:ApplicationModel]. |
|
7623 |
||
7624 |
verboseBacktrace ~~ true ifTrue:[ |
|
7625 |
"/ with dense backtrace, hide the ProcessorScheduler |
|
7626 |
"/ contexts at the top; look for a Process>>suspend* |
|
7627 |
"/ context within the first 10 contexts |
|
7628 |
||
7629 |
suspendContext := nil. |
|
7630 |
c := con. |
|
7631 |
1 to:10 do:[:i | |
|
7632 |
|selector| |
|
7633 |
||
7634 |
c notNil ifTrue:[ |
|
7635 |
selector := c selector. |
|
7636 |
selector notNil ifTrue:[ |
|
7637 |
(selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[ |
|
7638 |
suspendContext := c. |
|
7639 |
calledBySuspendContext := cc. |
|
7640 |
]. |
|
7641 |
]. |
|
7642 |
cc := c. |
|
7643 |
c := c sender. |
|
7644 |
] |
|
7645 |
]. |
|
7646 |
suspendContext notNil ifTrue:[ |
|
7647 |
con := suspendContext. |
|
7648 |
calledContext := calledBySuspendContext. |
|
7649 |
suspendContext := nil |
|
7650 |
]. |
|
7651 |
]. |
|
7652 |
"/ Transcript show:'1 '; showCR:con. |
|
7653 |
con notNil ifTrue:[ |
|
7654 |
"/ hide the halt implementation |
|
7655 |
sel := con selector. |
|
7656 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7657 |
(method := con method) notNil ifTrue:[ |
|
7658 |
method mclass == Object ifTrue:[ |
|
7659 |
(sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[ |
|
7660 |
isStoppedAtBreakPointWithParameter := true. |
|
7661 |
breakPointParameter := con argAt:1. |
|
7662 |
]. |
|
7663 |
isStoppedAtHaltOrBreakPoint := true. |
|
7664 |
verboseBacktrace ~~ true ifTrue:[ |
|
7665 |
calledContext := con. |
|
7666 |
con := con sender. |
|
7667 |
] |
|
7668 |
] ifFalse:[ |
|
7669 |
method mclass == Breakpoint ifTrue:[ |
|
7670 |
isStoppedAtHaltOrBreakPoint := true. |
|
7671 |
isStoppedAtStatementBreakpoint := true. |
|
7672 |
verboseBacktrace ~~ true ifTrue:[ |
|
7673 |
calledContext := con. |
|
7674 |
con := con sender. |
|
7675 |
]. |
|
7676 |
"/ Transcript show:'2 '; showCR:con. |
|
7677 |
]. |
|
7678 |
]. |
|
7679 |
]. |
|
7680 |
]. |
|
7681 |
]. |
|
7682 |
||
7683 |
(verboseBacktrace not or:[ hideSupportCode]) ifTrue:[ |
|
7684 |
[ |
|
7685 |
con notNil |
|
7686 |
and:[ con isBlockContext not |
|
7687 |
and:[ con method notNil |
|
7688 |
and:[ (con method shouldBeSkippedInDebuggersWalkBack) |
|
7689 |
and:[ (self haltSelectors includes: con selector) not]]]] |
|
7690 |
] whileTrue:[ |
|
7691 |
"/ Transcript show:'xx '; showCR:con. |
|
7692 |
calledContext := con. |
|
7693 |
con := con sender |
|
7694 |
]. |
|
7695 |
]. |
|
7696 |
||
7697 |
" |
|
7698 |
get them all, by walking along the caller chain. |
|
7699 |
depending on the settings, skip some intermediate contexts |
|
7700 |
(such as collection enumeration implementations), which are usually not |
|
7701 |
of interest when debugging an application. |
|
7702 |
On the fly, gather some additional information |
|
7703 |
such as: are we at a halt/breakpoint, are we in a modal dialog opened, |
|
7704 |
are we coming from an application model's action etc. |
|
7705 |
" |
|
7706 |
count := 0. |
|
7707 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
|
7708 |
"/ remember any halt/breakpoint or openModal on the fly |
|
7709 |
DebuggingContextWalk == true ifTrue:[ '---' print. con printCR ]. |
|
7710 |
||
7711 |
sel := con selector. |
|
7712 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7713 |
(method := con method) notNil ifTrue:[ |
|
7714 |
method mclass == Object ifTrue:[ |
|
7715 |
(sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[ |
|
7716 |
isStoppedAtBreakPointWithParameter := true. |
|
7717 |
breakPointParameter := con argAt:1. |
|
7718 |
]. |
|
7719 |
isStoppedAtHaltOrBreakPoint := true. |
|
7720 |
] ifFalse:[ |
|
7721 |
method mclass == Breakpoint ifTrue:[ |
|
7722 |
isStoppedAtHaltOrBreakPoint := true. |
|
7723 |
]. |
|
7724 |
] |
|
7725 |
] |
|
7726 |
] ifFalse:[ |
|
7727 |
((sel == #openModal) or:[sel == #openModal:]) ifTrue:[ |
|
7728 |
isStoppedInModalDialog := true. |
|
7729 |
] ifFalse:[ |
|
7730 |
alreadyInApplicationCode ifFalse:[ |
|
7731 |
(con receiver isLazyValue not "/ careful to not force futures/lazy values |
|
7732 |
and:[con receiver isKindOf:ApplicationModel]) ifTrue:[ |
|
7733 |
isStoppedInApplicationAction := true. |
|
7734 |
] |
|
7735 |
] |
|
7736 |
] |
|
7737 |
]. |
|
7738 |
||
7739 |
[ |
|
7740 |
|show1| |
|
7741 |
||
7742 |
show1 := self showingContext1:con calling:calledContext. |
|
7743 |
DebuggingDebugger3 == true ifTrue:[ |
|
7744 |
'showingContext1: (' print. con print. ') --> ' print. show1 printCR. |
|
7745 |
]. |
|
7746 |
show1 |
|
7747 |
] whileFalse:[ |
|
7748 |
calledContext := con. |
|
7749 |
con := con sender. |
|
7750 |
]. |
|
7751 |
||
7752 |
show2 := self showingContext2:con nesting:count. |
|
7753 |
DebuggingDebugger3 == true ifTrue:[ |
|
7754 |
'showingContext2: (' print. con print. ') --> ' print. show2 printCR. |
|
7755 |
]. |
|
7756 |
||
7757 |
show2 ifTrue:[ |
|
7758 |
contextArray add:con. |
|
7759 |
||
7760 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
7761 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
7762 |
] ifFalse:[ |
|
7763 |
nm := self contextListEntryFor:con. |
|
7764 |
]. |
|
7765 |
text add:nm. |
|
7766 |
count := count + 1. |
|
7767 |
]. |
|
7768 |
||
7769 |
"/ with hidden support code, skip over internals of exceptions |
|
7770 |
hideSupportCode == true ifTrue:[ |
|
7771 |
"/ Transcript showCR:'x'. |
|
7772 |
(con isBlockContext |
|
7773 |
and:[ (h := con home) notNil |
|
7774 |
and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[ |
|
7775 |
|blocksReceiver| |
|
7776 |
blocksReceiver := con receiver. |
|
7777 |
c := con sender. |
|
7778 |
[ |
|
7779 |
c notNil |
|
7780 |
and:[ |
|
7781 |
sndr := c sender. |
|
7782 |
(sndr ~= h) |
|
7783 |
and:[ |
|
7784 |
blocksReceiver isCollection "/ skip collection implementations |
|
7785 |
or:[ ( #( #'handle:do:' "/ skip exception implementations |
|
7786 |
#'handleDo:' |
|
7787 |
#'answer:do:' |
|
7788 |
#'ensure:' ) includes: c selector ) |
|
7789 |
or:[ #'perform:*' "/ skip perform implementations |
|
7790 |
match: c selector ]] |
|
7791 |
] |
|
7792 |
] |
|
7793 |
] whileTrue:[ |
|
7794 |
c := sndr |
|
7795 |
]. |
|
7796 |
c notNil ifTrue:[ |
|
7797 |
con := c "sender". |
|
7798 |
]. |
|
7799 |
]. |
|
7800 |
]. |
|
7801 |
||
7802 |
"/ |
|
7803 |
"/ kludge: if it's a wrapped method, then hide the wrap-call |
|
7804 |
"/ |
|
7805 |
method := con method. |
|
7806 |
method notNil ifTrue:[ |
|
7807 |
called := con. |
|
7808 |
caller := con sender. |
|
7809 |
(caller notNil and:[caller receiver == method]) ifTrue:[ |
|
7810 |
called2 := caller. |
|
7811 |
caller2 := caller sender. |
|
7812 |
caller2 notNil ifTrue:[ |
|
7813 |
(caller2 method isWrapped |
|
7814 |
and:[ caller2 method originalMethod == method ]) ifTrue:[ |
|
7815 |
calledContext := called2. |
|
7816 |
con := caller2 |
|
7817 |
]. |
|
7818 |
]. |
|
7819 |
||
7820 |
]. |
|
7821 |
caller := caller2 := nil |
|
7822 |
]. |
|
7823 |
||
7824 |
"/ with dense backtrace, skip the doIt method's context |
|
7825 |
"/ (its dummy anyway) and fake that context's name |
|
7826 |
||
7827 |
verboseBacktrace ~~ true ifTrue:[ |
|
7828 |
(con isBlockContext |
|
7829 |
and:[(h := con home) == con sender |
|
7830 |
and:[h notNil |
|
7831 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
|
7832 |
and:[h method who isNil]]]]) ifTrue:[ |
|
7833 |
calledContext := con. |
|
7834 |
con := con sender. |
|
7835 |
text removeLast. |
|
7836 |
||
7837 |
text add:(self contextListEntryFor:con methodHome). |
|
7838 |
]. |
|
7839 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
|
7840 |
]. |
|
7841 |
||
7842 |
"/ with dense backtrace, don't show contexts below the doIt |
|
7843 |
( verboseBacktrace ~~ true |
|
7844 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
|
7845 |
con := nil. |
|
7846 |
] ifFalse:[ |
|
7847 |
calledContext := con. |
|
7848 |
con := con sender |
|
7849 |
]. |
|
7850 |
]. |
|
7851 |
||
7852 |
" |
|
7853 |
did we reach the end ? |
|
7854 |
" |
|
7855 |
(con isNil or:[con sender isNil]) ifTrue:[ |
|
7856 |
||
7857 |
"/ the very last one is the startup context |
|
7858 |
"/ (in main) - it has nil as receiver and nil as selector |
|
7859 |
||
7860 |
(contextArray notEmpty |
|
7861 |
and:[contextArray last selector isNil]) ifTrue:[ |
|
7862 |
contextArray removeLast. |
|
7863 |
text removeLast |
|
7864 |
]. |
|
7865 |
||
7866 |
verboseBacktrace ~~ true ifTrue:[ |
|
7867 |
"/ in dense mode, remove process startup contexts (if any) |
|
7868 |
||
7869 |
(contextArray size > 0 |
|
7870 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
7871 |
con selector == #start ifTrue:[ |
|
7872 |
contextArray removeLast. |
|
7873 |
text removeLast. |
|
7874 |
||
7875 |
[contextArray size > 0 |
|
7876 |
and:[contextArray last methodHome == con]] whileTrue:[ |
|
7877 |
contextArray removeLast. |
|
7878 |
text removeLast. |
|
7879 |
] |
|
7880 |
] |
|
7881 |
] |
|
7882 |
] |
|
7883 |
] ifFalse:[ |
|
7884 |
m notNil ifTrue:[ |
|
7885 |
m enable:#showMore. |
|
7886 |
]. |
|
7887 |
canShowMore := true. |
|
7888 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
|
7889 |
]. |
|
266 | 7890 |
]. |
7891 |
||
7892 |
contextView setList:text. |
|
944 | 7893 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7894 |
releaseInspectors ifTrue:[ |
15497 | 7895 |
receiverInspector release. |
7896 |
contextInspector release. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7897 |
]. |
266 | 7898 |
|
7899 |
m notNil ifTrue:[ |
|
15497 | 7900 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 7901 |
]. |
3511 | 7902 |
self updateMenuItems. |
266 | 7903 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7904 |
|
7797 | 7905 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7906 |
"Modified: / 27-07-2012 / 15:10:53 / cg" |
266 | 7907 |
! |
7908 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7909 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7910 |
"show calling chain from aContext in the walk-back listview. |
1213 | 7911 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7912 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7913 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7914 |
|
8152 | 7915 |
con := aContext. |
15257 | 7916 |
self verboseBacktraceHolder value ifFalse:[ |
15413 | 7917 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
7918 |
con := con sender. |
|
7919 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
7920 |
con := con sender. |
|
7921 |
]. |
|
7922 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7923 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7924 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7925 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7926 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7927 |
"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
|
7928 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7929 |
|
3447 | 7930 |
showingContext1:aContext calling:calledContext |
7823 | 7931 |
"return false, if this (top) context is to be skipped. |
10205 | 7932 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 7933 |
the set of methods which are suppressed is my (claus's) own choice." |
7934 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7935 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 7936 |
|
15257 | 7937 |
self verboseBacktraceHolder value ifTrue:[ ^true ]. |
3447 | 7938 |
aContext isNil ifTrue:[ ^true ]. |
7939 |
||
7940 |
sel := aContext selector. |
|
7941 |
rec := aContext receiver. |
|
7942 |
mthd := aContext method. |
|
7943 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
7944 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7945 |
"/ to avoid firing/waiting the lazy or future |
10205 | 7946 |
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
|
7947 |
aContext sender notNil ifTrue:[ |
15413 | 7948 |
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
|
7949 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7950 |
|
11636 | 7951 |
DebuggingDebugger3 == true ifTrue:[ |
15413 | 7952 |
'showingContext1: (' print. aContext print. |
7953 |
') calling: (' print. calledContext print. |
|
7954 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7955 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7956 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7957 |
(#(doCallHandler: doRaise |
3447 | 7958 |
) includes:sel) |
15413 | 7959 |
ifTrue:[ |
7960 |
recIsException ifTrue:[ ^ false]. |
|
7961 |
]. |
|
3447 | 7962 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7963 |
(#(raise raiseRequest |
3447 | 7964 |
) includes:sel) |
15413 | 7965 |
ifTrue:[ |
7966 |
recIsException ifTrue:[ |
|
7967 |
(senderRec isLazyValue not |
|
7968 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
7969 |
]. |
|
7970 |
]. |
|
3447 | 7971 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7972 |
(#(doWhile: |
3447 | 7973 |
) includes:sel) |
15413 | 7974 |
ifTrue:[ |
7975 |
rec isBlock ifTrue:[ |
|
7976 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
7977 |
]. |
|
7978 |
]. |
|
3447 | 7979 |
|
8620 | 7980 |
calledContext notNil ifTrue:[ |
15413 | 7981 |
calledSel := calledContext selector. |
7982 |
calledRec := calledContext receiver. |
|
7983 |
||
7984 |
calledRec isBlock ifTrue:[ |
|
7985 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
7986 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
7987 |
]. |
|
7988 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
7989 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8620 | 7990 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7991 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7992 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7993 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7994 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7995 |
"/ |
10205 | 7996 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7997 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7998 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7999 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8000 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8001 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8002 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8003 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8004 |
"/ ]. |
8620 | 8005 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8006 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8007 |
(#(handleDo:) includes:sel) |
15413 | 8008 |
ifTrue:[ |
8009 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
8010 |
]. |
|
10205 | 8011 |
(#( |
15413 | 8012 |
withCursor:do: |
8013 |
withWaitCursorDo: |
|
8014 |
withReadCursorDo: |
|
8015 |
withWriteCursorDo: |
|
8016 |
withSearchCursorDo: |
|
3447 | 8017 |
) includes:sel) |
15413 | 8018 |
ifTrue:[ |
8019 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
8020 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
8021 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
8022 |
]. |
|
10205 | 8023 |
|
8024 |
(#( |
|
15413 | 8025 |
wait |
8026 |
waitWithTimeout: |
|
8027 |
waitWithTimeoutMs: |
|
3447 | 8028 |
) includes:sel) |
15413 | 8029 |
ifTrue:[ |
8030 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
8031 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
8032 |
]. |
|
3447 | 8033 |
|
8034 |
^ true |
|
8035 |
||
9662 | 8036 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
11696 | 8037 |
"Modified: / 27-07-2012 / 17:30:18 / cg" |
3447 | 8038 |
! |
8039 |
||
8040 |
showingContext2:aContext nesting:nesting |
|
7823 | 8041 |
"return false, if this (intermediate) context is to be skipped. |
13455 | 8042 |
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
|
8043 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 8044 |
|
10205 | 8045 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8046 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8047 |
|
15257 | 8048 |
self verboseBacktraceHolder value ifTrue:[^ true]. |
3447 | 8049 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8050 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8051 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8052 |
sel := aContext selector. |
939 | 8053 |
mClass := aContext methodClass. |
8054 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8055 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8056 |
sender notNil ifTrue:[ |
15413 | 8057 |
senderSelector := sender selector. |
8058 |
senderReceiver := sender receiver. |
|
8059 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8060 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8061 |
|
939 | 8062 |
sel == #withCursor:do: ifTrue:[ |
15413 | 8063 |
(mClass == WindowGroup) ifTrue:[^ false]. |
8064 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 8065 |
]. |
8066 |
(sel == #withExecuteCursorDo: |
|
8067 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
15413 | 8068 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 8069 |
]. |
8070 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
8071 |
(sel == #do: |
6600 | 8072 |
or:[sel == #from:to:do: |
6601 | 8073 |
or:[sel == #keysAndValuesDo: |
8074 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
15413 | 8075 |
mClass == Array ifTrue:[^ false]. |
8076 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
8077 |
mClass == Set ifTrue:[^ false]. |
|
8078 |
mClass == Dictionary ifTrue:[^ false]. |
|
8079 |
mClass == Interval ifTrue:[^ false]. |
|
10205 | 8080 |
]. |
8081 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8082 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8083 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8084 |
or:[sel == #perform:with:with:with: |
11696 | 8085 |
or:[sel == #perform:with:with:with:with: |
8086 |
or:[sel == #perform:withArguments: |
|
8087 |
or:[sel == #perform:with:ifNotUnderstood: |
|
8088 |
or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]) |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8089 |
ifTrue:[ |
15413 | 8090 |
hideSupportCode == true ifTrue:[ |
8091 |
"/ 'x' printCR. |
|
8092 |
mClass == Object ifTrue:[^ false] |
|
8093 |
]. |
|
8094 |
nesting == 0 ifTrue:[^ true]. |
|
8095 |
mClass == Array ifTrue:[^ false]. |
|
8096 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8097 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8098 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8099 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8100 |
|
939 | 8101 |
(mClass == Object) ifTrue:[ |
15413 | 8102 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 8103 |
]. |
8104 |
||
8105 |
(mClass == Method) ifTrue:[ |
|
15413 | 8106 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 8107 |
]. |
8108 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8109 |
(mClass == SmallInteger) ifTrue:[ |
15413 | 8110 |
(sel == #to:do:) ifTrue:[^ false]. |
8111 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8112 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8113 |
|
939 | 8114 |
(mClass == Block) ifTrue:[ |
15413 | 8115 |
sel == #ensure: ifTrue:[^ false]. |
8116 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
8117 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
8118 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
8119 |
sel == #on:do: ifTrue:[^ false]. |
|
8120 |
||
8121 |
sel == #value ifTrue:[^ false]. |
|
8122 |
sel == #value: ifTrue:[^ false]. |
|
8123 |
sel == #value:value: ifTrue:[^ false]. |
|
8124 |
sel == #value:value:value: ifTrue:[^ false]. |
|
8125 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
8126 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
8127 |
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
|
8128 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8129 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8130 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8131 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8132 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8133 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8134 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8135 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8136 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8137 |
"/ 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
|
8138 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8139 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8140 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8141 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8142 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8143 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8144 |
|
15413 | 8145 |
aContext home notNil ifTrue:[ |
8146 |
aContext home receiver isLazyValue ifFalse:[ |
|
8147 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
|
8148 |
(aContext home selector == #wait) ifTrue:[^ false]. |
|
8149 |
(aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
8150 |
] |
|
8151 |
] |
|
8152 |
] |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8153 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8154 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8155 |
(rec isExceptionHandler) ifTrue:[ |
15413 | 8156 |
sel == #handle:do: ifTrue:[^ false]. |
8157 |
sel == #handleDo: ifTrue:[^ false]. |
|
8158 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
8159 |
sel == #answer:do: ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8160 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
8161 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
15413 | 8162 |
sel == #doRaise ifTrue:[^ false]. |
8163 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
8164 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
8165 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
8166 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8167 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8168 |
(mClass == Context) ifTrue:[ |
15413 | 8169 |
sel == #unwind ifTrue:[^ false]. |
8170 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8171 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8172 |
(mClass == ProcessorScheduler) ifTrue:[ |
15413 | 8173 |
sel == #interruptActive ifTrue:[^ false]. |
8174 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
8175 |
sel == #suspend: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8176 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8177 |
mClass == Process ifTrue:[ |
15413 | 8178 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8179 |
]. |
15256 | 8180 |
(sel == #break) ifTrue:[ |
15413 | 8181 |
(mClass == Breakpoint) ifTrue:[^ false]. |
15256 | 8182 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8183 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8184 |
|
9662 | 8185 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
11696 | 8186 |
"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
|
8187 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
8188 |
|
4859 | 8189 |
!DebugView methodsFor:'private-control loop'! |
266 | 8190 |
|
8191 |
controlLoop |
|
8192 |
"this is a kludge: |
|
15413 | 8193 |
start a dispatchloop which exits when |
8194 |
either continue, return or step is pressed |
|
266 | 8195 |
" |
8196 |
||
8197 |
haveControl := true. |
|
664 | 8198 |
[ |
15413 | 8199 |
[haveControl] whileTrue:[ |
13388 | 8200 |
AbortOperationRequest handle:[:ex | |
8201 |
] do:[ |
|
15413 | 8202 |
self controlLoopCatchingErrors |
13388 | 8203 |
] |
15413 | 8204 |
]. |
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
8205 |
] ensure:[ |
15413 | 8206 |
catchBlock := nil. |
8207 |
haveControl := false |
|
266 | 8208 |
]. |
664 | 8209 |
|
8210 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 8211 |
! |
8212 |
||
8213 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
8214 |
"this is the debuggers own private event handling loop; |
1187 | 8215 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
8216 |
|
266 | 8217 |
"setup a self removing catch-block" |
8218 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
8219 |
||
8220 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
15757 | 8221 |
"if we do not have multiple processes or its a system process |
8222 |
we start another dispatch loop, which exits when |
|
8223 |
either continue, return or step is pressed |
|
8224 |
or (via the catchBlock) if an error occurs. |
|
8225 |
Since our display is an extra exclusive one, |
|
8226 |
all processing for normal views stops here ... |
|
8227 |
" |
|
8228 |
||
8229 |
WindowGroup setActiveGroup:windowGroup. |
|
8230 |
SignalSet anySignal handle:[:ex | |
|
8231 |
|signal| |
|
8232 |
||
8233 |
signal := ex creator. |
|
8234 |
(UserInterruptSignal accepts:signal) ifTrue:[ |
|
14835 | 8235 |
Transcript showCR:'UserInterruptSignal'. |
15757 | 8236 |
self topView raiseDeiconified. |
8237 |
ex proceed. |
|
8238 |
]. |
|
8239 |
||
8240 |
(UserNotification accepts:signal) ifTrue:[ |
|
11890 | 8241 |
Transcript showCR:'UserNotification'. |
15757 | 8242 |
(signal ~~ ActivityNotificationSignal) ifTrue:[ |
8243 |
self showError:ex description. |
|
8244 |
]. |
|
8245 |
ex proceed. |
|
8246 |
]. |
|
8247 |
(HaltInterrupt accepts:signal) ifTrue:[ |
|
11890 | 8248 |
Transcript showCR:'HaltInterrupt'. |
15757 | 8249 |
Transcript showCR:'Halt/Break in debugger ignored'. |
8250 |
self topView raiseDeiconified. |
|
8251 |
ex proceed. |
|
8252 |
]. |
|
8253 |
||
8254 |
self showError:'*** Error in modal debugger: |
|
266 | 8255 |
|
334 | 8256 |
>>>> Signal: ' , signal printString , ' |
266 | 8257 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8258 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8259 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8260 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8261 |
>>>> : ' , 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
|
8262 |
>>>> : ' , 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
|
8263 |
>>>> : ' , 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
|
8264 |
>>>> : ' , 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
|
8265 |
>>>> : ' , 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
|
8266 |
>>>> : ' , 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
|
8267 |
>>>> : ' , 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
|
8268 |
>>>> : ' , 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
|
8269 |
>>>> : ' , 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
|
8270 |
>>>> : ' , 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
|
8271 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 8272 |
>>>> Message: ' , ex description , ' |
266 | 8273 |
|
1187 | 8274 |
caught & ignored.'. |
15757 | 8275 |
ex return. |
8276 |
] do:[ |
|
11890 | 8277 |
"/ UserNotification handle:[:ex | |
8278 |
"/ (ex signal == ActivityNotificationSignal) ifTrue:[ |
|
8279 |
"/ ex proceed |
|
8280 |
"/ ]. |
|
8281 |
"/ self showError:ex description. |
|
8282 |
"/ ex proceed. |
|
8283 |
"/ ] do:[ |
|
16960 | 8284 |
device isNil ifTrue:[^ self]. |
8285 |
||
16253 | 8286 |
device |
15757 | 8287 |
dispatchModalWhile:[ |
8288 |
Processor activeProcess state:#debug. |
|
8289 |
haveControl]. |
|
11890 | 8290 |
"/ ] |
15757 | 8291 |
]. |
8292 |
WindowGroup setActiveGroup:nil. |
|
266 | 8293 |
] ifFalse:[ |
15757 | 8294 |
"we do have multiple processes - |
8295 |
simply enter the DebugViews-Windowgroup event loop. |
|
8296 |
effectively suspending event processing for the currently |
|
8297 |
active group. |
|
8298 |
" |
|
8299 |
SignalSet anySignal handle:[:ex | |
|
8300 |
|answer signal eMsg| |
|
8301 |
||
8302 |
signal := ex creator. |
|
8303 |
||
8304 |
DebuggingDebugger ~~ true ifTrue:[ |
|
8305 |
(signal == ActivityNotification) ifTrue:[ |
|
8306 |
ex proceed |
|
8307 |
]. |
|
8308 |
"/ |
|
8309 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
8310 |
"/ |
|
8311 |
ex catchInDebugger ifTrue:[ |
|
8312 |
'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR. |
|
8313 |
self halt. "/ self destroy. |
|
8314 |
ex reject |
|
8315 |
]. |
|
8316 |
||
8317 |
"/ |
|
8318 |
"/ ignore recursive breakpoints |
|
8319 |
"/ |
|
8320 |
(signal isControlInterrupt) ifTrue:[ |
|
8321 |
ignoreBreakpoints == true ifTrue:[ |
|
8322 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
8323 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
8324 |
self topView raiseDeiconified. |
|
8325 |
ex proceed |
|
8326 |
]. |
|
8327 |
]. |
|
8328 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
8329 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
8330 |
answer := Dialog |
|
8331 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
8332 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
8333 |
values:#( #proceed #close ) |
|
8334 |
default:#close. |
|
8335 |
answer == #close ifTrue:[ |
|
8336 |
self destroy. |
|
8337 |
ex reject |
|
8338 |
]. |
|
8339 |
ex return. |
|
8340 |
]. |
|
8341 |
signal == RecursiveExceptionError ifTrue:[ |
|
8342 |
(ex exception creator == BreakPointInterrupt) |
|
8343 |
ifTrue:[ |
|
8344 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
8345 |
ex proceed. |
|
8346 |
]. |
|
8347 |
||
8348 |
self showError:'*** Recursive error in debugger: |
|
266 | 8349 |
|
12687
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8350 |
>>>> Signal: ' , ex creator printString , ' |
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8351 |
>>>> ' , ex parameter creator printString , ' |
266 | 8352 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8353 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8354 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8355 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8356 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 8357 |
>>>> Message: ' , ex description , ' |
266 | 8358 |
|
1187 | 8359 |
caught & ignored.'. |
15757 | 8360 |
ex return |
8361 |
]. |
|
8362 |
]. |
|
8363 |
||
8364 |
self topView raiseDeiconified. |
|
8365 |
||
8366 |
eMsg := ex description. |
|
8367 |
(signal isControlInterrupt) ifTrue:[ |
|
8368 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
8369 |
]. |
|
8370 |
Dialog aboutToOpenBoxNotificationSignal |
|
8371 |
handle:[:ex | ex proceed ] |
|
8372 |
do:[ |
|
8373 |
answer := Dialog |
|
8374 |
choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
|
8375 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
8376 |
values:#( #proceed #cancel #debug ) |
|
8377 |
default:#cancel. |
|
8378 |
]. |
|
8379 |
answer == #debug ifTrue:[ |
|
8380 |
'DebugView [info]: caught exception - debugging' infoPrintCR. |
|
8381 |
Debugger |
|
8382 |
enterUnconditional:(ex suspendedContext) |
|
8383 |
withMessage:(ex creator class name,' in debugger: ' , eMsg) |
|
8384 |
mayProceed:true. |
|
8385 |
ex proceed. |
|
8386 |
]. |
|
8387 |
answer == #proceed ifTrue:[ |
|
8388 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
8389 |
ex proceed. |
|
8390 |
]. |
|
8391 |
'DebugView [info]: caught exception - returning' infoPrintCR. |
|
8392 |
ex return. |
|
8393 |
] do:[ |
|
8394 |
"/ make certain that sub-debuggers, inspectors etc. |
|
8395 |
"/ come up on my device. |
|
16253 | 8396 |
Screen currentScreenQuerySignal answer:device |
15757 | 8397 |
do:[ |
8398 |
Dialog aboutToOpenBoxNotificationSignal |
|
8399 |
handle:[:ex | ex proceed ] |
|
8400 |
do:[ |
|
8401 |
windowGroup |
|
8402 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
8403 |
true] |
|
8404 |
onLeave:[] |
|
8405 |
] |
|
8406 |
] |
|
8407 |
]. |
|
266 | 8408 |
]. |
8409 |
catchBlock := nil. |
|
8410 |
||
11818 | 8411 |
"Created: / 24-11-1995 / 20:33:45 / cg" |
8412 |
"Modified: / 26-09-2012 / 15:03:39 / cg" |
|
266 | 8413 |
! ! |
8414 |
||
13416 | 8415 |
!DebugView methodsFor:'queries'! |
8416 |
||
13488 | 8417 |
canDefineForCallee:callee |
8418 |
"again, pure heuristics here" |
|
8419 |
||
16072 | 8420 |
|mthd app heuristic selector sender| |
8421 |
||
8422 |
callee isNil ifTrue:[^ false]. |
|
13488 | 8423 |
|
8424 |
classToDefineIn := selectorToDefine := nil. "/ sorry - left as info to define action |
|
8425 |
||
16072 | 8426 |
"/ clicked on an unimplemented method ? |
8427 |
sender := callee sender. |
|
8428 |
sender isNil ifTrue:[^ false]. |
|
8429 |
||
8430 |
mthd := sender method. |
|
8431 |
mthd isNil ifTrue:[ |
|
8432 |
sender isBlockContext ifFalse:[ |
|
8433 |
"/ an unimplemented method |
|
8434 |
selector := sender selector. |
|
8435 |
(sender receiver class canUnderstand:selector) ifFalse:[ |
|
8436 |
classToDefineIn := sender receiver class. |
|
8437 |
selectorToDefine := selector. |
|
8438 |
^ true |
|
8439 |
] |
|
8440 |
] |
|
8441 |
]. |
|
8442 |
||
8443 |
mthd := callee method. |
|
8444 |
mthd notNil ifTrue:[ |
|
8445 |
(mthd selector == #subclassResponsibility) ifTrue:[ |
|
8446 |
classToDefineIn := sender receiver class. |
|
8447 |
selectorToDefine := sender selector. |
|
8448 |
^ true. |
|
8449 |
]. |
|
8450 |
||
8451 |
"/ that's a big hack, but I am tired of navigating to find the missing menu message... |
|
8452 |
"/ you will thank me!! |
|
8453 |
mthd selector == #error:mayProceed: ifTrue:[ |
|
8454 |
(callee receiver isKindOf:MenuPanel) ifTrue:[ |
|
8455 |
|senderHome| |
|
8456 |
||
8457 |
(senderHome := sender home) notNil ifTrue:[ |
|
8458 |
(senderHome selector startsWith:'accept:') ifTrue:[ |
|
8459 |
(inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[ |
|
8460 |
(app := self processesApplication) notNil ifTrue:[ |
|
8461 |
heuristic := senderHome argsAndVars select:[:o | o isSymbol]. |
|
8462 |
heuristic size == 1 ifTrue:[ |
|
8463 |
classToDefineIn := app class. |
|
8464 |
selectorToDefine := heuristic first. |
|
8465 |
^ true |
|
8466 |
]. |
|
8467 |
]. |
|
8468 |
]. |
|
8469 |
]. |
|
8470 |
]. |
|
8471 |
]. |
|
8472 |
] |
|
13488 | 8473 |
]. |
8474 |
^ false |
|
8475 |
! |
|
8476 |
||
13489 | 8477 |
showingAlreadyModifiedCode |
8478 |
^ methodCodeToggle isVisible |
|
8479 |
and:[ methodCodeToggleSelectionHolder value = 2 ] |
|
8480 |
! ! |
|
8481 |
||
8482 |
!DebugView methodsFor:'user interaction'! |
|
8483 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8484 |
checkIfCodeIsReallyModified |
16430 | 8485 |
|methodSource editorCode| |
6616 | 8486 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8487 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8488 |
|
16430 | 8489 |
currentMethod isNil ifTrue:[^ false]. |
8490 |
||
8491 |
methodSource := currentMethod source. |
|
8492 |
methodSource notNil ifTrue:[ |
|
8493 |
methodSource := methodSource string. |
|
8494 |
editorCode := codeView contents string. |
|
8495 |
methodSource = editorCode ifTrue:[ |
|
8496 |
^ false |
|
8497 |
]. |
|
8498 |
(methodSource withTabsExpanded:8) = (editorCode withTabsExpanded:8) ifTrue:[ |
|
8499 |
^ false |
|
8500 |
]. |
|
6616 | 8501 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8502 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8503 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8504 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8505 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8506 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8507 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8508 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8509 |
checkSelectionChangeAllowed:newSelection |
13388 | 8510 |
|answer v| |
8511 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8512 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8513 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8514 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8515 |
and:[newSelection = contextView selection]) ifTrue:[ |
15413 | 8516 |
^ true |
8517 |
]. |
|
8518 |
||
8519 |
answer := Dialog |
|
8520 |
confirmWithCancel:('Code modified - change selection anyway ?') |
|
8521 |
labels:#('No' 'No, Show Diffs' 'Yes'). |
|
13388 | 8522 |
answer isNil ifTrue:[^ false]. |
8523 |
answer == false ifTrue:[ |
|
15413 | 8524 |
v := DiffCodeView |
8525 |
openOn:codeView contents |
|
8526 |
label:(resources string:'Changed code (to be accepted ?)') |
|
8527 |
and:currentMethod source |
|
8528 |
label:(resources string:'Method''s actual (maybe original) code'). |
|
8529 |
v label:(resources string:'Comparing method''s code'). |
|
8530 |
v waitUntilVisible. |
|
8531 |
^ false |
|
13388 | 8532 |
]. |
8533 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8534 |
codeView modified:false. |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8535 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8536 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8537 |
|
266 | 8538 |
codeAccept:someCode |
13394 | 8539 |
"user wants some code to be recompiled" |
8540 |
||
14640 | 8541 |
ParseError handle:[:ex | |
15413 | 8542 |
ex lineNumber notNil ifTrue:[ |
8543 |
codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition. |
|
8544 |
]. |
|
8545 |
Dialog information:ex description. |
|
14640 | 8546 |
"/ ParseError new |
8547 |
"/ errorMessage:aMessage startPosition:position endPosition:endPos; |
|
8548 |
"/ parameter:self; |
|
8549 |
"/ lineNumber:tokenLineNr; "lineNr" |
|
8550 |
"/ raiseRequest. |
|
15413 | 8551 |
] do:[ |
8552 |
^ self codeAccept:someCode unwind:false category:nil onCancel:nil |
|
14640 | 8553 |
]. |
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8554 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8555 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 8556 |
! |
8557 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8558 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
13394 | 8559 |
"user wants some code to be recompiled. |
8560 |
Optionally unwind stack to right above the changed method. |
|
13455 | 8561 |
This undwind option is a leftover from times, when the debugger had no chance to |
15413 | 8562 |
show the original code. |
8563 |
Now, it can, and got a choice-field to select between original and changed code. |
|
8564 |
So the undwind option is not longer used and probably completely obsolete now |
|
13455 | 8565 |
(aka: this method is always called with doUnwind==false, these days)" |
3427 | 8566 |
|
13842 | 8567 |
|con newMethod| |
3427 | 8568 |
|
8569 |
codeView withWaitCursorDo:[ |
|
16430 | 8570 |
" |
8571 |
find the method-home context for this one |
|
8572 |
" |
|
8573 |
doUnwind ifTrue:[ |
|
8574 |
con := selectedContext. |
|
8575 |
top := con. |
|
8576 |
[con notNil] whileTrue:[ |
|
8577 |
(con methodHome == selectedContext) ifTrue:[ |
|
8578 |
top := con |
|
8579 |
]. |
|
8580 |
con := con sender |
|
8581 |
]. |
|
8582 |
]. |
|
8583 |
||
8584 |
"/ |
|
8585 |
"/ provide the classes nameSpace and changefile-update answers; |
|
8586 |
"/ in case we accept while in another context, to not capture these settings again |
|
8587 |
"/ |
|
8588 |
(Class updateChangeFileQuerySignal, |
|
8589 |
Class updateChangeListQuerySignal, |
|
8590 |
Class updateHistoryLineQuerySignal) answer:true |
|
8591 |
do:[ |
|
8592 |
Class nameSpaceQuerySignal answer:(aClass nameSpace) |
|
8593 |
do:[ |
|
8594 |
"/ the compiler nowadays already cares for the package... |
|
8595 |
"/ no, actually, it does not in case we are in the middle of a fileIn, |
|
8596 |
"/ and packageQuery is already answered by someone else. |
|
8597 |
"/ Better make it unpackaged, in case the user makes changes to other |
|
8598 |
"/ classes here (actually, I often change compiler, debugger, inspector here) |
|
8599 |
Class packageQuerySignal |
|
8600 |
answer:nil |
|
8601 |
do:[ |
|
8602 |
codeView contents:someCode. |
|
8603 |
Class methodRedefinitionNotification |
|
8604 |
answer:#keep |
|
8605 |
do:[ |
|
8606 |
| breakpoints newMethodOrClass | |
|
8607 |
||
8608 |
breakpoints := nil. |
|
8609 |
codeView isCodeView2 ifTrue:[ |
|
8610 |
breakpoints := codeView breakpoints. |
|
8611 |
]. |
|
8612 |
||
8613 |
BreakpointQuery answer: breakpoints do:[ |
|
8614 |
"/ Use original method's programming language instead of class's one. |
|
8615 |
"/ In most cases it's the same, but it may be that the method edited |
|
8616 |
"/ and accepted was an extension method written in another languages |
|
8617 |
"/ (such as Smalltalk extension to Java class or Ruby extension to |
|
8618 |
"/ Smalltalk class. |
|
8619 |
newMethodOrClass := selectedContext programmingLanguage |
|
8620 |
compilerClassForInteractiveTools |
|
8621 |
compile:someCode |
|
8622 |
forClass:aClass |
|
8623 |
inCategory:category |
|
8624 |
notifying:codeView. |
|
8625 |
"/ Kludge for accepting Java code in a debugger. The Java compiler |
|
8626 |
"/ does not compile single methods but always a full class and returns |
|
8627 |
"/ the compiled class(es) rather than a method. |
|
8628 |
"/ However, we need to update the method holder of a codeView. |
|
8629 |
"/ |
|
8630 |
"/ So, here we check whether the returned `newMethod` is really a method, |
|
8631 |
"/ if it's a class, try to search that class for a method with the |
|
8632 |
"/ same selector as selector of currently selected context. If found, |
|
8633 |
"/ that's the 'new' method we are going to show. |
|
8634 |
newMethodOrClass isBehavior ifTrue:[ |
|
8635 |
| selector | |
|
8636 |
||
8637 |
selector := selectedContext selector. |
|
8638 |
newMethod := newMethodOrClass compiledMethodAt: selector ifAbsent: nil. |
|
8639 |
] ifFalse:[ |
|
8640 |
newMethod := newMethodOrClass. |
|
8641 |
newMethod == #Error ifTrue:[ |
|
8642 |
"/ should now be obsolete |
|
8643 |
newMethod := nil |
|
8644 |
]. |
|
8645 |
]. |
|
8646 |
]. |
|
8647 |
]. |
|
8648 |
]. |
|
8649 |
]. |
|
8650 |
]. |
|
8651 |
||
8652 |
methodCodeToggleSelectionHolder value:2. "/ showing current code |
|
8653 |
methodCodeToggle beVisible. |
|
8654 |
||
8655 |
inspecting ifFalse:[ |
|
8656 |
(newMethod isNil) ifTrue:[^ cancelAction value]. |
|
8657 |
||
8658 |
codeView modified:false. |
|
8659 |
codeView isCodeView2 ifTrue:[ |
|
8660 |
codeView methodHolder value: newMethod. |
|
8661 |
]. |
|
8662 |
currentMethod := newMethod. |
|
8663 |
||
8664 |
doUnwind ifTrue:[ |
|
8665 |
"/ if it worked, and doUnwind is true, |
|
8666 |
"/ remove everything up to and including top |
|
8667 |
"/ from the context chain |
|
8668 |
||
8669 |
selectedContext canReturn ifTrue:[ |
|
8670 |
self setContext:(top "sender"). |
|
8671 |
exitAction := #restart. |
|
8672 |
selectedContext setLineNumber:1. |
|
8673 |
self doRestart. |
|
8674 |
] ifFalse:[ |
|
8675 |
self setContext:(top sender). |
|
8676 |
exitAction := #return. |
|
8677 |
]. |
|
8678 |
]. |
|
8679 |
]. |
|
3427 | 8680 |
]. |
8681 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
8682 |
"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
|
8683 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
14713 | 8684 |
"Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3427 | 8685 |
! |
8686 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8687 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
13394 | 8688 |
"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
|
8689 |
|
16422 | 8690 |
|sel implementorClass receiverClass method category wrapper| |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8691 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8692 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8693 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8694 |
"/ 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
|
8695 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8696 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8697 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8698 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8699 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8700 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8701 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8702 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8703 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8704 |
|
16422 | 8705 |
" |
8706 |
use class&selector to find the method for the compilation |
|
8707 |
and compile. |
|
8708 |
" |
|
8709 |
category := givenCategoryOrNil. |
|
8710 |
sel := selectedContext selector. |
|
8711 |
implementorClass := selectedContext methodClass. |
|
8712 |
method := selectedContext method. |
|
8713 |
||
8714 |
implementorClass isNil ifTrue:[ |
|
8715 |
(method notNil |
|
8716 |
and:[method mclass isNil |
|
8717 |
and:[(wrapper := method wrapper) notNil]] |
|
8718 |
) ifTrue:[ |
|
8719 |
method := wrapper. |
|
8720 |
]. |
|
8721 |
method notNil ifTrue:[ |
|
8722 |
implementorClass := method mclass. |
|
8723 |
implementorClass isNil ifTrue:[ |
|
8724 |
implementorClass := method getMclass |
|
8725 |
]. |
|
8726 |
]. |
|
8727 |
]. |
|
8728 |
implementorClass notNil ifTrue:[ |
|
8729 |
category isNil ifTrue:[ |
|
8730 |
method isNil ifTrue:[ |
|
8731 |
method := implementorClass compiledMethodAt:sel. |
|
8732 |
]. |
|
8733 |
category := method category |
|
8734 |
] |
|
8735 |
] ifFalse:[ |
|
8736 |
receiverClass := selectedContext receiver class. |
|
8737 |
implementorClass := receiverClass whichClassImplements:sel. |
|
8738 |
implementorClass := implementorClass ? receiverClass. |
|
8739 |
implementorClass ~~ Object ifTrue:[ |
|
8740 |
implementorClass := Dialog |
|
8741 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
8742 |
initialAnswer:implementorClass name |
|
8743 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
8744 |
implementorClass size == 0 ifTrue:[ |
|
8745 |
^ cancelAction value "/ cancelled |
|
8746 |
]. |
|
8747 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
8748 |
implementorClass isNil ifTrue:[ |
|
8749 |
Dialog warn:'No such class'. |
|
8750 |
^ cancelAction value "/ cancelled |
|
8751 |
]. |
|
8752 |
]. |
|
8753 |
]. |
|
8754 |
||
8755 |
self |
|
8756 |
codeAccept:someCode |
|
8757 |
inClass:implementorClass |
|
8758 |
unwind:doUnwind |
|
8759 |
category:category |
|
8760 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8761 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8762 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8763 |
"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
|
8764 |
"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
|
8765 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8766 |
|
7912 | 8767 |
codeCompletion |
15413 | 8768 |
"/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
14109 | 8769 |
"/ (can we move that to a utility - probably DoWhatIMeanSupport) |
8770 |
||
8771 |
|cls language| |
|
7912 | 8772 |
|
8212 | 8773 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 8774 |
|
7912 | 8775 |
cls := currentMethod mclass. |
15413 | 8776 |
cls notNil ifTrue:[ |
8777 |
language := cls programmingLanguage. |
|
14109 | 8778 |
]. |
8212 | 8779 |
|
7912 | 8780 |
UserInformation handle:[:ex | |
15413 | 8781 |
ex proceed. |
7912 | 8782 |
] do:[ |
15413 | 8783 |
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
|
8784 |
]. |
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8785 |
|
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8786 |
"Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7912 | 8787 |
! |
8788 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8789 |
confirm:aString |
6971 | 8790 |
"open a modal yes-no dialog. |
8791 |
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
|
8792 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8793 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
16960 | 8794 |
^ true |
8795 |
]. |
|
8796 |
^ super confirm:(resources stringWithCRs:aString). |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8797 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8798 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
8799 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
8800 |
"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
|
8801 |
Also sent to autoselect an interesting context on entry." |
0 | 8802 |
|
9235 | 8803 |
HaltInterrupt handle:[:ex | |
15413 | 8804 |
ignoreBreakpoints ifFalse:[ex reject]. |
8805 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
8806 |
ex proceed |
|
3447 | 8807 |
] do:[ |
15413 | 8808 |
self updateForContext:lineNr |
3269 | 8809 |
]. |
8810 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
8811 |
|
3447 | 8812 |
"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
|
8813 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8814 |
|
10205 | 8815 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8816 |
stackInspector notNil ifTrue:[ |
15413 | 8817 |
stackInspector destroy. |
8818 |
stackInspector := nil. |
|
8819 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
8820 |
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
|
8821 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8822 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8823 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8824 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8825 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8826 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8827 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8828 |
sel notNil ifTrue:[ |
15413 | 8829 |
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
|
8830 |
] |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8831 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8832 |
"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
|
8833 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8834 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8835 |
processEvent:anEvent |
6129 | 8836 |
"filter keyboard events for popUp variable value display. |
8837 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8838 |
|
12106 | 8839 |
<resource: #keyboard (#CodeCompletion )> |
8840 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8841 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8842 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8843 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8844 |
evView notNil ifTrue:[ |
15413 | 8845 |
focusView := evView windowGroup focusView. |
8846 |
focusView isNil ifTrue:[ |
|
8847 |
focusView := evView. |
|
8848 |
]. |
|
8849 |
||
8850 |
anEvent isKeyPressEvent ifTrue:[ |
|
8851 |
key := anEvent key. |
|
8852 |
rawKey := anEvent rawKey. |
|
8853 |
||
8854 |
inCodeView := (focusView == codeView |
|
8855 |
or:[focusView isComponentOf:codeView]). |
|
8856 |
inCodeView ifTrue:[ |
|
8857 |
key == #CodeCompletion ifTrue:[ |
|
8858 |
"/ complete the word before/under the cursor. |
|
8859 |
self sensor |
|
8860 |
pushUserEvent:#codeCompletion |
|
8861 |
for:self |
|
8862 |
withArguments:#(). |
|
8863 |
^ true |
|
8864 |
]. |
|
8865 |
]. |
|
8866 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8867 |
|
3602 | 8868 |
false ifTrue:[ |
15413 | 8869 |
anEvent isButtonReleaseEvent ifTrue:[ |
8870 |
anEvent view == codeView ifTrue:[ |
|
8871 |
(RBParser notNil and:[RBParser isLoaded]) |
|
8872 |
ifTrue:[ |
|
8873 |
self sensor |
|
8874 |
pushEvent:anEvent. "/ must be first in queue |
|
8875 |
||
8876 |
self sensor |
|
8877 |
pushUserEvent:#explainSelection |
|
8878 |
for:self |
|
8879 |
withArguments:nil. |
|
8880 |
^ true "/ eaten |
|
8881 |
] |
|
8882 |
] |
|
8883 |
]. |
|
3602 | 8884 |
]. |
8885 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8886 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8887 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8888 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8889 |
|
8212 | 8890 |
setCurrentMethod:aMethodOrNil |
8891 |
currentMethod := aMethodOrNil. |
|
8892 |
! |
|
8893 |
||
15413 | 8894 |
showSelection:lineNr |
1327 | 8895 |
"user clicked on a header line - show selected code in textView. |
8896 |
Also sent to autoselect an interesting context on entry." |
|
15413 | 8897 |
|
8898 |
UserNotification |
|
8899 |
handle:[:ex | |
|
8900 |
"/ ex suspendedContext fullPrintAll. |
|
8901 |
Transcript showCR:ex description. |
|
8902 |
"/ Transcript showCR:ex parameter. |
|
8903 |
ex proceed |
|
8904 |
] |
|
8905 |
do:[ |
|
8906 |
Error |
|
8907 |
handle:[:ex | |
|
8908 |
|s con| |
|
8909 |
||
8910 |
ex creator isControlInterrupt ifTrue:[ |
|
8911 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' |
|
8912 |
infoPrintCR. |
|
8913 |
ex proceed |
|
8914 |
]. |
|
8915 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' |
|
8916 |
bindWith:ex suspendedContext) infoPrintCR. |
|
8917 |
s := '' writeStream. |
|
8918 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
8919 |
s nextPutLine:'****'. |
|
8920 |
s nextPutLine:'**** ',(ex description). |
|
8921 |
s nextPutLine:'****'. |
|
8922 |
con := ex suspendedContext. |
|
8923 |
s nextPutLine:'**** ',(con printString). |
|
8924 |
con := con sender. |
|
8925 |
HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ]. |
|
8926 |
||
5842 | 8927 |
"/ [con notNil] whileTrue:[ |
8928 |
"/ Error catch:[:ex | |
|
8929 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
8930 |
"/ ]. |
|
4947 | 8931 |
"/ |
5842 | 8932 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
8933 |
"/ con := nil |
|
8934 |
"/ ] ifFalse:[ |
|
8935 |
"/ con := con sender. |
|
8936 |
"/ ] |
|
8937 |
"/ ]. |
|
15413 | 8938 |
|
8939 |
codeView contents:(s contents). |
|
8940 |
ex return. |
|
8941 |
] |
|
8942 |
do:[ self doShowSelection:lineNr ] |
|
8943 |
] |
|
11610 | 8944 |
|
8945 |
"Modified: / 19-07-2012 / 10:56:58 / cg" |
|
1327 | 8946 |
! |
8947 |
||
10205 | 8948 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8949 |
stackInspector isNil ifTrue:[ |
15413 | 8950 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
8951 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
8952 |
stackInspector := InspectorView |
|
8953 |
origin:(0.6 @ 0.0) |
|
8954 |
corner:(1.0 @ 1.0) |
|
8955 |
in:contextInspector superView. |
|
8956 |
stackInspector realize. |
|
8957 |
stackInspector fieldListLabel:'Stack'. |
|
8958 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8959 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8960 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8961 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8962 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8963 |
|
12529 | 8964 |
updateContextInfoFor:aContext |
8965 |
"additional info as-per selected context; |
|
8966 |
for now: |
|
15656 | 8967 |
update:with:from: - show who was responsible |
12529 | 8968 |
" |
8969 |
||
12552 | 8970 |
|whatChanged changedObject receiver| |
12529 | 8971 |
|
8972 |
aContext selector == #'update:with:from:' ifTrue:[ |
|
15656 | 8973 |
receiver := aContext receiver. |
8974 |
whatChanged := aContext argAt:1. |
|
8975 |
changedObject := aContext argAt:3. |
|
8976 |
||
8977 |
changedObject isBehavior ifTrue:[ |
|
8978 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold). |
|
8979 |
^ self |
|
8980 |
]. |
|
8981 |
||
8982 |
receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm | |
|
8983 |
|val| |
|
8984 |
||
8985 |
IsDebuggingQuery answer:true do:[ |
|
8986 |
val := (receiver instVarAt:i). |
|
8987 |
]. |
|
8988 |
val == changedObject ifTrue:[ |
|
8989 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold). |
|
8990 |
^ self |
|
8991 |
] |
|
8992 |
]. |
|
8993 |
||
8994 |
(receiver isKindOf:ApplicationModel) ifTrue:[ |
|
8995 |
receiver builder notNil ifTrue:[ |
|
8996 |
(receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue | |
|
8997 |
eachValue == changedObject ifTrue:[ |
|
8998 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold). |
|
8999 |
^ self |
|
9000 |
] |
|
9001 |
] |
|
9002 |
] |
|
9003 |
]. |
|
9004 |
||
9005 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold). |
|
9006 |
^self. |
|
12529 | 9007 |
]. |
9008 |
contextInfoLabel label:nil. |
|
9009 |
! |
|
9010 |
||
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
9011 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
9012 |
"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
|
9013 |
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
|
9014 |
|
56 | 9015 |
|con homeContext sel method code canAccept |
105 | 9016 |
implementorClass lineNrInMethod rec m line |
10205 | 9017 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 9018 |
codeSet highlighter evaluatorClass |
11912
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
9019 |
canDefine callee searchClass originalMethod cannotAcceptDueToOutdatedClass| |
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
9020 |
|
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
9021 |
canDefine := cannotAcceptDueToOutdatedClass := false. |
8212 | 9022 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
9023 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
9024 |
contextArray notNil ifTrue:[ |
16430 | 9025 |
lineNr <= contextArray size ifTrue:[ |
9026 |
con := contextArray at:lineNr. |
|
9027 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
9028 |
]. |
|
9029 |
" |
|
9030 |
clicking on the '** ...'-line shows more ... |
|
9031 |
" |
|
9032 |
con isNil ifTrue:[ |
|
9033 |
line := contextView list at:lineNr. |
|
9034 |
(line startsWith:'**') ifTrue:[ |
|
9035 |
self showMore. |
|
9036 |
lineNr >= contextArray size ifTrue:[ |
|
9037 |
contextView setSelection:lineNr. |
|
9038 |
con := contextArray at:lineNr ifAbsent:nil |
|
9039 |
] |
|
9040 |
]. |
|
9041 |
con isNil ifTrue:[ |
|
9042 |
codeView contents:nil. |
|
9043 |
^ self |
|
9044 |
]. |
|
9045 |
]. |
|
9046 |
||
9047 |
selectedContext := con. |
|
9048 |
m := contextView middleButtonMenu. |
|
9049 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
9050 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
9051 |
]. |
|
9052 |
||
9053 |
self withExecuteCursorDo:[ |
|
9054 |
codeSet := false. |
|
9055 |
||
9056 |
" |
|
9057 |
give it to the (lower right) inspector |
|
9058 |
" |
|
9059 |
Error handle:[:ex | |
|
9060 |
'DebugView [warning]: error while accessing context: ' errorPrint. |
|
9061 |
ex description errorPrintCR. |
|
9062 |
contextInspector inspect:nil. |
|
9063 |
contextInspector fieldListLabel:('Context'). |
|
9064 |
ex suspendedContext fullPrintAllOn: Transcript. |
|
9479 | 9065 |
"/ ex reject. |
16430 | 9066 |
] do:[ |
9067 |
contextInspector inspect:con. |
|
9068 |
"/ contextInspector fieldListLabel:('Context: ',con method whoString). |
|
9069 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
9070 |
]. |
|
9071 |
||
9072 |
"/ show a stack inspector sometimes |
|
9073 |
||
9074 |
con hasStackToShow ifTrue:[ |
|
9075 |
self showStackInspectorFor:con |
|
9076 |
] ifFalse:[ |
|
9077 |
self hideStackInspector |
|
9078 |
]. |
|
9079 |
||
9080 |
homeContext := con methodHome. |
|
9081 |
con canReturn ifTrue:[ |
|
9082 |
returnButton enable. restartButton enable. |
|
9083 |
] ifFalse:[ |
|
9084 |
returnButton disable. restartButton disable. |
|
9085 |
]. |
|
9086 |
||
9087 |
lineNrInMethod := con lineNumber. |
|
9088 |
||
9089 |
canAccept := false. |
|
9090 |
||
9091 |
homeContext isNil ifTrue:[ |
|
9092 |
" |
|
9093 |
mhmh - an optimized block |
|
9094 |
should get the block here, and get the method from |
|
9095 |
that one ... |
|
9096 |
But in the current version, there is no easy way to get to the block |
|
9097 |
since that one is not in the context. |
|
9098 |
A future new block calling scheme will fix this |
|
9099 |
(passing the block instead of the home as block argument). |
|
9100 |
" |
|
9101 |
(method := con method) isNil ifTrue:[ |
|
9102 |
"temporary kludge - peek into the sender context. |
|
9103 |
If its a do-like method and there is a single block variable |
|
9104 |
in the args or temporaries, that must be the one. |
|
9105 |
This helps in some cases. |
|
9106 |
" |
|
9107 |
(sender := con sender) notNil ifTrue:[ |
|
9108 |
tryVars := false. |
|
9109 |
(selSender := sender selector) notNil ifTrue:[ |
|
9110 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
9111 |
tryVars := true. |
|
9112 |
] |
|
9113 |
]. |
|
9114 |
tryVars ifTrue:[ |
|
9115 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
9116 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
9117 |
possibleBlocks size == 1 ifTrue:[ |
|
9118 |
method := possibleBlocks first method. |
|
9119 |
]. |
|
9120 |
] |
|
9121 |
]. |
|
9122 |
] |
|
9123 |
] ifFalse:[ |
|
9124 |
"fetch rec here - so we won't need context in doItAction" |
|
9125 |
rec := homeContext receiver. |
|
9126 |
sel := homeContext selector. |
|
9127 |
sel notNil ifTrue:[ |
|
9128 |
canAccept := true. |
|
9129 |
||
9130 |
implementorClass := homeContext methodClass. |
|
9131 |
implementorClass isNil ifTrue:[ |
|
9132 |
homeContext method notNil ifTrue:[ |
|
9133 |
WrappedMethod allInstancesDo:[:wrapped | |
|
9134 |
wrapped originalMethod == homeContext method ifTrue:[ |
|
9135 |
implementorClass := wrapped mclass |
|
9136 |
] |
|
9137 |
]. |
|
9138 |
implementorClass isNil ifTrue:[ |
|
9139 |
(homeContext searchClass notNil |
|
9140 |
and:[homeContext searchClass isObsolete]) ifTrue:[ |
|
9141 |
cannotAcceptDueToOutdatedClass := true. |
|
9142 |
] |
|
9143 |
]. |
|
9144 |
]. |
|
9145 |
]. |
|
9146 |
implementorClass isNil ifTrue:[ |
|
9147 |
Error handle:[:ex | |
|
11890 | 9148 |
"/ not covered by Error, anyway |
9149 |
"/ ex signal == BreakPointInterrupt ifTrue:[ |
|
9150 |
"/ ex proceed. |
|
9151 |
"/ ]. |
|
16430 | 9152 |
code := 'error while asking method for its source'. |
9153 |
code := code , Character cr , ex creator printString. |
|
9154 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
9155 |
||
9156 |
canAccept := false. |
|
9157 |
ex return. |
|
9158 |
] do:[ |
|
9159 |
" |
|
9160 |
special: look if this context was created by |
|
9161 |
valueWithReceiver kind of method invocation; |
|
9162 |
if so, grab the method from the sender and show it |
|
9163 |
" |
|
9164 |
((sender := homeContext sender) notNil |
|
9165 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
9166 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
9167 |
method := sender receiver. |
|
9168 |
canAccept := false. |
|
9169 |
] ifFalse:[ |
|
9170 |
(method := con method) notNil ifTrue:[ |
|
9171 |
canAccept := false. |
|
9172 |
] |
|
9173 |
]. |
|
9174 |
] |
|
9175 |
] ifFalse:[ |
|
9176 |
method := implementorClass compiledMethodAt:sel. |
|
9177 |
]. |
|
9178 |
] |
|
9179 |
]. |
|
9180 |
||
9181 |
homeContext notNil ifTrue:[ |
|
9182 |
searchClass := homeContext searchClass ? rec class. |
|
9183 |
currentMethod := searchClass lookupMethodFor:sel. |
|
9184 |
]. |
|
9185 |
originalMethod := currentMethod. |
|
9186 |
(currentMethod notNil |
|
9187 |
and:[currentMethod ~~ method |
|
9188 |
and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]] |
|
9189 |
) ifTrue:[ |
|
9190 |
originalMethod := method. |
|
9191 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
9192 |
method := originalMethod. "/ the one which is suspended / was executing |
|
9193 |
] ifFalse:[ |
|
9194 |
method := currentMethod. "/ the one which has already been accepted/modified. |
|
9195 |
lineNrInMethod := nil. |
|
9196 |
canAccept := true. |
|
9197 |
]. |
|
9198 |
methodCodeToggle beVisible. |
|
9199 |
] ifFalse:[ |
|
9200 |
methodCodeToggle beInvisible. |
|
9201 |
]. |
|
9202 |
||
9203 |
code isNil ifTrue:[ |
|
9204 |
errMsg := nil. |
|
9205 |
method isNil ifTrue:[ |
|
9206 |
"/ fall back heuristics (see how this was called, fetch block from caller) |
|
9207 |
sender := con sender. |
|
9208 |
con isBlockContext ifTrue:[ |
|
9209 |
(sender notNil |
|
9210 |
and:[((sender selector ? '') startsWith:'value') |
|
9211 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
9212 |
code := sender receiver source. |
|
9213 |
] |
|
9214 |
] ifFalse:[ |
|
9215 |
(sender notNil |
|
9216 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
9217 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
9218 |
method := sender receiver. |
|
9219 |
] |
|
9220 |
] |
|
9221 |
]. |
|
9222 |
method notNil ifTrue:[ |
|
9223 |
contextInspector fieldListLabel:(method selector "whoString"). |
|
9224 |
Error handle:[:ex | |
|
11890 | 9225 |
"/ not covered by Error, anyway |
9226 |
"/ ex signal isControlInterrupt ifTrue:[ |
|
9227 |
"/ ex proceed. |
|
9228 |
"/ ]. |
|
16430 | 9229 |
code := 'error while asking method for its source'. |
9230 |
code := code , Character cr , ex creator printString. |
|
9231 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
9232 |
||
9233 |
canAccept := false. |
|
9234 |
ex return. |
|
9235 |
] do:[ |
|
9236 |
self sensor shiftDown ifTrue:[ |
|
9237 |
code := method decompiledSource |
|
9238 |
] ifFalse:[ |
|
9239 |
code := method source. |
|
9240 |
]. |
|
9241 |
]. |
|
9242 |
||
9243 |
code isNil ifTrue:[ |
|
9244 |
method sourceFilename notNil ifTrue:[ |
|
9245 |
codeView contents:(resources |
|
9246 |
string:'** no sourcefile: %1 **' |
|
9247 |
with:method sourceFilename). |
|
9248 |
codeView realized ifTrue:[ |
|
9249 |
"codeView is not realized on initial startup" |
|
9250 |
codeView flash:'no source'. |
|
9251 |
]. |
|
9252 |
codeSet := true. |
|
9253 |
] ifFalse:[ |
|
9254 |
[ |
|
9255 |
|src| |
|
9256 |
||
9257 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
9258 |
codeView contents:src. |
|
9259 |
codeSet := true. |
|
9260 |
] on: Error do:[ |
|
9261 |
errMsg := '** no source **' |
|
9262 |
]. |
|
9263 |
] |
|
9264 |
]. |
|
9265 |
] ifFalse:[ |
|
9266 |
contextInspector fieldListLabel:'Context'. |
|
9267 |
homeContext isNil ifTrue:[ |
|
9268 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
9269 |
] ifFalse:[ |
|
9270 |
errMsg := '** no method - no source **'. |
|
16800 | 9271 |
canDefine := true. |
16430 | 9272 |
] |
9273 |
]. |
|
9274 |
errMsg notNil ifTrue:[ |
|
9275 |
self showError:errMsg. |
|
9276 |
codeSet := true. |
|
9277 |
] |
|
9278 |
]. |
|
9279 |
||
9280 |
code isNil ifTrue:[ |
|
9281 |
"/ canAccept := false. |
|
9282 |
codeSet ifFalse:[ |
|
9283 |
codeView contents:nil. |
|
9284 |
] |
|
9285 |
] ifFalse:[ |
|
9286 |
lineNrInMethod notNil ifTrue:[ |
|
9287 |
lineNrInMethod == 0 ifTrue:[ |
|
9288 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
9289 |
lineNrInMethod := method lineNumber |
|
9290 |
]. |
|
9291 |
"/ guess lineNumber from sent-messages selector |
|
9292 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
9293 |
lineNrInMethod == 0 ifTrue:[ |
|
9294 |
|conIdx sentContext messages| |
|
9295 |
||
9296 |
conIdx := contextArray identityIndexOf:con. |
|
9297 |
conIdx > 1 ifTrue:[ |
|
9298 |
sentContext := contextArray at:conIdx-1. |
|
9299 |
sentContext isBlockContext ifFalse:[ |
|
9300 |
(method notNil and:[code notNil]) ifTrue:[ |
|
9301 |
messages := method messagesSent. |
|
9302 |
messages size == 1 ifTrue:[ |
|
9303 |
sentContext selector == messages first ifTrue:[ |
|
9304 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
9305 |
] |
|
9306 |
] |
|
9307 |
]. |
|
9308 |
]. |
|
9309 |
]. |
|
9310 |
]. |
|
9311 |
]. |
|
9312 |
]. |
|
9313 |
codeView isCodeView2 ifTrue:[ |
|
9314 |
codeView model |
|
9315 |
setValue: code; |
|
9316 |
changed. |
|
9317 |
codeView methodHolder value: method. |
|
9318 |
codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
|
9319 |
] ifFalse:[ |
|
9320 |
UserPreferences current syntaxColoring ifTrue:[ |
|
9321 |
implementorClass isNil ifTrue:[ |
|
16933 | 9322 |
|guessedHome| |
16430 | 9323 |
(con isBlockContext |
9324 |
and:[con home isNil |
|
16933 | 9325 |
and:[(guessedHome := con guessedHome) notNil]]) |
16430 | 9326 |
ifTrue:[ |
16933 | 9327 |
implementorClass := guessedHome mclass |
16430 | 9328 |
] |
9329 |
]. |
|
9330 |
implementorClass notNil ifTrue:[ |
|
9331 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
9332 |
code size < 100000 ifTrue:[ |
|
9333 |
Error catch:[ |
|
9334 |
code := highlighter formatMethodSource:code in:implementorClass. |
|
9335 |
] |
|
9336 |
] |
|
9337 |
] |
|
9338 |
] |
|
9339 |
]. |
|
1555 | 9340 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9341 |
"/ code ~= (codeView contents) ifTrue:[ |
16430 | 9342 |
cannotAcceptDueToOutdatedClass ifTrue:[ |
16501 | 9343 |
codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' withColor:Color red),Character cr,Character cr,code asString). |
16430 | 9344 |
] ifFalse:[ |
9345 |
codeView setContents:code. |
|
9346 |
]. |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9347 |
"/ ]. |
16430 | 9348 |
]. |
9349 |
(lineNrInMethod notNil |
|
9350 |
and:[lineNrInMethod ~~ 0 |
|
9351 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 9352 |
lineNrInMethod == 255 ifFalse:[ |
16430 | 9353 |
(lineNrInMethod == 255 |
9354 |
and:[method notNil |
|
9355 |
and:[method hasCode not]]) ifTrue:[ |
|
9356 |
"/ means: do not really know in interpreted methods |
|
9357 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
9358 |
] ifFalse:[ |
|
9359 |
codeView selectLine:lineNrInMethod. |
|
9360 |
]. |
|
9361 |
codeView makeSelectionVisible |
|
7000 | 9362 |
]. |
16430 | 9363 |
] ifFalse:[ |
9364 |
codeView unselect. |
|
9365 |
codeView scrollToTop |
|
9366 |
] |
|
9367 |
]. |
|
9368 |
||
9369 |
codeView acceptEnabled:canAccept. |
|
9370 |
canAccept ifTrue:[ |
|
9371 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
9372 |
] ifFalse:[ |
|
9373 |
codeView acceptAction:[:code | self beep] |
|
9374 |
]. |
|
9375 |
||
9376 |
receiverInspector inspect:rec. |
|
9377 |
receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle). |
|
9378 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
|
9379 |
||
9380 |
" |
|
9381 |
the one below is wrong: currently, the |
|
9382 |
evaluator cannot handle passed contexts. |
|
9383 |
Once it does, pass con as in:-arg |
|
9384 |
" |
|
9385 |
(rec isJavaObject |
|
9386 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
9387 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
9388 |
evaluatorClass := Parser. |
|
9389 |
codeView commentStrings:#( '//' ( '/*' '*/' ) ). |
|
9390 |
] ifFalse:[ |
|
9391 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
9392 |
evaluatorClass := method mclass evaluatorClass. |
|
9393 |
codeView commentStrings:method mclass programmingLanguage commentStrings. |
|
9394 |
] ifFalse:[ |
|
9395 |
evaluatorClass := rec class evaluatorClass. |
|
9396 |
codeView commentStrings:rec class programmingLanguage commentStrings. |
|
9397 |
]. |
|
9398 |
]. |
|
9399 |
||
9400 |
codeView |
|
16933 | 9401 |
simulatedSelf:rec; |
16430 | 9402 |
doItAction: |
9403 |
[:theCode | |
|
9404 |
evaluatorClass |
|
9405 |
evaluate:theCode |
|
9406 |
in:actualContext "/ (selectedContext ? actualContext) |
|
9407 |
receiver:rec |
|
9408 |
notifying:codeView |
|
9409 |
logged:true |
|
9410 |
ifFail:nil |
|
9411 |
]; |
|
9412 |
editedMethodOrClass:(method ? rec class). |
|
9413 |
||
9414 |
||
9415 |
self setCurrentMethod:method. |
|
9416 |
||
9417 |
selectedContext := homeContext ? con. |
|
9418 |
actualContext := con |
|
9419 |
]. |
|
4122 | 9420 |
] ifFalse:[ |
16430 | 9421 |
codeView contents:nil. |
4122 | 9422 |
]. |
9423 |
codeView modified:false. |
|
9424 |
||
9425 |
con isContext ifFalse:[ |
|
16430 | 9426 |
sendButton disable. |
4122 | 9427 |
] ifTrue:[ |
16430 | 9428 |
sendButton enable. |
10205 | 9429 |
]. |
12529 | 9430 |
self updateContextInfoFor:con. |
10205 | 9431 |
|
9432 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 9433 |
(due to the block held in codeView). |
9434 |
(not really needed, since stuff gets collected away sooner or later ... |
|
9435 |
... but this makes it a bit sooner) |
|
9436 |
" |
|
9437 |
con := nil. |
|
9438 |
homeContext := nil. |
|
9439 |
||
13488 | 9440 |
(canDefine or:[self canDefineForCallee:callee]) ifTrue:[ |
16430 | 9441 |
defineButton beVisible. |
4122 | 9442 |
] ifFalse:[ |
16430 | 9443 |
defineButton beInvisible. |
4122 | 9444 |
]. |
9445 |
||
12529 | 9446 |
"/ enable/disable some menu items |
4122 | 9447 |
self updateMenuItems |
9448 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
9449 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
10752 | 9450 |
"Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13394 | 9451 |
"Modified: / 28-08-2013 / 15:13:02 / cg" |
4122 | 9452 |
! ! |
9453 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9454 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'accessing'! |
8170 | 9455 |
|
9456 |
ignoreCount:something |
|
9457 |
ignoreCount := something. |
|
9458 |
! |
|
9459 |
||
9460 |
ignoreEndTime:something |
|
9461 |
ignoreEndTime := something. |
|
9462 |
! |
|
9463 |
||
12937 | 9464 |
ignoreForProcess:aProcess |
9465 |
ignoredProcesses isNil ifTrue:[ |
|
15413 | 9466 |
ignoredProcesses := WeakIdentitySet new. |
12937 | 9467 |
]. |
9468 |
ignoredProcesses add:aProcess |
|
9469 |
! |
|
9470 |
||
9471 |
ignoreForReceiverClass:aClass |
|
9472 |
ignoredReceiverClasses isNil ifTrue:[ |
|
15413 | 9473 |
ignoredReceiverClasses := WeakIdentitySet new. |
12937 | 9474 |
]. |
9475 |
ignoredReceiverClasses add:aClass |
|
9476 |
! |
|
9477 |
||
14608 | 9478 |
ignoreIfCalledFromMethod:aMethod |
9479 |
ignoredSendingClassAndSelectors isNil ifTrue:[ |
|
15413 | 9480 |
ignoredSendingClassAndSelectors := OrderedCollection new. |
14608 | 9481 |
]. |
9482 |
||
9483 |
"/ remember the method's name, not the method. |
|
9484 |
"/ so it can be recompiled and we still detect ignores |
|
9485 |
ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector } |
|
9486 |
! |
|
9487 |
||
11210 | 9488 |
ignoreUntilShiftKeyPressed:aBoolean |
9489 |
ignoreUntilShiftKeyPressed := aBoolean. |
|
9490 |
||
9491 |
"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
|
9492 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9493 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9494 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9495 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9496 |
decrementIgnoreCount |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9497 |
ignoreCount notNil ifTrue:[ |
15413 | 9498 |
ignoreCount > 0 ifTrue:[ |
9499 |
ignoreCount := ignoreCount - 1 |
|
9500 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9501 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9502 |
! ! |
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 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9505 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9506 |
printConditionOn:aStream |
14608 | 9507 |
ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[ |
16933 | 9508 |
aStream nextPutAll:(' if called from %1 » %2' |
16535 | 9509 |
bindWith:ignoredSendingClassAndSelectors first first |
9510 |
with:ignoredSendingClassAndSelectors first second). |
|
9511 |
^ self. |
|
14608 | 9512 |
]. |
12937 | 9513 |
ignoredProcesses notEmptyOrNil ifTrue:[ |
16535 | 9514 |
aStream nextPutAll:(' in %1 processes (%2)' |
9515 |
bindWith:ignoredProcesses size |
|
9516 |
with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9517 |
^ self. |
|
14608 | 9518 |
]. |
9519 |
ignoredReceiverClasses notNil ifTrue:[ |
|
16535 | 9520 |
aStream nextPutAll:(' for %1 classes (%2)' |
9521 |
bindWith:ignoredReceiverClasses size |
|
9522 |
with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9523 |
^ self. |
|
14608 | 9524 |
]. |
9525 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
16535 | 9526 |
aStream nextPutAll:' until shiftKey pressed'. |
9527 |
^ self. |
|
14608 | 9528 |
]. |
9529 |
ignoreEndTime notNil ifTrue:[ |
|
16535 | 9530 |
aStream nextPutAll:' until '. |
9531 |
ignoreEndTime printOn:aStream. |
|
9532 |
^ self. |
|
14608 | 9533 |
]. |
9534 |
(ignoreCount notNil) ifTrue:[ |
|
16535 | 9535 |
(ignoreCount > 0) ifTrue:[ |
9536 |
aStream nextPutAll:' for '. |
|
9537 |
ignoreCount printOn:aStream. |
|
9538 |
^ self. |
|
9539 |
]. |
|
9540 |
(ignoreCount < 0) ifTrue:[ |
|
9541 |
aStream nextPutAll:' forEver'. |
|
9542 |
^ self. |
|
9543 |
]. |
|
9544 |
aStream nextPutAll:' no longer'. |
|
14608 | 9545 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9546 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9547 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9548 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9549 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9550 |
haltIgnoredInfoString |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9551 |
"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
|
9552 |
nil if not ignored" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9553 |
|
12941 | 9554 |
^ String streamContents:[:s | |
15413 | 9555 |
s nextPutAll:'ignored '. |
9556 |
self printConditionOn:s |
|
12941 | 9557 |
]. |
9558 |
||
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9559 |
"/ ignoreCount notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9560 |
"/ ignoreCount > 0 ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9561 |
"/ ^ '%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
|
9562 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9563 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9564 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9565 |
"/ ignoreEndTime notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9566 |
"/ (ignoreEndTime > Timestamp now) ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9567 |
"/ ^ 'ignored until %1' bindWith:ignoreEndTime |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9568 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9569 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9570 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9571 |
"/ ignoreUntilShiftKeyPressed == true ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9572 |
"/ Screen current shiftDown ifFalse:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9573 |
"/ ^ 'ignored until shiftKey is pressed' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9574 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9575 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9576 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9577 |
"/ ignoredProcesses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9578 |
"/ ^ 'ignored in some processes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9579 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9580 |
"/ ignoredReceiverClasses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9581 |
"/ ^ 'ignored for some receiver classes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9582 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9583 |
"/ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9584 |
"/ ^ 'ignored until reenabled' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9585 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9586 |
"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
|
9587 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9588 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9589 |
isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9590 |
"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
|
9591 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9592 |
ignoreEndTime notNil ifTrue:[ |
15413 | 9593 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9594 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9595 |
ignoreCount notNil ifTrue:[ |
15413 | 9596 |
^ ignoreCount == -1 or:[ ignoreCount > 0 ] |
12562 | 9597 |
]. |
12941 | 9598 |
ignoredProcesses notNil ifTrue:[ |
15413 | 9599 |
ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]]. |
9600 |
ignoredProcesses isEmpty ifTrue:[ |
|
9601 |
ignoredProcesses := nil. |
|
9602 |
^ false |
|
9603 |
]. |
|
12941 | 9604 |
]. |
12562 | 9605 |
^ true |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9606 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9607 |
"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
|
9608 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9609 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9610 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9611 |
^ false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9612 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9613 |
"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
|
9614 |
"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
|
9615 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9616 |
|
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9617 |
isForBreakpointWithParameter:paramArg |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9618 |
^ false |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9619 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9620 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9621 |
"Created: / 06-03-2012 / 14:36:28 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9622 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9623 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9624 |
isHaltIgnored |
12941 | 9625 |
"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
|
9626 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9627 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
15413 | 9628 |
^ Screen current shiftDown not |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9629 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9630 |
ignoreCount notNil ifTrue:[ |
15413 | 9631 |
^ ignoreCount > 0 |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9632 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9633 |
ignoreEndTime notNil ifTrue:[ |
15413 | 9634 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9635 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9636 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9637 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9638 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9639 |
"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
|
9640 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9641 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9642 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
11210 | 9643 |
|
8170 | 9644 |
method |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9645 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9646 |
|
9922 | 9647 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
9648 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9649 |
m := weakMethodHolder at:1. |
9796 | 9650 |
"/ wait until really gone (it could still be on the call stack |
9651 |
"/ |
|
9652 |
"/ m notNil ifTrue:[ |
|
9653 |
"/ m mclass isNil ifTrue:[ |
|
9654 |
"/ "/ no longer valid |
|
9655 |
"/ weakMethodHolder at:1 put:nil. |
|
9656 |
"/ ^ nil |
|
9657 |
"/ ]. |
|
9658 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9659 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9660 |
|
9922 | 9661 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 9662 |
! |
9663 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9664 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9665 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9666 |
|
9922 | 9667 |
methodArg == #all ifTrue:[ |
15413 | 9668 |
weakMethodHolder := methodArg |
9922 | 9669 |
] ifFalse:[ |
15413 | 9670 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 9671 |
]. |
8170 | 9672 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9673 |
|
9922 | 9674 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 9675 |
! ! |
9676 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9677 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9678 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9679 |
printOn:aStream |
9922 | 9680 |
|method| |
9681 |
||
9682 |
(method := self method) isNil ifTrue:[ |
|
15413 | 9683 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
9684 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9685 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9686 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9687 |
aStream nextPutAll:'Ignore '. |
11704 | 9688 |
method isSymbol ifTrue:[ |
15413 | 9689 |
method printOn:aStream. |
11704 | 9690 |
] ifFalse:[ |
15413 | 9691 |
method whoString printOn:aStream. |
11704 | 9692 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9693 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9694 |
|
11704 | 9695 |
"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
|
9696 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9697 |
|
8170 | 9698 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
9699 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9700 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9701 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9702 |
|
12941 | 9703 |
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
|
9704 |
^ super isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9705 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9706 |
"Modified: / 06-03-2012 / 12:40:20 / cg" |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9707 |
! |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9708 |
|
8170 | 9709 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9710 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 9711 |
weakMethodHolder == #all ifTrue:[^ true]. |
9712 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9713 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 9714 |
|
9715 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 9716 |
! |
9717 |
||
9718 |
isHaltIgnoredInMethod:aMethod line:line |
|
12937 | 9719 |
^ self isHaltIgnoredInMethod:aMethod line:line context:nil |
9720 |
! |
|
9721 |
||
9722 |
isHaltIgnoredInMethod:aMethod line:line context:context |
|
9095 | 9723 |
"/ 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
|
9724 |
|
13059 | 9725 |
"/ Transcript showCR:'-----------------------------'. |
9726 |
"/ Transcript showCR:aMethod. |
|
9727 |
"/ Transcript showCR:line. |
|
9728 |
"/ Transcript showCR:context. |
|
9729 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9730 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 9731 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 9732 |
|
12937 | 9733 |
context notNil ifTrue:[ |
15413 | 9734 |
ignoredReceiverClasses notNil ifTrue:[ |
9735 |
^ ignoredReceiverClasses includes:(context receiver class) |
|
9736 |
]. |
|
12941 | 9737 |
]. |
13059 | 9738 |
|
9739 |
"/ Transcript showCR:ignoredProcesses. |
|
9740 |
"/ Transcript showCR:Processor activeProcess. |
|
12941 | 9741 |
ignoredProcesses notNil ifTrue:[ |
15413 | 9742 |
^ ignoredProcesses includes:(Processor activeProcess) |
12937 | 9743 |
]. |
14608 | 9744 |
ignoredSendingClassAndSelectors notNil ifTrue:[ |
15413 | 9745 |
context withAllSendersDo:[:each | |
9746 |
|m className selector cls| |
|
9747 |
||
9748 |
(m := each method) notNil ifTrue:[ |
|
9749 |
cls := m mclass. |
|
9750 |
cls notNil ifTrue:[ |
|
9751 |
className := cls name. |
|
9752 |
selector := m selector. |
|
9753 |
(ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]]) |
|
9754 |
ifTrue:[^ true]. |
|
9755 |
]. |
|
9756 |
] |
|
9757 |
] |
|
14608 | 9758 |
]. |
9759 |
||
9760 |
^ self isHaltIgnored "/ unconditionally |
|
8170 | 9761 |
! ! |
9762 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9763 |
!DebugView::IgnoredBreakpoint methodsFor:'accessing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9764 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9765 |
parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9766 |
^ parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9767 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9768 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9769 |
parameter:something |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9770 |
parameter := something. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9771 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9772 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9773 |
!DebugView::IgnoredBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9774 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9775 |
printOn:aStream |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9776 |
aStream nextPutAll:'Ignore breakpoint:#', parameter. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9777 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9778 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9779 |
"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
|
9780 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9781 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9782 |
!DebugView::IgnoredBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9783 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9784 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9785 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9786 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9787 |
"Created: / 06-03-2012 / 12:54:35 / cg" |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9788 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9789 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9790 |
isForBreakpointWithParameter:paramArg |
15730 | 9791 |
Transcript showCR:parameter. |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9792 |
^ paramArg = parameter |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9793 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9794 |
"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
|
9795 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9796 |
|
4122 | 9797 |
!DebugView class methodsFor:'documentation'! |
9798 |
||
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9799 |
version |
15730 | 9800 |
^ '$Header$' |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9801 |
! |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9802 |
|
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
9803 |
version_CVS |
15730 | 9804 |
^ '$Header$' |
10628 | 9805 |
! |
9806 |
||
9807 |
version_SVN |
|
15730 | 9808 |
^ '$Id$' |
4122 | 9809 |
! ! |
9810 |
||
12106 | 9811 |
|
4122 | 9812 |
DebugView initialize! |