author | Stefan Vogel <sv@exept.de> |
Thu, 21 Jul 2016 10:50:55 +0200 | |
changeset 16750 | 1cb2908253d2 |
parent 16730 | d3a953901bf1 |
child 16753 | d0e2c8fd4a62 |
child 16800 | 95c770ac8fd6 |
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 |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1531 |
actually occured. |
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:[ |
15413 | 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 |
12039 | 1556 |
and Exception contexts, to present the context in which the error actually occured. |
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 |
||
1860 |
"/ cannot remove halts or coded breakpoints. |
|
1861 |
canRemove := haltingMethod isMethodWithBreakpoints or:[ haltingMethod isBreakpointed ]. |
|
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. |
2010 |
"/ in this case, thisContext IS recursive, but thats no error |
|
2011 |
"/ condition. |
|
2012 |
foundNoByteCodeContext := false. |
|
2013 |
foundExitContext := false. |
|
2014 |
||
2015 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
2016 |
[ |
|
2017 |
foundNoByteCodeContext not |
|
2018 |
and:[ foundExitContext not |
|
2019 |
and:[c notNil |
|
2020 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
2021 |
]]]] |
|
2022 |
whileTrue:[ |
|
2023 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
2024 |
foundExitContext := true |
|
2025 |
]. |
|
2026 |
c selector == #noByteCode ifTrue:[ |
|
2027 |
foundNoByteCodeContext := true |
|
2028 |
]. |
|
2029 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
2030 |
]. |
|
2031 |
||
2032 |
(foundNoByteCodeContext not |
|
2033 |
and:[ foundExitContext not]) ifFalse:[ |
|
2034 |
('DebugView [warning]: reentered') errorPrintCR. |
|
2035 |
||
2036 |
^ MiniDebugger |
|
2037 |
enter:aContext |
|
2038 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
2039 |
mayProceed:mayProceed. |
|
2040 |
]. |
|
2041 |
foundExitContext ifTrue:[ |
|
2042 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
2043 |
^ self. |
|
2044 |
]. |
|
3447 | 2045 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
2046 |
|
10203 | 2047 |
"/'entering: ' print. aContext printCR. |
2048 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 2049 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
2050 |
||
11890 | 2051 |
(self isHaltToBeIgnored) ifTrue:[ |
16058 | 2052 |
^ self. |
8170 | 2053 |
]. |
11892 | 2054 |
"/ "/ does not work yet - but we should ignore any breakpoints while stepping |
2055 |
"/ (stepping and:[steppedContext notNil]) ifTrue:[ |
|
2056 |
"/ self isEnteredDueToBreakpointOrHalt ifTrue:[ |
|
2057 |
"/ 'DebugView [info]: ignored other interrupt while stepping' infoPrintCR. |
|
2058 |
"/ ^ self |
|
2059 |
"/ ]. |
|
2060 |
"/ ]. |
|
16058 | 2061 |
userprefs := UserPreferences current. |
2062 |
"/ optionally log this debugger entry |
|
2063 |
(logFile := userprefs debuggerLogFile) notNil ifTrue:[ |
|
2064 |
logFile asFilename appendingFileDo:[:s | |
|
2065 |
s cr. |
|
2066 |
s nextPutLine:'-----------------------'. |
|
2067 |
Timestamp now printOn:s. |
|
2068 |
s nextPutAll:' ['; nextPutAll:Processor activeProcess name; nextPutAll:']'; cr. |
|
2069 |
s cr. |
|
2070 |
aContext fullPrintAllOn:s |
|
2071 |
]. |
|
2072 |
]. |
|
2073 |
||
13965 | 2074 |
iAmNew := self drawableId isNil. |
73 | 2075 |
|
16058 | 2076 |
self verboseBacktraceHolder value:(userprefs verboseBacktraceInDebugger). |
939 | 2077 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
2078 |
busy := cachable := true. |
73 | 2079 |
inspecting := false. |
2080 |
inspectedProcess := Processor activeProcess. |
|
2081 |
stepping := false. |
|
2082 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2083 |
stepHow := nil. |
8148 | 2084 |
nChainShown := InitialNChainShown. |
73 | 2085 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2086 |
"/ if debugger is entered while a box has grabbed the |
9076 | 2087 |
"/ 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
|
2088 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2089 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2090 |
"/ 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
|
2091 |
"/ 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
|
2092 |
"/ 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
|
2093 |
Screen allScreens do:[:aScreen | |
16058 | 2094 |
aScreen ungrabPointer. |
2095 |
aScreen ungrabKeyboard. |
|
10205 | 2096 |
]. |
2097 |
||
2098 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
2099 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
16058 | 2100 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2101 |
] ifFalse:[ |
16058 | 2102 |
terminateButton enable. |
2103 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2104 |
]. |
73 | 2105 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
2106 |
iAmNew ifFalse:[ |
16058 | 2107 |
"/ not the first time - disable buttons & menus |
2108 |
"/ from the previous life |
|
2109 |
self turnOffAllButtons. |
|
2110 |
||
2111 |
m := contextView middleButtonMenu. |
|
2112 |
m notNil ifTrue:[ |
|
2113 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
2114 |
]. |
|
2115 |
self showingDenseWalkback:(self verboseBacktraceHolder value not). |
|
132 | 2116 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2117 |
self iconLabel:'Debugger'. |
132 | 2118 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2119 |
windowGroup isNil ifTrue:[ |
16058 | 2120 |
self windowGroup: WindowGroup new. |
2121 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2122 |
]. |
132 | 2123 |
exclusive ifFalse:[ |
16058 | 2124 |
"/ create a (modal) windowGroup for myself |
2125 |
||
2126 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2127 |
] ifTrue:[ |
16058 | 2128 |
"/ create a windowGroup with a synchronous sensor for me |
2129 |
||
2130 |
windowGroup beSynchronous. |
|
73 | 2131 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2132 |
windowGroup setProcess:Processor activeProcess. |
15027 | 2133 |
IsDebuggingQuery answer:true do:[ |
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2134 |
|
16058 | 2135 |
" |
2136 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
|
2137 |
" |
|
12039 | 2138 |
"/Transcript show:'0 '; showCR:aContext. |
2139 |
"/Transcript show:'0 '; showCR:thisContext sender. |
|
2140 |
"/Transcript show:'0 '; showCR:thisContext sender sender. |
|
2141 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender. |
|
2142 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender. |
|
2143 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender. |
|
2144 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender. |
|
2145 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender. |
|
2146 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender . |
|
2147 |
"/Transcript show:'0 '; showCR:thisContext 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. |
|
2149 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender. |
|
2150 |
"/Transcript showCR:initialSelectionOrNil. |
|
16058 | 2151 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
2152 |
"/'after setContext; first is ' print. |
|
2153 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
2154 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
2155 |
||
2156 |
self updateButtonsAndMenuItemsForContext:aContext. |
|
2157 |
||
2158 |
" |
|
2159 |
If this is a new debugger, do a realize. |
|
2160 |
Otherwise, its probably better to do a map, which shows the |
|
2161 |
view at the previous position, without a need for the user to set the |
|
2162 |
position again |
|
2163 |
" |
|
2164 |
iAmNew ifTrue:[ |
|
2165 |
self realize. |
|
2166 |
] ifFalse:[ |
|
2167 |
self remap. |
|
2168 |
]. |
|
2169 |
self setForegroundWindow. |
|
2170 |
||
2171 |
exclusive ifTrue:[ |
|
2172 |
self showError:' |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2173 |
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
|
2174 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2175 |
This is a modal debugger - all event processing is stopped.. |
10205 | 2176 |
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
|
2177 |
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
|
2178 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2179 |
Also, there is no event processing (redraw) for other views.' |
16058 | 2180 |
]. |
2181 |
||
2182 |
self autoRaiseView ifTrue:[ |
|
2183 |
"/ self raise. |
|
2184 |
self raiseDeiconified. |
|
2185 |
self topView activate; setForegroundWindow; activate. |
|
2186 |
]. |
|
2187 |
||
2188 |
canContinue := true. |
|
2189 |
exitAction := nil. |
|
2190 |
||
2191 |
"/ enter private event handling loop. This is left (and we come back here again) |
|
2192 |
"/ when any button was pressed which requires continuation of the debuggee or |
|
2193 |
"/ closedown of the debugger. |
|
2194 |
[self controlLoop] ifCurtailed:[ |
|
2195 |
windowGroup notNil ifTrue:[ |
|
2196 |
windowGroup setProcess:nil. |
|
2197 |
]. |
|
2198 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
2199 |
self destroy |
|
2200 |
]. |
|
2201 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2202 |
]. |
10203 | 2203 |
"/ here after my own control loop is finished. |
2204 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2205 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2206 |
"/ 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
|
2207 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 2208 |
contextView contents:nil. |
2209 |
||
73 | 2210 |
codeView acceptAction:nil. |
942 | 2211 |
codeView doItAction:nil. |
73 | 2212 |
|
4892 | 2213 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
16058 | 2214 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 2215 |
]. |
2216 |
||
11911 | 2217 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
2218 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
2219 |
||
73 | 2220 |
(exitAction ~~ #step) ifTrue:[ |
16058 | 2221 |
"/ not stepping or continue - close window |
2222 |
self cacheMyself. |
|
2223 |
receiverInspector release. |
|
2224 |
contextInspector release. |
|
2225 |
||
2226 |
self unmap. |
|
2227 |
self flush. |
|
2228 |
||
2229 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
2230 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
2231 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
2232 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
2233 |
(exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ]. |
|
2234 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
2235 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
2236 |
exitAction isBlock ifTrue:[ |
|
2237 |
self exit_unwindThenDo:exitAction. |
|
2238 |
"does not return" |
|
2239 |
]. |
|
2240 |
"not reached" |
|
2241 |
^ self |
|
73 | 2242 |
]. |
2243 |
||
3447 | 2244 |
"/ stepping - window stays open |
940 | 2245 |
selectedContext := actualContext := firstContext := nil. |
73 | 2246 |
|
2472 | 2247 |
"/ restore the previous pointer grab |
73 | 2248 |
grabber notNil ifTrue:[ |
16253 | 2249 |
device grabPointerInView:grabber. |
16058 | 2250 |
grabber := nil. |
61 | 2251 |
]. |
73 | 2252 |
|
2253 |
(exitAction == #step) ifTrue:[ |
|
16058 | 2254 |
" |
2255 |
schedule another stepInterrupt |
|
2256 |
- must enter myself into the collection of open debuggers, |
|
2257 |
in case the stepping process comes back again via a halt or signal |
|
2258 |
before the step is finished. In this case, the stepping debugger should |
|
2259 |
come up (instead of a new one) |
|
2260 |
- must flush caches since optimized methods not always |
|
2261 |
look for pending interrupts |
|
2262 |
" |
|
2263 |
||
2264 |
"/ |
|
2265 |
"/ also must care for stepping into a return |
|
2266 |
"/ |
|
2267 |
steppedContext notNil ifTrue:[ |
|
2268 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
2269 |
]. |
|
2270 |
||
2271 |
OpenDebuggers isNil ifTrue:[ |
|
2272 |
OpenDebuggers := WeakIdentitySet new. |
|
2273 |
]. |
|
2274 |
OpenDebuggers add:self. |
|
2275 |
||
2276 |
self label:'single stepping - please wait ...'. |
|
2277 |
stepping := true. |
|
2278 |
||
2279 |
ObjectMemory stepInterruptHandler:self. |
|
2280 |
Processor activeProcess stepInterruptHandler:self. |
|
2281 |
ObjectMemory flushCaches. |
|
2282 |
||
2283 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
2284 |
Context singleStepInterruptRequest |
|
2285 |
raiseWith: |
|
2286 |
(("bigStep" steppedContextLineno notNil) |
|
2287 |
ifTrue:[#next] |
|
2288 |
ifFalse:[#step]) |
|
2289 |
] ifFalse:[ |
|
2290 |
"/ see if we came here through an interrupt-action |
|
2291 |
"/ (i.e. aProcess interruptWith:...) |
|
2292 |
||
2293 |
enteredByInterrupt := false. |
|
2294 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2295 |
[enteredByInterrupt not |
|
2296 |
and:[con notNil |
|
2297 |
and:[con ~~ aContext]]] whileTrue:[ |
|
2298 |
((sel := con selector) == #timerInterrupt |
|
2299 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
2300 |
enteredByInterrupt := true. |
|
2301 |
] ifFalse:[ |
|
2302 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2303 |
]. |
|
2304 |
]. |
|
2305 |
||
2306 |
ObjectMemory flushInlineCaches. |
|
2307 |
||
2308 |
DebuggingDebugger == true ifTrue:[ |
|
2309 |
enteredByInterrupt printCR. |
|
2310 |
]. |
|
2311 |
enteredByInterrupt ifTrue:[ |
|
2312 |
"/ don't want to step through all intermediate |
|
2313 |
"/ (scheduler-) contexts; place a return-trap on the |
|
2314 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2315 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2316 |
"/ 'special unwind return' printCR. |
16058 | 2317 |
con unwindThenDo:[ |
2318 |
Processor activeProcess stepInterruptHandler:self. |
|
2319 |
ObjectMemory stepInterruptHandler:self. |
|
2320 |
InStepInterrupt := nil. |
|
2321 |
StepInterruptPending := 1. |
|
2322 |
InterruptPending := 1]. |
|
2323 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2324 |
"/ 'normal step return' printCR. |
16058 | 2325 |
skipLineNr ~~ #return ifTrue:[ |
2326 |
StepInterruptPending := 1. |
|
2327 |
InterruptPending := 1. |
|
2328 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2329 |
"/ 'step for return' printCR. |
16058 | 2330 |
] |
2331 |
]. |
|
2332 |
InStepInterrupt := nil |
|
2333 |
] |
|
73 | 2334 |
] ifFalse:[ |
16058 | 2335 |
OpenDebuggers notNil ifTrue:[ |
2336 |
OpenDebuggers remove:self ifAbsent:[]. |
|
2337 |
]. |
|
2338 |
self cacheMyself. |
|
73 | 2339 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2340 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
2341 |
"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
|
2342 |
"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
|
2343 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
11697 | 2344 |
"Modified: / 27-07-2012 / 17:35:56 / cg" |
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2347 |
exit_abort |
5455 | 2348 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
2349 |
"/ that one would run on top of this context. |
|
2350 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2351 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2352 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2353 |
"/ done in the #enter:select method. |
5455 | 2354 |
"/ You are not expected to understand this. |
2355 |
||
6487 | 2356 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
2357 |
! |
|
2358 |
||
2359 |
exit_abortAll |
|
2360 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2361 |
"/ that one would run on top of this context. |
|
2362 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2363 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2364 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2365 |
"/ done in the #enter:select method. |
6487 | 2366 |
"/ You are not expected to understand this. |
2367 |
||
2368 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2371 |
exit_quickTerminate |
3447 | 2372 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2373 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2374 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2375 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 2376 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2377 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2378 |
|
13360 | 2379 |
exit_resend |
2380 |
|con| |
|
2381 |
||
2382 |
selectedContext notNil ifTrue:[ |
|
15413 | 2383 |
con := selectedContext. |
2384 |
self cacheMyself. |
|
2385 |
" |
|
2386 |
have to catch errors occuring in unwind-blocks |
|
2387 |
" |
|
2388 |
Error handle:[:ex | |
|
2389 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2390 |
ex description infoPrintCR. |
|
2391 |
ex proceed |
|
2392 |
] do:[ |
|
2393 |
^ con unwindThenResend. |
|
2394 |
]. |
|
2395 |
'DebugView [warning]: cannot resend selected context''s message' errorPrintCR |
|
13360 | 2396 |
] |
2397 |
! |
|
2398 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2399 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2400 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2401 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2402 |
selectedContext notNil ifTrue:[ |
15413 | 2403 |
con := selectedContext. |
2404 |
self cacheMyself. |
|
2405 |
" |
|
2406 |
have to catch errors occuring in unwind-blocks |
|
2407 |
" |
|
2408 |
Error handle:[:ex | |
|
2409 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2410 |
ex description infoPrintCR. |
|
2411 |
ex proceed |
|
2412 |
] do:[ |
|
2413 |
con unwindAndRestart. |
|
2414 |
]. |
|
2415 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2416 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2417 |
|
11818 | 2418 |
"Created: / 16-11-2001 / 17:23:17 / cg" |
11819 | 2419 |
"Modified: / 26-09-2012 / 15:09:52 / cg" |
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2422 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2423 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2424 |
|
14902 | 2425 |
retVal := nil. |
2426 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2427 |
selectedContext notNil ifTrue:[ |
15413 | 2428 |
" |
2429 |
if there is a selection in the codeView, |
|
2430 |
evaluate it and use the result as return value |
|
2431 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2432 |
"/ 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
|
2433 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2434 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2435 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2436 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2437 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2438 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2439 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2440 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2441 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2442 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2443 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2444 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2445 |
"/ retVal := codeView doItAction value:s. |
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 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2448 |
|
15413 | 2449 |
con := selectedContext. |
2450 |
self cacheMyself. |
|
2451 |
" |
|
2452 |
have to catch errors occuring in unwind-blocks |
|
2453 |
" |
|
2454 |
Error handle:[:ex | |
|
2455 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2456 |
ex description infoPrintCR. |
|
2457 |
ex proceed |
|
2458 |
] do:[ |
|
2459 |
con unwind:retVal. |
|
2460 |
]. |
|
2461 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2464 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 2465 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2468 |
exit_terminate |
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 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2471 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2472 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2473 |
Error handle:[:ex | |
15413 | 2474 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2475 |
ex description infoPrintCR. |
|
2476 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2477 |
] do:[ |
15413 | 2478 |
self cacheMyself. |
2479 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2480 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2481 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2482 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2483 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 2484 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
2485 |
! |
|
2486 |
||
6487 | 2487 |
exit_unwindThenDo:aBlock |
2488 |
|con| |
|
2489 |
||
2490 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2491 |
"/ that one would run on top of this context. |
|
2492 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2493 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2494 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2495 |
"/ done in the #enter:select method. |
6487 | 2496 |
"/ You are not expected to understand this. |
2497 |
||
2498 |
" |
|
2499 |
have to catch errors occuring in unwind-blocks |
|
2500 |
" |
|
2501 |
self cacheMyself. |
|
12743 | 2502 |
con := thisContext sender. |
6487 | 2503 |
|
2504 |
Error handle:[:ex | |
|
15413 | 2505 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2506 |
ex description infoPrintCR. |
|
2507 |
ex proceed |
|
6487 | 2508 |
] do:[ |
15413 | 2509 |
"/ find the enter:select context. |
2510 |
[(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ |
|
2511 |
con := con sender |
|
2512 |
]. |
|
2513 |
||
2514 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
2515 |
con sender receiver == self class ifTrue:[ |
|
2516 |
con := con sender. |
|
2517 |
con sender receiver == self class ifTrue:[ |
|
2518 |
con := con sender methodHome. |
|
2519 |
]. |
|
2520 |
]. |
|
2521 |
||
2522 |
con unwindThenDo:aBlock. |
|
6487 | 2523 |
]. |
2524 |
'DebugView [warning]: abort failed' errorPrintCR |
|
2525 |
||
2526 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
2527 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
2528 |
! |
|
2529 |
||
3447 | 2530 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
2531 |
|selection con1 con2 h| |
|
2532 |
||
2533 |
initialSelectionOrNil notNil ifTrue:[ |
|
15413 | 2534 |
^ initialSelectionOrNil |
3447 | 2535 |
]. |
2536 |
||
2537 |
" |
|
2538 |
and find the one context to show initially |
|
2539 |
- if we came here by a send (single step), its the top context; |
|
2540 |
- if we came here by a step (i.e. bigStep), its the top context |
|
2541 |
(for ifs and whiles) or the sender (for regular sends). |
|
2542 |
- otherwise, we came here by some signal raise, and we are interested |
|
2543 |
in the context where the raise actually occured. |
|
2544 |
" |
|
2545 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
2546 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
12039 | 2547 |
"/ Transcript show:'x '; showCR:exitAction. |
2548 |
||
2549 |
"/ came here via a step? |
|
3447 | 2550 |
exitAction == #step ifTrue:[ |
15413 | 2551 |
selection := 1. |
2552 |
steppedContext notNil ifTrue:[ |
|
2553 |
||
2554 |
" |
|
2555 |
if we came here by a big-step, show the method where we are |
|
2556 |
" |
|
2557 |
con1 == steppedContext ifTrue:[ |
|
2558 |
selection := 1 |
|
2559 |
] ifFalse:[ |
|
2560 |
con2 == steppedContext ifTrue:[ |
|
2561 |
selection := 2 |
|
2562 |
] |
|
2563 |
]. |
|
2564 |
" |
|
2565 |
for bigStep, we could also be in a block below the actual method ... |
|
2566 |
" |
|
2567 |
((h := con1 home) notNil |
|
2568 |
and:[h == steppedContext]) ifTrue:[ |
|
2569 |
selection := 1 |
|
2570 |
] ifFalse:[ |
|
2571 |
(con2 notNil |
|
2572 |
and:[(h := con2 home) notNil |
|
2573 |
and:[h == steppedContext]]) ifTrue:[ |
|
2574 |
selection := 2 |
|
2575 |
] |
|
2576 |
]. |
|
2577 |
h := nil. |
|
2578 |
] |
|
3447 | 2579 |
] ifFalse:[ |
15413 | 2580 |
steppedContext isNil ifTrue:[ |
2581 |
" |
|
2582 |
preselect a more interesting context, (where halt/raise was ...) |
|
2583 |
" |
|
2584 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
2585 |
selection := self class interestingContextIndexIn:contextArray. |
|
12039 | 2586 |
"/ Transcript show:'x '; showCR:selection. |
15413 | 2587 |
selection := selection min:(contextArray size). |
2588 |
] ifFalse:[ |
|
2589 |
" |
|
2590 |
if we came here by a big-step, show the method where we are |
|
2591 |
" |
|
2592 |
con1 == steppedContext ifTrue:[ |
|
2593 |
selection := 1 |
|
2594 |
] ifFalse:[ |
|
2595 |
con2 == steppedContext ifTrue:[ |
|
2596 |
selection := 2. |
|
2597 |
] |
|
2598 |
] |
|
2599 |
] |
|
3447 | 2600 |
]. |
2601 |
^ selection |
|
2602 |
||
2603 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
2604 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 2605 |
! |
2606 |
||
5110 | 2607 |
isInspecting |
2608 |
^ inspecting |
|
2609 |
! |
|
2610 |
||
2611 |
isNotInspecting |
|
2612 |
^ inspecting not |
|
2613 |
! |
|
2614 |
||
73 | 2615 |
openOn:aProcess |
10205 | 2616 |
"enter the debugger on a process - |
73 | 2617 |
in this case, we are just inspecting the context chain of the process, |
2618 |
not running on top of the debugged process, but as a separate |
|
2619 |
one. (think of it as an inspector showing more detail, and offering |
|
2620 |
some more control operations)" |
|
2621 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2622 |
|bpanel dummy w| |
73 | 2623 |
|
15257 | 2624 |
self verboseBacktraceHolder value:( UserPreferences current verboseBacktraceInDebugger ). |
939 | 2625 |
|
73 | 2626 |
busy := true. |
2627 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2628 |
stepHow := nil. |
73 | 2629 |
inspecting := true. |
2630 |
inspectedProcess := aProcess. |
|
8148 | 2631 |
nChainShown := InitialNChainShown. |
73 | 2632 |
|
2633 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2634 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2635 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2636 |
"/ get the max size & freeze button |
6647 | 2637 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2638 |
w := continueButton preferredWidth. |
6647 | 2639 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2640 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2641 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2642 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2643 |
aProcess state == #run ifTrue:[ |
16253 | 2644 |
device hasColors ifTrue:[ |
2645 |
continueButton foregroundColor:Color red darkened. |
|
2646 |
]. |
|
2647 |
continueButton label:(resources string:'Stop'). |
|
2648 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2649 |
] ifFalse:[ |
16253 | 2650 |
device hasColors ifTrue:[ |
2651 |
continueButton foregroundColor:Color green darkened darkened. |
|
2652 |
]. |
|
2653 |
continueButton label:(resources string:'Continue'). |
|
2654 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2655 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2656 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 2657 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2658 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2659 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2660 |
|
92 | 2661 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 2662 |
dummy borderWidth:0; level:0. |
61 | 2663 |
|
73 | 2664 |
"/ stepButton destroy. |
2665 |
"/ sendButton destroy. |
|
2666 |
||
2667 |
updateButton := Button |
|
16253 | 2668 |
label:(resources string:'Update') |
2669 |
action:[self updateContext] |
|
2670 |
in:bpanel. |
|
73 | 2671 |
monitorToggle := Toggle in:bpanel. |
6647 | 2672 |
monitorToggle label:(resources string:'Monitor'). |
73 | 2673 |
monitorToggle pressAction:[self autoUpdateOn]. |
2674 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
2675 |
||
2676 |
"can only look into process - context chain is not active" |
|
2677 |
canContinue := true. |
|
2678 |
||
2679 |
terminateButton enable. |
|
2680 |
abortButton enable. |
|
2681 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2682 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2683 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2684 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2685 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2686 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 2687 |
|
2688 |
aProcess isNil ifTrue:[ |
|
16253 | 2689 |
terminateButton disable. |
2690 |
abortButton disable. |
|
2691 |
continueButton disable. |
|
2692 |
returnButton disable. |
|
2693 |
restartButton disable. |
|
73 | 2694 |
] ifFalse:[ |
16253 | 2695 |
(aProcess suspendedContext isNil |
2696 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
2697 |
terminateButton disable. |
|
2698 |
]. |
|
2699 |
||
2700 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
2701 |
||
2702 |
catchBlock := [ |
|
2703 |
catchBlock := nil. |
|
2704 |
contextArray := nil. |
|
2705 |
selectedContext := actualContext := firstContext := nil. |
|
2706 |
steppedContext := wrapperContext := nil. |
|
2707 |
||
2708 |
(exitAction == #terminate) ifTrue:[ |
|
2709 |
aProcess terminate. |
|
2710 |
]. |
|
2711 |
(exitAction == #quickTerminate) ifTrue:[ |
|
2712 |
aProcess terminateNoSignal. |
|
2713 |
]. |
|
2714 |
super destroy |
|
2715 |
]. |
|
73 | 2716 |
]. |
2717 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2718 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2719 |
"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
|
2720 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2721 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2722 |
|
13388 | 2723 |
selectContextWithIndex:index |
13362 | 2724 |
self showSelection:index. |
2725 |
contextView setSelection:index. |
|
2726 |
index > 1 ifTrue:[ |
|
15413 | 2727 |
contextView scrollToLine:(index - 1) |
13362 | 2728 |
]. |
2729 |
! |
|
2730 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2731 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 2732 |
|selection| |
2733 |
||
2734 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2735 |
selection notNil ifTrue:[ |
15413 | 2736 |
self selectContextWithIndex:selection |
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2739 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 2740 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2743 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2744 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2745 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2746 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2747 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2748 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2749 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2750 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2751 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2752 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2753 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2754 |
! ! |
2755 |
||
2756 |
!DebugView methodsFor:'help'! |
|
2757 |
||
8212 | 2758 |
flyByHelpDependsOnPositionIn:aView |
2759 |
"subclasses where the help-text depends upon the pointer position might |
|
2760 |
want to redefine this" |
|
2761 |
||
2762 |
^ aView == codeView |
|
2763 |
! |
|
2764 |
||
3510 | 2765 |
flyByHelpTextFor:aComponent |
2766 |
|s| |
|
2767 |
||
15774 | 2768 |
aComponent == codeView ifTrue:[ |
2769 |
|point localPoint| |
|
2770 |
||
16253 | 2771 |
point := device pointerPosition. |
2772 |
localPoint := device translatePointFromRoot:point toView:codeView. |
|
15774 | 2773 |
((localPoint x between:0 and:codeView width) |
2774 |
and:[localPoint y between:0 and:codeView height]) |
|
2775 |
ifTrue:[ |
|
2776 |
^ self flyByHelpTextFor:codeView at:localPoint |
|
2777 |
]. |
|
2778 |
^ nil |
|
2779 |
]. |
|
2780 |
||
3510 | 2781 |
aComponent == abortButton ifTrue:[ |
15774 | 2782 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2783 |
]. |
2784 |
aComponent == terminateButton ifTrue:[ |
|
15774 | 2785 |
Processor activeProcess isGUIProcess ifTrue:[ |
2786 |
s := 'Terminate the process (closes view and shuts down application)' |
|
2787 |
] ifFalse:[ |
|
2788 |
s := 'Terminate the process' |
|
2789 |
] |
|
3510 | 2790 |
]. |
2791 |
aComponent == continueButton ifTrue:[ |
|
15774 | 2792 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2793 |
s := 'Stop' |
|
2794 |
] ifFalse:[ |
|
2795 |
s := 'Continue execution' |
|
2796 |
] |
|
3510 | 2797 |
]. |
2798 |
aComponent == stepButton ifTrue:[ |
|
15774 | 2799 |
s := 'Step to next send in selected context (don''t enter into called methods)' |
3510 | 2800 |
]. |
2801 |
aComponent == nextButton ifTrue:[ |
|
15774 | 2802 |
s := 'Step to next line in selected context (don''t enter into called methods)' |
3510 | 2803 |
]. |
2804 |
aComponent == nextOverButton ifTrue:[ |
|
15774 | 2805 |
s := 'Step over to cursor-line' |
3510 | 2806 |
]. |
2807 |
aComponent == nextOutButton ifTrue:[ |
|
15774 | 2808 |
s := 'Step out to caller' |
3510 | 2809 |
]. |
2810 |
aComponent == sendButton ifTrue:[ |
|
15774 | 2811 |
s := 'Send next message (enter into called methods)' |
3510 | 2812 |
]. |
2813 |
aComponent == returnButton ifTrue:[ |
|
15774 | 2814 |
restartButton enabled ifTrue:[ |
2815 |
s := 'Return from the selected method' |
|
2816 |
] ifFalse:[ |
|
2817 |
s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2818 |
] |
|
3510 | 2819 |
]. |
2820 |
aComponent == restartButton ifTrue:[ |
|
15774 | 2821 |
restartButton enabled ifTrue:[ |
2822 |
s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again' |
|
2823 |
] ifFalse:[ |
|
2824 |
s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2825 |
] |
|
3510 | 2826 |
]. |
13361 | 2827 |
aComponent == resendButton ifTrue:[ |
15774 | 2828 |
resendButton enabled ifTrue:[ |
2829 |
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.' |
|
2830 |
] ifFalse:[ |
|
2831 |
s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2832 |
] |
|
13361 | 2833 |
]. |
3510 | 2834 |
aComponent == monitorToggle ifTrue:[ |
15774 | 2835 |
s := 'Toggle monitoring' |
3510 | 2836 |
]. |
2837 |
aComponent == updateButton ifTrue:[ |
|
15774 | 2838 |
s := 'Update' |
3510 | 2839 |
]. |
13464 | 2840 |
aComponent == defineButton ifTrue:[ |
15774 | 2841 |
s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then' |
13464 | 2842 |
]. |
8656 | 2843 |
aComponent == reportButton ifTrue:[ |
15774 | 2844 |
s := 'Send a defect report via eMail' |
8656 | 2845 |
]. |
3510 | 2846 |
s notNil ifTrue:[ |
15774 | 2847 |
^ resources stringWithCRs:s |
3510 | 2848 |
]. |
2849 |
^ nil |
|
2850 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2851 |
"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
|
2852 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2853 |
! |
2854 |
||
8212 | 2855 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2856 |
|s vline line col pos interval| |
8212 | 2857 |
|
2858 |
aComponent == codeView ifFalse:[^ nil]. |
|
2859 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2860 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2861 |
|
8396 | 2862 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2863 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2864 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2865 |
|
2866 |
pos := codeView characterPositionOfLine:line col:col. |
|
2867 |
interval := pos to:pos. |
|
2868 |
||
10205 | 2869 |
self |
15413 | 2870 |
withNodeValueAtInterval:interval |
2871 |
do:[:value :description | |
|
2872 |
|valueClassOrSizeString valueString| |
|
2873 |
||
2874 |
valueClassOrSizeString := valueString := ''. |
|
2875 |
||
2876 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2877 |
value isString ifTrue:[ |
|
2878 |
value isText ifTrue:[ |
|
2879 |
valueString := '"',(value contractTo:80),'"'. |
|
2880 |
] ifFalse:[ |
|
2881 |
valueString := value storeString contractTo:80. |
|
2882 |
]. |
|
2883 |
] ifFalse:[ |
|
2884 |
(value isBoolean |
|
2885 |
or:[ value isInteger |
|
2886 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2887 |
valueString := value printString. |
|
2888 |
] ifFalse:[ |
|
2889 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2890 |
||
2891 |
(value isArray |
|
2892 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2893 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2894 |
]. |
|
2895 |
||
2896 |
Error handle:[:ex | |
|
2897 |
valueString := '??? (',ex description,')' |
|
2898 |
] do:[ |
|
2899 |
[ |
|
2900 |
valueString := value printString contractTo:80. |
|
2901 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
|
2902 |
] |
|
2903 |
] |
|
2904 |
]. |
|
2905 |
description isEmptyOrNil ifTrue:[ |
|
2906 |
s := valueString , valueClassOrSizeString |
|
2907 |
] ifFalse:[ |
|
2908 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2909 |
]. |
|
2910 |
]. |
|
8592 | 2911 |
"/ Transcript showCR:s. |
2912 |
^ s |
|
9446 | 2913 |
|
2914 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2915 |
! |
2916 |
||
266 | 2917 |
helpTextFor:aComponent |
2918 |
|s| |
|
2919 |
||
2920 |
aComponent == abortButton ifTrue:[ |
|
15413 | 2921 |
s := 'HELP_ABORT' |
266 | 2922 |
]. |
2923 |
aComponent == terminateButton ifTrue:[ |
|
15413 | 2924 |
s := 'HELP_TERMINATE' |
266 | 2925 |
]. |
2926 |
aComponent == continueButton ifTrue:[ |
|
15413 | 2927 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2928 |
s := 'HELP_STOP' |
|
2929 |
] ifFalse:[ |
|
2930 |
s := 'HELP_CONTINUE' |
|
2931 |
] |
|
266 | 2932 |
]. |
2933 |
aComponent == stepButton ifTrue:[ |
|
15413 | 2934 |
s := 'HELP_STEP' |
266 | 2935 |
]. |
2936 |
aComponent == nextButton ifTrue:[ |
|
15413 | 2937 |
s := 'HELP_NEXT' |
266 | 2938 |
]. |
1065 | 2939 |
aComponent == nextOverButton ifTrue:[ |
15413 | 2940 |
s := 'HELP_NEXTOVER' |
1065 | 2941 |
]. |
2942 |
aComponent == nextOutButton ifTrue:[ |
|
15413 | 2943 |
s := 'HELP_NEXTOUT' |
1065 | 2944 |
]. |
266 | 2945 |
aComponent == stepButton ifTrue:[ |
15413 | 2946 |
s := 'HELP_STEP' |
266 | 2947 |
]. |
2948 |
aComponent == sendButton ifTrue:[ |
|
15413 | 2949 |
s := 'HELP_SEND' |
266 | 2950 |
]. |
2951 |
aComponent == returnButton ifTrue:[ |
|
15413 | 2952 |
returnButton enabled ifTrue:[ |
2953 |
s := 'HELP_RETURN' |
|
2954 |
] ifFalse:[ |
|
2955 |
s := 'HELP_RETURN_DISABLED' |
|
2956 |
]. |
|
266 | 2957 |
]. |
2958 |
aComponent == restartButton ifTrue:[ |
|
15413 | 2959 |
restartButton enabled ifTrue:[ |
2960 |
s := 'HELP_RESTART' |
|
2961 |
] ifFalse:[ |
|
2962 |
s := 'HELP_RESTART_DISABLED' |
|
2963 |
]. |
|
266 | 2964 |
]. |
13361 | 2965 |
aComponent == resendButton ifTrue:[ |
15413 | 2966 |
resendButton enabled ifTrue:[ |
2967 |
s := 'HELP_RESEND' |
|
2968 |
] ifFalse:[ |
|
2969 |
s := 'HELP_RESEND_DISABLED' |
|
2970 |
]. |
|
13361 | 2971 |
]. |
266 | 2972 |
aComponent == contextView ifTrue:[ |
15413 | 2973 |
s := 'HELP_WALKBACK' |
266 | 2974 |
]. |
2975 |
aComponent == codeView ifTrue:[ |
|
15413 | 2976 |
s := 'HELP_CODEVIEW' |
266 | 2977 |
]. |
2978 |
aComponent == monitorToggle ifTrue:[ |
|
15413 | 2979 |
s := 'HELP_MONITOR' |
266 | 2980 |
]. |
2981 |
aComponent == updateButton ifTrue:[ |
|
15413 | 2982 |
s := 'HELP_UPDATE' |
266 | 2983 |
]. |
14523 | 2984 |
aComponent == gotoDialogOpenerButton ifTrue:[ |
15413 | 2985 |
s := 'HELP_GOTO_DIALOG_OPENER' |
14523 | 2986 |
]. |
2987 |
aComponent == gotoApplicationActionMethodButton ifTrue:[ |
|
15413 | 2988 |
s := 'HELP_GOTO_APPLICATION_ACTION' |
14523 | 2989 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2990 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2991 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2992 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2993 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
15413 | 2994 |
s := 'HELP_REC_INSP' |
266 | 2995 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2996 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
15413 | 2997 |
s := 'HELP_CON_INSP' |
266 | 2998 |
]. |
2999 |
||
3000 |
s notNil ifTrue:[ |
|
15413 | 3001 |
^ resources stringWithCRs:s |
266 | 3002 |
]. |
3003 |
^ nil |
|
3004 |
||
3005 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 3006 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 3007 |
! ! |
3008 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3009 |
!DebugView methodsFor:'initialization & release'! |
266 | 3010 |
|
3011 |
addToCurrentProject |
|
3012 |
"ignored here" |
|
3013 |
||
3014 |
^ self |
|
3015 |
! |
|
3016 |
||
2115 | 3017 |
destroy |
3018 |
"closing the debugger implies an abort or continue" |
|
3019 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3020 |
self destroyWithConfirmation:true |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3021 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3022 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3023 |
"Modified: / 23-03-2012 / 12:50:01 / cg" |
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 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3026 |
destroyWithConfirmation:withConfirmation |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3027 |
"closing the debugger implies an abort or continue" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3028 |
|
2404 | 3029 |
|m| |
3030 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3031 |
withConfirmation ifTrue:[ |
15413 | 3032 |
self checkIfCodeIsReallyModified ifTrue:[ |
3033 |
(self confirm:('Code modified - exit anyway ?')) |
|
3034 |
ifFalse:[ |
|
3035 |
^ self |
|
3036 |
] |
|
3037 |
] |
|
2115 | 3038 |
]. |
3039 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
3040 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
3041 |
|
2404 | 3042 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 3043 |
inspecting ifFalse:[ |
15413 | 3044 |
"I am running on top of a process, abort or continue it" |
3045 |
||
3046 |
windowGroup notNil ifTrue:[ |
|
3047 |
windowGroup setProcess:nil. |
|
3048 |
]. |
|
3049 |
self uncacheMyself. |
|
3050 |
||
3051 |
"/ |
|
3052 |
"/ catch invalid return; |
|
3053 |
"/ this happens, when my process has somehow died (quickterminate) |
|
3054 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
3055 |
"/ #destroy-window function. |
|
3056 |
"/ |
|
3057 |
Context cannotReturnSignal handle:[:ex | |
|
3058 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
3059 |
self uncacheMyself. |
|
3060 |
Debugger newDebugger. |
|
3061 |
ex return. |
|
3062 |
] do:[ |
|
3063 |
AbortOperationRequest isHandled ifTrue:[ |
|
3064 |
self doAbort. |
|
3065 |
] ifFalse:[ |
|
3066 |
self doContinue |
|
3067 |
] |
|
3068 |
]. |
|
3069 |
"/ We don't reach this point normally |
|
3070 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2115 | 3071 |
]. |
3072 |
||
2299 | 3073 |
Debugger newDebugger. |
2115 | 3074 |
"/ since I am going to be destroyed, remove me from the cache |
3075 |
self uncacheMyself. |
|
3076 |
super destroy. |
|
3077 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3078 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3079 |
"Created: / 23-03-2012 / 12:49:50 / cg" |
2115 | 3080 |
! |
3081 |
||
266 | 3082 |
initialize |
10205 | 3083 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
12529 | 3084 |
newLayout v exceptionAndTogglePanel codeToggleLabels userPrefs| |
266 | 3085 |
|
3086 |
super initialize. |
|
3087 |
||
12529 | 3088 |
userPrefs := UserPreferences current. |
3089 |
||
15257 | 3090 |
self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger). |
3091 |
||
12529 | 3092 |
hideSupportCode := userPrefs hideSupportCodeInDebugger ? false. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3093 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
15413 | 3094 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
3095 |
|
266 | 3096 |
busy := false. |
3097 |
exclusive := false. |
|
3098 |
inspecting := false. |
|
3099 |
exitAction := nil. |
|
3100 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3101 |
stepHow := nil. |
266 | 3102 |
canContinue := false. |
3103 |
||
3269 | 3104 |
mH := 0. |
3105 |
||
3447 | 3106 |
menuPanel := MenuPanel in:self. |
8131 | 3107 |
menuPanel receiver:self. |
3447 | 3108 |
menuPanel verticalLayout:false. |
8131 | 3109 |
menu := self class menuSpec decodeAsLiteralArray. |
3110 |
menu findGuiResourcesIn:self. |
|
3111 |
menuPanel menu:menu. |
|
3447 | 3112 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
3113 |
mH := menuPanel preferredHeight. |
3447 | 3114 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
3115 |
||
12529 | 3116 |
newLayout := userPrefs useNewLayoutInDebugger. |
8148 | 3117 |
newLayout ifFalse:[ |
15413 | 3118 |
bpanel := HorizontalPanelView in:self. |
3119 |
||
3120 |
self initializeButtonsIn:bpanel. |
|
3121 |
||
3122 |
bH := bpanel preferredHeight + 5. |
|
3123 |
bpanel origin:(0.0 @ mH) |
|
3124 |
extent:(1.0 @ bH). |
|
3125 |
panel := VariableVerticalPanel |
|
3126 |
origin:(0.0 @ (mH + bH)) |
|
3127 |
corner:(1.0 @ 1.0) |
|
3128 |
in:self. |
|
3129 |
||
3130 |
v := self initializeContextListViewIn:panel. |
|
3131 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
3132 |
||
3133 |
codePanel := View in:panel. |
|
3134 |
v := self initializeCodeViewIn:codePanel. |
|
3135 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3136 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3137 |
||
3138 |
v := self initializeInspectorViewsIn:panel. |
|
3139 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3140 |
|
8148 | 3141 |
] ifTrue:[ |
15413 | 3142 |
bpanel1 := HorizontalPanelView in:self. |
3143 |
self initializeButtons1In:bpanel1. |
|
3144 |
||
3145 |
contextInfoLabel := Label label:''. |
|
3146 |
contextInfoLabel adjust:#left. |
|
3147 |
bpanel1 add:contextInfoLabel. |
|
3148 |
||
3149 |
bH1 := bpanel1 preferredHeight + 5. |
|
3150 |
bpanel1 origin:(0.0 @ mH) |
|
3151 |
extent:(1.0 @ bH1). |
|
3152 |
panel := VariableVerticalPanel |
|
3153 |
origin:(0.0 @ (mH + bH1)) |
|
3154 |
corner:(1.0 @ 1.0) |
|
3155 |
in:self. |
|
3156 |
"/ panel showHandle:true. |
|
3157 |
"/ panel handlePosition:#left. |
|
3158 |
||
3159 |
v := self initializeContextListViewIn:panel. |
|
3160 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
3161 |
||
3162 |
codePanel := View in:panel. |
|
3163 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
3164 |
self initializeButtons2In:bpanel2. |
|
3165 |
||
3166 |
bH2 := bpanel2 preferredHeight + 5. |
|
3167 |
bpanel2 origin:(0.0 @ 0.0) |
|
3168 |
extent:(1.0 @ bH2). |
|
3169 |
||
3170 |
exceptionInfoLabel := Label label:''. |
|
3171 |
exceptionInfoLabel adjust:#left. |
|
3172 |
||
3173 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
3174 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
3175 |
exceptionAndTogglePanel |
|
3176 |
geometryLayout: |
|
3177 |
((LayoutFrame |
|
3178 |
origin:(0.0 @ 0.0) |
|
3179 |
corner:(1.0 @ 0.0)) |
|
3180 |
topOffset:bH2; |
|
3181 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
3182 |
rightOffset:-2). |
|
3183 |
||
3184 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
3185 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
3186 |
codeToggleLabels := resources array:{ |
|
3187 |
'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
|
3188 |
'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
|
3189 |
}. |
|
3190 |
methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
|
3191 |
methodCodeToggle list:codeToggleLabels. |
|
3192 |
methodCodeToggle useIndex:true. |
|
3193 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
3194 |
methodCodeToggle beInvisible. |
|
3195 |
||
3196 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
3197 |
||
3198 |
v := self initializeCodeViewIn:codePanel. |
|
3199 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
3200 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3201 |
||
3202 |
v := self initializeInspectorViewsIn:panel. |
|
3203 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3204 |
]. |
3205 |
||
3387 | 3206 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
15413 | 3207 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3208 |
]. |
9626 | 3209 |
LastExtent notNil ifTrue:[ |
15413 | 3210 |
self extent:LastExtent. |
9626 | 3211 |
]. |
3212 |
LastOrigin notNil ifTrue:[ |
|
15413 | 3213 |
self origin:LastOrigin. |
9626 | 3214 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3215 |
|
3269 | 3216 |
" |
3217 |
Debugger newDebugger |
|
3218 |
" |
|
3447 | 3219 |
|
11693 | 3220 |
"Modified: / 27-07-2012 / 14:46:07 / cg" |
3269 | 3221 |
! |
3222 |
||
10205 | 3223 |
initializeAbortButtonIn:bpanel |
3224 |
abortButton := Button |
|
16134 | 3225 |
label:(resources string:'Abort') |
3226 |
action:[ |
|
3227 |
abortButton turnOffWithoutRedraw. |
|
3228 |
self doAbort |
|
3229 |
] |
|
3230 |
in:bpanel. |
|
3231 |
||
3232 |
abortButton name:'abortButton'. |
|
3447 | 3233 |
|
3234 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
3235 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
3236 |
! |
|
3237 |
||
10205 | 3238 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3239 |
"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
|
3240 |
|
3447 | 3241 |
|separator| |
3242 |
||
10205 | 3243 |
bpanel horizontalLayout:#left. |
3447 | 3244 |
bpanel verticalLayout:#centerMax. |
3245 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3246 |
||
8194 | 3247 |
self initializeContinueButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3248 |
continueButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3249 |
|
9131 | 3250 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
3251 |
"/ separator borderWidth:0; level:0. |
|
3447 | 3252 |
self initializeAbortButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3253 |
abortButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3254 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3255 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3256 |
separator borderWidth:0; level:0. |
3269 | 3257 |
|
3447 | 3258 |
self initializeTerminateButtonIn:bpanel. |
3259 |
||
9131 | 3260 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 3261 |
separator borderWidth:0; level:0. |
3262 |
||
13362 | 3263 |
self initializeGotoDialogOpenerButtonIn:bpanel. |
14523 | 3264 |
self initializeGotoApplicationActionMethodButtonIn:bpanel. |
3447 | 3265 |
self initializeDefineButtonIn:bpanel. |
14523 | 3266 |
|
4356 | 3267 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
15413 | 3268 |
separator := View extent:(10 @ 5) in:bpanel. |
3269 |
separator borderWidth:0; level:0. |
|
3270 |
self initializeReportButtonIn:bpanel. |
|
4356 | 3271 |
]. |
3447 | 3272 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 3273 |
! |
3274 |
||
10205 | 3275 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3276 |
"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
|
3277 |
|
3269 | 3278 |
|separator| |
3279 |
||
9131 | 3280 |
bpanel horizontalLayout:#left. |
3269 | 3281 |
bpanel verticalLayout:#centerMax. |
3282 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3283 |
||
3447 | 3284 |
self initializeNextButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3285 |
nextButton width:100. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3286 |
|
3447 | 3287 |
self initializeStepButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3288 |
stepButton width:100. |
3447 | 3289 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3290 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3291 |
"/ 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
|
3292 |
"/ 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
|
3293 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3294 |
|
3269 | 3295 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3296 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3297 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3298 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3299 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3300 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3301 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3302 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3303 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3304 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3305 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3306 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3307 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3308 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3309 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3310 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3311 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3312 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3313 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3314 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3315 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3316 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3317 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3318 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3319 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3320 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3321 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3322 |
|
3447 | 3323 |
self initializeSendButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3324 |
sendButton width:100. |
3447 | 3325 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3326 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3327 |
separator borderWidth:0; level:0. |
3269 | 3328 |
|
3447 | 3329 |
self initializeReturnButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3330 |
returnButton width:100. |
3447 | 3331 |
self initializeRestartButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3332 |
restartButton width:100. |
13360 | 3333 |
self initializeResendButtonIn:bpanel. |
3334 |
resendButton width:100. |
|
3447 | 3335 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
3336 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 3337 |
! |
3338 |
||
10205 | 3339 |
initializeButtonsIn:bpanel |
3269 | 3340 |
|separator| |
3341 |
||
3342 |
bpanel horizontalLayout:#left. |
|
3343 |
bpanel verticalLayout:#centerMax. |
|
3344 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3345 |
||
3447 | 3346 |
self initializeAbortButtonIn:bpanel. |
3347 |
||
3269 | 3348 |
separator := View extent:(10 @ 5) in:bpanel. |
3349 |
separator borderWidth:0; level:0. |
|
3350 |
||
3447 | 3351 |
self initializeContinueButtonIn:bpanel. |
3269 | 3352 |
|
3353 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3354 |
separator borderWidth:0; level:0. |
|
3355 |
||
10205 | 3356 |
self initializeReturnButtonIn:bpanel. |
3357 |
self initializeRestartButtonIn:bpanel. |
|
13360 | 3358 |
self initializeResendButtonIn:bpanel. |
3269 | 3359 |
|
3360 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3361 |
separator borderWidth:0; level:0. |
|
3362 |
||
3447 | 3363 |
self initializeNextButtonIn:bpanel. |
3364 |
self initializeStepButtonIn:bpanel. |
|
3365 |
||
3269 | 3366 |
"/ cg: |
3367 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
3368 |
"/ they do not work relyable with inlined blocks yet. |
|
3369 |
"/ |
|
3370 |
||
3371 |
||
3372 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
3373 |
"/ img isNil ifTrue:[ |
|
3374 |
"/ img := (resources at:'next') |
|
3375 |
"/ ]. |
|
3376 |
"/ nextButton := Button |
|
3377 |
"/ label:img |
|
3378 |
"/ action:[stepButton turnOff. self doNext] |
|
3379 |
"/ in:bpanel. |
|
3380 |
"/ |
|
3381 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
3382 |
"/ img isNil ifTrue:[ |
|
3383 |
"/ img := (resources at:'over') |
|
3384 |
"/ ]. |
|
3385 |
"/ nextOverButton := Button |
|
3386 |
"/ label:img |
|
3387 |
"/ action:[stepButton turnOff. self doNextOver] |
|
3388 |
"/ in:bpanel. |
|
3389 |
"/ |
|
3390 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
3391 |
"/ img isNil ifTrue:[ |
|
3392 |
"/ img := (resources at:'out') |
|
3393 |
"/ ]. |
|
3394 |
"/ nextOutButton := Button |
|
3395 |
"/ label:img |
|
3396 |
"/ action:[stepButton turnOff. self doNextOut] |
|
3397 |
"/ in:bpanel. |
|
3398 |
||
3447 | 3399 |
self initializeSendButtonIn:bpanel. |
3400 |
||
3187 | 3401 |
separator := View extent:(30 @ 5) in:bpanel. |
3402 |
separator borderWidth:0; level:0. |
|
3269 | 3403 |
|
3447 | 3404 |
self initializeTerminateButtonIn:bpanel. |
3405 |
||
3269 | 3406 |
separator := View extent:(30 @ 5) in:bpanel. |
3407 |
separator borderWidth:0; level:0. |
|
3408 |
||
3447 | 3409 |
self initializeDefineButtonIn:bpanel. |
4356 | 3410 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
15413 | 3411 |
self initializeReportButtonIn:bpanel. |
4356 | 3412 |
]. |
3413 |
||
3447 | 3414 |
|
3415 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
3416 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 3417 |
! |
3418 |
||
3419 |
initializeCodeViewIn:panel |
|
13519 | 3420 |
|scrollableCodeView| |
3269 | 3421 |
|
10628 | 3422 |
(UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
15413 | 3423 |
scrollableCodeView := codeView := Tools::CodeView2 new. |
3424 |
codeView model: ValueHolder new. |
|
3425 |
codeView methodHolder: ValueHolder new. |
|
3426 |
codeView classHolder: ValueHolder new. |
|
10628 | 3427 |
] ifFalse:[ |
15413 | 3428 |
scrollableCodeView := HVScrollableView |
3429 |
for:CodeView |
|
3430 |
miniScrollerH:true |
|
3431 |
miniScrollerV:false |
|
3432 |
in:panel. |
|
3433 |
||
3434 |
codeView := scrollableCodeView scrolledView. |
|
3435 |
codeView enableMotionEvents. "/ for active help |
|
3436 |
]. |
|
3437 |
||
3438 |
(UserPreferences current showAcceptCancelBarInBrowser |
|
3439 |
and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
|
3440 |
ViewWithAcceptAndCancelBar notNil ifTrue:[ |
|
3441 |
|v| |
|
3442 |
||
3443 |
v := ViewWithAcceptAndCancelBar new. |
|
3444 |
v slaveView:scrollableCodeView. |
|
3445 |
v reallyModifiedHolder:(codeView isCodeView2 |
|
3446 |
ifTrue:[ codeView reallyModifiedChannel ] |
|
3447 |
ifFalse:[ |
|
3448 |
BlockValue |
|
3449 |
with:[:m | |
|
3450 |
|same| |
|
3451 |
||
3452 |
same := (codeView contentsAsString string = currentMethod source string). |
|
3453 |
codeView modifiedChannel setValue:false. "/ so it triggers again |
|
3454 |
same not. |
|
3455 |
] |
|
3456 |
argument:codeView modifiedChannel |
|
3457 |
]). |
|
3458 |
v cancelAction: |
|
3459 |
[ |
|
3460 |
"/ codeView setClipboardText:(codeView contents). "/ for undo |
|
3461 |
codeView device rememberInCopyBufferHistory:(codeView contents). "/ for undo |
|
3462 |
codeView contents:(currentMethod source). |
|
3463 |
codeView modifiedChannel setValue:false; changed. "/ trigger |
|
3464 |
codeView requestFocus. |
|
3465 |
]. |
|
3466 |
v compareAction: |
|
3467 |
[ |
|
3468 |
v := DiffCodeView |
|
3469 |
openOn:codeView contentsAsString |
|
3470 |
label:(resources string:'Changed definition (to be accepted ?)') |
|
3471 |
and:currentMethod source |
|
3472 |
label:(resources string:'Method''s Original Code'). |
|
3473 |
v label:(resources string:'Changed Code in Debugger'). |
|
3474 |
v waitUntilVisible. |
|
3475 |
"/ codeView requestFocus |
|
3476 |
]. |
|
3477 |
scrollableCodeView := v. |
|
3478 |
] |
|
13519 | 3479 |
]. |
3480 |
||
3481 |
panel add:scrollableCodeView. |
|
3482 |
^ scrollableCodeView |
|
10628 | 3483 |
|
13842 | 3484 |
"Modified: / 06-12-2013 / 17:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3269 | 3485 |
! |
3486 |
||
3487 |
initializeContextListViewIn:panel |
|
3488 |
|v| |
|
266 | 3489 |
|
10205 | 3490 |
v := HVScrollableView |
15413 | 3491 |
for:SelectionInListView |
3492 |
miniScrollerH:true |
|
3493 |
miniScrollerV:false |
|
3494 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
3495 |
v autoHideHorizontalScrollBar:true. |
266 | 3496 |
|
3497 |
contextView := v scrolledView. |
|
3498 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 3499 |
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
|
3500 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 3501 |
|
10205 | 3502 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 3503 |
|
3269 | 3504 |
^ v |
3505 |
! |
|
3506 |
||
5453 | 3507 |
initializeContextViewsMiddleButtonMenu |
3508 |
<resource: #programMenu > |
|
3509 |
||
10205 | 3510 |
contextView middleButtonMenu:(self middleButtonMenu). |
3511 |
! |
|
3512 |
||
3513 |
initializeContinueButtonIn:bpanel |
|
3514 |
continueButton := Button |
|
16134 | 3515 |
label:(resources string:'Continue') |
3516 |
action:[ |
|
3517 |
continueButton turnOffWithoutRedraw. |
|
3518 |
self doContinue |
|
3519 |
] |
|
3520 |
in:bpanel. |
|
3521 |
||
3522 |
continueButton name:'continueButton'. |
|
3447 | 3523 |
|
3524 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
3525 |
! |
|
3526 |
||
10205 | 3527 |
initializeDefineButtonIn:bpanel |
3528 |
defineButton := Button |
|
16134 | 3529 |
label:(resources string:'Define') |
3530 |
action:[ |
|
3531 |
defineButton turnOffWithoutRedraw. |
|
3532 |
self doDefine |
|
3533 |
] |
|
3534 |
in:bpanel. |
|
3535 |
||
3536 |
defineButton name:'defineButton'. |
|
3447 | 3537 |
defineButton beInvisible |
3538 |
||
3539 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
3540 |
! |
|
3541 |
||
14523 | 3542 |
initializeGotoApplicationActionMethodButtonIn:bpanel |
3543 |
gotoApplicationActionMethodButton := Button |
|
16134 | 3544 |
label:(resources string:'Goto Responsible Application Method') |
3545 |
action:[ |
|
3546 |
gotoApplicationActionMethodButton turnOffWithoutRedraw. |
|
3547 |
self doGotoApplicationActionMethod |
|
3548 |
] |
|
3549 |
in:bpanel. |
|
3550 |
||
3551 |
gotoApplicationActionMethodButton name:'gotoAppMethodButton'. |
|
14523 | 3552 |
gotoApplicationActionMethodButton beInvisible |
3553 |
! |
|
3554 |
||
13362 | 3555 |
initializeGotoDialogOpenerButtonIn:bpanel |
3556 |
gotoDialogOpenerButton := Button |
|
16134 | 3557 |
label:(resources string:'Goto Dialog Opener') |
3558 |
action:[ |
|
3559 |
gotoDialogOpenerButton turnOffWithoutRedraw. |
|
3560 |
self doGotoDialogOpener |
|
3561 |
] |
|
3562 |
in:bpanel. |
|
3563 |
||
3564 |
gotoDialogOpenerButton name:'gotoDialogOpenerButton'. |
|
13362 | 3565 |
gotoDialogOpenerButton beInvisible |
3566 |
! |
|
3567 |
||
3269 | 3568 |
initializeInspectorViewsIn:panel |
3569 |
|hpanel| |
|
266 | 3570 |
|
3571 |
hpanel := VariableHorizontalPanel in:panel. |
|
3572 |
||
3573 |
receiverInspector := InspectorView |
|
15413 | 3574 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
3575 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3576 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 3577 |
|
3578 |
contextInspector := ContextInspectorView |
|
15413 | 3579 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
3580 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3581 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3582 |
|
3269 | 3583 |
^ hpanel |
266 | 3584 |
! |
3585 |
||
10205 | 3586 |
initializeNextButtonIn:bpanel |
3587 |
nextButton := Button |
|
16134 | 3588 |
label:(resources string:'Debug_Next') |
3589 |
action:[ |
|
3590 |
stepButton turnOff. |
|
3591 |
self doNext |
|
3592 |
] |
|
3593 |
in:bpanel. |
|
3594 |
||
3595 |
nextButton name:'nextButton'. |
|
3596 |
||
3597 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
3447 | 3598 |
! |
3599 |
||
10205 | 3600 |
initializeReportButtonIn:bpanel |
3601 |
reportButton := Button |
|
16134 | 3602 |
label:(resources string:'Report by Mail...') |
3603 |
action:[ |
|
3604 |
reportButton turnOffWithoutRedraw. |
|
3605 |
self doOpenReportMailApp. |
|
3606 |
] |
|
3607 |
in:bpanel. |
|
3608 |
||
3609 |
reportButton name:'reportButton'. |
|
4356 | 3610 |
|
3611 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
3612 |
! |
|
3613 |
||
13360 | 3614 |
initializeResendButtonIn:bpanel |
3615 |
resendButton := Button |
|
16134 | 3616 |
label:(resources string:'Resend') |
3617 |
action:[ |
|
3618 |
resendButton turnOff. |
|
3619 |
self doResend |
|
3620 |
] |
|
3621 |
in:bpanel. |
|
3622 |
||
3623 |
resendButton name:'resendButton'. |
|
13490 | 3624 |
|
3625 |
"/ if we have this, we do not need the restart button |
|
3626 |
restartButton beInvisible. |
|
13360 | 3627 |
! |
3628 |
||
10205 | 3629 |
initializeRestartButtonIn:bpanel |
3630 |
restartButton := Button |
|
16134 | 3631 |
label:(resources string:'Restart') |
3632 |
action:[ |
|
3633 |
restartButton turnOff. |
|
3634 |
self doRestart |
|
3635 |
] |
|
3636 |
in:bpanel. |
|
3637 |
||
3638 |
restartButton name:'restartButton' |
|
3639 |
||
3447 | 3640 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
3641 |
! |
|
3642 |
||
10205 | 3643 |
initializeReturnButtonIn:bpanel |
3644 |
returnButton := Button |
|
16134 | 3645 |
label:(resources string:'Return') |
3646 |
action:[ |
|
3647 |
returnButton turnOff. |
|
3648 |
self doReturn |
|
3649 |
] |
|
3650 |
in:bpanel. |
|
3651 |
||
3652 |
returnButton name:'returnButton'. |
|
3447 | 3653 |
|
3654 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
3655 |
! |
|
3656 |
||
10205 | 3657 |
initializeSendButtonIn:bpanel |
3658 |
sendButton := Button |
|
16134 | 3659 |
label:(resources string:'Send') |
3660 |
action:[ |
|
3661 |
sendButton turnOff. |
|
3662 |
self doSend |
|
3663 |
] |
|
3664 |
in:bpanel. |
|
3665 |
||
3666 |
sendButton name:'sendButton'. |
|
3447 | 3667 |
|
3668 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
3669 |
! |
|
3670 |
||
10205 | 3671 |
initializeStepButtonIn:bpanel |
3672 |
stepButton := Button |
|
16134 | 3673 |
label:(resources string:'Debug_Step') |
3674 |
action:[ |
|
3675 |
stepButton turnOff. |
|
3676 |
self doStep |
|
3677 |
] |
|
3678 |
in:bpanel. |
|
3679 |
||
3680 |
stepButton name:'stepButton'. |
|
3447 | 3681 |
|
3682 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
3683 |
! |
|
3684 |
||
10205 | 3685 |
initializeTerminateButtonIn:bpanel |
3686 |
terminateButton := Button |
|
16134 | 3687 |
label:(resources string:'Debug_Terminate') |
3688 |
action:[ |
|
3689 |
terminateButton turnOffWithoutRedraw. |
|
3690 |
self doTerminate |
|
3691 |
] |
|
3692 |
in:bpanel. |
|
3693 |
||
3694 |
terminateButton name:'terminateButton'. |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3695 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3696 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3697 |
|
3447 | 3698 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 3699 |
! |
3700 |
||
1249 | 3701 |
postRealize |
3702 |
super postRealize. |
|
266 | 3703 |
|
3704 |
inspecting ifTrue:[ |
|
15413 | 3705 |
inspectedProcess notNil ifTrue:[ |
3706 |
" |
|
3707 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
3708 |
to run between mine and the debugged processes prio) |
|
3709 |
" |
|
3710 |
Processor activeProcess |
|
3711 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
3712 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3713 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3714 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3715 |
self sensor addEventListener:self. |
1249 | 3716 |
|
3717 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 3718 |
! |
3719 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3720 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3721 |
"/ 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
|
3722 |
"/ 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
|
3723 |
|
13965 | 3724 |
self drawableId notNil ifTrue:[ |
15413 | 3725 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3726 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3727 |
"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
|
3728 |
self recreate. |
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 |
|
11818 | 3731 |
releaseDebuggee |
3732 |
"We have to be careful to release all refs to the debuggee, |
|
3733 |
because we may be in the cache. |
|
3734 |
Otherwise, the GC will not be able to release it" |
|
3735 |
||
3736 |
busy := false. |
|
3737 |
||
3738 |
codeView acceptAction:nil. |
|
3739 |
codeView doItAction:nil. |
|
3740 |
codeView contents:nil. |
|
3741 |
||
3742 |
receiverInspector release. |
|
3743 |
contextInspector release. |
|
3744 |
inspectedProcess := nil. |
|
3745 |
contextArray := nil. |
|
13361 | 3746 |
((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[ |
15413 | 3747 |
selectedContext := nil. |
11818 | 3748 |
]. |
3749 |
actualContext := firstContext := nil. |
|
3750 |
steppedContext := wrapperContext := nil. |
|
3751 |
catchBlock := nil. |
|
3752 |
grabber := nil. |
|
3753 |
self autoUpdateOff. |
|
3754 |
||
3755 |
"Created: / 10-07-1997 / 14:57:51 / stefan" |
|
3756 |
"Modified: / 26-09-2012 / 15:08:21 / cg" |
|
3757 |
! |
|
3758 |
||
266 | 3759 |
setLabelFor:aMessage in:aProcess |
9403 | 3760 |
|l lines processNameOrNil pidOrNil osPidString| |
6821 | 3761 |
|
3762 |
lines := aMessage asStringCollection. |
|
3763 |
lines size > 1 ifTrue:[ |
|
16501 | 3764 |
l := lines first |
6821 | 3765 |
] ifFalse:[ |
16501 | 3766 |
l := aMessage. |
6821 | 3767 |
]. |
3768 |
||
3769 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
3770 |
Error handle:[:ex | |
16501 | 3771 |
l := l , '???' |
1030 | 3772 |
] do:[ |
16501 | 3773 |
processNameOrNil := aProcess name. |
3774 |
processNameOrNil notNil ifTrue:[ |
|
3775 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
3776 |
]. |
|
3777 |
pidOrNil := aProcess id printString. |
|
3778 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 3779 |
]. |
1030 | 3780 |
l := l , ')'. |
266 | 3781 |
self label:l. |
6821 | 3782 |
|
10205 | 3783 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
16501 | 3784 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
9403 | 3785 |
]. |
3786 |
||
8305 | 3787 |
exceptionInfoLabel notNil ifTrue:[ |
16501 | 3788 |
exceptionInfoLabel |
3789 |
label:(resources |
|
3790 |
string:'%1 in process %2 [%3]%4' |
|
3791 |
with:(lines first withColor:#red) |
|
3792 |
with:(processNameOrNil ? '') |
|
3793 |
with:(pidOrNil ? '') |
|
3794 |
with:(osPidString ? '')) |
|
8305 | 3795 |
]. |
3796 |
||
6821 | 3797 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 3798 |
! ! |
3799 |
||
3800 |
!DebugView methodsFor:'interrupt handling'! |
|
3801 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3802 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3803 |
DebuggingDebugger == true ifTrue:[ |
15413 | 3804 |
'contextIRQ' printCR. |
3805 |
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
|
3806 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3807 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3808 |
|
1364 | 3809 |
"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
|
3810 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3811 |
|
0 | 3812 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3813 |
DebuggingDebugger == true ifTrue:[ |
15413 | 3814 |
'stepIRQ' print. |
3815 |
"/ ' in ' print. thisContext sender fullPrint. |
|
3816 |
'' printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3817 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
3818 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3819 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3820 |
|
11636 | 3821 |
"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
|
3822 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3823 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3824 |
stepOrNext |
15413 | 3825 |
|where here con s isWrap method wrappedMethod |
11636 | 3826 |
originalMethodOfWrappedMethod originalMethodsContext |
3827 |
inBlock subBlockLeft ignore contextBelow wrapContext |
|
10205 | 3828 |
leftWrap enteredWrap anyStepBlocks |
16373 | 3829 |
oneMore initiallyShown inBlockBelow receiver processName |
3830 |
inBreakPointHandlingCode bpntReceiver| |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3831 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3832 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3833 |
"/ DebuggingDebugger := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3834 |
"/ DebuggingDebugger2 := true |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3835 |
"/ DebuggingDebugger2 := false |
11636 | 3836 |
"/ DebuggingDebugger3 := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3837 |
"/ '' printCR |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3838 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3839 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3840 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3841 |
skipLineNr == #return ifTrue:[ |
16373 | 3842 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
3843 |
here := thisContext sender sender. |
|
3844 |
here setLineNumber:nil. |
|
3845 |
here := nil. |
|
3846 |
con := thisContext sender sender sender. |
|
3847 |
||
3848 |
HaltInterrupt handle:[:ex | |
|
3849 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
3850 |
ex proceed |
|
3851 |
] do:[ |
|
3852 |
self enter:con select:nil. |
|
3853 |
]. |
|
3854 |
con := nil. |
|
3855 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3856 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3857 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3858 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3859 |
"/ "/ 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
|
3860 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3861 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3862 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3863 |
"/ 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
|
3864 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3865 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3866 |
|
52 | 3867 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
16373 | 3868 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
3869 |
^ self |
|
52 | 3870 |
]. |
3871 |
||
29 | 3872 |
here := thisContext. "stepInterrupt" |
10205 | 3873 |
here := here sender. "the caller; step- or contextIRQ" |
3874 |
here := here sender. "the interrupted context" |
|
29 | 3875 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3876 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 3877 |
'***************************' printCR. |
3878 |
'here in ' print. |
|
3879 |
inWrap ifTrue:['(wrap) ' print.]. |
|
3880 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
3881 |
here selector printCR. |
|
3882 |
'stepping in ' print. |
|
3883 |
steppedContext notNil ifTrue:[ |
|
3884 |
((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print. |
|
3885 |
]. |
|
3886 |
steppedContext printCR. |
|
3887 |
]. |
|
3888 |
||
3889 |
(inBreakPointHandlingCode := (here selector == #break)) ifTrue:[ |
|
3890 |
bpntReceiver := here receiver. |
|
3891 |
] ifFalse:[ |
|
3892 |
(inBreakPointHandlingCode := (here sender selector == #break)) ifTrue:[ |
|
3893 |
bpntReceiver := here sender receiver. |
|
3894 |
] |
|
3895 |
]. |
|
3896 |
||
13197 | 3897 |
"/ when single stepping, ignore breakpoints |
16373 | 3898 |
inBreakPointHandlingCode ifTrue:[ |
16376 | 3899 |
(bpntReceiver notNil and:[ bpntReceiver isKindOf:Breakpoint ]) ifTrue:[ |
16373 | 3900 |
false "here receiver isEnabled" ifFalse:[ |
3901 |
con := nil. |
|
3902 |
where := nil. here := nil. |
|
3903 |
StepInterruptPending := 1. |
|
3904 |
InterruptPending := 1. |
|
3905 |
InStepInterrupt := nil. |
|
3906 |
^ self |
|
3907 |
] |
|
3908 |
]. |
|
13197 | 3909 |
]. |
3910 |
||
3911 |
"/ kludge: a bug-workaround; |
|
3912 |
"/ I should not see those... |
|
2581 | 3913 |
|
3914 |
here selector == #ioInterrupt ifTrue:[ |
|
16373 | 3915 |
DebuggingDebugger2 == true ifTrue:[ |
3916 |
'oops - should not get that one' printCR. |
|
3917 |
]. |
|
3918 |
Processor ioInterrupt. |
|
3919 |
StepInterruptPending := 1. |
|
3920 |
InterruptPending := 1. |
|
3921 |
where := nil. here := nil. |
|
3922 |
InStepInterrupt := nil. |
|
3923 |
^ self |
|
2581 | 3924 |
]. |
3925 |
||
3926 |
stepUntilEntering notNil ifTrue:[ |
|
16373 | 3927 |
DebuggingDebugger2 == true ifTrue:[ |
3928 |
'check if entering ' print. stepUntilEntering printCR. |
|
3929 |
]. |
|
3930 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
3931 |
DebuggingDebugger2 == true ifTrue:[ |
|
3932 |
'entering...' printCR. |
|
3933 |
]. |
|
3934 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
3935 |
||
3936 |
lastStepUntilEntering := stepUntilEntering. |
|
3937 |
stepUntilEntering := nil. |
|
3938 |
self enter:here select:nil. |
|
3939 |
con := nil. |
|
3940 |
^ self |
|
3941 |
]. |
|
3942 |
"/ see if stepping context is still active ... |
|
3943 |
||
3944 |
con := here. |
|
3945 |
||
3946 |
DebuggingDebugger2 == true ifTrue:[ |
|
3947 |
'start searching at: ' print. |
|
3948 |
con fullPrint. |
|
3949 |
]. |
|
3950 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
3951 |
con := con sender |
|
3952 |
]. |
|
3953 |
con notNil ifTrue:[ |
|
3954 |
DebuggingDebugger2 == true ifTrue:[ |
|
3955 |
'steppingContext still active - continue stepping' printCR. |
|
3956 |
]. |
|
3957 |
con := nil. |
|
3958 |
where := nil. here := nil. |
|
3959 |
StepInterruptPending := 1. |
|
3960 |
InterruptPending := 1. |
|
3961 |
InStepInterrupt := nil. |
|
3962 |
^ self |
|
3963 |
]. |
|
3964 |
stepUntilEntering := nil. |
|
2581 | 3965 |
]. |
3966 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
3967 |
" |
11636 | 3968 |
kludge to hide breakpoint wrappers in the context list and when single stepping: |
16373 | 3969 |
check if we are in a wrapper method's hidden setup-sequence |
3970 |
if so, ignore the interrupt and continue single sending. |
|
3971 |
Assume we are in a wrappers setup code, if there is another context above, |
|
3972 |
which is for the wrapper method (i.e. if there is context with an originalmethod |
|
3973 |
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
|
3974 |
" |
29 | 3975 |
isWrap := false. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3976 |
subBlockLeft := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3977 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3978 |
|
57 | 3979 |
inWrap ifTrue:[ |
16373 | 3980 |
"/ situation1: |
3981 |
"/ valueWithReceiver or other |
|
3982 |
"/ foo (wrapped) <- wrapContext |
|
3983 |
"/ |
|
3984 |
"/ situation2: |
|
3985 |
"/ foo (original) <- originalMethodsContext |
|
3986 |
"/ valueWithReceiver |
|
3987 |
"/ foo (wrapped) <- wrapContext |
|
3988 |
"/ |
|
3989 |
"/ situation3: |
|
3990 |
"/ other |
|
3991 |
"/ foo (original) <- originalMethodsContext |
|
3992 |
"/ valueWithReceiver |
|
3993 |
"/ foo (wrapped) <- wrapContext |
|
3994 |
"/ |
|
3995 |
"/ situation4: |
|
3996 |
"/ ... many-contexts ... (more than 8) |
|
3997 |
"/ possibly foo (original) |
|
3998 |
"/ valueWithReceiver or other |
|
3999 |
"/ foo (wrapped) |
|
4000 |
"/ |
|
4001 |
||
4002 |
"/ search for the wrapped method's context and extract the original method |
|
4003 |
where := here. |
|
4004 |
8 timesRepeat:[ |
|
4005 |
wrapContext isNil ifTrue:[ |
|
4006 |
where notNil ifTrue:[ |
|
4007 |
DebuggingDebugger2 == true ifTrue:[ |
|
4008 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
4009 |
where printCR |
|
4010 |
]. |
|
4011 |
where isBlockContext ifFalse:[ |
|
4012 |
method := where method. |
|
4013 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4014 |
originalMethodOfWrappedMethod := method originalMethod. |
|
4015 |
wrappedMethod := method. |
|
4016 |
wrapContext := where. |
|
4017 |
]. |
|
4018 |
]. |
|
4019 |
where := where sender |
|
4020 |
] |
|
4021 |
] |
|
4022 |
]. |
|
4023 |
DebuggingDebugger2 == true ifTrue:[ |
|
4024 |
'wrap-context is: ' print. |
|
4025 |
wrapContext notNil ifTrue:[ |
|
4026 |
((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print. |
|
4027 |
]. |
|
4028 |
wrapContext printCR |
|
4029 |
]. |
|
4030 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
4031 |
'oops no wrap?' errorPrintCR. |
|
4032 |
]. |
|
11636 | 4033 |
]. |
4034 |
||
4035 |
(inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[ |
|
16373 | 4036 |
isWrap := false. |
4037 |
"/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ]. |
|
4038 |
where := here. |
|
4039 |
8 timesRepeat:[ |
|
4040 |
originalMethodsContext isNil ifTrue:[ |
|
4041 |
where notNil ifTrue:[ |
|
4042 |
DebuggingDebugger2 ifTrue:[ |
|
4043 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
4044 |
where printCR |
|
4045 |
]. |
|
4046 |
where isBlockContext ifFalse:[ |
|
4047 |
method := where method. |
|
4048 |
method == originalMethodOfWrappedMethod ifTrue:[ |
|
4049 |
originalMethodsContext := here. |
|
4050 |
where == here ifTrue:[ |
|
4051 |
"/ situation2 |
|
4052 |
DebuggingDebugger2 ifTrue:[ 's2' printCR ]. |
|
4053 |
isWrap := true. |
|
4054 |
"/ here setSender:(wrapContext sender). --- leads to a crash |
|
4055 |
] ifFalse: [ |
|
4056 |
"/ situation3 |
|
4057 |
DebuggingDebugger2 ifTrue:[ 's3' printCR ]. |
|
4058 |
inWrap := false. |
|
4059 |
isWrap := false. |
|
4060 |
]. |
|
4061 |
steppedContext := where |
|
11636 | 4062 |
"/ ] ifFalse:[ |
4063 |
"/ where selector == wrapContext selector ifTrue:[ |
|
4064 |
"/ where receiver == wrapContext receiver ifTrue:[ |
|
4065 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
4066 |
"/ method printCR. |
|
4067 |
"/ method originalMethod printCR. |
|
4068 |
"/ originalMethodOfWrappedMethod printCR. |
|
4069 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
4070 |
"/ ]. |
|
4071 |
"/ ]. |
|
16373 | 4072 |
]. |
4073 |
where := where sender |
|
4074 |
]. |
|
4075 |
]. |
|
4076 |
]. |
|
4077 |
]. |
|
4078 |
DebuggingDebugger2 ifTrue:[ |
|
4079 |
'original method-context is: ' print. |
|
4080 |
originalMethodsContext notNil ifTrue:[ |
|
4081 |
((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print. |
|
4082 |
]. |
|
4083 |
originalMethodsContext printCR |
|
4084 |
]. |
|
4085 |
originalMethodsContext isNil ifTrue:[ |
|
4086 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
4087 |
"/ situation4 |
|
4088 |
DebuggingDebugger2 ifTrue:[ 's4' printCR ]. |
|
4089 |
DebuggingDebugger2 ifTrue:[ steppedContext printCR ]. |
|
4090 |
isWrap := false. |
|
4091 |
] ifFalse:[ |
|
4092 |
"/ situation1 |
|
4093 |
DebuggingDebugger2 ifTrue:[ 's1' printCR ]. |
|
4094 |
isWrap := true. |
|
4095 |
"/ steppedContext := wrapContext |
|
4096 |
]. |
|
4097 |
]. |
|
29 | 4098 |
]. |
4099 |
||
4100 |
isWrap ifTrue:[ |
|
16373 | 4101 |
DebuggingDebugger2 == true ifTrue:[ |
4102 |
'ignore wrap' printCR. |
|
4103 |
]. |
|
4104 |
||
4105 |
"/ |
|
4106 |
"/ ignore, while in wrappers hidden setup |
|
4107 |
"/ |
|
4108 |
where := nil. here := nil. |
|
4109 |
ObjectMemory flushInlineCaches. |
|
4110 |
||
4111 |
DebuggingDebugger2 == true ifTrue:[ |
|
4112 |
skipLineNr == #return ifTrue:[ |
|
4113 |
'skipRet in wrap' printCR. |
|
4114 |
] |
|
4115 |
]. |
|
4116 |
||
4117 |
StepInterruptPending := 1. |
|
4118 |
InterruptPending := 1. |
|
4119 |
InStepInterrupt := nil. |
|
4120 |
^ self |
|
29 | 4121 |
]. |
4122 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4123 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 4124 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4125 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4126 |
'bigStep is: ' print. bigStep printCR. |
4127 |
'steppedContext is: ' print. steppedContext printCR. |
|
4128 |
]. |
|
4129 |
||
4130 |
s := 'Debugger: after step'. |
|
2581 | 4131 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4132 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4133 |
"/ 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
|
4134 |
"/ |
16373 | 4135 |
(bigStep and:[steppedContext notNil]) ifTrue:[ |
4136 |
" |
|
4137 |
a step or next - ignore all contexts below the interesting one |
|
4138 |
" |
|
4139 |
where := here. "the interrupted context" |
|
4140 |
contextBelow := nil. |
|
4141 |
||
4142 |
where home notNil ifTrue:[ |
|
4143 |
"/ |
|
4144 |
"/ in a block called by 'our' context ? |
|
4145 |
"/ |
|
4146 |
where home == steppedContext ifTrue:[ |
|
4147 |
"/ '*block*' printCR. |
|
4148 |
inBlock := true |
|
4149 |
] |
|
4150 |
]. |
|
4151 |
(where == steppedContext) ifFalse:[ |
|
4152 |
where := where sender. |
|
4153 |
||
4154 |
where notNil ifTrue:[ |
|
4155 |
where home == steppedContext ifTrue:[ |
|
4156 |
"/ '*block*' printCR. |
|
4157 |
inBlock := true. |
|
4158 |
] |
|
4159 |
]. |
|
57 | 4160 |
|
4161 |
"/ 'looking for ' print. |
|
3055 | 4162 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 4163 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4164 |
"/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
|
4165 |
"/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
|
4166 |
|
16373 | 4167 |
where == steppedContext ifFalse:[ |
4168 |
||
4169 |
"/ check if we are in a context below steppedContext |
|
4170 |
"/ (i.e. if steppedContext can be reached from |
|
4171 |
"/ interrupted context. Not using context-ref but its |
|
4172 |
"/ address to avoid creation of many useless contexts.) |
|
4173 |
||
4174 |
(inBlock) ifFalse:[ |
|
4175 |
[where notNil] whileTrue:[ |
|
4176 |
||
4177 |
"/ if either the receiver or any arg of this context |
|
4178 |
"/ is a block of the steppedContext, we must really |
|
4179 |
"/ do a single step. Otherwise, stepping through a |
|
4180 |
"/ do:-loop would be very difficult. |
|
4181 |
receiver := where receiver. |
|
13197 | 4182 |
where selector == #critical: ifTrue:[ |
4183 |
anyStepBlocks := true. |
|
4184 |
] ifFalse:[ |
|
16373 | 4185 |
(receiver isBlock |
4186 |
and:[(receiver isKindOf:Block) |
|
4187 |
and:[receiver homeMethod == steppedContext method |
|
4188 |
"receiver home == steppedContext"]]) |
|
4189 |
ifTrue:[ |
|
4190 |
anyStepBlocks := true. |
|
4191 |
] ifFalse:[ |
|
4192 |
where args do:[:arg | |
|
4193 |
(arg isBlock |
|
4194 |
and:[(arg isKindOf:Block) |
|
4195 |
and:[arg homeMethod == steppedContext method |
|
4196 |
"arg home == steppedContext"]]) |
|
4197 |
ifTrue:[ |
|
4198 |
anyStepBlocks := true. |
|
4199 |
] ifFalse:[ |
|
4200 |
(where methodHome notNil |
|
4201 |
and:[where methodHome receiver isBlock |
|
4202 |
and:[(where methodHome receiver isKindOf:Block) |
|
4203 |
and:[where methodHome receiver homeMethod == steppedContext method |
|
4204 |
"where methodHome receiver home == steppedContext"]]]) |
|
4205 |
ifTrue:[ |
|
4206 |
anyStepBlocks := true. |
|
4207 |
] |
|
4208 |
]. |
|
4209 |
] |
|
4210 |
]. |
|
13197 | 4211 |
]. |
16373 | 4212 |
DebuggingDebugger2 == true ifTrue:[ |
4213 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
4214 |
where selector printCR. |
|
4215 |
]. |
|
4216 |
||
4217 |
where == steppedContext ifTrue:[ |
|
3055 | 4218 |
"/ 'found it - below; ignore' printCR. |
16373 | 4219 |
" |
4220 |
found the interesting context somwehere up in the |
|
4221 |
chain. We seem to be still below the interesting one ... |
|
4222 |
" |
|
4223 |
tracing == true ifTrue:[ |
|
4224 |
here printString printCR |
|
4225 |
]. |
|
4226 |
" |
|
4227 |
yes, a context below |
|
4228 |
- continue and schedule another stepInterrupt. |
|
4229 |
Must flush caches since optimized methods not always |
|
4230 |
look for pending interrupts |
|
4231 |
" |
|
4232 |
||
4233 |
contextBelow notNil ifTrue:[ |
|
3055 | 4234 |
"/ '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
|
4235 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4236 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4237 |
"/ 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
|
4238 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4239 |
|
16373 | 4240 |
DebuggingDebugger2 == true ifTrue:[ |
4241 |
'below stepCon; continue until unwind of: ' print. |
|
4242 |
contextBelow printCR. |
|
4243 |
]. |
|
4244 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
4245 |
StepInterruptPending := nil. |
|
4246 |
] ifFalse:[ |
|
4247 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4248 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4249 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4250 |
"/ 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
|
4251 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4252 |
|
16373 | 4253 |
DebuggingDebugger2 == true ifTrue:[ |
4254 |
'in stepCon; continue single stepping' printCR. |
|
4255 |
]. |
|
4256 |
StepInterruptPending := 1. |
|
4257 |
InterruptPending := 1. |
|
4258 |
]. |
|
4259 |
where := nil. here := nil. |
|
4260 |
InStepInterrupt := nil. |
|
4261 |
||
4262 |
^ self |
|
4263 |
]. |
|
4264 |
||
4265 |
(steppedContext notNil and:[ |
|
4266 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
4267 |
inBlockBelow := true. |
|
4268 |
]. |
|
4269 |
||
4270 |
anyStepBlocks ifFalse:[ |
|
4271 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4272 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4273 |
"/ 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
|
4274 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4275 |
where isBlockContext ifFalse:[ |
16373 | 4276 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4277 |
]. |
16373 | 4278 |
] |
4279 |
]. |
|
4280 |
where := where sender |
|
4281 |
]. |
|
4282 |
s := 'Debugger: context returned'. |
|
4283 |
subBlockLeft := true. |
|
4284 |
]. |
|
4285 |
] ifTrue:[ |
|
3055 | 4286 |
"/ 'found it right in sender' printCR. |
16373 | 4287 |
s := 'Debugger: after step' |
4288 |
]. |
|
4289 |
] ifTrue:[ |
|
3055 | 4290 |
"/ 'found it right away' printCR. |
16373 | 4291 |
s := 'Debugger: after step' |
4292 |
]. |
|
0 | 4293 |
] ifFalse:[ |
3055 | 4294 |
"/ ' send' printCR. |
16373 | 4295 |
" |
4296 |
a send |
|
4297 |
" |
|
4298 |
DebuggingDebugger2 == true ifTrue:[ |
|
4299 |
'clear steppedContext' printCR. |
|
4300 |
]. |
|
4301 |
steppedContext := nil. |
|
4302 |
s := 'Debugger: after send' |
|
0 | 4303 |
]. |
7 | 4304 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4305 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4306 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
16373 | 4307 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4308 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4309 |
|
790 | 4310 |
"/ handle the case, when a subBlock leaves; |
4311 |
"/ continue stepping in the home context. |
|
4312 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4313 |
subBlockLeft ifTrue:[ |
16373 | 4314 |
steppedContext home notNil ifTrue:[ |
4315 |
steppedContext := steppedContext home. |
|
4316 |
s := 'Debugger: after step'. |
|
4317 |
subBlockLeft := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4318 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4319 |
|
16373 | 4320 |
] |
790 | 4321 |
]. |
4322 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4323 |
" |
10205 | 4324 |
kludge to hide breakpoint wrappers in the context list: |
16373 | 4325 |
check if we are in a wrapper methods hidden exit-sequence |
4326 |
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
|
4327 |
" |
10205 | 4328 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4329 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4330 |
ifTrue:[ |
16373 | 4331 |
"/ did not find our steppedContext along the chain; |
4332 |
"/ could be in a wrappedMethods exitBlock ... |
|
4333 |
||
4334 |
leftWrap ifFalse:[ |
|
4335 |
where := here. |
|
4336 |
wrappedMethod := nil. |
|
4337 |
5 timesRepeat:[ |
|
4338 |
where notNil ifTrue:[ |
|
4339 |
where isBlockContext ifFalse:[ |
|
4340 |
method := where method. |
|
4341 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4342 |
where == wrapperContext ifTrue:[ |
|
4343 |
DebuggingDebugger2 == true ifTrue:[ |
|
4344 |
'change stepCon fromWrapped: ' print. |
|
4345 |
steppedContext print. |
|
4346 |
' to: ' print. |
|
4347 |
wrapperContext printCR. |
|
4348 |
]. |
|
4349 |
||
4350 |
inWrap := true. |
|
4351 |
enteredWrap := true. |
|
4352 |
steppedContext := wrapperContext. |
|
4353 |
wrapperContext := nil. |
|
4354 |
] |
|
4355 |
]. |
|
4356 |
]. |
|
4357 |
where := where sender |
|
4358 |
] |
|
4359 |
]. |
|
4360 |
]. |
|
4361 |
enteredWrap ifTrue:[ |
|
4362 |
ignore := true |
|
4363 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4364 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4365 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4366 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4367 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4368 |
subBlockLeft ifTrue:[ |
16373 | 4369 |
"/ special care for stepInterrupt in send, |
4370 |
"/ when created a dummy context (lineNr == 1) |
|
4371 |
||
4372 |
steppedContext lineNumber isNil ifTrue:[ |
|
4373 |
steppedContext selector == here sender selector ifTrue:[ |
|
4374 |
subBlockLeft := false. |
|
4375 |
s := 'Debugger: after step'. |
|
4376 |
steppedContext := here sender. |
|
4377 |
]. |
|
4378 |
]. |
|
4379 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4380 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4381 |
|
57 | 4382 |
inBlock ifTrue:[ |
16376 | 4383 |
DebuggingDebugger2 == true ifTrue:[ 'inBlock' printCR ]. |
16373 | 4384 |
s := 'Debugger: in block'. |
57 | 4385 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4386 |
inBlockBelow ifTrue:[ |
16376 | 4387 |
DebuggingDebugger2 == true ifTrue:[ 'inBlockBelow' printCR ]. |
16373 | 4388 |
ignore := true |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4389 |
]. |
57 | 4390 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4391 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4392 |
where notNil ifTrue:[ |
4393 |
'(' print. steppedContextLineno print. ') ' print. |
|
4394 |
where printCR. |
|
4395 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
4396 |
]. |
57 | 4397 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4398 |
ignore ifFalse:[ |
16373 | 4399 |
(bigStep |
4400 |
and:[steppedContextLineno notNil |
|
4401 |
and:[where notNil |
|
4402 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
4403 |
(here isBlockContext |
|
4404 |
and:[(here methodHome == steppedContext) |
|
4405 |
or:[here home == steppedContext]]) ifTrue:[ |
|
4406 |
DebuggingDebugger2 == true ifTrue:[ |
|
4407 |
'same line but in block' printCR. |
|
4408 |
]. |
|
4409 |
||
4410 |
steppedContext := actualContext := here. |
|
4411 |
steppedContextLineno := here lineNumber. |
|
4412 |
] ifFalse:[ |
|
4413 |
"/ kludge - I only have the info for up to 255 lines |
|
4414 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
4415 |
DebuggingDebugger2 == true ifTrue:[ |
|
4416 |
'same line - ignored' printCR. |
|
4417 |
]. |
|
4418 |
ignore := true |
|
4419 |
]. |
|
4420 |
]. |
|
4421 |
]. |
|
4422 |
||
4423 |
(subBlockLeft not |
|
4424 |
and:[skipLineNr notNil |
|
4425 |
and:[where notNil |
|
4426 |
and:[where lineNumber notNil |
|
4427 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
4428 |
DebuggingDebugger2 == true ifTrue:[ |
|
4429 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
4430 |
]. |
|
4431 |
ignore := true |
|
4432 |
]. |
|
4433 |
||
4434 |
(steppedContextLineno isNil |
|
4435 |
and:[skipLineNr isNil |
|
4436 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
4437 |
DebuggingDebugger2 == true ifTrue:[ |
|
4438 |
'same line2 (after conIRQ) - ignored' printCR. |
|
4439 |
]. |
|
4440 |
ignore := true |
|
4441 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4442 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4443 |
|
57 | 4444 |
ignore ifTrue:[ |
3055 | 4445 |
"/' ' printCR. |
16373 | 4446 |
where := nil. here := nil. |
4447 |
" |
|
4448 |
yes, a context below |
|
4449 |
- continue and schedule another stepInterrupt. |
|
4450 |
Must flush caches since optimized methods not always |
|
4451 |
look for pending interrupts |
|
4452 |
" |
|
4453 |
ObjectMemory flushInlineCaches. |
|
4454 |
StepInterruptPending := 1. |
|
4455 |
InterruptPending := 1. |
|
4456 |
InStepInterrupt := nil. |
|
4457 |
^ self |
|
57 | 4458 |
]. |
4459 |
||
3055 | 4460 |
"/ ' ' printCR. |
57 | 4461 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4462 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 4463 |
|
57 | 4464 |
tracing := false. |
4465 |
bigStep := false. |
|
4466 |
||
0 | 4467 |
"release refs to context" |
4468 |
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
|
4469 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4470 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4471 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4472 |
'==> 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
|
4473 |
]. |
1364 | 4474 |
|
4475 |
initiallyShown := nil. |
|
4476 |
(oneMore == true) ifTrue:[ |
|
16373 | 4477 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
4478 |
initiallyShown := 2 |
|
4479 |
] ifFalse:[ |
|
4480 |
initiallyShown := 1 |
|
4481 |
] |
|
1364 | 4482 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4483 |
con := thisContext sender sender. |
3435 | 4484 |
|
9235 | 4485 |
HaltInterrupt handle:[:ex | |
16373 | 4486 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
4487 |
ex proceed |
|
3435 | 4488 |
] do:[ |
16373 | 4489 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4490 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4491 |
con := nil |
1364 | 4492 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4493 |
"Created: / 14-10-1996 / 12:53:39 / cg" |
16373 | 4494 |
"Modified: / 30-04-2016 / 11:47:01 / cg" |
0 | 4495 |
! ! |
4496 |
||
4867 | 4497 |
!DebugView methodsFor:'menu & button actions'! |
266 | 4498 |
|
5875 | 4499 |
addBrowserBookmark |
4500 |
"add a browser-bookmark for the selected contexts method" |
|
4501 |
||
4502 |
|cls sel| |
|
4503 |
||
4504 |
selectedContext isNil ifTrue:[^ self]. |
|
4505 |
||
4506 |
cls := selectedContext receiver class. |
|
4507 |
sel := selectedContext selector. |
|
4508 |
(cls includesSelector:sel) ifFalse:[ |
|
15413 | 4509 |
sel := nil |
5875 | 4510 |
]. |
4511 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
4512 |
! |
|
4513 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4514 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4515 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4516 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4517 |
"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
|
4518 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4519 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4520 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4521 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4522 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4523 |
"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
|
4524 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4525 |
|
266 | 4526 |
autoUpdateOff |
4527 |
"stop the update process" |
|
4528 |
||
4529 |
updateProcess notNil ifTrue:[ |
|
15413 | 4530 |
monitorToggle lampColor:(Color yellow). |
4531 |
updateProcess terminate. |
|
4532 |
updateProcess := nil |
|
266 | 4533 |
] |
4534 |
! |
|
4535 |
||
4536 |
autoUpdateOn |
|
4537 |
"fork a subprocess which updates the contextList in regular intervals" |
|
4538 |
||
4539 |
updateProcess isNil ifTrue:[ |
|
15413 | 4540 |
updateProcess := |
4541 |
[ |
|
4542 |
[true] whileTrue:[ |
|
4543 |
monitorToggle showLamp ifTrue:[ |
|
4544 |
monitorToggle lampColor:(Color yellow). |
|
4545 |
] ifFalse:[ |
|
4546 |
monitorToggle activeForegroundColor:Color black. |
|
4547 |
]. |
|
4548 |
(Delay forSeconds:0.25) wait. |
|
4549 |
self updateContext. |
|
4550 |
monitorToggle showLamp ifTrue:[ |
|
4551 |
monitorToggle lampColor:(Color red). |
|
4552 |
] ifFalse:[ |
|
4553 |
monitorToggle activeForegroundColor:Color red. |
|
4554 |
]. |
|
4555 |
(Delay forSeconds:0.25) wait. |
|
4556 |
self updateContext. |
|
4557 |
] |
|
4558 |
] forkAt:(Processor activePriority - 1) |
|
266 | 4559 |
] |
4560 |
||
4561 |
! |
|
4562 |
||
13408 | 4563 |
browseBlocksHome |
4564 |
"browse the receiver block's home method (if a value-like send is selected)" |
|
4565 |
||
13414 | 4566 |
|cls sel block mthd| |
13408 | 4567 |
|
4568 |
selectedContext isNil ifTrue:[^ self]. |
|
4569 |
(block := selectedContext receiver) isBlock ifFalse:[ ^ self ]. |
|
4570 |
||
13414 | 4571 |
mthd := block method. |
4572 |
cls := mthd mclass. |
|
4573 |
sel := mthd selector. |
|
4574 |
||
4575 |
(cls notNil and:[(cls includesSelector:sel)]) ifTrue:[ |
|
15835 | 4576 |
cls browserClass openInClass:cls selector:sel. |
4577 |
^ self |
|
13414 | 4578 |
]. |
4579 |
||
4580 |
mthd source notEmptyOrNil ifTrue:[ |
|
15835 | 4581 |
(Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs) |
4582 |
ifTrue:[ |
|
4583 |
SystemBrowser default browseMethods:{ mthd } title:'Unbound Method' sort:false |
|
4584 |
"/ TextView openWith:mthd source title:'Unbound Method''s Source'. |
|
4585 |
]. |
|
4586 |
^ self |
|
13414 | 4587 |
]. |
4588 |
cls notNil ifTrue:[ |
|
15835 | 4589 |
(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) |
4590 |
ifTrue:[ |
|
4591 |
cls browserClass openInClass:cls selector:nil. |
|
4592 |
]. |
|
4593 |
^ self |
|
13414 | 4594 |
]. |
4595 |
Dialog information:'Block''s home method is (no longer) present in any class.'. |
|
13408 | 4596 |
! |
4597 |
||
3269 | 4598 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4599 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4600 |
|
4601 |
|cls sel| |
|
4602 |
||
4603 |
selectedContext isNil ifTrue:[^ self]. |
|
4604 |
||
4605 |
cls := selectedContext receiver class. |
|
4606 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4607 |
(cls includesSelector:sel) ifFalse:[ |
15413 | 4608 |
sel := nil |
3269 | 4609 |
]. |
4610 |
cls browserClass openInClass:cls selector:sel. |
|
4611 |
||
4612 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
4613 |
! |
|
4614 |
||
4615 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4616 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 4617 |
|
4618 |
|cls mthd| |
|
4619 |
||
4620 |
selectedContext isNil ifTrue:[^ self]. |
|
4621 |
||
4622 |
mthd := selectedContext method. |
|
3447 | 4623 |
mthd notNil ifTrue:[ |
16373 | 4624 |
cls := mthd containingClass. |
4625 |
"/ still nil if unbound - then use receiver's class |
|
3447 | 4626 |
]. |
4627 |
cls isNil ifTrue:[ |
|
16373 | 4628 |
cls := selectedContext receiver class |
3269 | 4629 |
]. |
4630 |
cls browserClass browseClassHierarchy:cls. |
|
4631 |
||
16373 | 4632 |
"Modified: / 17-11-2001 / 19:43:06 / cg" |
4633 |
"Modified (comment): / 30-04-2016 / 15:51:28 / cg" |
|
3269 | 4634 |
! |
4635 |
||
4636 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4637 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 4638 |
|
4639 |
|cls mthd| |
|
4640 |
||
4641 |
selectedContext isNil ifTrue:[^ self]. |
|
4642 |
||
4643 |
mthd := selectedContext method. |
|
3447 | 4644 |
mthd notNil ifTrue:[ |
16373 | 4645 |
cls := mthd containingClass. |
4646 |
"/ still nil if unbound - then use receiver's class |
|
3447 | 4647 |
]. |
4648 |
cls isNil ifTrue:[ |
|
16373 | 4649 |
cls := selectedContext receiver class |
3269 | 4650 |
]. |
4651 |
cls browserClass browseFullClassProtocol:cls. |
|
4652 |
||
16373 | 4653 |
"Modified: / 17-11-2001 / 19:43:43 / cg" |
4654 |
"Modified (comment): / 30-04-2016 / 15:51:32 / cg" |
|
3269 | 4655 |
! |
4656 |
||
4657 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4658 |
"browse the implementing class (of the selected context's message)" |
3269 | 4659 |
|
11610 | 4660 |
|con mthd who sel cls home| |
4661 |
||
4662 |
con := selectedContext ? actualContext. |
|
4663 |
con isNil ifTrue:[^ self]. |
|
4664 |
||
4665 |
mthd := con method. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4666 |
mthd notNil ifTrue:[ |
15413 | 4667 |
who := mthd who. |
4668 |
who notNil ifTrue:[ |
|
4669 |
cls := who methodClass. |
|
4670 |
sel := who methodSelector. |
|
4671 |
] ifFalse:[ |
|
4672 |
"might have been re-accepted" |
|
4673 |
(home := con methodHome) notNil ifTrue:[ |
|
4674 |
(sel := home selector) notNil ifTrue:[ |
|
4675 |
cls := home receiver class |
|
4676 |
whichClassImplements:selectedContext selector. |
|
4677 |
cls notNil ifTrue:[ |
|
4678 |
Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
|
4679 |
]. |
|
4680 |
] |
|
4681 |
]. |
|
4682 |
]. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4683 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4684 |
cls isNil ifTrue:[ |
15413 | 4685 |
"/ class not found - try receiver |
4686 |
cls := con receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4687 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4688 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4689 |
cls browserClass openInClass:cls selector:sel. |
266 | 4690 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
4691 |
"Created: / 22-11-1995 / 21:27:01 / cg" |
11610 | 4692 |
"Modified: / 19-07-2012 / 11:27:32 / cg" |
266 | 4693 |
! |
4694 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4695 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4696 |
"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
|
4697 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4698 |
selectedContext isNil ifTrue:[ |
15413 | 4699 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4700 |
]. |
4153 | 4701 |
"/ selectedContext receiver class browserClass |
11610 | 4702 |
self withWaitCursorDo:[ |
15413 | 4703 |
UserPreferences systemBrowserClass |
4704 |
browseImplementorsOf:selectedContext selector. |
|
11610 | 4705 |
] |
4706 |
||
4707 |
"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
|
4708 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4709 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4710 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4711 |
"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
|
4712 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4713 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4714 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4715 |
(sel := codeView selection) notNil ifTrue:[ |
15413 | 4716 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4717 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4718 |
initial isNil ifTrue:[ |
15413 | 4719 |
initial := selectedContext isNil |
4720 |
ifTrue:[nil] |
|
4721 |
ifFalse:[selectedContext selector]. |
|
10205 | 4722 |
]. |
4723 |
selector := Dialog |
|
15413 | 4724 |
requestSelector:'Selector to browse implementors of:' |
4725 |
initialAnswer:initial. |
|
11610 | 4726 |
|
4727 |
selector notEmptyOrNil ifTrue:[ |
|
15413 | 4728 |
self withWaitCursorDo:[ |
4729 |
UserPreferences systemBrowserClass |
|
4730 |
browseImplementorsMatching:selector. |
|
4731 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4732 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4733 |
|
11610 | 4734 |
"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
|
4735 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4736 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4737 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4738 |
"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
|
4739 |
|
13488 | 4740 |
|app appClass| |
4741 |
||
4742 |
(app := self processesApplication) notNil ifTrue:[ |
|
15413 | 4743 |
appClass := app class. |
4744 |
appClass browserClass openInClass:appClass selector:nil. |
|
4745 |
^ self |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4746 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4747 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4748 |
|
3269 | 4749 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4750 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4751 |
|
4752 |
|cls sel| |
|
4753 |
||
4754 |
selectedContext isNil ifTrue:[^ self]. |
|
4755 |
||
11610 | 4756 |
selectedContext isCheapBlockContext ifTrue:[ |
15413 | 4757 |
cls := selectedContext method mclass. |
4758 |
sel := selectedContext method selector. |
|
11610 | 4759 |
] ifFalse:[ |
15413 | 4760 |
cls := selectedContext receiver class. |
4761 |
sel := selectedContext selector. |
|
11610 | 4762 |
]. |
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4763 |
(cls includesSelector:sel) ifFalse:[ |
15413 | 4764 |
sel := nil |
3269 | 4765 |
]. |
4766 |
cls browserClass openInClass:cls selector:sel. |
|
4767 |
||
11610 | 4768 |
"Modified: / 19-07-2012 / 11:29:48 / cg" |
3269 | 4769 |
! |
4770 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4771 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4772 |
"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
|
4773 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4774 |
selectedContext isNil ifTrue:[ |
15413 | 4775 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4776 |
]. |
11610 | 4777 |
self withWaitCursorDo:[ |
15413 | 4778 |
UserPreferences systemBrowserClass |
4779 |
browseAllCallsOn:selectedContext selector. |
|
11610 | 4780 |
] |
4781 |
||
4782 |
"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
|
4783 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4784 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4785 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4786 |
"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
|
4787 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4788 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4789 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4790 |
(sel := codeView selection) notNil ifTrue:[ |
15413 | 4791 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4792 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4793 |
initial isNil ifTrue:[ |
15413 | 4794 |
initial := selectedContext isNil |
4795 |
ifTrue:[nil] |
|
4796 |
ifFalse:[selectedContext selector]. |
|
10205 | 4797 |
]. |
4798 |
selector := Dialog |
|
15413 | 4799 |
requestSelector:'Selector to browse senders of:' |
4800 |
initialAnswer:initial. |
|
11610 | 4801 |
|
4802 |
selector notEmptyOrNil ifTrue:[ |
|
15413 | 4803 |
self withWaitCursorDo:[ |
4804 |
UserPreferences systemBrowserClass |
|
4805 |
browseAllCallsOn:selector asSymbol. |
|
4806 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4807 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4808 |
|
11610 | 4809 |
"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
|
4810 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4811 |
|
11391 | 4812 |
clearRememberedCallchain |
4813 |
"clear the remembered callchain." |
|
4814 |
||
4815 |
RememberedCallChain := nil |
|
4816 |
||
4817 |
"Created: / 08-03-2012 / 01:29:46 / cg" |
|
4818 |
! |
|
4819 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4820 |
closeAllDebuggers |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4821 |
(Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4822 |
ifFalse:[ |
15413 | 4823 |
^ self |
4824 |
]. |
|
4825 |
||
4826 |
self class allInstancesDo:[:debugger | |
|
4827 |
debugger ~~ self ifTrue:[ |
|
4828 |
debugger busy ifTrue:[ |
|
4829 |
debugger destroyWithConfirmation:true. |
|
4830 |
]. |
|
4831 |
]. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4832 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4833 |
self closeRequest. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4834 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4835 |
"Created: / 23-03-2012 / 12:40:22 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4836 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4837 |
|
9626 | 4838 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 4839 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 4840 |
LastExtent := self extent. |
4841 |
LastOrigin := self origin. |
|
4842 |
||
4843 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
4844 |
! |
|
4845 |
||
266 | 4846 |
copyWalkbackText |
4847 |
"place the contents of the walkback view into the copy-paste buffer. |
|
12884 | 4848 |
This allows pasting it into some other view for printing. |
4849 |
||
4850 |
Show the full verbose context without filtering." |
|
266 | 4851 |
|
10760 | 4852 |
|infoText| |
4853 |
||
12884 | 4854 |
firstContext isNil ifTrue:[ |
15413 | 4855 |
infoText := 'No context, no walkback'. |
10760 | 4856 |
] ifFalse:[ |
15413 | 4857 |
exceptionInfoLabel notNil ifTrue:[ |
4858 |
infoText := exceptionInfoLabel label , '\\' withCRs. |
|
4859 |
] ifFalse:[ |
|
4860 |
infoText := '' |
|
4861 |
]. |
|
4862 |
infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection. |
|
10760 | 4863 |
]. |
4864 |
||
4865 |
self setClipboardText:infoText |
|
266 | 4866 |
|
4867 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
4868 |
! |
|
4869 |
||
4870 |
doAbort |
|
1187 | 4871 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 4872 |
at save places (for example: in the event loop) and returns back |
4873 |
from whatever the process is doing, but does not terminate it." |
|
4874 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4875 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 4876 |
(self confirm:('Code modified - abort anyway ?')) |
4877 |
ifFalse:[ |
|
4878 |
^ self |
|
4879 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4880 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4881 |
|
266 | 4882 |
inspecting ifTrue:[ |
15413 | 4883 |
inspectedProcess isDead ifTrue:[ |
4884 |
self showTerminated. |
|
4885 |
^ self |
|
4886 |
]. |
|
4887 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4888 |
self showError:'** the process does not handle the abort signal **' |
|
4889 |
] ifTrue:[ |
|
4890 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
4891 |
]. |
|
4892 |
^ self |
|
266 | 4893 |
]. |
4894 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4895 |
steppedContext := wrapperContext := nil. |
266 | 4896 |
haveControl := false. |
4897 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4898 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4899 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4900 |
catchBlock notNil ifTrue:[ |
15413 | 4901 |
abortButton turnOff. |
4902 |
catchBlock value. |
|
4903 |
||
4904 |
"/ not reached |
|
4905 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
266 | 4906 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4907 |
|
266 | 4908 |
^ self. |
4909 |
||
3447 | 4910 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 4911 |
! |
4912 |
||
6487 | 4913 |
doAbortAll |
4914 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
4915 |
at save places (for example: in the event loop) and returns back |
|
4916 |
from whatever the process is doing, but does not terminate it." |
|
4917 |
||
4918 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
15413 | 4919 |
(self confirm:('Code modified - abort anyway ?')) |
4920 |
ifFalse:[ |
|
4921 |
^ self |
|
4922 |
] |
|
6487 | 4923 |
]. |
4924 |
||
4925 |
inspecting ifTrue:[ |
|
15413 | 4926 |
inspectedProcess isDead ifTrue:[ |
4927 |
self showTerminated. |
|
4928 |
^ self |
|
4929 |
]. |
|
4930 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4931 |
self showError:'** the process does not handle the abort signal **' |
|
4932 |
] ifTrue:[ |
|
4933 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
4934 |
]. |
|
4935 |
^ self |
|
6487 | 4936 |
]. |
4937 |
||
4938 |
steppedContext := wrapperContext := nil. |
|
4939 |
haveControl := false. |
|
4940 |
exitAction := #abortAll. |
|
4941 |
||
4942 |
"exit private event-loop" |
|
4943 |
catchBlock notNil ifTrue:[ |
|
15413 | 4944 |
abortButton turnOff. |
4945 |
catchBlock value. |
|
4946 |
||
4947 |
"/ not reached |
|
4948 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 4949 |
]. |
4950 |
||
4951 |
^ self. |
|
4952 |
||
4953 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
4954 |
! |
|
4955 |
||
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4956 |
doChangeProcessPriority |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4957 |
"ask for and change the process's priority" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4958 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4959 |
|oldPrio newPrio s| |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4960 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4961 |
oldPrio := (inspectedProcess ? Processor activeProcess) priority. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4962 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4963 |
[ |
15413 | 4964 |
s := Dialog |
4965 |
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)\') |
|
4966 |
initialAnswer:oldPrio printString. |
|
4967 |
s isEmptyOrNil ifTrue:[^ self]. |
|
4968 |
newPrio := Integer readFrom:s onError:nil. |
|
4969 |
newPrio isNil |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4970 |
] whileTrue. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4971 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4972 |
newPrio := newPrio max:(Processor lowestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4973 |
newPrio := newPrio min:(Processor highestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4974 |
newPrio >= Processor highIOPriority ifTrue:[ |
15413 | 4975 |
(Dialog |
4976 |
confirm:(resources |
|
4977 |
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?')) |
|
4978 |
ifFalse:[^ self]. |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4979 |
]. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
4980 |
(inspectedProcess ? Processor activeProcess) priority:newPrio. |
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 |
"Created: / 07-03-2012 / 14:15:09 / cg" |
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 |
|
266 | 4985 |
doContinue |
4986 |
"continue from menu" |
|
4987 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
4988 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
4989 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4990 |
self checkIfCodeIsReallyModified ifTrue:[ |
16253 | 4991 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
4992 |
^ self |
|
4993 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4994 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4995 |
|
266 | 4996 |
inspecting ifTrue:[ |
16253 | 4997 |
device hasColors ifTrue:[ |
4998 |
continueButton foregroundColor:Color red darkened. |
|
4999 |
]. |
|
5000 |
continueButton label:(resources string:'Stop'). |
|
5001 |
continueButton action:[self doStop]. |
|
5002 |
||
5003 |
self processPerform:#resume. |
|
5004 |
||
5005 |
^ self |
|
266 | 5006 |
]. |
5007 |
canContinue ifTrue:[ |
|
16253 | 5008 |
exContext := thisContext findSpecialHandle:false raise:true. |
5009 |
||
5010 |
(exContext notNil |
|
5011 |
and:[ (ex := exContext receiver) isLazyValue not |
|
5012 |
and:[ ex isException |
|
5013 |
and:[ ex creator == NoHandlerError |
|
5014 |
and:[ ex exception creator == RecursionError]]]]) |
|
5015 |
ifTrue:[ |
|
5016 |
"/ debug due to unhandled recursionInterrupt. |
|
5017 |
"/ ask if we should proceed with more stack. |
|
5018 |
||
5019 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
5020 |
answer == true ifTrue:[ |
|
5021 |
proc := Processor activeProcess. |
|
5022 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
5023 |
]. |
|
5024 |
]. |
|
5025 |
||
5026 |
steppedContext := wrapperContext := nil. |
|
5027 |
tracing := false. |
|
5028 |
haveControl := false. |
|
5029 |
exitAction := #continue. |
|
5030 |
||
5031 |
"exit private event-loop" |
|
5032 |
catchBlock value. |
|
5033 |
||
5034 |
"/ not reached. |
|
5035 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
5036 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5037 |
|
266 | 5038 |
] ifFalse:[ |
16253 | 5039 |
inspecting ifFalse:[ |
5040 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
5041 |
self showSelection:1. |
|
5042 |
self doReturn |
|
5043 |
] |
|
266 | 5044 |
] |
477 | 5045 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
5046 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 5047 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 5048 |
! |
5049 |
||
13351 | 5050 |
doContinueAfterDelay |
5051 |
Delay waitForSeconds:5. |
|
5052 |
self doContinue. |
|
5053 |
! |
|
5054 |
||
3187 | 5055 |
doDefine |
5955 | 5056 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5057 |
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
|
5058 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5059 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5060 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5061 |
|
13488 | 5062 |
selectorToDefine notNil ifTrue:[ |
15413 | 5063 |
selector := selectorToDefine. |
5064 |
receiversClass := classToDefineIn. |
|
13488 | 5065 |
] ifFalse:[ |
15413 | 5066 |
selector := actualContext selector. |
5067 |
receiversClass := actualContext receiver class. |
|
13538 | 5068 |
]. |
5069 |
||
5070 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
|
5071 |
implClass notNil ifTrue:[ |
|
15413 | 5072 |
"/ must be a subclassResponsibility |
5073 |
||
5074 |
idx := contextArray identityIndexOf:actualContext. |
|
5075 |
idx > 1 ifTrue:[ |
|
5076 |
callee := contextArray at:idx-1. |
|
5077 |
||
5078 |
callee selector == #subclassResponsibility ifTrue:[ |
|
5079 |
restart := false. |
|
5080 |
] |
|
5081 |
]. |
|
13538 | 5082 |
]. |
5083 |
||
5084 |
"generate nice argument names" |
|
5085 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
5086 |
bagOfUsedClassNames := Bag new. |
|
5087 |
argNames := actualContext args |
|
15413 | 5088 |
collect: |
5089 |
[:eachArg | |
|
5090 |
|nm| |
|
5091 |
||
5092 |
nm := eachArg class nameWithoutPrefix. |
|
5093 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
5094 |
nm article , nm |
|
5095 |
] ifFalse:[ |
|
5096 |
bagOfUsedClassNames add:nm. |
|
5097 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
5098 |
]. |
|
5099 |
]. |
|
5955 | 5100 |
|
5101 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 5102 |
|
3447 | 5103 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
5104 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
5105 |
||
13488 | 5106 |
|
5107 |
( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[ |
|
15413 | 5108 |
(self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?') |
5109 |
ifFalse:[ |
|
5110 |
^ self |
|
5111 |
] |
|
3447 | 5112 |
]. |
5113 |
||
5114 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5115 |
"/ code for a getter |
3447 | 5116 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
15413 | 5117 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
5118 |
cat := 'accessing'. |
|
3447 | 5119 |
]. |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5120 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5121 |
"/ code for a setter |
3447 | 5122 |
(selector numArgs == 1 |
5123 |
and:[(selector endsWith:':') |
|
12716
062e27d32904
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12687
diff
changeset
|
5124 |
and:[receiversClass instVarNames includes:(selector copyButLast:1)]]) |
3447 | 5125 |
ifTrue:[ |
15413 | 5126 |
varName := selector copyButLast:1. |
5127 |
argName := argNames first. |
|
5128 |
code := '%1\' , haltStmtFix , '\ %3 := %4.'. |
|
5129 |
cat := 'accessing'. |
|
3447 | 5130 |
]. |
5131 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5132 |
"/ code for a tester |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5133 |
(selector numArgs == 0 |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5134 |
and:[(selector startsWith:'is') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5135 |
and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]]) |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5136 |
ifTrue:[ |
15413 | 5137 |
(receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[ |
5138 |
code := '%1\' , haltStmtFix , '\ ^ true.'. |
|
5139 |
] ifFalse:[ |
|
5140 |
code := '%1\' , haltStmtFix , '\ ^ false.'. |
|
5141 |
]. |
|
5142 |
cat := 'testing'. |
|
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 |
|
3447 | 5145 |
"/ actualContext receiver isClass ifTrue:[ |
5146 |
"/ selector == #new ifTrue:[ |
|
5147 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
5148 |
"/ ]. |
|
5149 |
"/ selector == #'new:' ifTrue:[ |
|
5150 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
5151 |
"/ ]. |
|
5152 |
"/ ]. |
|
5153 |
code isNil ifTrue:[ |
|
15413 | 5154 |
code := '%1\' , haltStmtDef |
10205 | 5155 |
]. |
5156 |
||
5157 |
self |
|
15413 | 5158 |
codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs |
5159 |
inClass:receiversClass |
|
5160 |
unwind:false |
|
5161 |
category:cat |
|
5162 |
onCancel:[^ self]. |
|
3269 | 5163 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5164 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5165 |
restart ifTrue:[ |
15413 | 5166 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5167 |
] |
3427 | 5168 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5169 |
"Modified: / 23-03-2012 / 09:49:31 / cg" |
3187 | 5170 |
! |
5171 |
||
14523 | 5172 |
doGotoApplicationActionMethod |
5173 |
"select the first application-model context. |
|
5174 |
This is another great helper, when you hit an exception, |
|
5175 |
to quickly navigate to the responsible code of you application" |
|
5176 |
||
5177 |
contextArray keysAndValuesDo:[:i :c | |
|
15413 | 5178 |
|nextCon nextRcvr dialog| |
5179 |
||
5180 |
"/ find the first appModel context |
|
5181 |
nextCon := contextArray at:i+1. |
|
5182 |
"/ |
|
5183 |
"/ while not in the appModel |
|
5184 |
"/ |
|
5185 |
[ |
|
5186 |
nextRcvr := nextCon receiver. |
|
5187 |
(nextRcvr isKindOf:ApplicationModel) |
|
5188 |
] whileFalse:[ |
|
5189 |
nextCon := nextCon sender |
|
5190 |
]. |
|
5191 |
self selectContext:nextCon. |
|
5192 |
^ self. |
|
14523 | 5193 |
]. |
5194 |
"/ not found |
|
5195 |
gotoApplicationActionMethodButton disable. |
|
5196 |
! |
|
5197 |
||
13362 | 5198 |
doGotoDialogOpener |
14523 | 5199 |
"select the context where the dialog was opened. |
5200 |
This is a great helper, when you press interrupt while a modal dialog |
|
5201 |
is open, to quickly navigate to the corresponding opening code of you application" |
|
13362 | 5202 |
|
5203 |
contextArray keysAndValuesDo:[:i :c | |
|
15413 | 5204 |
|nextCon nextRcvr dialog| |
5205 |
||
5206 |
"/ find the openModal, then walk upward |
|
5207 |
((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[ |
|
5208 |
dialog := c receiver. |
|
5209 |
nextCon := contextArray at:i+1. |
|
5210 |
"/ |
|
5211 |
"/ while still in dialog code |
|
5212 |
"/ |
|
5213 |
[ |
|
5214 |
nextRcvr := nextCon receiver. |
|
5215 |
(nextRcvr == dialog) |
|
5216 |
or:[ nextRcvr == dialog class |
|
5217 |
or:[ nextRcvr == DialogBox ]] |
|
5218 |
] whileTrue:[ |
|
5219 |
(nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ |
|
5220 |
nextCon := nextCon methodHome |
|
5221 |
]. |
|
5222 |
nextCon := nextCon sender. |
|
5223 |
]. |
|
5224 |
"/ |
|
5225 |
"/ while still in a Notification |
|
5226 |
"/ |
|
5227 |
[ |
|
5228 |
nextRcvr := nextCon receiver. |
|
5229 |
(nextRcvr isKindOf:UserInformation) |
|
5230 |
or:[ nextRcvr isBehavior |
|
5231 |
and:[nextRcvr includesBehavior:UserInformation]] |
|
5232 |
] whileTrue:[ |
|
5233 |
nextCon := nextCon sender |
|
5234 |
]. |
|
5235 |
"/ |
|
5236 |
"/ while still in UIBuilder |
|
5237 |
"/ |
|
5238 |
[ |
|
5239 |
nextRcvr := nextCon receiver. |
|
5240 |
(nextRcvr isKindOf:WindowBuilder) |
|
5241 |
] whileTrue:[ |
|
5242 |
nextCon := nextCon sender |
|
5243 |
]. |
|
5244 |
"/ |
|
5245 |
"/ while still in SimpleDialog |
|
5246 |
"/ |
|
5247 |
[ |
|
5248 |
nextRcvr := nextCon receiver. |
|
5249 |
(nextRcvr class == SimpleDialog) |
|
5250 |
] whileTrue:[ |
|
5251 |
nextCon := nextCon sender |
|
5252 |
]. |
|
5253 |
"/ |
|
5254 |
"/ while still in applicationModel support code |
|
5255 |
"/ |
|
5256 |
[ |
|
5257 |
(nextCon selector startsWith:'openDialogSpec'). |
|
5258 |
] whileTrue:[ |
|
5259 |
nextCon := nextCon sender |
|
5260 |
]. |
|
5261 |
self selectContext:nextCon. |
|
5262 |
^ self. |
|
5263 |
] |
|
13362 | 5264 |
]. |
13388 | 5265 |
"/ not found |
13362 | 5266 |
gotoDialogOpenerButton disable. |
5267 |
! |
|
5268 |
||
12671 | 5269 |
doInspectProcess |
5270 |
(inspectedProcess ? Processor activeProcess) inspect. |
|
5271 |
! |
|
5272 |
||
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5273 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5274 |
"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
|
5275 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5276 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5277 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5278 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5279 |
(self confirm:('Code modified - step anyway ?')) |
5280 |
ifFalse:[ |
|
5281 |
^ self |
|
5282 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5283 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5284 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5285 |
canContinue ifTrue:[ |
15413 | 5286 |
steppedContext := wrapperContext := nil. |
5287 |
haveControl := false. |
|
5288 |
exitAction := #step. |
|
5289 |
||
5290 |
"exit private event-loop" |
|
5291 |
catchBlock value. |
|
5292 |
||
5293 |
"/ not reached |
|
5294 |
'DebugView [warning]: send failed' errorPrintCR. |
|
5295 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5296 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5297 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5298 |
"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
|
5299 |
"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
|
5300 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5301 |
|
266 | 5302 |
doNext |
1072 | 5303 |
"skip for next source-code line; entering blocks" |
266 | 5304 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5305 |
stepHow := #nextIn. |
266 | 5306 |
self doStep:nil |
790 | 5307 |
|
1072 | 5308 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5309 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5310 |
|
13351 | 5311 |
doNextAfterDelay |
5312 |
Delay waitForSeconds:5. |
|
5313 |
self doNext. |
|
5314 |
! |
|
5315 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5316 |
doNextOut |
1072 | 5317 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5318 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5319 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5320 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5321 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5322 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 5323 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5324 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5325 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5326 |
doNextOver |
1072 | 5327 |
"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
|
5328 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5329 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5330 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5331 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5332 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 5333 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 5334 |
! |
5335 |
||
5336 |
doNoTrace |
|
5337 |
traceView notNil ifTrue:[ |
|
15413 | 5338 |
traceView topView destroy. |
5339 |
traceView := nil. |
|
266 | 5340 |
]. |
5341 |
tracing := false |
|
5342 |
! |
|
5343 |
||
4356 | 5344 |
doOpenReportMailApp |
5345 |
"open a mail report tool" |
|
5346 |
||
5347 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5348 |
|
4356 | 5349 |
str := '' writeStream. |
5350 |
||
5351 |
str nextPutLine:('Error notification from ' |
|
15413 | 5352 |
, OperatingSystem getLoginName |
5353 |
, '@' |
|
5354 |
, OperatingSystem getHostName). |
|
4356 | 5355 |
str cr. |
5356 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
5357 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 5358 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
5359 |
str nextPutLine:('Description: ' , self label). |
|
5360 |
"/ str nextPutLine:('Error: ', printedException description). |
|
5361 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
5362 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
5363 |
str nextPutLine:'Backtrace:'. |
|
5364 |
str cr. |
|
5365 |
||
5366 |
firstContext notNil ifTrue:[ |
|
15413 | 5367 |
firstContext fullPrintAllOn:str. |
4356 | 5368 |
]. |
5369 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5370 |
|
10205 | 5371 |
SendMailTool |
15413 | 5372 |
openForMessage:(str contents) |
5373 |
withSubject:('STX Error:[', self label, ']') |
|
5374 |
preOpenBlock:[:inst| |
|
5375 |
inst recipientEntryField value:'error@exept.de' |
|
5376 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5377 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5378 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 5379 |
! |
5380 |
||
13360 | 5381 |
doResend |
5382 |
"resend - the selected context is unwound and its message resent. |
|
5383 |
To be done after a cde change, to get nto the new method" |
|
5384 |
||
5385 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
15413 | 5386 |
(self confirm:('Code modified - resend anyway ?')) ifFalse:[ |
5387 |
^ self |
|
5388 |
] |
|
13360 | 5389 |
]. |
5390 |
inspecting ifTrue:[ |
|
15413 | 5391 |
^ self showError:'** not avail in inspecting debugger **' |
13360 | 5392 |
]. |
5393 |
steppedContext := wrapperContext := nil. |
|
5394 |
haveControl := false. |
|
5395 |
exitAction := #resend. "exit private event-loop" |
|
5396 |
||
5397 |
catchBlock value. |
|
5398 |
||
5399 |
"/ normally not reached |
|
5400 |
||
5401 |
'DebugView [warning]: resend failed' errorPrintCR. |
|
5402 |
resendButton turnOff. |
|
5403 |
! |
|
5404 |
||
266 | 5405 |
doRestart |
5406 |
"restart - the selected context will be restarted" |
|
10205 | 5407 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5408 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5409 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
5410 |
^ self |
|
5411 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5412 |
]. |
266 | 5413 |
inspecting ifTrue:[ |
15413 | 5414 |
selectedContext isNil ifTrue:[ |
5415 |
^ self showError:'** select a context first **' |
|
5416 |
]. |
|
5417 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
5418 |
^ self |
|
266 | 5419 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5420 |
steppedContext := wrapperContext := nil. |
266 | 5421 |
haveControl := false. |
6365 | 5422 |
exitAction := #restart. "exit private event-loop" |
5423 |
||
5424 |
catchBlock value. |
|
5425 |
||
5426 |
"/ normally not reached |
|
10205 | 5427 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5428 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5429 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5430 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5431 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 5432 |
! |
5433 |
||
5434 |
doReturn |
|
5435 |
"return - the selected context will do a ^nil" |
|
5436 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5437 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5438 |
(self confirm:('Code modified - return anyway ?')) |
5439 |
ifFalse:[ |
|
5440 |
^ self |
|
5441 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5442 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5443 |
|
266 | 5444 |
inspecting ifTrue:[ |
15413 | 5445 |
selectedContext isNil ifTrue:[ |
5446 |
^ self showError:'** select a context first **' |
|
5447 |
]. |
|
5448 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
5449 |
^ self |
|
266 | 5450 |
]. |
5451 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5452 |
steppedContext := wrapperContext := nil. |
266 | 5453 |
haveControl := false. |
5454 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5455 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5456 |
"exit private event-loop" |
6365 | 5457 |
catchBlock value. |
477 | 5458 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5459 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5460 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5461 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5462 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5463 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 5464 |
! |
5465 |
||
5466 |
doSend |
|
5467 |
"single send; reenter with next message send" |
|
5468 |
||
1072 | 5469 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5470 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5471 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5472 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5473 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5474 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5475 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5476 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5477 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5478 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5479 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5480 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5481 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5482 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5483 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5484 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5485 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5486 |
|
1072 | 5487 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 5488 |
! |
5489 |
||
5490 |
doStep |
|
5491 |
"skip for next send in selected method" |
|
5492 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5493 |
stepHow := #step. |
790 | 5494 |
self doStep:-1 |
5495 |
||
1072 | 5496 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 5497 |
! |
5498 |
||
13197 | 5499 |
doStep:lineNrOrNilOrMinus1 |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5500 |
"common helper for step, skip & next. |
10205 | 5501 |
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
|
5502 |
or to next line (if nil) or to next send (if -1)" |
266 | 5503 |
|
5504 |
|con method| |
|
5505 |
||
5506 |
inspecting ifTrue:[^ self]. |
|
5507 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5508 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5509 |
(self confirm:('Code modified - step anyway ?')) |
5510 |
ifFalse:[ |
|
5511 |
^ self |
|
5512 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5513 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5514 |
|
266 | 5515 |
canContinue ifTrue:[ |
15413 | 5516 |
selectedContext notNil ifTrue:[ |
5517 |
con := actualContext. "/ selectedContext. |
|
5518 |
steppedContextLineno := actualContext lineNumber. |
|
5519 |
] ifFalse:[ |
|
5520 |
con := contextArray at:2. |
|
5521 |
steppedContextLineno := con lineNumber. |
|
5522 |
]. |
|
5523 |
||
5524 |
skipLineNr := lineNrOrNilOrMinus1. |
|
5525 |
||
5526 |
lineNrOrNilOrMinus1 == -1 ifTrue:[ |
|
5527 |
steppedContextLineno := skipLineNr := nil. |
|
5528 |
]. |
|
5529 |
||
5530 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
5531 |
steppedContext := contextArray at:1. |
|
5532 |
stepHow := #nextIn. |
|
5533 |
] ifFalse:[ |
|
5534 |
stepHow == #nextOut ifTrue:[ |
|
5535 |
steppedContext := con home. |
|
5536 |
] ifFalse:[ |
|
5537 |
steppedContext := con. |
|
5538 |
]. |
|
5539 |
]. |
|
5540 |
||
5541 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5542 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
5543 |
"/ ' 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
|
5544 |
|
15413 | 5545 |
" |
5546 |
if we step in a wrapped method, |
|
5547 |
prepare to skip the prolog ... |
|
5548 |
" |
|
5549 |
||
5550 |
inWrap := false. |
|
5551 |
method := con method. |
|
5552 |
(method notNil |
|
5553 |
and:[method isWrapped |
|
5554 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
5555 |
inWrap := true |
|
5556 |
]. |
|
5557 |
||
5558 |
lineNrOrNilOrMinus1 == #return ifTrue:[ |
|
5559 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
5560 |
]. |
|
5561 |
||
5562 |
con := nil. |
|
5563 |
bigStep := true. |
|
5564 |
haveControl := false. |
|
5565 |
exitAction := #step. |
|
5566 |
||
5567 |
"exit private event-loop" |
|
5568 |
catchBlock value. |
|
5569 |
||
5570 |
"/ not reached |
|
5571 |
'DebugView [warning]: step failed' errorPrintCR. |
|
5572 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 5573 |
] |
477 | 5574 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5575 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 5576 |
! |
5577 |
||
13351 | 5578 |
doStepAfterDelay |
5579 |
Delay waitForSeconds:5. |
|
5580 |
self doStep. |
|
5581 |
! |
|
5582 |
||
266 | 5583 |
doStop |
5584 |
"stop the process (if its running, otherwise this is a no-op)" |
|
5585 |
||
5586 |
inspecting ifTrue:[ |
|
16253 | 5587 |
device hasColors ifTrue:[ |
5588 |
continueButton foregroundColor:Color green darkened darkened. |
|
5589 |
]. |
|
5590 |
continueButton label:(resources string:'Continue'). |
|
5591 |
continueButton action:[self doContinue]. |
|
5592 |
||
5593 |
self processPerform:#stop. |
|
5594 |
||
5595 |
^ self |
|
266 | 5596 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5597 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5598 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 5599 |
! |
5600 |
||
5601 |
doTerminate |
|
5602 |
"terminate - the process has a chance for cleanup" |
|
5603 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5604 |
self checkIfCodeIsReallyModified ifTrue:[ |
15413 | 5605 |
(self confirm:('Code modified - terminate anyway ?')) |
5606 |
ifFalse:[ |
|
5607 |
^ self |
|
5608 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5609 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5610 |
|
266 | 5611 |
inspecting ifTrue:[ |
15413 | 5612 |
self processPerform:#terminate. |
5613 |
^ self |
|
266 | 5614 |
]. |
5615 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5616 |
steppedContext := wrapperContext := nil. |
266 | 5617 |
haveControl := false. |
10205 | 5618 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5619 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5620 |
"exit private event-loop" |
6365 | 5621 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5622 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5623 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5624 |
inspecting ifFalse:[ |
15413 | 5625 |
'DebugView [warning]: terminate failed' errorPrintCR. |
5626 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
5627 |
Debugger newDebugger. |
|
5628 |
Processor activeProcess terminate. |
|
5629 |
] |
|
266 | 5630 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5631 |
terminateButton turnOff. |
477 | 5632 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5633 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 5634 |
! |
5635 |
||
5636 |
doTrace |
|
5637 |
"tracing - not really implemented ..." |
|
5638 |
||
5639 |
self warn:'this function is not yet implemented'. |
|
5640 |
||
5641 |
"/ |v b| |
|
5642 |
"/ |
|
5643 |
"/ traceView isNil ifTrue:[ |
|
5644 |
"/ v := StandardSystemView on:Display. |
|
5645 |
"/ v label:'Debugger-Trace'. |
|
5646 |
"/ v icon:icon. |
|
5647 |
"/ |
|
5648 |
"/ b := Button label:'untrace' in:v. |
|
5649 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
5650 |
"/ b action:[ |
|
5651 |
"/ StepInterruptPending := nil. |
|
5652 |
"/ tracing := false. |
|
5653 |
"/ v unrealize. |
|
5654 |
"/ traceView := nil |
|
5655 |
"/ ]. |
|
5656 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
5657 |
"/ traceView origin:(0 @ (b height)) |
|
5658 |
"/ extent:[v width @ (v height - b height)] |
|
5659 |
"/ ]. |
|
5660 |
"/ v realize. |
|
5661 |
"/ |
|
5662 |
"/ tracing := true. |
|
5663 |
! |
|
5664 |
||
5665 |
doTraceStep |
|
5666 |
"tracestep - not implemented yet" |
|
5667 |
||
5668 |
canContinue ifTrue:[ |
|
15413 | 5669 |
tracing := true. |
5670 |
self doStep |
|
266 | 5671 |
] |
5672 |
! |
|
5673 |
||
5674 |
exit |
|
5675 |
"exit from menu: immediate exit from smalltalk" |
|
5676 |
||
14129 | 5677 |
OperatingSystem exit:10 |
266 | 5678 |
! |
5679 |
||
13388 | 5680 |
findContextForWhich:aBlock thenDo:additionalAction |
5681 |
|con| |
|
5682 |
||
5683 |
con := self selectedContext. |
|
5684 |
con isNil ifTrue:[^ self]. |
|
5685 |
||
5686 |
con := con sender. |
|
5687 |
[con notNil] whileTrue:[ |
|
15413 | 5688 |
(aBlock value:con) ifTrue:[ |
5689 |
(self selectContext:con) ifTrue:[ |
|
5690 |
additionalAction value:con. |
|
5691 |
^ self. |
|
5692 |
] |
|
5693 |
]. |
|
5694 |
con := con sender. |
|
13388 | 5695 |
]. |
5696 |
||
5697 |
Dialog information:'None found'. |
|
5698 |
! |
|
5699 |
||
5700 |
findContextWithStringInSource |
|
5701 |
|stringToSearch source| |
|
5702 |
||
5703 |
stringToSearch := Dialog request:'Search what:'. |
|
5704 |
stringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5705 |
||
15413 | 5706 |
self |
5707 |
findContextForWhich:[:con | |
|
5708 |
con method notNil |
|
5709 |
and:[ (source := con method source) notNil |
|
5710 |
and:[ (source includesString:stringToSearch) ]] |
|
5711 |
] |
|
5712 |
thenDo:[:con | |
|
5713 |
codeView searchFwd:stringToSearch. |
|
5714 |
] |
|
13388 | 5715 |
! |
5716 |
||
5717 |
findContextWithValueInVariable |
|
5718 |
|valueStringToSearch| |
|
5719 |
||
5720 |
valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'. |
|
5721 |
valueStringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5722 |
||
15413 | 5723 |
self |
5724 |
findContextForWhich:[:con | |
|
5725 |
con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase] |
|
5726 |
] |
|
5727 |
thenDo:[:con | ] |
|
13388 | 5728 |
! |
5729 |
||
11595 | 5730 |
findHandlerFor |
13388 | 5731 |
|exClass con| |
11595 | 5732 |
|
15413 | 5733 |
(con := self selectedContext) isNil ifTrue:[ |
5734 |
con := contextArray at:1 |
|
11595 | 5735 |
]. |
5736 |
con sender isNil ifTrue:[ |
|
15413 | 5737 |
self information:'Context has already returned'. |
5738 |
^ self |
|
5739 |
]. |
|
5740 |
||
5741 |
exClass := Dialog |
|
5742 |
choose:'Exception class:' |
|
5743 |
fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name]) |
|
5744 |
lines:25 |
|
5745 |
title:'Choose Exception class'. |
|
14523 | 5746 |
exClass isNil ifTrue:[^ self]. |
13388 | 5747 |
|
15413 | 5748 |
self |
5749 |
findContextForWhich:[:con | |
|
5750 |
con isHandleContext |
|
5751 |
and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] |
|
5752 |
] |
|
5753 |
thenDo:[:con | |
|
5754 |
self selectContext:con sender. |
|
5755 |
] |
|
13388 | 5756 |
! |
5757 |
||
15255 | 5758 |
findHomeContext |
5759 |
|con home| |
|
5760 |
||
5761 |
(con := self selectedContext) isNil ifTrue:[ |
|
15413 | 5762 |
self beep. |
5763 |
^ self. |
|
15255 | 5764 |
]. |
5765 |
(home := con home) isNil ifTrue:[ |
|
15413 | 5766 |
self beep. |
5767 |
^ self. |
|
15255 | 5768 |
]. |
5769 |
||
5770 |
"/ still have to find it - home could be elsewhere (another process) |
|
5771 |
"/ (i.e. cannot simply select it) |
|
5772 |
||
15413 | 5773 |
self |
5774 |
findContextForWhich:[:con | |
|
5775 |
con == home |
|
5776 |
] |
|
5777 |
thenDo:[:con | |
|
5778 |
self selectContext:con. |
|
5779 |
] |
|
15255 | 5780 |
! |
5781 |
||
13388 | 5782 |
findNextExceptionHandlerContext |
15413 | 5783 |
self |
5784 |
findContextForWhich:[:con | |
|
5785 |
con isHandleContext |
|
5786 |
] |
|
5787 |
thenDo:[:con | |
|
5788 |
self selectContext:con sender. |
|
5789 |
] |
|
11595 | 5790 |
! |
5791 |
||
266 | 5792 |
inspectContext |
5793 |
"launch an inspector on the currently selected context" |
|
5794 |
||
11595 | 5795 |
|con| |
5796 |
||
5797 |
(con := self selectedContext) notNil ifTrue:[ |
|
15413 | 5798 |
con inspect. |
266 | 5799 |
] |
11595 | 5800 |
|
5801 |
"Modified: / 17-07-2012 / 12:52:34 / cg" |
|
266 | 5802 |
! |
5803 |
||
15247 | 5804 |
inspectContextsMethod |
5805 |
"launch an inspector on the currently selected context's method" |
|
5806 |
||
5807 |
|con| |
|
5808 |
||
5809 |
(con := self selectedContext) notNil ifTrue:[ |
|
15413 | 5810 |
con method inspect. |
15247 | 5811 |
] |
5812 |
! |
|
5813 |
||
12840 | 5814 |
inspectWidgetHierarchy |
5815 |
|rcvr view| |
|
5816 |
||
5817 |
selectedContext isNil ifTrue:[ ^ self ]. |
|
5818 |
Tools::ViewTreeInspectorApplication isNil ifTrue:[ |
|
15413 | 5819 |
Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'. |
5820 |
^ self. |
|
12840 | 5821 |
]. |
5822 |
||
5823 |
rcvr := selectedContext receiver. |
|
5824 |
rcvr isView ifTrue:[ |
|
15413 | 5825 |
view := rcvr |
12840 | 5826 |
] ifFalse:[ |
15413 | 5827 |
view := rcvr window |
12840 | 5828 |
]. |
5829 |
Tools::ViewTreeInspectorApplication openOn:view |
|
5830 |
! |
|
5831 |
||
8142 | 5832 |
middleButtonMenu |
5833 |
<resource: #programMenu > |
|
5834 |
||
9488 | 5835 |
|items m nameOfExecutable| |
8142 | 5836 |
|
5837 |
exclusive ifTrue:[ |
|
15413 | 5838 |
items := #( |
5839 |
('Show More WalkBack' showMore ) |
|
5840 |
('-' ) |
|
5841 |
('Add Breakpoint' addBreakpoint ) |
|
5842 |
('Remove Breakpoint' removeBreakpoint ) |
|
5843 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
5844 |
('-' ) |
|
5845 |
). |
|
8142 | 5846 |
] ifFalse:[ |
15413 | 5847 |
items := #( |
5848 |
('Show More WalkBack' showMore ) |
|
5849 |
('-' ) |
|
5850 |
('Skip' skip ) |
|
5851 |
('Step Out' skipForReturn ) |
|
5852 |
('Skip until Entering...' skipUntilEntering ) |
|
5853 |
('-' ) |
|
8142 | 5854 |
" |
15413 | 5855 |
('Continue' doContinue ) |
5856 |
('Terminate' doTerminate ) |
|
5857 |
('Abort' doAbort ) |
|
5858 |
('-' ) |
|
5859 |
('Step' doStep ) |
|
5860 |
('Send' doSend ) |
|
5861 |
('-' ) |
|
5862 |
('Return' doReturn ) |
|
5863 |
('Restart' doRestart ) |
|
5864 |
('-' ) |
|
8142 | 5865 |
" |
15413 | 5866 |
('Add Breakpoint' addBreakpoint ) |
5867 |
('Remove Breakpoint' removeBreakpoint ) |
|
5868 |
('Remove all Break- & Tracepoints' removeAllBreakpoints ) |
|
5869 |
). |
|
11210 | 5870 |
|
12840 | 5871 |
"/ self allowBreakPointsInDebugger ifFalse:[ |
5872 |
"/ items := items , #( |
|
5873 |
"/ ('Allow Breakpoints & halt in Debugger' doNotIgnoreBreakpoints ) |
|
5874 |
"/ ). |
|
5875 |
"/ ] ifTrue:[ |
|
5876 |
"/ items := items , #( |
|
5877 |
"/ ('Ignore Breakpoints & halt in Debugger' doIgnoreBreakpoints ) |
|
5878 |
"/ ). |
|
5879 |
"/ ]. |
|
11210 | 5880 |
|
15413 | 5881 |
items := items , #( |
5882 |
('-' ) |
|
5883 |
('Browse Implementing Class' browseImplementingClass ) |
|
5884 |
('Browse Receiver''s Class' browseReceiversClass ) |
|
5885 |
('Browse Blocks''s Home' browseBlocksHome ) |
|
11610 | 5886 |
"/ ('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
5887 |
"/ ('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
15413 | 5888 |
('Implementors' browseImplementors ) |
5889 |
('Implementors Of...' browseImplementorsOf ) |
|
5890 |
('Senders' browseSenders ) |
|
5891 |
('Senders Of...' browseSendersOf ) |
|
5892 |
('-' ) |
|
5893 |
('Inspect Context' inspectContext ) |
|
5894 |
). |
|
8142 | 5895 |
]. |
5896 |
||
9488 | 5897 |
items := items , #( |
15413 | 5898 |
('Copy WalkBack Text' copyWalkbackText ) |
5899 |
('-' ) |
|
5900 |
('Hard Terminate (Danger)' quickTerminate ) |
|
5901 |
('=' )). |
|
9488 | 5902 |
|
5903 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
5904 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
5905 |
||
5906 |
items := items , { |
|
15413 | 5907 |
{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
10205 | 5908 |
|
5909 |
m := PopUpMenu |
|
15413 | 5910 |
itemList:items |
5911 |
resources:resources |
|
5912 |
receiver:self |
|
5913 |
for:contextView. |
|
8142 | 5914 |
|
5915 |
inspecting ifTrue:[ |
|
15413 | 5916 |
m notNil ifTrue:[ |
5917 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
5918 |
browseClassHierarchy browseFullClassProtocol |
|
5919 |
browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut). |
|
5920 |
]. |
|
8142 | 5921 |
]. |
5922 |
self updateMenuItems. |
|
5923 |
||
5924 |
^ m. |
|
9488 | 5925 |
|
13210 | 5926 |
"Modified: / 22-07-2013 / 15:30:05 / cg" |
8142 | 5927 |
! |
5928 |
||
15257 | 5929 |
notShowingDenseWalkbackHolder |
5930 |
^ BlockValue forLogicalNot: self showingDenseWalkbackHolder. |
|
5931 |
! |
|
5932 |
||
11573 | 5933 |
notShowingSupportCode |
5934 |
^ hideSupportCode == true. |
|
5935 |
||
5936 |
"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
|
5937 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5938 |
|
3447 | 5939 |
openAboutThisApplication |
5940 |
"opens an about box for this application." |
|
5941 |
||
7112 | 5942 |
Dialog aboutClass:self class. |
5943 |
||
5944 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 5945 |
! |
5946 |
||
8620 | 5947 |
openSettingsDialog |
14559 | 5948 |
|settingsList| |
8620 | 5949 |
|
10205 | 5950 |
settingsList := |
15413 | 5951 |
#( |
5952 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
5953 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
5954 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
5955 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
5956 |
). |
|
5957 |
||
5958 |
SettingsDialog |
|
5959 |
openWithList:settingsList |
|
5960 |
label:(resources string:'Debugger Settings'). |
|
8620 | 5961 |
! |
5962 |
||
13488 | 5963 |
processesApplication |
5964 |
"if the debugged process is a GUI process, |
|
5965 |
AND it has an applicaiton, return it. |
|
5966 |
Otherwise, return nil" |
|
5967 |
||
14430 | 5968 |
|p wgs app nonModalWGs| |
13488 | 5969 |
|
5970 |
p := inspectedProcess ? Processor activeProcess. |
|
5971 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
|
15413 | 5972 |
wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p]. |
5973 |
nonModalWGs := wgs reject:[:wg | wg isModal]. |
|
5974 |
nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application]. |
|
5975 |
||
5976 |
wgs do:[:wg | |
|
5977 |
|wgi| |
|
5978 |
||
5979 |
wgi := wg. |
|
5980 |
[wgi notNil] whileTrue:[ |
|
5981 |
(app := wgi application) notNil ifTrue:[^ app]. |
|
5982 |
wgi isModal ifTrue:[ |
|
5983 |
wgi := wgi previousGroup |
|
5984 |
] ifFalse:[ |
|
5985 |
wgi := nil. |
|
5986 |
] |
|
5987 |
] |
|
5988 |
] |
|
13488 | 5989 |
]. |
5990 |
^ nil |
|
5991 |
! |
|
5992 |
||
266 | 5993 |
quickTerminate |
5994 |
"quick terminate - the process will get no chance for cleanup actions" |
|
5995 |
||
5996 |
inspecting ifTrue:[ |
|
15413 | 5997 |
self processPerform:#terminateNoSignal. |
5998 |
^ self |
|
266 | 5999 |
]. |
6000 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
6001 |
steppedContext := wrapperContext := nil. |
266 | 6002 |
haveControl := false. |
6003 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6004 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6005 |
"exit private event-loop" |
6365 | 6006 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6007 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6008 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6009 |
inspecting ifFalse:[ |
15413 | 6010 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
6011 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
6012 |
Debugger newDebugger. |
|
6013 |
Processor activeProcess terminateNoSignal. |
|
6014 |
] |
|
266 | 6015 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6016 |
terminateButton turnOff. |
477 | 6017 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6018 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 6019 |
! |
6020 |
||
11391 | 6021 |
rememberCallchain |
6022 |
"remember the callchain in a classvar. |
|
6023 |
When entered the next time, highlight already entered contexts. |
|
6024 |
This makes it possible to identitfy the caller as the first common context |
|
6025 |
along the chain (i.e. the context which is responsible for the debugger to be entered)" |
|
6026 |
||
6027 |
RememberedCallChain := contextArray copy |
|
6028 |
||
6029 |
"Created: / 07-03-2012 / 23:07:07 / cg" |
|
6030 |
! |
|
6031 |
||
13388 | 6032 |
selectContext:aContext |
6033 |
|idx| |
|
6034 |
||
6035 |
idx := contextArray identityIndexOf:aContext. |
|
6036 |
idx == 0 ifTrue:[ |
|
15413 | 6037 |
"/ some contexts hidden? |
6038 |
(self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[ |
|
6039 |
Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'. |
|
6040 |
self showFullWalkback. |
|
6041 |
self showingDenseWalkback:false. |
|
6042 |
self showingSupportCode:true. |
|
6043 |
]. |
|
6044 |
idx := contextArray identityIndexOf:aContext. |
|
13388 | 6045 |
]. |
6046 |
idx ~~ 0 ifTrue:[ |
|
15413 | 6047 |
self selectContextWithIndex:idx. |
6048 |
^ true. |
|
13388 | 6049 |
]. |
6050 |
^ false |
|
6051 |
! |
|
6052 |
||
11595 | 6053 |
selectedContext |
15960 | 6054 |
|selIdx| |
6055 |
||
6056 |
(selIdx := contextView selection) notNil ifTrue:[ |
|
6057 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
|
6058 |
^ (contextArray at:selIdx). |
|
6059 |
] |
|
11595 | 6060 |
]. |
6061 |
^ nil |
|
6062 |
||
6063 |
"Created: / 17-07-2012 / 12:52:10 / cg" |
|
6064 |
! |
|
6065 |
||
11647 | 6066 |
showFullWalkback |
6067 |
"double the number of contexts shown" |
|
6068 |
||
6069 |
contextArray notNil ifTrue:[ |
|
15413 | 6070 |
nChainShown := 9999. |
6071 |
self redisplayBacktrace. |
|
11647 | 6072 |
] |
6073 |
||
6074 |
"Created: / 23-07-2012 / 12:24:02 / cg" |
|
6075 |
! |
|
6076 |
||
266 | 6077 |
showMore |
3447 | 6078 |
"double the number of contexts shown" |
266 | 6079 |
|
6080 |
contextArray notNil ifTrue:[ |
|
15413 | 6081 |
nChainShown := nChainShown * 2. |
6082 |
self redisplayBacktrace. |
|
266 | 6083 |
] |
563 | 6084 |
|
3447 | 6085 |
"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
|
6086 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6087 |
|
11573 | 6088 |
showSupportCode |
6089 |
hideSupportCode := false. |
|
6090 |
self redisplayBacktrace. |
|
6091 |
||
6092 |
"Created: / 10-06-2012 / 21:27:53 / cg" |
|
6093 |
! |
|
6094 |
||
3447 | 6095 |
showingDenseWalkback |
15257 | 6096 |
^ self verboseBacktraceHolder value not |
3447 | 6097 |
|
6098 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
6099 |
! |
|
6100 |
||
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6101 |
showingDenseWalkback:aBoolean |
15257 | 6102 |
self verboseBacktraceHolder value:aBoolean not. |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6103 |
self redisplayBacktrace. |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6104 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6105 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6106 |
! |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6107 |
|
15257 | 6108 |
showingDenseWalkbackHolder |
6109 |
^ BlockValue forLogicalNot:self verboseBacktraceHolder |
|
6110 |
! |
|
6111 |
||
11573 | 6112 |
showingSupportCode |
6113 |
^ hideSupportCode == false. |
|
6114 |
||
6115 |
"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
|
6116 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6117 |
|
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6118 |
showingSupportCode:aBoolean |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6119 |
hideSupportCode := aBoolean not. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6120 |
self redisplayBacktrace. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6121 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6122 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6123 |
! |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6124 |
|
3447 | 6125 |
showingVerboseWalkback |
15257 | 6126 |
^ self verboseBacktraceHolder value |
3447 | 6127 |
|
6128 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
6129 |
! |
|
6130 |
||
9626 | 6131 |
sizeChanged:how |
10205 | 6132 |
super sizeChanged:how. |
9626 | 6133 |
LastExtent := self extent. |
6134 |
||
6135 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
6136 |
! |
|
6137 |
||
266 | 6138 |
skip |
6139 |
"skip for cursor line in selected method" |
|
6140 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6141 |
stepHow := #skip. |
266 | 6142 |
self doStep:codeView cursorLine. |
790 | 6143 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6144 |
"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
|
6145 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6146 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6147 |
skipForReturn |
2581 | 6148 |
"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
|
6149 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6150 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6151 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6152 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6153 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 6154 |
! |
6155 |
||
6156 |
skipUntilEntering |
|
6157 |
"skip until some particular method is invoked." |
|
6158 |
||
6159 |
|selector| |
|
6160 |
||
10205 | 6161 |
selector := Dialog |
15413 | 6162 |
request:'Skip until entering what (matchpattern):' |
6163 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 6164 |
selector size == 0 ifTrue:[^ self]. |
6165 |
||
6166 |
stepUntilEntering := selector asSymbol. |
|
6167 |
stepHow := #send. |
|
6168 |
self doStep:-1. |
|
6169 |
||
6170 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 6171 |
! |
6172 |
||
11573 | 6173 |
toggleShowSupportCode |
6174 |
hideSupportCode ifTrue:[ |
|
15413 | 6175 |
self showSupportCode |
11645
4f39a925956d
changed: #toggleShowSupportCode
Stefan Vogel <sv@exept.de>
parents:
11636
diff
changeset
|
6176 |
] ifFalse:[ |
15413 | 6177 |
self hideSupportCode |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6178 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6179 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6180 |
"Modified: / 17-11-2001 / 20:07:45 / cg" |
11573 | 6181 |
"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
|
6182 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6183 |
|
3447 | 6184 |
toggleVerboseWalkback |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6185 |
self showingDenseWalkback:(self showingDenseWalkback not) |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6186 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6187 |
"Modified: / 27-07-2012 / 15:00:15 / cg" |
11610 | 6188 |
! |
6189 |
||
6190 |
updateMenuItems |
|
13408 | 6191 |
"enable/disable some menu items, depending on the current selected context" |
6192 |
||
11610 | 6193 |
|m mthd cls mCls rCls| |
6194 |
||
6195 |
m := contextView middleButtonMenu. |
|
6196 |
m notNil ifTrue:[ |
|
15413 | 6197 |
m disable:#removeBreakpoint. |
6198 |
m disable:#addBreakpoint. |
|
6199 |
canShowMore ifFalse:[ |
|
6200 |
m disable:#showMore |
|
6201 |
]. |
|
6202 |
||
6203 |
selectedContext notNil ifTrue:[ |
|
6204 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
6205 |
||
6206 |
mthd := selectedContext method. |
|
6207 |
mthd notNil ifTrue:[ |
|
6208 |
cls := mCls := mthd containingClass. |
|
6209 |
mthd isBreakpointed ifTrue:[ |
|
6210 |
m enable:#removeBreakpoint. |
|
6211 |
] ifFalse:[ |
|
6212 |
m enable:#addBreakpoint. |
|
6213 |
] |
|
6214 |
]. |
|
6215 |
(selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[ |
|
6216 |
"/ a cheap block's context |
|
6217 |
] ifFalse:[ |
|
6218 |
rCls := selectedContext receiver class. |
|
6219 |
cls isNil ifTrue:[ |
|
6220 |
cls := rCls |
|
6221 |
]. |
|
6222 |
]. |
|
6223 |
cls notNil ifTrue:[ |
|
6224 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6225 |
rCls == mCls ifTrue:[ |
|
6226 |
m disable:#browseReceiversClass |
|
6227 |
]. |
|
6228 |
mCls isNil ifTrue:[ |
|
6229 |
m disable:#browseImplementingClass |
|
6230 |
] |
|
6231 |
||
6232 |
] ifFalse:[ |
|
6233 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6234 |
]. |
|
6235 |
mthd notNil ifTrue:[ |
|
6236 |
m enableAll:#(browseImplementingClass). |
|
6237 |
]. |
|
6238 |
selectedContext isCheapBlockContext ifTrue:[ |
|
6239 |
m disableAll:#(browseReceiversClass). |
|
6240 |
]. |
|
6241 |
selectedContext receiver isBlock ifTrue:[ |
|
6242 |
m enableAll:#(browseBlocksHome). |
|
6243 |
] ifFalse:[ |
|
6244 |
m disableAll:#(browseBlocksHome). |
|
6245 |
]. |
|
6246 |
] ifFalse:[ |
|
6247 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy |
|
6248 |
browseBlocksHome browseFullClassProtocol). |
|
6249 |
] |
|
11610 | 6250 |
] |
6251 |
||
6252 |
"Modified: / 19-07-2012 / 11:53:30 / cg" |
|
266 | 6253 |
! ! |
6254 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6255 |
!DebugView methodsFor:'menu & button actions-breakpoints'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6256 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6257 |
addBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6258 |
"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
|
6259 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6260 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6261 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6262 |
selectedContext isNil ifTrue:[ |
15413 | 6263 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6264 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6265 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
15413 | 6266 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6267 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6268 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6269 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6270 |
implementorClass notNil ifTrue:[ |
15413 | 6271 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6272 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
6273 |
method setBreakPoint |
|
6274 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6275 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6276 |
contextView middleButtonMenu disable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6277 |
contextView middleButtonMenu enable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6278 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6279 |
"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
|
6280 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6281 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6282 |
allowBreakPointsInDebugger |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6283 |
^ ignoreBreakpoints not |
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 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6286 |
allowBreakPointsInDebugger:aBoolean |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6287 |
ignoreBreakpoints := aBoolean not. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6288 |
self initializeMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6289 |
self initializeContextViewsMiddleButtonMenu. |
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 |
doIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6293 |
self allowBreakPointsInDebugger:false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6294 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6295 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6296 |
doNotIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6297 |
self allowBreakPointsInDebugger:true |
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 |
|
14680 | 6300 |
ignoreAllHaltsForCurrentProcess |
15413 | 6301 |
self |
6302 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6303 |
orThisReceiverClass:false orCurrentProcess:true |
|
6304 |
orIfCalledFromMethod:nil |
|
6305 |
forAll:true. |
|
14680 | 6306 |
|
6307 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6308 |
! |
|
6309 |
||
6310 |
ignoreAllHaltsForThisReceiverClass |
|
15413 | 6311 |
self |
6312 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6313 |
orThisReceiverClass:true orCurrentProcess:false |
|
6314 |
orIfCalledFromMethod:nil |
|
6315 |
forAll:true. |
|
14680 | 6316 |
|
6317 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6318 |
! |
|
6319 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6320 |
ignoreAllHaltsForever |
15413 | 6321 |
self |
6322 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
|
6323 |
orThisReceiverClass:false orCurrentProcess:false |
|
6324 |
orIfCalledFromMethod:nil |
|
6325 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6326 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6327 |
"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
|
6328 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6329 |
|
14680 | 6330 |
ignoreAllHaltsIfCalledFromMethod:aMethod |
15413 | 6331 |
self |
6332 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6333 |
orThisReceiverClass:false orCurrentProcess:false |
|
6334 |
orIfCalledFromMethod:aMethod |
|
6335 |
forAll:true. |
|
14680 | 6336 |
! |
6337 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6338 |
ignoreAllHaltsUntilShiftKeyIsPressed |
15413 | 6339 |
self |
6340 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6341 |
orThisReceiverClass:false orCurrentProcess:false |
|
6342 |
orIfCalledFromMethod:nil |
|
6343 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6344 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6345 |
"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
|
6346 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6347 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6348 |
ignoreBreakpointsWithThisParameterForever |
11370 | 6349 |
Object disableBreakPoint:breakPointParameter. |
6350 |
"/ self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:false. |
|
6351 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6352 |
"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
|
6353 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6354 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6355 |
ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
15413 | 6356 |
self |
6357 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6358 |
orThisReceiverClass:false orCurrentProcess:false |
|
6359 |
orIfCalledFromMethod:nil |
|
6360 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6361 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6362 |
"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
|
6363 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6364 |
|
12937 | 6365 |
ignoreHaltForCurrentProcess |
15413 | 6366 |
self |
6367 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6368 |
orThisReceiverClass:false orCurrentProcess:true |
|
6369 |
orIfCalledFromMethod:nil |
|
6370 |
forAll:false. |
|
12937 | 6371 |
|
6372 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6373 |
! |
|
6374 |
||
6375 |
ignoreHaltForThisReceiverClass |
|
15413 | 6376 |
self |
6377 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6378 |
orThisReceiverClass:true orCurrentProcess:false |
|
6379 |
orIfCalledFromMethod:nil |
|
6380 |
forAll:false. |
|
12937 | 6381 |
|
6382 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6383 |
! |
|
6384 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6385 |
ignoreHaltForever |
15413 | 6386 |
self |
6387 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
|
6388 |
orThisReceiverClass:false orCurrentProcess:false |
|
6389 |
orIfCalledFromMethod:nil |
|
6390 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6391 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6392 |
"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
|
6393 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6394 |
|
14608 | 6395 |
ignoreHaltIfCalledFromMethod:aMethod |
15413 | 6396 |
self |
6397 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
|
6398 |
orThisReceiverClass:false orCurrentProcess:false |
|
6399 |
orIfCalledFromMethod:aMethod |
|
6400 |
forAll:false. |
|
14608 | 6401 |
! |
6402 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6403 |
ignoreHaltUntilShiftKeyIsPressed |
15413 | 6404 |
self |
6405 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
|
6406 |
orThisReceiverClass:false orCurrentProcess:false |
|
6407 |
orIfCalledFromMethod:nil |
|
6408 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6409 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6410 |
"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
|
6411 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6412 |
|
14680 | 6413 |
menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
6414 |
<resource: #programMenu > |
|
6415 |
||
6416 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:true |
|
6417 |
! |
|
6418 |
||
14608 | 6419 |
menuForIgnoreBreakpointIfCalledFromAnyOf |
6420 |
<resource: #programMenu > |
|
6421 |
||
14680 | 6422 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:false |
6423 |
! |
|
6424 |
||
6425 |
menuForIgnoreBreakpointIfCalledFromAnyOfForAll:forAllHaltsBoolean |
|
6426 |
<resource: #programMenu > |
|
6427 |
||
14608 | 6428 |
|m count already| |
6429 |
||
6430 |
m := Menu new. |
|
6431 |
count := 0. |
|
6432 |
already := IdentitySet new. |
|
6433 |
||
6434 |
contextArray do:[:con | |
|
15413 | 6435 |
|mthd cls sel| |
6436 |
||
6437 |
mthd := con method. |
|
6438 |
mthd notNil ifTrue:[ |
|
6439 |
mthd isWrapped ifFalse:[ |
|
6440 |
(already includes:already) ifFalse:[ |
|
6441 |
already add:mthd. |
|
6442 |
m addItem:(MenuItem |
|
6443 |
label: (mthd whoString) |
|
6444 |
itemValue: [ forAllHaltsBoolean |
|
6445 |
ifTrue:[self ignoreHaltIfCalledFromMethod:mthd] |
|
6446 |
ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd] |
|
6447 |
] |
|
6448 |
translateLabel: false). |
|
6449 |
count := count + 1. |
|
6450 |
(count > 20) ifTrue:[ |
|
6451 |
^ m |
|
6452 |
]. |
|
6453 |
] |
|
6454 |
] |
|
6455 |
] |
|
14608 | 6456 |
]. |
6457 |
^ m |
|
6458 |
! |
|
6459 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6460 |
openBreakPointBrowser |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6461 |
Tools::BreakpointBrowser open |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6462 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6463 |
"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
|
6464 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6465 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6466 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6467 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6468 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6469 |
[ |
15413 | 6470 |
answer := Dialog |
6471 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
6472 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6473 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6474 |
||
6475 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6476 |
dT notNil ifTrue:[ |
|
6477 |
LastIgnoreHaltDuration := dT. |
|
6478 |
self |
|
6479 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6480 |
orThisReceiverClass:false orCurrentProcess:false |
|
6481 |
orIfCalledFromMethod:nil |
|
6482 |
forAll:true. |
|
6483 |
^ self. |
|
6484 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6485 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6486 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6487 |
"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
|
6488 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6489 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6490 |
openIgnoreBreakpointsWithThisParameterNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6491 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6492 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6493 |
[ |
15413 | 6494 |
answer := Dialog |
6495 |
request:(resources |
|
6496 |
string:'How often should breakpoints with parameter "%1" be ignored ?' |
|
6497 |
with:breakPointParameter) |
|
6498 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6499 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6500 |
||
6501 |
n := Integer readFrom:answer onError:nil. |
|
6502 |
n notNil ifTrue:[ |
|
6503 |
LastIgnoreHaltNTimes := n. |
|
6504 |
self |
|
6505 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6506 |
orThisReceiverClass:false orCurrentProcess:false |
|
6507 |
orIfCalledFromMethod:nil |
|
6508 |
forAll:false. |
|
6509 |
^ self. |
|
6510 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6511 |
] loop. |
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 |
"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
|
6514 |
"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
|
6515 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6516 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6517 |
openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6518 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6519 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6520 |
[ |
15413 | 6521 |
answer := Dialog |
6522 |
request:(resources |
|
6523 |
string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?' |
|
6524 |
with:breakPointParameter) |
|
6525 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6526 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6527 |
||
6528 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6529 |
dT notNil ifTrue:[ |
|
6530 |
LastIgnoreHaltDuration := dT. |
|
6531 |
self |
|
6532 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6533 |
orThisReceiverClass:false orCurrentProcess:false |
|
6534 |
orIfCalledFromMethod:nil |
|
6535 |
forAll:false. |
|
6536 |
^ self. |
|
6537 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6538 |
] loop |
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 |
"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
|
6541 |
! |
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 |
openIgnoreHaltNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6544 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6545 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6546 |
[ |
15413 | 6547 |
answer := Dialog |
6548 |
request:(resources string:'How often should this halt be ignored ?') |
|
6549 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6550 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6551 |
||
6552 |
n := Integer readFrom:answer onError:nil. |
|
6553 |
n notNil ifTrue:[ |
|
6554 |
LastIgnoreHaltNTimes := n. |
|
6555 |
self |
|
6556 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6557 |
orThisReceiverClass:false orCurrentProcess:false |
|
6558 |
orIfCalledFromMethod:nil |
|
6559 |
forAll:false. |
|
6560 |
^ self. |
|
6561 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6562 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6563 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6564 |
"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
|
6565 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6566 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6567 |
openIgnoreHaltUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6568 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6569 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6570 |
[ |
15413 | 6571 |
answer := Dialog |
6572 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
6573 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6574 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6575 |
||
6576 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6577 |
dT notNil ifTrue:[ |
|
6578 |
LastIgnoreHaltDuration := dT. |
|
6579 |
self |
|
6580 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6581 |
orThisReceiverClass:false orCurrentProcess:false |
|
6582 |
orIfCalledFromMethod:nil |
|
6583 |
forAll:false. |
|
6584 |
^ self. |
|
6585 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6586 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6587 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6588 |
"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
|
6589 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6590 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6591 |
removeAllBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6592 |
"remove all trace & breakpoints - if any" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6593 |
|
14532 | 6594 |
self withExecuteCursorDo:[ |
15413 | 6595 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
6596 |
MessageTracer unwrapAllMethods |
|
6597 |
]. |
|
6598 |
(MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[ |
|
6599 |
MethodWithBreakpoints removeAllBreakpoints |
|
6600 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6601 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6602 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6603 |
"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
|
6604 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6605 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6606 |
removeBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6607 |
"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
|
6608 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6609 |
|implementorClass method| |
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 |
selectedContext isNil ifTrue:[ |
15413 | 6612 |
^ self showError:'** select a context first **' |
11366
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 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
15413 | 6615 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6616 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6617 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6618 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6619 |
implementorClass notNil ifTrue:[ |
15413 | 6620 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6621 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
6622 |
method clearBreakPoint |
|
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 |
contextView middleButtonMenu disable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6626 |
contextView middleButtonMenu enable:#addBreakpoint. |
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 |
"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
|
6629 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6630 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6631 |
stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6632 |
self class stopIgnoringHalts |
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 |
|
266 | 6635 |
!DebugView methodsFor:'private'! |
6636 |
||
6487 | 6637 |
abortAllIsHandled |
9750 | 6638 |
^ AbortAllOperationWantedQuery query |
6639 |
||
6640 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 6641 |
! |
6642 |
||
266 | 6643 |
busy |
6644 |
^ busy |
|
6645 |
! |
|
6646 |
||
6647 |
exclusive:aBoolean |
|
6648 |
exclusive := aBoolean |
|
6649 |
! |
|
6650 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6651 |
explainSelection |
8212 | 6652 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6653 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6654 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6655 |
interval isEmpty ifTrue:[ |
15413 | 6656 |
crsrPos := codeView characterPositionOfCursor. |
6657 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
6658 |
crsrPos := (crsrPos - 1) max:1 |
|
6659 |
]. |
|
6660 |
interval := crsrPos to:crsrPos. |
|
10205 | 6661 |
]. |
6662 |
self |
|
15413 | 6663 |
withNodeValueAtInterval:interval |
6664 |
do:[:value :description | |
|
6665 |
self showValue:value |
|
6666 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6667 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6668 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6669 |
findNodeForInterval:interval |
8212 | 6670 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6671 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6672 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6673 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
6674 |
source := codeView contentsAsString string. |
10205 | 6675 |
"/ source := currentMethod notNil |
6676 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 6677 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
6678 |
source isNil ifTrue:[^ nil]. |
8214 | 6679 |
|
8212 | 6680 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
6681 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6682 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6683 |
|
7912 | 6684 |
findNodeIn:tree forInterval:interval |
6685 |
<resource: #obsolete> |
|
10205 | 6686 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6687 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6688 |
|
7912 | 6689 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6690 |
node := nil. |
10205 | 6691 |
tree nodesDo:[:each | |
15413 | 6692 |
(each intersectsInterval:interval) ifTrue:[ |
6693 |
(node isNil or:[node == each parent]) ifTrue:[ |
|
6694 |
node := each |
|
6695 |
] ifFalse:[ |
|
6696 |
(node parent notNil |
|
6697 |
and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
6698 |
] |
|
6699 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6700 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6701 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6702 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6703 |
|
2581 | 6704 |
goodSkipUntilSelector |
6705 |
|current| |
|
6706 |
||
6707 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
6708 |
selectedContext isNil ifTrue:[^ nil]. |
|
6709 |
current := selectedContext selector. |
|
6710 |
current isNil ifTrue:[^ nil]. |
|
6711 |
('change:*' match:current) ifTrue:[ |
|
15413 | 6712 |
^ 'update:*' |
2581 | 6713 |
]. |
6714 |
^ nil |
|
6715 |
! |
|
6716 |
||
8179 | 6717 |
haltSelectors |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6718 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break'). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6719 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6720 |
"Modified (format): / 27-01-2012 / 11:10:00 / cg" |
8179 | 6721 |
! |
6722 |
||
266 | 6723 |
interruptProcessWith:aBlock |
6724 |
"let inspected process do something, then update the context list" |
|
6725 |
||
6726 |
inspectedProcess isDead ifTrue:[ |
|
15413 | 6727 |
self showTerminated. |
6728 |
^ self |
|
266 | 6729 |
]. |
6730 |
inspectedProcess interruptWith:aBlock. |
|
6731 |
" |
|
6732 |
give the process a chance to run, then update |
|
6733 |
" |
|
6734 |
(Delay forSeconds:0.2) wait. |
|
6735 |
self setContext:(inspectedProcess suspendedContext). |
|
6736 |
! |
|
6737 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6738 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6739 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6740 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6741 |
|
8194 | 6742 |
openHTMLDocument: anHTMLFilename |
6743 |
"open a HTMLDocumentView on anHTMLFilename" |
|
6744 |
||
6745 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
6746 |
! |
|
6747 |
||
266 | 6748 |
processPerform:aMessage |
6749 |
"do something, then update the context list" |
|
6750 |
||
6751 |
inspectedProcess isDead ifTrue:[ |
|
15413 | 6752 |
self showTerminated. |
6753 |
^ self |
|
266 | 6754 |
]. |
6755 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
6756 |
|
266 | 6757 |
" |
6758 |
give the process a chance to run, then update |
|
6759 |
" |
|
6760 |
(Delay forSeconds:0.2) wait. |
|
6761 |
self setContext:(inspectedProcess suspendedContext). |
|
6762 |
! |
|
6763 |
||
939 | 6764 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6765 |
"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
|
6766 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6767 |
|
939 | 6768 |
|oldSelection oldContext con idx| |
6769 |
||
6770 |
contextArray notNil ifTrue:[ |
|
16065 | 6771 |
self withExecuteCursorDo:[ |
6772 |
oldSelection := contextView selection. |
|
6773 |
oldSelection notNil ifTrue:[ |
|
6774 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
6775 |
]. |
|
6776 |
||
6777 |
con := firstContext. |
|
950 | 6778 |
"/ con := contextArray at:1. |
16065 | 6779 |
"/ force redisplay, even if same by changing the first entry |
6780 |
contextArray size > 0 ifTrue:[ |
|
6781 |
contextArray at:1 put:nil. |
|
6782 |
]. |
|
6783 |
self setContext:con. |
|
6784 |
||
6785 |
oldContext isNil ifTrue:[ |
|
6786 |
idx := oldSelection |
|
6787 |
] ifFalse:[ |
|
6788 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
6789 |
]. |
|
6790 |
contextView setSelection:idx. |
|
6791 |
idx notNil ifTrue:[ |
|
6792 |
self showSelection:idx |
|
6793 |
] |
|
6794 |
] |
|
939 | 6795 |
] |
6796 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6797 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 6798 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 6799 |
! |
6800 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6801 |
selectedInterval |
7912 | 6802 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6803 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6804 |
|
7823 | 6805 |
showError:message |
6806 |
codeView contents:(resources string:message). |
|
6807 |
shown ifTrue:[ |
|
15413 | 6808 |
exclusive ifTrue:[ |
6809 |
"/ consider this a kludge: |
|
6810 |
"/ if exclusive, cannot use flash, since it suspends |
|
6811 |
"/ (but we cannot suspend here ...) |
|
6812 |
codeView redrawInverted. self flush. |
|
6813 |
OperatingSystem millisecondDelay:200. |
|
6814 |
codeView redraw |
|
6815 |
] ifFalse:[ |
|
6816 |
codeView flash |
|
6817 |
] |
|
7823 | 6818 |
] |
6819 |
||
6820 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
6821 |
! |
|
6822 |
||
6823 |
showTerminated |
|
6824 |
self showError:'** the process has terminated **' |
|
6825 |
! |
|
6826 |
||
6827 |
showValue:aValue |
|
6828 |
"/ TODO: show value in info field |
|
6829 |
"/ Transcript showCR:aValue printString |
|
6830 |
! |
|
6831 |
||
10205 | 6832 |
stepping |
6833 |
^ stepping |
|
6834 |
! |
|
6835 |
||
6836 |
unstep |
|
7823 | 6837 |
stepping := false. |
6838 |
bigStep := false. |
|
6839 |
steppedContext := wrapperContext := nil. |
|
6840 |
exitAction := nil |
|
6841 |
||
6842 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
6843 |
! |
|
6844 |
||
10203 | 6845 |
updateButtonsAndMenuItemsForContext:aContext |
6846 |
|m| |
|
6847 |
||
6848 |
m := contextView middleButtonMenu. |
|
6849 |
m notNil ifTrue:[ |
|
15413 | 6850 |
self updateMenuItems. |
6851 |
||
6852 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
6853 |
abortButton enable. |
|
6854 |
m enable:#doAbort. |
|
6855 |
] ifFalse:[ |
|
6856 |
abortButton disable. |
|
6857 |
m disable:#doAbort. |
|
6858 |
]. |
|
6859 |
exclusive ifTrue:[ |
|
6860 |
terminateButton disable. |
|
6861 |
m disable:#doTerminate. |
|
6862 |
] ifFalse:[ |
|
6863 |
terminateButton enable. |
|
6864 |
m enable:#doTerminate. |
|
6865 |
]. |
|
10203 | 6866 |
]. |
6867 |
||
6868 |
mayProceed == false ifTrue:[ |
|
15413 | 6869 |
continueButton disable. |
6870 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 6871 |
] ifFalse:[ |
15413 | 6872 |
continueButton enable. |
6873 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 6874 |
]. |
6875 |
||
13363 | 6876 |
isStoppedInModalDialog ifTrue:[ |
15413 | 6877 |
gotoDialogOpenerButton enable. |
6878 |
gotoDialogOpenerButton beVisible. |
|
13362 | 6879 |
] ifFalse:[ |
15413 | 6880 |
gotoDialogOpenerButton beInvisible. |
13362 | 6881 |
]. |
6882 |
||
14523 | 6883 |
(isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[ |
15413 | 6884 |
gotoApplicationActionMethodButton enable. |
6885 |
gotoApplicationActionMethodButton beVisible. |
|
14523 | 6886 |
] ifFalse:[ |
15413 | 6887 |
gotoApplicationActionMethodButton beInvisible. |
14523 | 6888 |
]. |
6889 |
||
10203 | 6890 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
6891 |
! |
|
6892 |
||
7823 | 6893 |
updateContext |
6894 |
|oldContext idx| |
|
6895 |
||
6896 |
inspectedProcess state == #dead ifTrue:[ |
|
15413 | 6897 |
self showTerminated. |
6898 |
^ self |
|
7823 | 6899 |
]. |
6900 |
||
6901 |
oldContext := selectedContext. |
|
6902 |
[ |
|
15413 | 6903 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
6904 |
oldContext notNil ifTrue:[ |
|
6905 |
contextArray notNil ifTrue:[ |
|
6906 |
idx := contextArray identityIndexOf:oldContext. |
|
6907 |
idx ~~ 0 ifTrue:[ |
|
6908 |
self showSelection:idx |
|
6909 |
] ifFalse:[ |
|
6910 |
codeView contents:('** context returned **') |
|
6911 |
] |
|
6912 |
] |
|
6913 |
] |
|
6914 |
]. |
|
7823 | 6915 |
] valueUninterruptably. |
6916 |
||
6917 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 6918 |
! |
6919 |
||
6920 |
withNodeValueAtInterval:interval do:aBlock |
|
14122 | 6921 |
"helper for flyByHelp and explan-selection" |
6922 |
||
15413 | 6923 |
|node definingNode nm nmBold nameSymbol |
14122 | 6924 |
varIdx parentNode receiver con receiversNonMetaClass| |
6925 |
||
6926 |
"/ interval printCR. |
|
10205 | 6927 |
Error |
15413 | 6928 |
handle:[:ex | ] |
6929 |
do:[ |
|
6930 |
[ |
|
6931 |
node := self findNodeForInterval:interval |
|
6932 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
6933 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
6934 |
|
8212 | 6935 |
node isNil ifTrue:[ ^ self ]. |
10205 | 6936 |
node isVariable ifFalse:[ |
15413 | 6937 |
"/ Transcript showCR:node. |
6938 |
^ self |
|
8592 | 6939 |
]. |
8212 | 6940 |
|
6941 |
nm := node name. |
|
8214 | 6942 |
nmBold := nm allBold. |
8600 | 6943 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 6944 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 6945 |
receiver := actualContext methodHome receiver. |
8212 | 6946 |
|
6947 |
(nm = 'self') ifTrue:[ |
|
15413 | 6948 |
aBlock value:receiver value:'receiver' allBold. |
6949 |
^ self |
|
8212 | 6950 |
]. |
6951 |
(nm = 'super') ifTrue:[ |
|
15413 | 6952 |
aBlock value:receiver value:'receiver' allBold. |
6953 |
^ self |
|
8212 | 6954 |
]. |
6955 |
(nm = 'thisContext') ifTrue:[ |
|
15413 | 6956 |
aBlock value:actualContext value:'context' allBold. |
6957 |
^ self |
|
8212 | 6958 |
]. |
6959 |
||
6960 |
definingNode := node whoDefines:nm. |
|
6961 |
definingNode isNil ifTrue:[ |
|
15413 | 6962 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 6963 |
"/aBlock value:'xIII' value:'instVar'. |
15413 | 6964 |
receiver class isMetaclass ifTrue:[ |
6965 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
6966 |
] ifFalse:[ |
|
6967 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
6968 |
]. |
|
6969 |
^ self |
|
6970 |
]. |
|
6971 |
||
6972 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
6973 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
6974 |
aBlock value:'' value:'private class ',nmBold. |
|
6975 |
^ self |
|
6976 |
]. |
|
6977 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
6978 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
6979 |
^ self |
|
6980 |
]. |
|
6981 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
6982 |
|pool| |
|
6983 |
||
6984 |
pool := Smalltalk at:eachPoolName. |
|
6985 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
6986 |
(pool classVarNames includes:nm) ifTrue:[ |
|
6987 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
6988 |
^ self |
|
6989 |
]. |
|
6990 |
]. |
|
6991 |
nameSymbol := nm asSymbolIfInterned. |
|
6992 |
nameSymbol notNil ifTrue:[ |
|
6993 |
(Smalltalk includesKey:nameSymbol) ifTrue:[ |
|
6994 |
(Smalltalk at:nameSymbol) isClass ifTrue:[ |
|
6995 |
aBlock value:'class: ',nmBold value:nil. |
|
6996 |
] ifFalse:[ |
|
6997 |
aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold. |
|
6998 |
]. |
|
6999 |
^ self |
|
7000 |
]. |
|
7001 |
]. |
|
7002 |
aBlock value:'' value:'unknown'. |
|
7003 |
^ self |
|
8212 | 7004 |
]. |
7005 |
"/definingNode printCR. |
|
7006 |
||
7007 |
definingNode isMethod ifTrue:[ |
|
15413 | 7008 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
7009 |
varIdx ~~ 0 ifTrue:[ |
|
7010 |
Error |
|
7011 |
handle:[:ex | ] |
|
7012 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
7013 |
^ self |
|
7014 |
]. |
|
7015 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
7016 |
varIdx ~~ 0 ifTrue:[ |
|
7017 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
7018 |
Error |
|
7019 |
handle:[:ex | ] |
|
7020 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
7021 |
^ self |
|
7022 |
] |
|
7023 |
]. |
|
8212 | 7024 |
]. |
7025 |
||
7026 |
definingNode isBlock ifTrue:[ |
|
15413 | 7027 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
7028 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
7029 |
varIdx ~~ 0 ifTrue:[ |
|
7030 |
"/ am I in this block ? |
|
7031 |
(actualContext lineNumber notNil |
|
7032 |
and:[ definingNode lastLineNumber notNil |
|
7033 |
and:[ (actualContext lineNumber |
|
7034 |
between:definingNode firstLineNumber |
|
7035 |
and:definingNode lastLineNumber) |
|
7036 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
7037 |
ifTrue:[ |
|
7038 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
7039 |
^ self |
|
7040 |
]. |
|
7041 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
|
7042 |
^ self |
|
7043 |
] |
|
7044 |
]. |
|
8212 | 7045 |
]. |
7046 |
||
7047 |
parentNode := definingNode parent. |
|
7048 |
||
7049 |
[parentNode notNil] whileTrue:[ |
|
15413 | 7050 |
"/'isMethod ' print. parentNode isMethod printCR. |
7051 |
parentNode isMethod ifTrue:[ |
|
7052 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
7053 |
varIdx ~~ 0 ifTrue:[ |
|
7054 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
7055 |
Error |
|
7056 |
handle:[:ex | ] |
|
7057 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
7058 |
^ self |
|
7059 |
] |
|
7060 |
]. |
|
7061 |
]. |
|
7062 |
"/'isBlock ' print. parentNode isBlock printCR. |
|
7063 |
parentNode isBlock ifTrue:[ |
|
7064 |
"/ we don't have any information on the inlineability |
|
7065 |
"/ of this block here (RBParser does not know what |
|
7066 |
"/ the compiler does). |
|
7067 |
"/ therefore, it is questionable if we can use the |
|
7068 |
"/ context's home context here. |
|
7069 |
"/ am I in this block ? |
|
7070 |
con := actualContext. |
|
7071 |
[con notNil |
|
7072 |
and:[ parentNode lastLineNumber notNil |
|
7073 |
and:[ con lineNumber notNil |
|
7074 |
and:[ con lineNumber |
|
7075 |
between:parentNode firstLineNumber |
|
7076 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
7077 |
con := con sender. |
|
7078 |
]. |
|
7079 |
con notNil ifTrue:[ |
|
7080 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
7081 |
varIdx ~~ 0 ifTrue:[ |
|
7082 |
Error |
|
7083 |
handle:[:ex | ] |
|
7084 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
7085 |
^ self |
|
7086 |
]. |
|
7087 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
7088 |
varIdx ~~ 0 ifTrue:[ |
|
7089 |
Error |
|
7090 |
handle:[:ex | ] |
|
7091 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
7092 |
^ self |
|
7093 |
]. |
|
7094 |
]. |
|
7095 |
]. |
|
7096 |
parentNode := parentNode parent. |
|
8212 | 7097 |
]. |
8214 | 7098 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 7099 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
7100 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 7101 |
! ! |
7102 |
||
7103 |
!DebugView methodsFor:'private queries'! |
|
7104 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7105 |
canBrowseClassHierarchy |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7106 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7107 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7108 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7109 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7110 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7111 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7112 |
canBrowseFullClassProtocol |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7113 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7114 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7115 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7116 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7117 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7118 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7119 |
canBrowseImplementingClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7120 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7121 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7122 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7123 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7124 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7125 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7126 |
canBrowseProcessesApplication |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7127 |
|p| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7128 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7129 |
p := inspectedProcess ? Processor activeProcess. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7130 |
p isNil ifTrue:[^ false]. |
14430 | 7131 |
^ p isGUIProcess and:[self processesApplication notNil ]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7132 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7133 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7134 |
canBrowseReceiversClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7135 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7136 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7137 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7138 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7139 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7140 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7141 |
canCloseAllDebuggers |
15413 | 7142 |
self class allInstancesDo:[:debugger | |
7143 |
debugger ~~ self ifTrue:[ |
|
7144 |
debugger busy ifTrue:[^ true]. |
|
7145 |
] |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7146 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7147 |
^ false |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7148 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7149 |
"Created: / 23-03-2012 / 12:40:18 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7150 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7151 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7152 |
canDefineMethod |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7153 |
^ defineButton isVisible |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7154 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7155 |
|
12840 | 7156 |
canInspectWidgetHierarchy |
7157 |
|rcvr| |
|
7158 |
||
7159 |
^ selectedContext notNil |
|
7160 |
and:[ (rcvr := selectedContext receiver) isView |
|
15413 | 7161 |
or:[ rcvr isKindOf: ApplicationModel ]] |
12840 | 7162 |
! |
7163 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7164 |
canRestart |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7165 |
^ restartButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7166 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7167 |
"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
|
7168 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7169 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7170 |
canReturn |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7171 |
^ returnButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7172 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7173 |
"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
|
7174 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7175 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7176 |
canSendEmail |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7177 |
^ SendMailTool notNil |
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 |
"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
|
7180 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7181 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7182 |
canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7183 |
^ canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7184 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7185 |
|
15255 | 7186 |
hasBlockContextSelected |
7187 |
^ contextView hasSelection |
|
7188 |
and:[ self selectedContext isBlockContext ] |
|
7189 |
! |
|
7190 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7191 |
hasContextSelected |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7192 |
^ contextView hasSelection |
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 |
"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
|
7195 |
! |
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 |
hasHaltsToIgnore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7198 |
^ IgnoredHalts notEmptyOrNil |
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 |
|
7823 | 7201 |
isAborting |
7202 |
^ exitAction == #abort |
|
7203 |
! |
|
7204 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7205 |
isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7206 |
^ isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7207 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7208 |
"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
|
7209 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7210 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7211 |
isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7212 |
^ isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7213 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7214 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7215 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7216 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
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 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7219 |
selectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7220 |
|con mthd| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7221 |
|
11595 | 7222 |
(con := self selectedContext) notNil ifTrue:[ |
15413 | 7223 |
mthd := con method. |
7224 |
^ mthd notNil and:[mthd isWrapped] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7225 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7226 |
^ false. |
11595 | 7227 |
|
11610 | 7228 |
"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
|
7229 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7230 |
|
7823 | 7231 |
setOfHiddenCallingSelectors |
7232 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
7233 |
! |
|
7234 |
||
7235 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
7236 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
7237 |
! ! |
|
7238 |
||
9922 | 7239 |
!DebugView methodsFor:'private-breakpoints'! |
7240 |
||
15413 | 7241 |
addIgnoredHaltForCount:countOrNil |
7242 |
orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7243 |
orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess |
|
7244 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
7245 |
forAll:aBoolean |
|
14608 | 7246 |
|
12937 | 7247 |
|haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil| |
9922 | 7248 |
|
7249 |
aBoolean ifTrue:[ |
|
15413 | 7250 |
haltingMethod := #all |
9922 | 7251 |
] ifFalse:[ |
15413 | 7252 |
haltingContext := self findHaltingContext. |
7253 |
haltingContext isNil ifTrue:[ |
|
7254 |
Transcript showCR:'no halting context found'. |
|
7255 |
^ self |
|
7256 |
]. |
|
7257 |
||
7258 |
haltingMethod := haltingContext method. |
|
7259 |
lineNrOfHalt := haltingContext lineNumber. |
|
7260 |
(lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ |
|
7261 |
Transcript showCR:'no halt lineNr found'. |
|
7262 |
^ self |
|
7263 |
]. |
|
7264 |
forThisReceiverClass ifTrue:[ |
|
7265 |
receiverClassOrNil := haltingContext receiver class |
|
7266 |
]. |
|
7267 |
forCurrentProcess ifTrue:[ |
|
7268 |
processOrNil := Processor activeProcess |
|
7269 |
]. |
|
9922 | 7270 |
]. |
7271 |
||
7272 |
self class |
|
15413 | 7273 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
7274 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7275 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
7276 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
11210 | 7277 |
|
7278 |
"Created: / 27-01-2012 / 11:31:12 / cg" |
|
9922 | 7279 |
! |
7280 |
||
7281 |
canAddBreakpoint |
|
7282 |
|m| |
|
7283 |
||
7284 |
m := contextView middleButtonMenu. |
|
7285 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
7286 |
! |
|
7287 |
||
7288 |
canRemoveBreakpoint |
|
7289 |
|m| |
|
7290 |
||
7291 |
m := contextView middleButtonMenu. |
|
7292 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
7293 |
! |
|
7294 |
||
7295 |
findHaltingContext |
|
7296 |
|haltSelectors| |
|
7297 |
||
7298 |
haltSelectors := self haltSelectors. |
|
7299 |
||
10205 | 7300 |
contextArray keysAndValuesDo:[:idx :con | |
15413 | 7301 |
|sel con2 sel2 method| |
7302 |
||
7303 |
sel := con selector. |
|
7304 |
(haltSelectors includes:sel) ifTrue:[ |
|
7305 |
(method := con method) notNil ifTrue:[ |
|
7306 |
method mclass == Object ifTrue:[ |
|
7307 |
con2 := contextArray at:idx+1. |
|
7308 |
sel2 := con2 selector. |
|
7309 |
(haltSelectors includes:sel2) ifTrue:[ |
|
7310 |
con2 method mclass == Object ifTrue:[ |
|
7311 |
^ contextArray at:idx+2. |
|
7312 |
] |
|
7313 |
]. |
|
7314 |
^ contextArray at:idx+1 |
|
7315 |
]. |
|
7316 |
method mclass == Breakpoint ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7317 |
(contextArray at:idx+1) infoPrintCR. |
15413 | 7318 |
^ contextArray at:idx+1 |
7319 |
]. |
|
7320 |
]. |
|
7321 |
]. |
|
7322 |
con method isWrapped ifTrue:[ |
|
7323 |
^ con |
|
7324 |
]. |
|
9922 | 7325 |
]. |
7326 |
^ nil |
|
7327 |
||
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7328 |
"Modified: / 27-01-2012 / 11:06:02 / cg" |
9922 | 7329 |
! |
7330 |
||
7331 |
ignoreBreakpoints |
|
7332 |
^ ignoreBreakpoints |
|
7333 |
||
7334 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
7335 |
! ! |
|
7336 |
||
7823 | 7337 |
!DebugView methodsFor:'private-cache handling'! |
7338 |
||
7339 |
cacheMyself |
|
7340 |
"remember myself for next debug session" |
|
7341 |
||
7342 |
"caching the last debugger will make the next debugger appear |
|
7343 |
faster, since no resources have to be allocated in the display. |
|
7344 |
We have to be careful to release all refs to the debuggee, though. |
|
7345 |
Otherwise, the GC will not be able to release it." |
|
7346 |
||
7347 |
windowGroup notNil ifTrue:[ |
|
16253 | 7348 |
windowGroup setProcess:nil. |
7823 | 7349 |
]. |
7350 |
||
7351 |
self releaseDebuggee. |
|
7352 |
||
7353 |
cachable ~~ true ifTrue:[^ self]. |
|
7354 |
||
7355 |
"/ |
|
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
7356 |
"/ only cache if I am on the Display (i.e. the default screen) |
7823 | 7357 |
"/ |
16253 | 7358 |
device == Display ifTrue:[ |
7359 |
exclusive ifTrue:[ |
|
7360 |
CachedExclusive := self |
|
7361 |
] ifFalse:[ |
|
7362 |
CachedDebugger := self |
|
7363 |
]. |
|
7823 | 7364 |
]. |
7365 |
||
7366 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
16253 | 7367 |
ObjectMemory stepInterruptHandler:nil |
7823 | 7368 |
]. |
7369 |
||
7370 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
7371 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
7372 |
! |
|
7373 |
||
7374 |
isCached |
|
13226 | 7375 |
"tell whether we are a cached debugger" |
7823 | 7376 |
|
7377 |
CachedExclusive == self ifTrue:[ |
|
15413 | 7378 |
^ true. |
7823 | 7379 |
]. |
7380 |
CachedDebugger == self ifTrue:[ |
|
15413 | 7381 |
^ true. |
7823 | 7382 |
]. |
7383 |
||
7384 |
^ false. |
|
7385 |
||
13226 | 7386 |
"Created: / 10-07-1997 / 15:22:43 / stefan" |
7387 |
"Modified (comment): / 27-07-2013 / 15:38:47 / cg" |
|
7823 | 7388 |
! |
7389 |
||
7390 |
uncacheMyself |
|
7391 |
"do not remember myself any longer for next debug session" |
|
7392 |
||
7393 |
cachable := false. |
|
7394 |
||
7395 |
CachedExclusive == self ifTrue:[ |
|
15413 | 7396 |
CachedExclusive := nil. |
7823 | 7397 |
]. |
7398 |
CachedDebugger == self ifTrue:[ |
|
15413 | 7399 |
CachedDebugger := nil. |
7823 | 7400 |
]. |
7401 |
OpenDebuggers notNil ifTrue:[ |
|
15413 | 7402 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 7403 |
]. |
7404 |
||
7405 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
7406 |
! ! |
|
7407 |
||
10628 | 7408 |
!DebugView methodsFor:'private-code view'! |
7409 |
||
7410 |
codeAspect |
|
11704 | 7411 |
^ SyntaxHighlighter codeAspectMethod |
10628 | 7412 |
|
7413 |
"Created: / 27-07-2011 / 13:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11704 | 7414 |
"Modified: / 27-07-2012 / 22:20:27 / cg" |
10628 | 7415 |
! ! |
7416 |
||
7823 | 7417 |
!DebugView methodsFor:'private-context handling'! |
7418 |
||
11391 | 7419 |
contextListEntryFor:aContext |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7420 |
^ Error |
16501 | 7421 |
handle:[:ex | '???' ] |
7422 |
do:[ |
|
7423 |
|s| |
|
7424 |
||
7425 |
aContext selector == #doIt ifTrue:[ |
|
7426 |
aContext receiver isNil ifTrue:[ |
|
7427 |
s := 'doIt' allBold |
|
7428 |
] |
|
7429 |
]. |
|
7430 |
||
7431 |
s := Text streamContents:[:s | aContext printOn:s ]. |
|
7432 |
RememberedCallChain notNil ifTrue:[ |
|
7433 |
(RememberedCallChain includesIdentical:aContext) ifTrue:[ |
|
7434 |
s := s withColor:#red. |
|
7435 |
]. |
|
7436 |
]. |
|
7437 |
s |
|
7438 |
]. |
|
11391 | 7439 |
|
7440 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
7441 |
! |
|
7442 |
||
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7443 |
is:aHomeContext inCallingChainOf:aContext |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7444 |
|con| |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7445 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7446 |
con := aContext. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7447 |
[con notNil and:[con ~~ aHomeContext]] whileTrue:[ |
15413 | 7448 |
con := con sender |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7449 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7450 |
^ con notNil |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7451 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7452 |
"Created: / 10-06-2012 / 18:46:29 / cg" |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7453 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7454 |
|
11890 | 7455 |
isEnteredDueToBreakpointOrHalt |
7456 |
"see if we came here due to a step interrupt" |
|
7457 |
||
7458 |
|c cReceiver| |
|
7459 |
||
7460 |
"/ look for a breakpoint-wrapper's context |
|
7461 |
c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil. |
|
7462 |
c isNil ifTrue:[ |
|
15413 | 7463 |
^ true. |
11890 | 7464 |
]. |
7465 |
cReceiver := c receiver. |
|
7466 |
^ cReceiver == BreakPointInterrupt |
|
13293 | 7467 |
|
7468 |
"Modified: / 01-08-2013 / 23:34:01 / cg" |
|
11890 | 7469 |
! |
7470 |
||
7471 |
isHaltToBeIgnored |
|
7472 |
"see if the current halt (if any) is in the ignore-list" |
|
7473 |
||
13059 | 7474 |
|c cReceiver sender haltingMethod lineNrInHaltingMethod breakpointParameter |
7475 |
sReceiver| |
|
11890 | 7476 |
|
7477 |
"/ should a halt be ignored ? |
|
7478 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
7479 |
||
13059 | 7480 |
"/ look for a method breakpoint-wrapper's context |
11890 | 7481 |
c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
7482 |
c notNil ifTrue:[ |
|
15413 | 7483 |
((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[ |
7484 |
c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
|
7485 |
cReceiver := c receiver. |
|
7486 |
]. |
|
7487 |
(cReceiver isKindOf:BreakPointInterrupt) ifFalse:[ |
|
7488 |
c := nil |
|
7489 |
] ifTrue:[ |
|
7490 |
[ |
|
7491 |
sender := c sender. |
|
7492 |
((sReceiver := sender receiver) isKindOf:BreakPointInterrupt) |
|
7493 |
or:[ sReceiver == BreakPointInterrupt ] |
|
7494 |
] whileTrue:[ |
|
7495 |
c := sender |
|
7496 |
]. |
|
7497 |
[ (sender := c sender) isBlockContext ] whileTrue:[ |
|
7498 |
c := sender |
|
7499 |
]. |
|
7500 |
sender := nil. "/ avoid keeping a reference to this context |
|
7501 |
]. |
|
11890 | 7502 |
]. |
14993 | 7503 |
"/ Transcript showCR:c. |
11890 | 7504 |
c isNil ifTrue:[ |
15413 | 7505 |
"/ look for halts or explicit breakpoints |
7506 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
7507 |
c isNil ifTrue:[ |
|
7508 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
7509 |
c isNil ifTrue:[ |
|
7510 |
^ false |
|
7511 |
]. |
|
7512 |
breakpointParameter := c argAt:1. |
|
7513 |
(self class |
|
7514 |
isBreakpointToBeIgnoredForParameter:breakpointParameter |
|
7515 |
context:(c sender) |
|
7516 |
modifyEntryCount:true |
|
7517 |
) ifTrue:[ |
|
7518 |
^ true. |
|
7519 |
]. |
|
7520 |
]. |
|
11890 | 7521 |
]. |
7522 |
||
7523 |
c := c sender. |
|
7524 |
"/ a code-breakpoint ? |
|
7525 |
(c receiver isKindOf:Breakpoint) ifTrue:[ |
|
15413 | 7526 |
c := c sender. |
11890 | 7527 |
]. |
7528 |
haltingMethod := c method. |
|
7529 |
||
7530 |
haltingMethod isWrapped ifTrue:[ |
|
15413 | 7531 |
lineNrInHaltingMethod := 1. |
11890 | 7532 |
] ifFalse:[ |
15413 | 7533 |
lineNrInHaltingMethod := c lineNumber. |
7534 |
"/ Transcript showCR:c. |
|
11890 | 7535 |
]. |
7536 |
||
12562 | 7537 |
^ self class |
15413 | 7538 |
isHaltToBeIgnoredIn:haltingMethod |
7539 |
atLineNr:lineNrInHaltingMethod |
|
7540 |
context:c |
|
7541 |
modifyEntryCount:true. |
|
11890 | 7542 |
|
7543 |
"Created: / 22-10-2010 / 12:09:53 / cg" |
|
7544 |
"Modified: / 06-03-2012 / 12:54:09 / cg" |
|
7545 |
! |
|
7546 |
||
266 | 7547 |
setContext:aContext |
7548 |
"show calling chain from aContext in the walk-back listview" |
|
7549 |
||
641 | 7550 |
^ 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
|
7551 |
|
641 | 7552 |
"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
|
7553 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7554 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7555 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
7556 |
"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
|
7557 |
Most complications here arise from filtering less-interesting contexts |
15256 | 7558 |
if not in verbose-context mode or when hiding implementation contexts. |
15413 | 7559 |
There is a lot of heuristic magic here, to make the debugger as useful |
15256 | 7560 |
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
|
7561 |
|
14531 | 7562 |
|con sel text method caller caller2 called called2 m count c cc sndr |
14523 | 7563 |
suspendContext calledBySuspendContext nm h calledContext show2 |
15257 | 7564 |
alreadyInApplicationCode verboseBacktrace| |
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7565 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7566 |
"/ (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7567 |
"/ "no change" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7568 |
"/ ^ false |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7569 |
"/ ]. |
266 | 7570 |
|
14523 | 7571 |
isStoppedAtHaltOrBreakPoint := isStoppedAtBreakPointWithParameter := false. |
7572 |
isStoppedInModalDialog := isStoppedInApplicationAction := alreadyInApplicationCode := false. |
|
14531 | 7573 |
isStoppedAtStatementBreakpoint := false. |
939 | 7574 |
firstContext := aContext. |
15257 | 7575 |
verboseBacktrace := self verboseBacktraceHolder value. |
939 | 7576 |
|
266 | 7577 |
m := contextView middleButtonMenu. |
7578 |
m notNil ifTrue:[ |
|
15497 | 7579 |
m disable:#showMore. |
266 | 7580 |
]. |
3269 | 7581 |
canShowMore := false. |
266 | 7582 |
|
7583 |
aContext isNil ifTrue:[ |
|
15497 | 7584 |
text := Array with:'** no context **'. |
7585 |
contextArray := nil. |
|
266 | 7586 |
] ifFalse:[ |
15497 | 7587 |
text := OrderedCollection new:nChainShown. |
7588 |
contextArray := OrderedCollection new:nChainShown. |
|
7589 |
||
7590 |
con := aContext. |
|
7591 |
calledContext := nil. |
|
7592 |
||
7593 |
DebuggingContextWalk == true ifTrue:[ |
|
7594 |
'======================================' print. con printCR. |
|
7595 |
]. |
|
7596 |
alreadyInApplicationCode := |
|
7597 |
con receiver isLazyValue not "/ careful to not force futures/lazy values |
|
7598 |
and:[con receiver isKindOf:ApplicationModel]. |
|
7599 |
||
7600 |
verboseBacktrace ~~ true ifTrue:[ |
|
7601 |
"/ with dense backtrace, hide the ProcessorScheduler |
|
7602 |
"/ contexts at the top; look for a Process>>suspend* |
|
7603 |
"/ context within the first 10 contexts |
|
7604 |
||
7605 |
suspendContext := nil. |
|
7606 |
c := con. |
|
7607 |
1 to:10 do:[:i | |
|
7608 |
|selector| |
|
7609 |
||
7610 |
c notNil ifTrue:[ |
|
7611 |
selector := c selector. |
|
7612 |
selector notNil ifTrue:[ |
|
7613 |
(selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[ |
|
7614 |
suspendContext := c. |
|
7615 |
calledBySuspendContext := cc. |
|
7616 |
]. |
|
7617 |
]. |
|
7618 |
cc := c. |
|
7619 |
c := c sender. |
|
7620 |
] |
|
7621 |
]. |
|
7622 |
suspendContext notNil ifTrue:[ |
|
7623 |
con := suspendContext. |
|
7624 |
calledContext := calledBySuspendContext. |
|
7625 |
suspendContext := nil |
|
7626 |
]. |
|
7627 |
]. |
|
7628 |
"/ Transcript show:'1 '; showCR:con. |
|
7629 |
con notNil ifTrue:[ |
|
7630 |
"/ hide the halt implementation |
|
7631 |
sel := con selector. |
|
7632 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7633 |
(method := con method) notNil ifTrue:[ |
|
7634 |
method mclass == Object ifTrue:[ |
|
7635 |
(sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[ |
|
7636 |
isStoppedAtBreakPointWithParameter := true. |
|
7637 |
breakPointParameter := con argAt:1. |
|
7638 |
]. |
|
7639 |
isStoppedAtHaltOrBreakPoint := true. |
|
7640 |
verboseBacktrace ~~ true ifTrue:[ |
|
7641 |
calledContext := con. |
|
7642 |
con := con sender. |
|
7643 |
] |
|
7644 |
] ifFalse:[ |
|
7645 |
method mclass == Breakpoint ifTrue:[ |
|
7646 |
isStoppedAtHaltOrBreakPoint := true. |
|
7647 |
isStoppedAtStatementBreakpoint := true. |
|
7648 |
verboseBacktrace ~~ true ifTrue:[ |
|
7649 |
calledContext := con. |
|
7650 |
con := con sender. |
|
7651 |
]. |
|
7652 |
"/ Transcript show:'2 '; showCR:con. |
|
7653 |
]. |
|
7654 |
]. |
|
7655 |
]. |
|
7656 |
]. |
|
7657 |
]. |
|
7658 |
||
7659 |
(verboseBacktrace not or:[ hideSupportCode]) ifTrue:[ |
|
7660 |
[ |
|
7661 |
con notNil |
|
7662 |
and:[ con isBlockContext not |
|
7663 |
and:[ con method notNil |
|
7664 |
and:[ (con method shouldBeSkippedInDebuggersWalkBack) |
|
7665 |
and:[ (self haltSelectors includes: con selector) not]]]] |
|
7666 |
] whileTrue:[ |
|
7667 |
"/ Transcript show:'xx '; showCR:con. |
|
7668 |
calledContext := con. |
|
7669 |
con := con sender |
|
7670 |
]. |
|
7671 |
]. |
|
7672 |
||
7673 |
" |
|
7674 |
get them all, by walking along the caller chain. |
|
7675 |
depending on the settings, skip some intermediate contexts |
|
7676 |
(such as collection enumeration implementations), which are usually not |
|
7677 |
of interest when debugging an application. |
|
7678 |
On the fly, gather some additional information |
|
7679 |
such as: are we at a halt/breakpoint, are we in a modal dialog opened, |
|
7680 |
are we coming from an application model's action etc. |
|
7681 |
" |
|
7682 |
count := 0. |
|
7683 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
|
7684 |
"/ remember any halt/breakpoint or openModal on the fly |
|
7685 |
DebuggingContextWalk == true ifTrue:[ '---' print. con printCR ]. |
|
7686 |
||
7687 |
sel := con selector. |
|
7688 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7689 |
(method := con method) notNil ifTrue:[ |
|
7690 |
method mclass == Object ifTrue:[ |
|
7691 |
(sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[ |
|
7692 |
isStoppedAtBreakPointWithParameter := true. |
|
7693 |
breakPointParameter := con argAt:1. |
|
7694 |
]. |
|
7695 |
isStoppedAtHaltOrBreakPoint := true. |
|
7696 |
] ifFalse:[ |
|
7697 |
method mclass == Breakpoint ifTrue:[ |
|
7698 |
isStoppedAtHaltOrBreakPoint := true. |
|
7699 |
]. |
|
7700 |
] |
|
7701 |
] |
|
7702 |
] ifFalse:[ |
|
7703 |
((sel == #openModal) or:[sel == #openModal:]) ifTrue:[ |
|
7704 |
isStoppedInModalDialog := true. |
|
7705 |
] ifFalse:[ |
|
7706 |
alreadyInApplicationCode ifFalse:[ |
|
7707 |
(con receiver isLazyValue not "/ careful to not force futures/lazy values |
|
7708 |
and:[con receiver isKindOf:ApplicationModel]) ifTrue:[ |
|
7709 |
isStoppedInApplicationAction := true. |
|
7710 |
] |
|
7711 |
] |
|
7712 |
] |
|
7713 |
]. |
|
7714 |
||
7715 |
[ |
|
7716 |
|show1| |
|
7717 |
||
7718 |
show1 := self showingContext1:con calling:calledContext. |
|
7719 |
DebuggingDebugger3 == true ifTrue:[ |
|
7720 |
'showingContext1: (' print. con print. ') --> ' print. show1 printCR. |
|
7721 |
]. |
|
7722 |
show1 |
|
7723 |
] whileFalse:[ |
|
7724 |
calledContext := con. |
|
7725 |
con := con sender. |
|
7726 |
]. |
|
7727 |
||
7728 |
show2 := self showingContext2:con nesting:count. |
|
7729 |
DebuggingDebugger3 == true ifTrue:[ |
|
7730 |
'showingContext2: (' print. con print. ') --> ' print. show2 printCR. |
|
7731 |
]. |
|
7732 |
||
7733 |
show2 ifTrue:[ |
|
7734 |
contextArray add:con. |
|
7735 |
||
7736 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
7737 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
7738 |
] ifFalse:[ |
|
7739 |
nm := self contextListEntryFor:con. |
|
7740 |
]. |
|
7741 |
text add:nm. |
|
7742 |
count := count + 1. |
|
7743 |
]. |
|
7744 |
||
7745 |
"/ with hidden support code, skip over internals of exceptions |
|
7746 |
hideSupportCode == true ifTrue:[ |
|
7747 |
"/ Transcript showCR:'x'. |
|
7748 |
(con isBlockContext |
|
7749 |
and:[ (h := con home) notNil |
|
7750 |
and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[ |
|
7751 |
|blocksReceiver| |
|
7752 |
blocksReceiver := con receiver. |
|
7753 |
c := con sender. |
|
7754 |
[ |
|
7755 |
c notNil |
|
7756 |
and:[ |
|
7757 |
sndr := c sender. |
|
7758 |
(sndr ~= h) |
|
7759 |
and:[ |
|
7760 |
blocksReceiver isCollection "/ skip collection implementations |
|
7761 |
or:[ ( #( #'handle:do:' "/ skip exception implementations |
|
7762 |
#'handleDo:' |
|
7763 |
#'answer:do:' |
|
7764 |
#'ensure:' ) includes: c selector ) |
|
7765 |
or:[ #'perform:*' "/ skip perform implementations |
|
7766 |
match: c selector ]] |
|
7767 |
] |
|
7768 |
] |
|
7769 |
] whileTrue:[ |
|
7770 |
c := sndr |
|
7771 |
]. |
|
7772 |
c notNil ifTrue:[ |
|
7773 |
con := c "sender". |
|
7774 |
]. |
|
7775 |
]. |
|
7776 |
]. |
|
7777 |
||
7778 |
"/ |
|
7779 |
"/ kludge: if it's a wrapped method, then hide the wrap-call |
|
7780 |
"/ |
|
7781 |
method := con method. |
|
7782 |
method notNil ifTrue:[ |
|
7783 |
called := con. |
|
7784 |
caller := con sender. |
|
7785 |
(caller notNil and:[caller receiver == method]) ifTrue:[ |
|
7786 |
called2 := caller. |
|
7787 |
caller2 := caller sender. |
|
7788 |
caller2 notNil ifTrue:[ |
|
7789 |
(caller2 method isWrapped |
|
7790 |
and:[ caller2 method originalMethod == method ]) ifTrue:[ |
|
7791 |
calledContext := called2. |
|
7792 |
con := caller2 |
|
7793 |
]. |
|
7794 |
]. |
|
7795 |
||
7796 |
]. |
|
7797 |
caller := caller2 := nil |
|
7798 |
]. |
|
7799 |
||
7800 |
"/ with dense backtrace, skip the doIt method's context |
|
7801 |
"/ (its dummy anyway) and fake that context's name |
|
7802 |
||
7803 |
verboseBacktrace ~~ true ifTrue:[ |
|
7804 |
(con isBlockContext |
|
7805 |
and:[(h := con home) == con sender |
|
7806 |
and:[h notNil |
|
7807 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
|
7808 |
and:[h method who isNil]]]]) ifTrue:[ |
|
7809 |
calledContext := con. |
|
7810 |
con := con sender. |
|
7811 |
text removeLast. |
|
7812 |
||
7813 |
text add:(self contextListEntryFor:con methodHome). |
|
7814 |
]. |
|
7815 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
|
7816 |
]. |
|
7817 |
||
7818 |
"/ with dense backtrace, don't show contexts below the doIt |
|
7819 |
( verboseBacktrace ~~ true |
|
7820 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
|
7821 |
con := nil. |
|
7822 |
] ifFalse:[ |
|
7823 |
calledContext := con. |
|
7824 |
con := con sender |
|
7825 |
]. |
|
7826 |
]. |
|
7827 |
||
7828 |
" |
|
7829 |
did we reach the end ? |
|
7830 |
" |
|
7831 |
(con isNil or:[con sender isNil]) ifTrue:[ |
|
7832 |
||
7833 |
"/ the very last one is the startup context |
|
7834 |
"/ (in main) - it has nil as receiver and nil as selector |
|
7835 |
||
7836 |
(contextArray notEmpty |
|
7837 |
and:[contextArray last selector isNil]) ifTrue:[ |
|
7838 |
contextArray removeLast. |
|
7839 |
text removeLast |
|
7840 |
]. |
|
7841 |
||
7842 |
verboseBacktrace ~~ true ifTrue:[ |
|
7843 |
"/ in dense mode, remove process startup contexts (if any) |
|
7844 |
||
7845 |
(contextArray size > 0 |
|
7846 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
7847 |
con selector == #start ifTrue:[ |
|
7848 |
contextArray removeLast. |
|
7849 |
text removeLast. |
|
7850 |
||
7851 |
[contextArray size > 0 |
|
7852 |
and:[contextArray last methodHome == con]] whileTrue:[ |
|
7853 |
contextArray removeLast. |
|
7854 |
text removeLast. |
|
7855 |
] |
|
7856 |
] |
|
7857 |
] |
|
7858 |
] |
|
7859 |
] ifFalse:[ |
|
7860 |
m notNil ifTrue:[ |
|
7861 |
m enable:#showMore. |
|
7862 |
]. |
|
7863 |
canShowMore := true. |
|
7864 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
|
7865 |
]. |
|
266 | 7866 |
]. |
7867 |
||
7868 |
contextView setList:text. |
|
944 | 7869 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7870 |
releaseInspectors ifTrue:[ |
15497 | 7871 |
receiverInspector release. |
7872 |
contextInspector release. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7873 |
]. |
266 | 7874 |
|
7875 |
m notNil ifTrue:[ |
|
15497 | 7876 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 7877 |
]. |
3511 | 7878 |
self updateMenuItems. |
266 | 7879 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7880 |
|
7797 | 7881 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7882 |
"Modified: / 27-07-2012 / 15:10:53 / cg" |
266 | 7883 |
! |
7884 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7885 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7886 |
"show calling chain from aContext in the walk-back listview. |
1213 | 7887 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7888 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7889 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7890 |
|
8152 | 7891 |
con := aContext. |
15257 | 7892 |
self verboseBacktraceHolder value ifFalse:[ |
15413 | 7893 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
7894 |
con := con sender. |
|
7895 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
7896 |
con := con sender. |
|
7897 |
]. |
|
7898 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7899 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7900 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7901 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7902 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7903 |
"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
|
7904 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7905 |
|
3447 | 7906 |
showingContext1:aContext calling:calledContext |
7823 | 7907 |
"return false, if this (top) context is to be skipped. |
10205 | 7908 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 7909 |
the set of methods which are suppressed is my (claus's) own choice." |
7910 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7911 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 7912 |
|
15257 | 7913 |
self verboseBacktraceHolder value ifTrue:[ ^true ]. |
3447 | 7914 |
aContext isNil ifTrue:[ ^true ]. |
7915 |
||
7916 |
sel := aContext selector. |
|
7917 |
rec := aContext receiver. |
|
7918 |
mthd := aContext method. |
|
7919 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
7920 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7921 |
"/ to avoid firing/waiting the lazy or future |
10205 | 7922 |
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
|
7923 |
aContext sender notNil ifTrue:[ |
15413 | 7924 |
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
|
7925 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7926 |
|
11636 | 7927 |
DebuggingDebugger3 == true ifTrue:[ |
15413 | 7928 |
'showingContext1: (' print. aContext print. |
7929 |
') calling: (' print. calledContext print. |
|
7930 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7931 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7932 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7933 |
(#(doCallHandler: doRaise |
3447 | 7934 |
) includes:sel) |
15413 | 7935 |
ifTrue:[ |
7936 |
recIsException ifTrue:[ ^ false]. |
|
7937 |
]. |
|
3447 | 7938 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7939 |
(#(raise raiseRequest |
3447 | 7940 |
) includes:sel) |
15413 | 7941 |
ifTrue:[ |
7942 |
recIsException ifTrue:[ |
|
7943 |
(senderRec isLazyValue not |
|
7944 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
7945 |
]. |
|
7946 |
]. |
|
3447 | 7947 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7948 |
(#(doWhile: |
3447 | 7949 |
) includes:sel) |
15413 | 7950 |
ifTrue:[ |
7951 |
rec isBlock ifTrue:[ |
|
7952 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
7953 |
]. |
|
7954 |
]. |
|
3447 | 7955 |
|
8620 | 7956 |
calledContext notNil ifTrue:[ |
15413 | 7957 |
calledSel := calledContext selector. |
7958 |
calledRec := calledContext receiver. |
|
7959 |
||
7960 |
calledRec isBlock ifTrue:[ |
|
7961 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
7962 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
7963 |
]. |
|
7964 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
7965 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8620 | 7966 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7967 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7968 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7969 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7970 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7971 |
"/ |
10205 | 7972 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7973 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7974 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7975 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7976 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7977 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7978 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7979 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7980 |
"/ ]. |
8620 | 7981 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7982 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7983 |
(#(handleDo:) includes:sel) |
15413 | 7984 |
ifTrue:[ |
7985 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
7986 |
]. |
|
10205 | 7987 |
(#( |
15413 | 7988 |
withCursor:do: |
7989 |
withWaitCursorDo: |
|
7990 |
withReadCursorDo: |
|
7991 |
withWriteCursorDo: |
|
7992 |
withSearchCursorDo: |
|
3447 | 7993 |
) includes:sel) |
15413 | 7994 |
ifTrue:[ |
7995 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
7996 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
7997 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
7998 |
]. |
|
10205 | 7999 |
|
8000 |
(#( |
|
15413 | 8001 |
wait |
8002 |
waitWithTimeout: |
|
8003 |
waitWithTimeoutMs: |
|
3447 | 8004 |
) includes:sel) |
15413 | 8005 |
ifTrue:[ |
8006 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
8007 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
8008 |
]. |
|
3447 | 8009 |
|
8010 |
^ true |
|
8011 |
||
9662 | 8012 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
11696 | 8013 |
"Modified: / 27-07-2012 / 17:30:18 / cg" |
3447 | 8014 |
! |
8015 |
||
8016 |
showingContext2:aContext nesting:nesting |
|
7823 | 8017 |
"return false, if this (intermediate) context is to be skipped. |
13455 | 8018 |
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
|
8019 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 8020 |
|
10205 | 8021 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8022 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8023 |
|
15257 | 8024 |
self verboseBacktraceHolder value ifTrue:[^ true]. |
3447 | 8025 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8026 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8027 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8028 |
sel := aContext selector. |
939 | 8029 |
mClass := aContext methodClass. |
8030 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8031 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8032 |
sender notNil ifTrue:[ |
15413 | 8033 |
senderSelector := sender selector. |
8034 |
senderReceiver := sender receiver. |
|
8035 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8036 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8037 |
|
939 | 8038 |
sel == #withCursor:do: ifTrue:[ |
15413 | 8039 |
(mClass == WindowGroup) ifTrue:[^ false]. |
8040 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 8041 |
]. |
8042 |
(sel == #withExecuteCursorDo: |
|
8043 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
15413 | 8044 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 8045 |
]. |
8046 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
8047 |
(sel == #do: |
6600 | 8048 |
or:[sel == #from:to:do: |
6601 | 8049 |
or:[sel == #keysAndValuesDo: |
8050 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
15413 | 8051 |
mClass == Array ifTrue:[^ false]. |
8052 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
8053 |
mClass == Set ifTrue:[^ false]. |
|
8054 |
mClass == Dictionary ifTrue:[^ false]. |
|
8055 |
mClass == Interval ifTrue:[^ false]. |
|
10205 | 8056 |
]. |
8057 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8058 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8059 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8060 |
or:[sel == #perform:with:with:with: |
11696 | 8061 |
or:[sel == #perform:with:with:with:with: |
8062 |
or:[sel == #perform:withArguments: |
|
8063 |
or:[sel == #perform:with:ifNotUnderstood: |
|
8064 |
or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]) |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8065 |
ifTrue:[ |
15413 | 8066 |
hideSupportCode == true ifTrue:[ |
8067 |
"/ 'x' printCR. |
|
8068 |
mClass == Object ifTrue:[^ false] |
|
8069 |
]. |
|
8070 |
nesting == 0 ifTrue:[^ true]. |
|
8071 |
mClass == Array ifTrue:[^ false]. |
|
8072 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8073 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8074 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8075 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8076 |
|
939 | 8077 |
(mClass == Object) ifTrue:[ |
15413 | 8078 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 8079 |
]. |
8080 |
||
8081 |
(mClass == Method) ifTrue:[ |
|
15413 | 8082 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 8083 |
]. |
8084 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8085 |
(mClass == SmallInteger) ifTrue:[ |
15413 | 8086 |
(sel == #to:do:) ifTrue:[^ false]. |
8087 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8088 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8089 |
|
939 | 8090 |
(mClass == Block) ifTrue:[ |
15413 | 8091 |
sel == #ensure: ifTrue:[^ false]. |
8092 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
8093 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
8094 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
8095 |
sel == #on:do: ifTrue:[^ false]. |
|
8096 |
||
8097 |
sel == #value ifTrue:[^ false]. |
|
8098 |
sel == #value: ifTrue:[^ false]. |
|
8099 |
sel == #value:value: ifTrue:[^ false]. |
|
8100 |
sel == #value:value:value: ifTrue:[^ false]. |
|
8101 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
8102 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
8103 |
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
|
8104 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8105 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8106 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8107 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8108 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8109 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8110 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8111 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8112 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8113 |
"/ 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
|
8114 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8115 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8116 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8117 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8118 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8119 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8120 |
|
15413 | 8121 |
aContext home notNil ifTrue:[ |
8122 |
aContext home receiver isLazyValue ifFalse:[ |
|
8123 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
|
8124 |
(aContext home selector == #wait) ifTrue:[^ false]. |
|
8125 |
(aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
8126 |
] |
|
8127 |
] |
|
8128 |
] |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8129 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8130 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8131 |
(rec isExceptionHandler) ifTrue:[ |
15413 | 8132 |
sel == #handle:do: ifTrue:[^ false]. |
8133 |
sel == #handleDo: ifTrue:[^ false]. |
|
8134 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
8135 |
sel == #answer:do: ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8136 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
8137 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
15413 | 8138 |
sel == #doRaise ifTrue:[^ false]. |
8139 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
8140 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
8141 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
8142 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8143 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8144 |
(mClass == Context) ifTrue:[ |
15413 | 8145 |
sel == #unwind ifTrue:[^ false]. |
8146 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8147 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8148 |
(mClass == ProcessorScheduler) ifTrue:[ |
15413 | 8149 |
sel == #interruptActive ifTrue:[^ false]. |
8150 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
8151 |
sel == #suspend: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8152 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8153 |
mClass == Process ifTrue:[ |
15413 | 8154 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8155 |
]. |
15256 | 8156 |
(sel == #break) ifTrue:[ |
15413 | 8157 |
(mClass == Breakpoint) ifTrue:[^ false]. |
15256 | 8158 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8159 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8160 |
|
9662 | 8161 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
11696 | 8162 |
"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
|
8163 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
8164 |
|
4859 | 8165 |
!DebugView methodsFor:'private-control loop'! |
266 | 8166 |
|
8167 |
controlLoop |
|
8168 |
"this is a kludge: |
|
15413 | 8169 |
start a dispatchloop which exits when |
8170 |
either continue, return or step is pressed |
|
266 | 8171 |
" |
8172 |
||
8173 |
haveControl := true. |
|
664 | 8174 |
[ |
15413 | 8175 |
[haveControl] whileTrue:[ |
13388 | 8176 |
AbortOperationRequest handle:[:ex | |
8177 |
] do:[ |
|
15413 | 8178 |
self controlLoopCatchingErrors |
13388 | 8179 |
] |
15413 | 8180 |
]. |
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
8181 |
] ensure:[ |
15413 | 8182 |
catchBlock := nil. |
8183 |
haveControl := false |
|
266 | 8184 |
]. |
664 | 8185 |
|
8186 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 8187 |
! |
8188 |
||
8189 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
8190 |
"this is the debuggers own private event handling loop; |
1187 | 8191 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
8192 |
|
266 | 8193 |
"setup a self removing catch-block" |
8194 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
8195 |
||
8196 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
15757 | 8197 |
"if we do not have multiple processes or its a system process |
8198 |
we start another dispatch loop, which exits when |
|
8199 |
either continue, return or step is pressed |
|
8200 |
or (via the catchBlock) if an error occurs. |
|
8201 |
Since our display is an extra exclusive one, |
|
8202 |
all processing for normal views stops here ... |
|
8203 |
" |
|
8204 |
||
8205 |
WindowGroup setActiveGroup:windowGroup. |
|
8206 |
SignalSet anySignal handle:[:ex | |
|
8207 |
|signal| |
|
8208 |
||
8209 |
signal := ex creator. |
|
8210 |
(UserInterruptSignal accepts:signal) ifTrue:[ |
|
14835 | 8211 |
Transcript showCR:'UserInterruptSignal'. |
15757 | 8212 |
self topView raiseDeiconified. |
8213 |
ex proceed. |
|
8214 |
]. |
|
8215 |
||
8216 |
(UserNotification accepts:signal) ifTrue:[ |
|
11890 | 8217 |
Transcript showCR:'UserNotification'. |
15757 | 8218 |
(signal ~~ ActivityNotificationSignal) ifTrue:[ |
8219 |
self showError:ex description. |
|
8220 |
]. |
|
8221 |
ex proceed. |
|
8222 |
]. |
|
8223 |
(HaltInterrupt accepts:signal) ifTrue:[ |
|
11890 | 8224 |
Transcript showCR:'HaltInterrupt'. |
15757 | 8225 |
Transcript showCR:'Halt/Break in debugger ignored'. |
8226 |
self topView raiseDeiconified. |
|
8227 |
ex proceed. |
|
8228 |
]. |
|
8229 |
||
8230 |
self showError:'*** Error in modal debugger: |
|
266 | 8231 |
|
334 | 8232 |
>>>> Signal: ' , signal printString , ' |
266 | 8233 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8234 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8235 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8236 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8237 |
>>>> : ' , 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
|
8238 |
>>>> : ' , 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
|
8239 |
>>>> : ' , 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
|
8240 |
>>>> : ' , 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
|
8241 |
>>>> : ' , 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
|
8242 |
>>>> : ' , 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
|
8243 |
>>>> : ' , 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
|
8244 |
>>>> : ' , 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
|
8245 |
>>>> : ' , 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
|
8246 |
>>>> : ' , 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
|
8247 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 8248 |
>>>> Message: ' , ex description , ' |
266 | 8249 |
|
1187 | 8250 |
caught & ignored.'. |
15757 | 8251 |
ex return. |
8252 |
] do:[ |
|
11890 | 8253 |
"/ UserNotification handle:[:ex | |
8254 |
"/ (ex signal == ActivityNotificationSignal) ifTrue:[ |
|
8255 |
"/ ex proceed |
|
8256 |
"/ ]. |
|
8257 |
"/ self showError:ex description. |
|
8258 |
"/ ex proceed. |
|
8259 |
"/ ] do:[ |
|
16253 | 8260 |
device |
15757 | 8261 |
dispatchModalWhile:[ |
8262 |
Processor activeProcess state:#debug. |
|
8263 |
haveControl]. |
|
11890 | 8264 |
"/ ] |
15757 | 8265 |
]. |
8266 |
WindowGroup setActiveGroup:nil. |
|
266 | 8267 |
] ifFalse:[ |
15757 | 8268 |
"we do have multiple processes - |
8269 |
simply enter the DebugViews-Windowgroup event loop. |
|
8270 |
effectively suspending event processing for the currently |
|
8271 |
active group. |
|
8272 |
" |
|
8273 |
SignalSet anySignal handle:[:ex | |
|
8274 |
|answer signal eMsg| |
|
8275 |
||
8276 |
signal := ex creator. |
|
8277 |
||
8278 |
DebuggingDebugger ~~ true ifTrue:[ |
|
8279 |
(signal == ActivityNotification) ifTrue:[ |
|
8280 |
ex proceed |
|
8281 |
]. |
|
8282 |
"/ |
|
8283 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
8284 |
"/ |
|
8285 |
ex catchInDebugger ifTrue:[ |
|
8286 |
'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR. |
|
8287 |
self halt. "/ self destroy. |
|
8288 |
ex reject |
|
8289 |
]. |
|
8290 |
||
8291 |
"/ |
|
8292 |
"/ ignore recursive breakpoints |
|
8293 |
"/ |
|
8294 |
(signal isControlInterrupt) ifTrue:[ |
|
8295 |
ignoreBreakpoints == true ifTrue:[ |
|
8296 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
8297 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
8298 |
self topView raiseDeiconified. |
|
8299 |
ex proceed |
|
8300 |
]. |
|
8301 |
]. |
|
8302 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
8303 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
8304 |
answer := Dialog |
|
8305 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
8306 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
8307 |
values:#( #proceed #close ) |
|
8308 |
default:#close. |
|
8309 |
answer == #close ifTrue:[ |
|
8310 |
self destroy. |
|
8311 |
ex reject |
|
8312 |
]. |
|
8313 |
ex return. |
|
8314 |
]. |
|
8315 |
signal == RecursiveExceptionError ifTrue:[ |
|
8316 |
(ex exception creator == BreakPointInterrupt) |
|
8317 |
ifTrue:[ |
|
8318 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
8319 |
ex proceed. |
|
8320 |
]. |
|
8321 |
||
8322 |
self showError:'*** Recursive error in debugger: |
|
266 | 8323 |
|
12687
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8324 |
>>>> Signal: ' , ex creator printString , ' |
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8325 |
>>>> ' , ex parameter creator printString , ' |
266 | 8326 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8327 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8328 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8329 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8330 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 8331 |
>>>> Message: ' , ex description , ' |
266 | 8332 |
|
1187 | 8333 |
caught & ignored.'. |
15757 | 8334 |
ex return |
8335 |
]. |
|
8336 |
]. |
|
8337 |
||
8338 |
self topView raiseDeiconified. |
|
8339 |
||
8340 |
eMsg := ex description. |
|
8341 |
(signal isControlInterrupt) ifTrue:[ |
|
8342 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
8343 |
]. |
|
8344 |
Dialog aboutToOpenBoxNotificationSignal |
|
8345 |
handle:[:ex | ex proceed ] |
|
8346 |
do:[ |
|
8347 |
answer := Dialog |
|
8348 |
choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
|
8349 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
8350 |
values:#( #proceed #cancel #debug ) |
|
8351 |
default:#cancel. |
|
8352 |
]. |
|
8353 |
answer == #debug ifTrue:[ |
|
8354 |
'DebugView [info]: caught exception - debugging' infoPrintCR. |
|
8355 |
Debugger |
|
8356 |
enterUnconditional:(ex suspendedContext) |
|
8357 |
withMessage:(ex creator class name,' in debugger: ' , eMsg) |
|
8358 |
mayProceed:true. |
|
8359 |
ex proceed. |
|
8360 |
]. |
|
8361 |
answer == #proceed ifTrue:[ |
|
8362 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
8363 |
ex proceed. |
|
8364 |
]. |
|
8365 |
'DebugView [info]: caught exception - returning' infoPrintCR. |
|
8366 |
ex return. |
|
8367 |
] do:[ |
|
8368 |
"/ make certain that sub-debuggers, inspectors etc. |
|
8369 |
"/ come up on my device. |
|
16253 | 8370 |
Screen currentScreenQuerySignal answer:device |
15757 | 8371 |
do:[ |
8372 |
Dialog aboutToOpenBoxNotificationSignal |
|
8373 |
handle:[:ex | ex proceed ] |
|
8374 |
do:[ |
|
8375 |
windowGroup |
|
8376 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
8377 |
true] |
|
8378 |
onLeave:[] |
|
8379 |
] |
|
8380 |
] |
|
8381 |
]. |
|
266 | 8382 |
]. |
8383 |
catchBlock := nil. |
|
8384 |
||
11818 | 8385 |
"Created: / 24-11-1995 / 20:33:45 / cg" |
8386 |
"Modified: / 26-09-2012 / 15:03:39 / cg" |
|
266 | 8387 |
! ! |
8388 |
||
13416 | 8389 |
!DebugView methodsFor:'queries'! |
8390 |
||
13488 | 8391 |
canDefineForCallee:callee |
8392 |
"again, pure heuristics here" |
|
8393 |
||
16072 | 8394 |
|mthd app heuristic selector sender| |
8395 |
||
8396 |
callee isNil ifTrue:[^ false]. |
|
13488 | 8397 |
|
8398 |
classToDefineIn := selectorToDefine := nil. "/ sorry - left as info to define action |
|
8399 |
||
16072 | 8400 |
"/ clicked on an unimplemented method ? |
8401 |
sender := callee sender. |
|
8402 |
sender isNil ifTrue:[^ false]. |
|
8403 |
||
8404 |
mthd := sender method. |
|
8405 |
mthd isNil ifTrue:[ |
|
8406 |
sender isBlockContext ifFalse:[ |
|
8407 |
"/ an unimplemented method |
|
8408 |
selector := sender selector. |
|
8409 |
(sender receiver class canUnderstand:selector) ifFalse:[ |
|
8410 |
classToDefineIn := sender receiver class. |
|
8411 |
selectorToDefine := selector. |
|
8412 |
^ true |
|
8413 |
] |
|
8414 |
] |
|
8415 |
]. |
|
8416 |
||
8417 |
mthd := callee method. |
|
8418 |
mthd notNil ifTrue:[ |
|
8419 |
(mthd selector == #subclassResponsibility) ifTrue:[ |
|
8420 |
classToDefineIn := sender receiver class. |
|
8421 |
selectorToDefine := sender selector. |
|
8422 |
^ true. |
|
8423 |
]. |
|
8424 |
||
8425 |
"/ that's a big hack, but I am tired of navigating to find the missing menu message... |
|
8426 |
"/ you will thank me!! |
|
8427 |
mthd selector == #error:mayProceed: ifTrue:[ |
|
8428 |
(callee receiver isKindOf:MenuPanel) ifTrue:[ |
|
8429 |
|senderHome| |
|
8430 |
||
8431 |
(senderHome := sender home) notNil ifTrue:[ |
|
8432 |
(senderHome selector startsWith:'accept:') ifTrue:[ |
|
8433 |
(inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[ |
|
8434 |
(app := self processesApplication) notNil ifTrue:[ |
|
8435 |
heuristic := senderHome argsAndVars select:[:o | o isSymbol]. |
|
8436 |
heuristic size == 1 ifTrue:[ |
|
8437 |
classToDefineIn := app class. |
|
8438 |
selectorToDefine := heuristic first. |
|
8439 |
^ true |
|
8440 |
]. |
|
8441 |
]. |
|
8442 |
]. |
|
8443 |
]. |
|
8444 |
]. |
|
8445 |
]. |
|
8446 |
] |
|
13488 | 8447 |
]. |
8448 |
^ false |
|
8449 |
! |
|
8450 |
||
13489 | 8451 |
showingAlreadyModifiedCode |
8452 |
^ methodCodeToggle isVisible |
|
8453 |
and:[ methodCodeToggleSelectionHolder value = 2 ] |
|
8454 |
! ! |
|
8455 |
||
8456 |
!DebugView methodsFor:'user interaction'! |
|
8457 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8458 |
checkIfCodeIsReallyModified |
16430 | 8459 |
|methodSource editorCode| |
6616 | 8460 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8461 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8462 |
|
16430 | 8463 |
currentMethod isNil ifTrue:[^ false]. |
8464 |
||
8465 |
methodSource := currentMethod source. |
|
8466 |
methodSource notNil ifTrue:[ |
|
8467 |
methodSource := methodSource string. |
|
8468 |
editorCode := codeView contents string. |
|
8469 |
methodSource = editorCode ifTrue:[ |
|
8470 |
^ false |
|
8471 |
]. |
|
8472 |
(methodSource withTabsExpanded:8) = (editorCode withTabsExpanded:8) ifTrue:[ |
|
8473 |
^ false |
|
8474 |
]. |
|
6616 | 8475 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8476 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8477 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8478 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8479 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8480 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8481 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8482 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8483 |
checkSelectionChangeAllowed:newSelection |
13388 | 8484 |
|answer v| |
8485 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8486 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8487 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8488 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8489 |
and:[newSelection = contextView selection]) ifTrue:[ |
15413 | 8490 |
^ true |
8491 |
]. |
|
8492 |
||
8493 |
answer := Dialog |
|
8494 |
confirmWithCancel:('Code modified - change selection anyway ?') |
|
8495 |
labels:#('No' 'No, Show Diffs' 'Yes'). |
|
13388 | 8496 |
answer isNil ifTrue:[^ false]. |
8497 |
answer == false ifTrue:[ |
|
15413 | 8498 |
v := DiffCodeView |
8499 |
openOn:codeView contents |
|
8500 |
label:(resources string:'Changed code (to be accepted ?)') |
|
8501 |
and:currentMethod source |
|
8502 |
label:(resources string:'Method''s actual (maybe original) code'). |
|
8503 |
v label:(resources string:'Comparing method''s code'). |
|
8504 |
v waitUntilVisible. |
|
8505 |
^ false |
|
13388 | 8506 |
]. |
8507 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8508 |
codeView modified:false. |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8509 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8510 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8511 |
|
266 | 8512 |
codeAccept:someCode |
13394 | 8513 |
"user wants some code to be recompiled" |
8514 |
||
14640 | 8515 |
ParseError handle:[:ex | |
15413 | 8516 |
ex lineNumber notNil ifTrue:[ |
8517 |
codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition. |
|
8518 |
]. |
|
8519 |
Dialog information:ex description. |
|
14640 | 8520 |
"/ ParseError new |
8521 |
"/ errorMessage:aMessage startPosition:position endPosition:endPos; |
|
8522 |
"/ parameter:self; |
|
8523 |
"/ lineNumber:tokenLineNr; "lineNr" |
|
8524 |
"/ raiseRequest. |
|
15413 | 8525 |
] do:[ |
8526 |
^ self codeAccept:someCode unwind:false category:nil onCancel:nil |
|
14640 | 8527 |
]. |
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8528 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8529 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 8530 |
! |
8531 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8532 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
13394 | 8533 |
"user wants some code to be recompiled. |
8534 |
Optionally unwind stack to right above the changed method. |
|
13455 | 8535 |
This undwind option is a leftover from times, when the debugger had no chance to |
15413 | 8536 |
show the original code. |
8537 |
Now, it can, and got a choice-field to select between original and changed code. |
|
8538 |
So the undwind option is not longer used and probably completely obsolete now |
|
13455 | 8539 |
(aka: this method is always called with doUnwind==false, these days)" |
3427 | 8540 |
|
13842 | 8541 |
|con newMethod| |
3427 | 8542 |
|
8543 |
codeView withWaitCursorDo:[ |
|
16430 | 8544 |
" |
8545 |
find the method-home context for this one |
|
8546 |
" |
|
8547 |
doUnwind ifTrue:[ |
|
8548 |
con := selectedContext. |
|
8549 |
top := con. |
|
8550 |
[con notNil] whileTrue:[ |
|
8551 |
(con methodHome == selectedContext) ifTrue:[ |
|
8552 |
top := con |
|
8553 |
]. |
|
8554 |
con := con sender |
|
8555 |
]. |
|
8556 |
]. |
|
8557 |
||
8558 |
"/ |
|
8559 |
"/ provide the classes nameSpace and changefile-update answers; |
|
8560 |
"/ in case we accept while in another context, to not capture these settings again |
|
8561 |
"/ |
|
8562 |
(Class updateChangeFileQuerySignal, |
|
8563 |
Class updateChangeListQuerySignal, |
|
8564 |
Class updateHistoryLineQuerySignal) answer:true |
|
8565 |
do:[ |
|
8566 |
Class nameSpaceQuerySignal answer:(aClass nameSpace) |
|
8567 |
do:[ |
|
8568 |
"/ the compiler nowadays already cares for the package... |
|
8569 |
"/ no, actually, it does not in case we are in the middle of a fileIn, |
|
8570 |
"/ and packageQuery is already answered by someone else. |
|
8571 |
"/ Better make it unpackaged, in case the user makes changes to other |
|
8572 |
"/ classes here (actually, I often change compiler, debugger, inspector here) |
|
8573 |
Class packageQuerySignal |
|
8574 |
answer:nil |
|
8575 |
do:[ |
|
8576 |
codeView contents:someCode. |
|
8577 |
Class methodRedefinitionNotification |
|
8578 |
answer:#keep |
|
8579 |
do:[ |
|
8580 |
| breakpoints newMethodOrClass | |
|
8581 |
||
8582 |
breakpoints := nil. |
|
8583 |
codeView isCodeView2 ifTrue:[ |
|
8584 |
breakpoints := codeView breakpoints. |
|
8585 |
]. |
|
8586 |
||
8587 |
BreakpointQuery answer: breakpoints do:[ |
|
8588 |
"/ Use original method's programming language instead of class's one. |
|
8589 |
"/ In most cases it's the same, but it may be that the method edited |
|
8590 |
"/ and accepted was an extension method written in another languages |
|
8591 |
"/ (such as Smalltalk extension to Java class or Ruby extension to |
|
8592 |
"/ Smalltalk class. |
|
8593 |
newMethodOrClass := selectedContext programmingLanguage |
|
8594 |
compilerClassForInteractiveTools |
|
8595 |
compile:someCode |
|
8596 |
forClass:aClass |
|
8597 |
inCategory:category |
|
8598 |
notifying:codeView. |
|
8599 |
"/ Kludge for accepting Java code in a debugger. The Java compiler |
|
8600 |
"/ does not compile single methods but always a full class and returns |
|
8601 |
"/ the compiled class(es) rather than a method. |
|
8602 |
"/ However, we need to update the method holder of a codeView. |
|
8603 |
"/ |
|
8604 |
"/ So, here we check whether the returned `newMethod` is really a method, |
|
8605 |
"/ if it's a class, try to search that class for a method with the |
|
8606 |
"/ same selector as selector of currently selected context. If found, |
|
8607 |
"/ that's the 'new' method we are going to show. |
|
8608 |
newMethodOrClass isBehavior ifTrue:[ |
|
8609 |
| selector | |
|
8610 |
||
8611 |
selector := selectedContext selector. |
|
8612 |
newMethod := newMethodOrClass compiledMethodAt: selector ifAbsent: nil. |
|
8613 |
] ifFalse:[ |
|
8614 |
newMethod := newMethodOrClass. |
|
8615 |
newMethod == #Error ifTrue:[ |
|
8616 |
"/ should now be obsolete |
|
8617 |
newMethod := nil |
|
8618 |
]. |
|
8619 |
]. |
|
8620 |
]. |
|
8621 |
]. |
|
8622 |
]. |
|
8623 |
]. |
|
8624 |
]. |
|
8625 |
||
8626 |
methodCodeToggleSelectionHolder value:2. "/ showing current code |
|
8627 |
methodCodeToggle beVisible. |
|
8628 |
||
8629 |
inspecting ifFalse:[ |
|
8630 |
(newMethod isNil) ifTrue:[^ cancelAction value]. |
|
8631 |
||
8632 |
codeView modified:false. |
|
8633 |
codeView isCodeView2 ifTrue:[ |
|
8634 |
codeView methodHolder value: newMethod. |
|
8635 |
]. |
|
8636 |
currentMethod := newMethod. |
|
8637 |
||
8638 |
doUnwind ifTrue:[ |
|
8639 |
"/ if it worked, and doUnwind is true, |
|
8640 |
"/ remove everything up to and including top |
|
8641 |
"/ from the context chain |
|
8642 |
||
8643 |
selectedContext canReturn ifTrue:[ |
|
8644 |
self setContext:(top "sender"). |
|
8645 |
exitAction := #restart. |
|
8646 |
selectedContext setLineNumber:1. |
|
8647 |
self doRestart. |
|
8648 |
] ifFalse:[ |
|
8649 |
self setContext:(top sender). |
|
8650 |
exitAction := #return. |
|
8651 |
]. |
|
8652 |
]. |
|
8653 |
]. |
|
3427 | 8654 |
]. |
8655 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
8656 |
"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
|
8657 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
14713 | 8658 |
"Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3427 | 8659 |
! |
8660 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8661 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
13394 | 8662 |
"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
|
8663 |
|
16422 | 8664 |
|sel implementorClass receiverClass method category wrapper| |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8665 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8666 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8667 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8668 |
"/ 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
|
8669 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8670 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8671 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8672 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8673 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8674 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8675 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8676 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8677 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8678 |
|
16422 | 8679 |
" |
8680 |
use class&selector to find the method for the compilation |
|
8681 |
and compile. |
|
8682 |
" |
|
8683 |
category := givenCategoryOrNil. |
|
8684 |
sel := selectedContext selector. |
|
8685 |
implementorClass := selectedContext methodClass. |
|
8686 |
method := selectedContext method. |
|
8687 |
||
8688 |
implementorClass isNil ifTrue:[ |
|
8689 |
(method notNil |
|
8690 |
and:[method mclass isNil |
|
8691 |
and:[(wrapper := method wrapper) notNil]] |
|
8692 |
) ifTrue:[ |
|
8693 |
method := wrapper. |
|
8694 |
]. |
|
8695 |
method notNil ifTrue:[ |
|
8696 |
implementorClass := method mclass. |
|
8697 |
implementorClass isNil ifTrue:[ |
|
8698 |
implementorClass := method getMclass |
|
8699 |
]. |
|
8700 |
]. |
|
8701 |
]. |
|
8702 |
implementorClass notNil ifTrue:[ |
|
8703 |
category isNil ifTrue:[ |
|
8704 |
method isNil ifTrue:[ |
|
8705 |
method := implementorClass compiledMethodAt:sel. |
|
8706 |
]. |
|
8707 |
category := method category |
|
8708 |
] |
|
8709 |
] ifFalse:[ |
|
8710 |
receiverClass := selectedContext receiver class. |
|
8711 |
implementorClass := receiverClass whichClassImplements:sel. |
|
8712 |
implementorClass := implementorClass ? receiverClass. |
|
8713 |
implementorClass ~~ Object ifTrue:[ |
|
8714 |
implementorClass := Dialog |
|
8715 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
8716 |
initialAnswer:implementorClass name |
|
8717 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
8718 |
implementorClass size == 0 ifTrue:[ |
|
8719 |
^ cancelAction value "/ cancelled |
|
8720 |
]. |
|
8721 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
8722 |
implementorClass isNil ifTrue:[ |
|
8723 |
Dialog warn:'No such class'. |
|
8724 |
^ cancelAction value "/ cancelled |
|
8725 |
]. |
|
8726 |
]. |
|
8727 |
]. |
|
8728 |
||
8729 |
self |
|
8730 |
codeAccept:someCode |
|
8731 |
inClass:implementorClass |
|
8732 |
unwind:doUnwind |
|
8733 |
category:category |
|
8734 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8735 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8736 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8737 |
"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
|
8738 |
"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
|
8739 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8740 |
|
7912 | 8741 |
codeCompletion |
15413 | 8742 |
"/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
14109 | 8743 |
"/ (can we move that to a utility - probably DoWhatIMeanSupport) |
8744 |
||
8745 |
|cls language| |
|
7912 | 8746 |
|
8212 | 8747 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 8748 |
|
7912 | 8749 |
cls := currentMethod mclass. |
15413 | 8750 |
cls notNil ifTrue:[ |
8751 |
language := cls programmingLanguage. |
|
14109 | 8752 |
]. |
8212 | 8753 |
|
7912 | 8754 |
UserInformation handle:[:ex | |
15413 | 8755 |
ex proceed. |
7912 | 8756 |
] do:[ |
15413 | 8757 |
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
|
8758 |
]. |
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8759 |
|
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8760 |
"Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7912 | 8761 |
! |
8762 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8763 |
confirm:aString |
6971 | 8764 |
"open a modal yes-no dialog. |
8765 |
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
|
8766 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8767 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
15413 | 8768 |
^ true |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8769 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8770 |
^ super confirm:aString. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8771 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8772 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
8773 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
8774 |
"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
|
8775 |
Also sent to autoselect an interesting context on entry." |
0 | 8776 |
|
9235 | 8777 |
HaltInterrupt handle:[:ex | |
15413 | 8778 |
ignoreBreakpoints ifFalse:[ex reject]. |
8779 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
8780 |
ex proceed |
|
3447 | 8781 |
] do:[ |
15413 | 8782 |
self updateForContext:lineNr |
3269 | 8783 |
]. |
8784 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
8785 |
|
3447 | 8786 |
"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
|
8787 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8788 |
|
10205 | 8789 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8790 |
stackInspector notNil ifTrue:[ |
15413 | 8791 |
stackInspector destroy. |
8792 |
stackInspector := nil. |
|
8793 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
8794 |
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
|
8795 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8796 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8797 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8798 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8799 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8800 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8801 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8802 |
sel notNil ifTrue:[ |
15413 | 8803 |
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
|
8804 |
] |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8805 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8806 |
"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
|
8807 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8808 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8809 |
processEvent:anEvent |
6129 | 8810 |
"filter keyboard events for popUp variable value display. |
8811 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8812 |
|
12106 | 8813 |
<resource: #keyboard (#CodeCompletion )> |
8814 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8815 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8816 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8817 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8818 |
evView notNil ifTrue:[ |
15413 | 8819 |
focusView := evView windowGroup focusView. |
8820 |
focusView isNil ifTrue:[ |
|
8821 |
focusView := evView. |
|
8822 |
]. |
|
8823 |
||
8824 |
anEvent isKeyPressEvent ifTrue:[ |
|
8825 |
key := anEvent key. |
|
8826 |
rawKey := anEvent rawKey. |
|
8827 |
||
8828 |
inCodeView := (focusView == codeView |
|
8829 |
or:[focusView isComponentOf:codeView]). |
|
8830 |
inCodeView ifTrue:[ |
|
8831 |
key == #CodeCompletion ifTrue:[ |
|
8832 |
"/ complete the word before/under the cursor. |
|
8833 |
self sensor |
|
8834 |
pushUserEvent:#codeCompletion |
|
8835 |
for:self |
|
8836 |
withArguments:#(). |
|
8837 |
^ true |
|
8838 |
]. |
|
8839 |
]. |
|
8840 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8841 |
|
3602 | 8842 |
false ifTrue:[ |
15413 | 8843 |
anEvent isButtonReleaseEvent ifTrue:[ |
8844 |
anEvent view == codeView ifTrue:[ |
|
8845 |
(RBParser notNil and:[RBParser isLoaded]) |
|
8846 |
ifTrue:[ |
|
8847 |
self sensor |
|
8848 |
pushEvent:anEvent. "/ must be first in queue |
|
8849 |
||
8850 |
self sensor |
|
8851 |
pushUserEvent:#explainSelection |
|
8852 |
for:self |
|
8853 |
withArguments:nil. |
|
8854 |
^ true "/ eaten |
|
8855 |
] |
|
8856 |
] |
|
8857 |
]. |
|
3602 | 8858 |
]. |
8859 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8860 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8861 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8862 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8863 |
|
8212 | 8864 |
setCurrentMethod:aMethodOrNil |
8865 |
currentMethod := aMethodOrNil. |
|
8866 |
! |
|
8867 |
||
15413 | 8868 |
showSelection:lineNr |
1327 | 8869 |
"user clicked on a header line - show selected code in textView. |
8870 |
Also sent to autoselect an interesting context on entry." |
|
15413 | 8871 |
|
8872 |
UserNotification |
|
8873 |
handle:[:ex | |
|
8874 |
"/ ex suspendedContext fullPrintAll. |
|
8875 |
Transcript showCR:ex description. |
|
8876 |
"/ Transcript showCR:ex parameter. |
|
8877 |
ex proceed |
|
8878 |
] |
|
8879 |
do:[ |
|
8880 |
Error |
|
8881 |
handle:[:ex | |
|
8882 |
|s con| |
|
8883 |
||
8884 |
ex creator isControlInterrupt ifTrue:[ |
|
8885 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' |
|
8886 |
infoPrintCR. |
|
8887 |
ex proceed |
|
8888 |
]. |
|
8889 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' |
|
8890 |
bindWith:ex suspendedContext) infoPrintCR. |
|
8891 |
s := '' writeStream. |
|
8892 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
8893 |
s nextPutLine:'****'. |
|
8894 |
s nextPutLine:'**** ',(ex description). |
|
8895 |
s nextPutLine:'****'. |
|
8896 |
con := ex suspendedContext. |
|
8897 |
s nextPutLine:'**** ',(con printString). |
|
8898 |
con := con sender. |
|
8899 |
HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ]. |
|
8900 |
||
5842 | 8901 |
"/ [con notNil] whileTrue:[ |
8902 |
"/ Error catch:[:ex | |
|
8903 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
8904 |
"/ ]. |
|
4947 | 8905 |
"/ |
5842 | 8906 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
8907 |
"/ con := nil |
|
8908 |
"/ ] ifFalse:[ |
|
8909 |
"/ con := con sender. |
|
8910 |
"/ ] |
|
8911 |
"/ ]. |
|
15413 | 8912 |
|
8913 |
codeView contents:(s contents). |
|
8914 |
ex return. |
|
8915 |
] |
|
8916 |
do:[ self doShowSelection:lineNr ] |
|
8917 |
] |
|
11610 | 8918 |
|
8919 |
"Modified: / 19-07-2012 / 10:56:58 / cg" |
|
1327 | 8920 |
! |
8921 |
||
10205 | 8922 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8923 |
stackInspector isNil ifTrue:[ |
15413 | 8924 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
8925 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
8926 |
stackInspector := InspectorView |
|
8927 |
origin:(0.6 @ 0.0) |
|
8928 |
corner:(1.0 @ 1.0) |
|
8929 |
in:contextInspector superView. |
|
8930 |
stackInspector realize. |
|
8931 |
stackInspector fieldListLabel:'Stack'. |
|
8932 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8933 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8934 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8935 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8936 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8937 |
|
12529 | 8938 |
updateContextInfoFor:aContext |
8939 |
"additional info as-per selected context; |
|
8940 |
for now: |
|
15656 | 8941 |
update:with:from: - show who was responsible |
12529 | 8942 |
" |
8943 |
||
12552 | 8944 |
|whatChanged changedObject receiver| |
12529 | 8945 |
|
8946 |
aContext selector == #'update:with:from:' ifTrue:[ |
|
15656 | 8947 |
receiver := aContext receiver. |
8948 |
whatChanged := aContext argAt:1. |
|
8949 |
changedObject := aContext argAt:3. |
|
8950 |
||
8951 |
changedObject isBehavior ifTrue:[ |
|
8952 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold). |
|
8953 |
^ self |
|
8954 |
]. |
|
8955 |
||
8956 |
receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm | |
|
8957 |
|val| |
|
8958 |
||
8959 |
IsDebuggingQuery answer:true do:[ |
|
8960 |
val := (receiver instVarAt:i). |
|
8961 |
]. |
|
8962 |
val == changedObject ifTrue:[ |
|
8963 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold). |
|
8964 |
^ self |
|
8965 |
] |
|
8966 |
]. |
|
8967 |
||
8968 |
(receiver isKindOf:ApplicationModel) ifTrue:[ |
|
8969 |
receiver builder notNil ifTrue:[ |
|
8970 |
(receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue | |
|
8971 |
eachValue == changedObject ifTrue:[ |
|
8972 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold). |
|
8973 |
^ self |
|
8974 |
] |
|
8975 |
] |
|
8976 |
] |
|
8977 |
]. |
|
8978 |
||
8979 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold). |
|
8980 |
^self. |
|
12529 | 8981 |
]. |
8982 |
contextInfoLabel label:nil. |
|
8983 |
! |
|
8984 |
||
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8985 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8986 |
"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
|
8987 |
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
|
8988 |
|
56 | 8989 |
|con homeContext sel method code canAccept |
105 | 8990 |
implementorClass lineNrInMethod rec m line |
10205 | 8991 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 8992 |
codeSet highlighter evaluatorClass |
11912
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
8993 |
canDefine callee searchClass originalMethod cannotAcceptDueToOutdatedClass| |
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
8994 |
|
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
8995 |
canDefine := cannotAcceptDueToOutdatedClass := false. |
8212 | 8996 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
8997 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8998 |
contextArray notNil ifTrue:[ |
16430 | 8999 |
lineNr <= contextArray size ifTrue:[ |
9000 |
con := contextArray at:lineNr. |
|
9001 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
9002 |
]. |
|
9003 |
" |
|
9004 |
clicking on the '** ...'-line shows more ... |
|
9005 |
" |
|
9006 |
con isNil ifTrue:[ |
|
9007 |
line := contextView list at:lineNr. |
|
9008 |
(line startsWith:'**') ifTrue:[ |
|
9009 |
self showMore. |
|
9010 |
lineNr >= contextArray size ifTrue:[ |
|
9011 |
contextView setSelection:lineNr. |
|
9012 |
con := contextArray at:lineNr ifAbsent:nil |
|
9013 |
] |
|
9014 |
]. |
|
9015 |
con isNil ifTrue:[ |
|
9016 |
codeView contents:nil. |
|
9017 |
^ self |
|
9018 |
]. |
|
9019 |
]. |
|
9020 |
||
9021 |
selectedContext := con. |
|
9022 |
m := contextView middleButtonMenu. |
|
9023 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
9024 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
9025 |
]. |
|
9026 |
||
9027 |
self withExecuteCursorDo:[ |
|
9028 |
codeSet := false. |
|
9029 |
||
9030 |
" |
|
9031 |
give it to the (lower right) inspector |
|
9032 |
" |
|
9033 |
Error handle:[:ex | |
|
9034 |
'DebugView [warning]: error while accessing context: ' errorPrint. |
|
9035 |
ex description errorPrintCR. |
|
9036 |
contextInspector inspect:nil. |
|
9037 |
contextInspector fieldListLabel:('Context'). |
|
9038 |
ex suspendedContext fullPrintAllOn: Transcript. |
|
9479 | 9039 |
"/ ex reject. |
16430 | 9040 |
] do:[ |
9041 |
contextInspector inspect:con. |
|
9042 |
"/ contextInspector fieldListLabel:('Context: ',con method whoString). |
|
9043 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
9044 |
]. |
|
9045 |
||
9046 |
"/ show a stack inspector sometimes |
|
9047 |
||
9048 |
con hasStackToShow ifTrue:[ |
|
9049 |
self showStackInspectorFor:con |
|
9050 |
] ifFalse:[ |
|
9051 |
self hideStackInspector |
|
9052 |
]. |
|
9053 |
||
9054 |
homeContext := con methodHome. |
|
9055 |
con canReturn ifTrue:[ |
|
9056 |
returnButton enable. restartButton enable. |
|
9057 |
] ifFalse:[ |
|
9058 |
returnButton disable. restartButton disable. |
|
9059 |
]. |
|
9060 |
||
9061 |
lineNrInMethod := con lineNumber. |
|
9062 |
||
9063 |
canAccept := false. |
|
9064 |
||
9065 |
homeContext isNil ifTrue:[ |
|
9066 |
" |
|
9067 |
mhmh - an optimized block |
|
9068 |
should get the block here, and get the method from |
|
9069 |
that one ... |
|
9070 |
But in the current version, there is no easy way to get to the block |
|
9071 |
since that one is not in the context. |
|
9072 |
A future new block calling scheme will fix this |
|
9073 |
(passing the block instead of the home as block argument). |
|
9074 |
" |
|
9075 |
(method := con method) isNil ifTrue:[ |
|
9076 |
"temporary kludge - peek into the sender context. |
|
9077 |
If its a do-like method and there is a single block variable |
|
9078 |
in the args or temporaries, that must be the one. |
|
9079 |
This helps in some cases. |
|
9080 |
" |
|
9081 |
(sender := con sender) notNil ifTrue:[ |
|
9082 |
tryVars := false. |
|
9083 |
(selSender := sender selector) notNil ifTrue:[ |
|
9084 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
9085 |
tryVars := true. |
|
9086 |
] |
|
9087 |
]. |
|
9088 |
tryVars ifTrue:[ |
|
9089 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
9090 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
9091 |
possibleBlocks size == 1 ifTrue:[ |
|
9092 |
method := possibleBlocks first method. |
|
9093 |
]. |
|
9094 |
] |
|
9095 |
]. |
|
9096 |
] |
|
9097 |
] ifFalse:[ |
|
9098 |
"fetch rec here - so we won't need context in doItAction" |
|
9099 |
rec := homeContext receiver. |
|
9100 |
sel := homeContext selector. |
|
9101 |
sel notNil ifTrue:[ |
|
9102 |
canAccept := true. |
|
9103 |
||
9104 |
implementorClass := homeContext methodClass. |
|
9105 |
implementorClass isNil ifTrue:[ |
|
9106 |
homeContext method notNil ifTrue:[ |
|
9107 |
WrappedMethod allInstancesDo:[:wrapped | |
|
9108 |
wrapped originalMethod == homeContext method ifTrue:[ |
|
9109 |
implementorClass := wrapped mclass |
|
9110 |
] |
|
9111 |
]. |
|
9112 |
implementorClass isNil ifTrue:[ |
|
9113 |
(homeContext searchClass notNil |
|
9114 |
and:[homeContext searchClass isObsolete]) ifTrue:[ |
|
9115 |
cannotAcceptDueToOutdatedClass := true. |
|
9116 |
] |
|
9117 |
]. |
|
9118 |
]. |
|
9119 |
]. |
|
9120 |
implementorClass isNil ifTrue:[ |
|
9121 |
Error handle:[:ex | |
|
11890 | 9122 |
"/ not covered by Error, anyway |
9123 |
"/ ex signal == BreakPointInterrupt ifTrue:[ |
|
9124 |
"/ ex proceed. |
|
9125 |
"/ ]. |
|
16430 | 9126 |
code := 'error while asking method for its source'. |
9127 |
code := code , Character cr , ex creator printString. |
|
9128 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
9129 |
||
9130 |
canAccept := false. |
|
9131 |
ex return. |
|
9132 |
] do:[ |
|
9133 |
" |
|
9134 |
special: look if this context was created by |
|
9135 |
valueWithReceiver kind of method invocation; |
|
9136 |
if so, grab the method from the sender and show it |
|
9137 |
" |
|
9138 |
((sender := homeContext sender) notNil |
|
9139 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
9140 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
9141 |
method := sender receiver. |
|
9142 |
canAccept := false. |
|
9143 |
] ifFalse:[ |
|
9144 |
(method := con method) notNil ifTrue:[ |
|
9145 |
canAccept := false. |
|
9146 |
] |
|
9147 |
]. |
|
9148 |
] |
|
9149 |
] ifFalse:[ |
|
9150 |
method := implementorClass compiledMethodAt:sel. |
|
9151 |
]. |
|
9152 |
] |
|
9153 |
]. |
|
9154 |
||
9155 |
homeContext notNil ifTrue:[ |
|
9156 |
searchClass := homeContext searchClass ? rec class. |
|
9157 |
currentMethod := searchClass lookupMethodFor:sel. |
|
9158 |
]. |
|
9159 |
originalMethod := currentMethod. |
|
9160 |
(currentMethod notNil |
|
9161 |
and:[currentMethod ~~ method |
|
9162 |
and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]] |
|
9163 |
) ifTrue:[ |
|
9164 |
originalMethod := method. |
|
9165 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
9166 |
method := originalMethod. "/ the one which is suspended / was executing |
|
9167 |
] ifFalse:[ |
|
9168 |
method := currentMethod. "/ the one which has already been accepted/modified. |
|
9169 |
lineNrInMethod := nil. |
|
9170 |
canAccept := true. |
|
9171 |
]. |
|
9172 |
methodCodeToggle beVisible. |
|
9173 |
] ifFalse:[ |
|
9174 |
methodCodeToggle beInvisible. |
|
9175 |
]. |
|
9176 |
||
9177 |
code isNil ifTrue:[ |
|
9178 |
errMsg := nil. |
|
9179 |
method isNil ifTrue:[ |
|
9180 |
"/ fall back heuristics (see how this was called, fetch block from caller) |
|
9181 |
sender := con sender. |
|
9182 |
con isBlockContext ifTrue:[ |
|
9183 |
(sender notNil |
|
9184 |
and:[((sender selector ? '') startsWith:'value') |
|
9185 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
9186 |
code := sender receiver source. |
|
9187 |
] |
|
9188 |
] ifFalse:[ |
|
9189 |
(sender notNil |
|
9190 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
9191 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
9192 |
method := sender receiver. |
|
9193 |
] |
|
9194 |
] |
|
9195 |
]. |
|
9196 |
method notNil ifTrue:[ |
|
9197 |
contextInspector fieldListLabel:(method selector "whoString"). |
|
9198 |
Error handle:[:ex | |
|
11890 | 9199 |
"/ not covered by Error, anyway |
9200 |
"/ ex signal isControlInterrupt ifTrue:[ |
|
9201 |
"/ ex proceed. |
|
9202 |
"/ ]. |
|
16430 | 9203 |
code := 'error while asking method for its source'. |
9204 |
code := code , Character cr , ex creator printString. |
|
9205 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
9206 |
||
9207 |
canAccept := false. |
|
9208 |
ex return. |
|
9209 |
] do:[ |
|
9210 |
self sensor shiftDown ifTrue:[ |
|
9211 |
code := method decompiledSource |
|
9212 |
] ifFalse:[ |
|
9213 |
code := method source. |
|
9214 |
]. |
|
9215 |
]. |
|
9216 |
||
9217 |
code isNil ifTrue:[ |
|
9218 |
method sourceFilename notNil ifTrue:[ |
|
9219 |
codeView contents:(resources |
|
9220 |
string:'** no sourcefile: %1 **' |
|
9221 |
with:method sourceFilename). |
|
9222 |
codeView realized ifTrue:[ |
|
9223 |
"codeView is not realized on initial startup" |
|
9224 |
codeView flash:'no source'. |
|
9225 |
]. |
|
9226 |
codeSet := true. |
|
9227 |
] ifFalse:[ |
|
9228 |
[ |
|
9229 |
|src| |
|
9230 |
||
9231 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
9232 |
codeView contents:src. |
|
9233 |
codeSet := true. |
|
9234 |
] on: Error do:[ |
|
9235 |
errMsg := '** no source **' |
|
9236 |
]. |
|
9237 |
] |
|
9238 |
]. |
|
9239 |
] ifFalse:[ |
|
9240 |
contextInspector fieldListLabel:'Context'. |
|
9241 |
homeContext isNil ifTrue:[ |
|
9242 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
9243 |
] ifFalse:[ |
|
9244 |
errMsg := '** no method - no source **'. |
|
9245 |
canDefine := false. "/ true. |
|
9246 |
] |
|
9247 |
]. |
|
9248 |
errMsg notNil ifTrue:[ |
|
9249 |
self showError:errMsg. |
|
9250 |
codeSet := true. |
|
9251 |
] |
|
9252 |
]. |
|
9253 |
||
9254 |
code isNil ifTrue:[ |
|
9255 |
"/ canAccept := false. |
|
9256 |
codeSet ifFalse:[ |
|
9257 |
codeView contents:nil. |
|
9258 |
] |
|
9259 |
] ifFalse:[ |
|
9260 |
lineNrInMethod notNil ifTrue:[ |
|
9261 |
lineNrInMethod == 0 ifTrue:[ |
|
9262 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
9263 |
lineNrInMethod := method lineNumber |
|
9264 |
]. |
|
9265 |
"/ guess lineNumber from sent-messages selector |
|
9266 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
9267 |
lineNrInMethod == 0 ifTrue:[ |
|
9268 |
|conIdx sentContext messages| |
|
9269 |
||
9270 |
conIdx := contextArray identityIndexOf:con. |
|
9271 |
conIdx > 1 ifTrue:[ |
|
9272 |
sentContext := contextArray at:conIdx-1. |
|
9273 |
sentContext isBlockContext ifFalse:[ |
|
9274 |
(method notNil and:[code notNil]) ifTrue:[ |
|
9275 |
messages := method messagesSent. |
|
9276 |
messages size == 1 ifTrue:[ |
|
9277 |
sentContext selector == messages first ifTrue:[ |
|
9278 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
9279 |
] |
|
9280 |
] |
|
9281 |
]. |
|
9282 |
]. |
|
9283 |
]. |
|
9284 |
]. |
|
9285 |
]. |
|
9286 |
]. |
|
9287 |
codeView isCodeView2 ifTrue:[ |
|
9288 |
codeView model |
|
9289 |
setValue: code; |
|
9290 |
changed. |
|
9291 |
codeView methodHolder value: method. |
|
9292 |
codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
|
9293 |
] ifFalse:[ |
|
9294 |
UserPreferences current syntaxColoring ifTrue:[ |
|
9295 |
implementorClass isNil ifTrue:[ |
|
9296 |
(con isBlockContext |
|
9297 |
and:[con home isNil |
|
9298 |
and:[con guessedHome notNil]]) |
|
9299 |
ifTrue:[ |
|
9300 |
implementorClass := con guessedHome mclass |
|
9301 |
] |
|
9302 |
]. |
|
9303 |
implementorClass notNil ifTrue:[ |
|
9304 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
9305 |
code size < 100000 ifTrue:[ |
|
9306 |
Error catch:[ |
|
9307 |
code := highlighter formatMethodSource:code in:implementorClass. |
|
9308 |
] |
|
9309 |
] |
|
9310 |
] |
|
9311 |
] |
|
9312 |
]. |
|
1555 | 9313 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9314 |
"/ code ~= (codeView contents) ifTrue:[ |
16430 | 9315 |
cannotAcceptDueToOutdatedClass ifTrue:[ |
16501 | 9316 |
codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' withColor:Color red),Character cr,Character cr,code asString). |
16430 | 9317 |
] ifFalse:[ |
9318 |
codeView setContents:code. |
|
9319 |
]. |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9320 |
"/ ]. |
16430 | 9321 |
]. |
9322 |
(lineNrInMethod notNil |
|
9323 |
and:[lineNrInMethod ~~ 0 |
|
9324 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 9325 |
lineNrInMethod == 255 ifFalse:[ |
16430 | 9326 |
(lineNrInMethod == 255 |
9327 |
and:[method notNil |
|
9328 |
and:[method hasCode not]]) ifTrue:[ |
|
9329 |
"/ means: do not really know in interpreted methods |
|
9330 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
9331 |
] ifFalse:[ |
|
9332 |
codeView selectLine:lineNrInMethod. |
|
9333 |
]. |
|
9334 |
codeView makeSelectionVisible |
|
7000 | 9335 |
]. |
16430 | 9336 |
] ifFalse:[ |
9337 |
codeView unselect. |
|
9338 |
codeView scrollToTop |
|
9339 |
] |
|
9340 |
]. |
|
9341 |
||
9342 |
codeView acceptEnabled:canAccept. |
|
9343 |
canAccept ifTrue:[ |
|
9344 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
9345 |
] ifFalse:[ |
|
9346 |
codeView acceptAction:[:code | self beep] |
|
9347 |
]. |
|
9348 |
||
9349 |
receiverInspector inspect:rec. |
|
9350 |
receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle). |
|
9351 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
|
9352 |
||
9353 |
" |
|
9354 |
the one below is wrong: currently, the |
|
9355 |
evaluator cannot handle passed contexts. |
|
9356 |
Once it does, pass con as in:-arg |
|
9357 |
" |
|
9358 |
(rec isJavaObject |
|
9359 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
9360 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
9361 |
evaluatorClass := Parser. |
|
9362 |
codeView commentStrings:#( '//' ( '/*' '*/' ) ). |
|
9363 |
] ifFalse:[ |
|
9364 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
9365 |
evaluatorClass := method mclass evaluatorClass. |
|
9366 |
codeView commentStrings:method mclass programmingLanguage commentStrings. |
|
9367 |
] ifFalse:[ |
|
9368 |
evaluatorClass := rec class evaluatorClass. |
|
9369 |
codeView commentStrings:rec class programmingLanguage commentStrings. |
|
9370 |
]. |
|
9371 |
]. |
|
9372 |
||
9373 |
codeView |
|
9374 |
doItAction: |
|
9375 |
[:theCode | |
|
9376 |
evaluatorClass |
|
9377 |
evaluate:theCode |
|
9378 |
in:actualContext "/ (selectedContext ? actualContext) |
|
9379 |
receiver:rec |
|
9380 |
notifying:codeView |
|
9381 |
logged:true |
|
9382 |
ifFail:nil |
|
9383 |
]; |
|
9384 |
editedMethodOrClass:(method ? rec class). |
|
9385 |
||
9386 |
||
9387 |
self setCurrentMethod:method. |
|
9388 |
||
9389 |
selectedContext := homeContext ? con. |
|
9390 |
actualContext := con |
|
9391 |
]. |
|
4122 | 9392 |
] ifFalse:[ |
16430 | 9393 |
codeView contents:nil. |
4122 | 9394 |
]. |
9395 |
codeView modified:false. |
|
9396 |
||
9397 |
con isContext ifFalse:[ |
|
16430 | 9398 |
sendButton disable. |
4122 | 9399 |
] ifTrue:[ |
16430 | 9400 |
sendButton enable. |
10205 | 9401 |
]. |
12529 | 9402 |
self updateContextInfoFor:con. |
10205 | 9403 |
|
9404 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 9405 |
(due to the block held in codeView). |
9406 |
(not really needed, since stuff gets collected away sooner or later ... |
|
9407 |
... but this makes it a bit sooner) |
|
9408 |
" |
|
9409 |
con := nil. |
|
9410 |
homeContext := nil. |
|
9411 |
||
13488 | 9412 |
(canDefine or:[self canDefineForCallee:callee]) ifTrue:[ |
16430 | 9413 |
defineButton beVisible. |
4122 | 9414 |
] ifFalse:[ |
16430 | 9415 |
defineButton beInvisible. |
4122 | 9416 |
]. |
9417 |
||
12529 | 9418 |
"/ enable/disable some menu items |
4122 | 9419 |
self updateMenuItems |
9420 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
9421 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
10752 | 9422 |
"Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13394 | 9423 |
"Modified: / 28-08-2013 / 15:13:02 / cg" |
4122 | 9424 |
! ! |
9425 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9426 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'accessing'! |
8170 | 9427 |
|
9428 |
ignoreCount:something |
|
9429 |
ignoreCount := something. |
|
9430 |
! |
|
9431 |
||
9432 |
ignoreEndTime:something |
|
9433 |
ignoreEndTime := something. |
|
9434 |
! |
|
9435 |
||
12937 | 9436 |
ignoreForProcess:aProcess |
9437 |
ignoredProcesses isNil ifTrue:[ |
|
15413 | 9438 |
ignoredProcesses := WeakIdentitySet new. |
12937 | 9439 |
]. |
9440 |
ignoredProcesses add:aProcess |
|
9441 |
! |
|
9442 |
||
9443 |
ignoreForReceiverClass:aClass |
|
9444 |
ignoredReceiverClasses isNil ifTrue:[ |
|
15413 | 9445 |
ignoredReceiverClasses := WeakIdentitySet new. |
12937 | 9446 |
]. |
9447 |
ignoredReceiverClasses add:aClass |
|
9448 |
! |
|
9449 |
||
14608 | 9450 |
ignoreIfCalledFromMethod:aMethod |
9451 |
ignoredSendingClassAndSelectors isNil ifTrue:[ |
|
15413 | 9452 |
ignoredSendingClassAndSelectors := OrderedCollection new. |
14608 | 9453 |
]. |
9454 |
||
9455 |
"/ remember the method's name, not the method. |
|
9456 |
"/ so it can be recompiled and we still detect ignores |
|
9457 |
ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector } |
|
9458 |
! |
|
9459 |
||
11210 | 9460 |
ignoreUntilShiftKeyPressed:aBoolean |
9461 |
ignoreUntilShiftKeyPressed := aBoolean. |
|
9462 |
||
9463 |
"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
|
9464 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9465 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9466 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9467 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9468 |
decrementIgnoreCount |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9469 |
ignoreCount notNil ifTrue:[ |
15413 | 9470 |
ignoreCount > 0 ifTrue:[ |
9471 |
ignoreCount := ignoreCount - 1 |
|
9472 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9473 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9474 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9475 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9476 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9477 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9478 |
printConditionOn:aStream |
14608 | 9479 |
ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[ |
16535 | 9480 |
aStream nextPutAll:(' if called from %1 » %2' |
9481 |
bindWith:ignoredSendingClassAndSelectors first first |
|
9482 |
with:ignoredSendingClassAndSelectors first second). |
|
9483 |
^ self. |
|
14608 | 9484 |
]. |
12937 | 9485 |
ignoredProcesses notEmptyOrNil ifTrue:[ |
16535 | 9486 |
aStream nextPutAll:(' in %1 processes (%2)' |
9487 |
bindWith:ignoredProcesses size |
|
9488 |
with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9489 |
^ self. |
|
14608 | 9490 |
]. |
9491 |
ignoredReceiverClasses notNil ifTrue:[ |
|
16535 | 9492 |
aStream nextPutAll:(' for %1 classes (%2)' |
9493 |
bindWith:ignoredReceiverClasses size |
|
9494 |
with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9495 |
^ self. |
|
14608 | 9496 |
]. |
9497 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
16535 | 9498 |
aStream nextPutAll:' until shiftKey pressed'. |
9499 |
^ self. |
|
14608 | 9500 |
]. |
9501 |
ignoreEndTime notNil ifTrue:[ |
|
16535 | 9502 |
aStream nextPutAll:' until '. |
9503 |
ignoreEndTime printOn:aStream. |
|
9504 |
^ self. |
|
14608 | 9505 |
]. |
9506 |
(ignoreCount notNil) ifTrue:[ |
|
16535 | 9507 |
(ignoreCount > 0) ifTrue:[ |
9508 |
aStream nextPutAll:' for '. |
|
9509 |
ignoreCount printOn:aStream. |
|
9510 |
^ self. |
|
9511 |
]. |
|
9512 |
(ignoreCount < 0) ifTrue:[ |
|
9513 |
aStream nextPutAll:' forEver'. |
|
9514 |
^ self. |
|
9515 |
]. |
|
9516 |
aStream nextPutAll:' no longer'. |
|
14608 | 9517 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9518 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9519 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9520 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9521 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9522 |
haltIgnoredInfoString |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9523 |
"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
|
9524 |
nil if not ignored" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9525 |
|
12941 | 9526 |
^ String streamContents:[:s | |
15413 | 9527 |
s nextPutAll:'ignored '. |
9528 |
self printConditionOn:s |
|
12941 | 9529 |
]. |
9530 |
||
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9531 |
"/ ignoreCount notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9532 |
"/ ignoreCount > 0 ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9533 |
"/ ^ '%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
|
9534 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9535 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9536 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9537 |
"/ ignoreEndTime notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9538 |
"/ (ignoreEndTime > Timestamp now) ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9539 |
"/ ^ 'ignored until %1' bindWith:ignoreEndTime |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9540 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9541 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9542 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9543 |
"/ ignoreUntilShiftKeyPressed == true ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9544 |
"/ Screen current shiftDown ifFalse:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9545 |
"/ ^ 'ignored until shiftKey is pressed' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9546 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9547 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9548 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9549 |
"/ ignoredProcesses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9550 |
"/ ^ 'ignored in some processes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9551 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9552 |
"/ ignoredReceiverClasses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9553 |
"/ ^ 'ignored for some receiver classes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9554 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9555 |
"/ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9556 |
"/ ^ 'ignored until reenabled' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9557 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9558 |
"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
|
9559 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9560 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9561 |
isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9562 |
"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
|
9563 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9564 |
ignoreEndTime notNil ifTrue:[ |
15413 | 9565 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9566 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9567 |
ignoreCount notNil ifTrue:[ |
15413 | 9568 |
^ ignoreCount == -1 or:[ ignoreCount > 0 ] |
12562 | 9569 |
]. |
12941 | 9570 |
ignoredProcesses notNil ifTrue:[ |
15413 | 9571 |
ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]]. |
9572 |
ignoredProcesses isEmpty ifTrue:[ |
|
9573 |
ignoredProcesses := nil. |
|
9574 |
^ false |
|
9575 |
]. |
|
12941 | 9576 |
]. |
12562 | 9577 |
^ true |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9578 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9579 |
"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
|
9580 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9581 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9582 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9583 |
^ false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9584 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9585 |
"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
|
9586 |
"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
|
9587 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9588 |
|
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9589 |
isForBreakpointWithParameter:paramArg |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9590 |
^ false |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9591 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9592 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9593 |
"Created: / 06-03-2012 / 14:36:28 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9594 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9595 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9596 |
isHaltIgnored |
12941 | 9597 |
"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
|
9598 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9599 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
15413 | 9600 |
^ Screen current shiftDown not |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9601 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9602 |
ignoreCount notNil ifTrue:[ |
15413 | 9603 |
^ ignoreCount > 0 |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9604 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9605 |
ignoreEndTime notNil ifTrue:[ |
15413 | 9606 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9607 |
]. |
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 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9610 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9611 |
"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
|
9612 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9613 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9614 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
11210 | 9615 |
|
8170 | 9616 |
method |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9617 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9618 |
|
9922 | 9619 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
9620 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9621 |
m := weakMethodHolder at:1. |
9796 | 9622 |
"/ wait until really gone (it could still be on the call stack |
9623 |
"/ |
|
9624 |
"/ m notNil ifTrue:[ |
|
9625 |
"/ m mclass isNil ifTrue:[ |
|
9626 |
"/ "/ no longer valid |
|
9627 |
"/ weakMethodHolder at:1 put:nil. |
|
9628 |
"/ ^ nil |
|
9629 |
"/ ]. |
|
9630 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9631 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9632 |
|
9922 | 9633 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 9634 |
! |
9635 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9636 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9637 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9638 |
|
9922 | 9639 |
methodArg == #all ifTrue:[ |
15413 | 9640 |
weakMethodHolder := methodArg |
9922 | 9641 |
] ifFalse:[ |
15413 | 9642 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 9643 |
]. |
8170 | 9644 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9645 |
|
9922 | 9646 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 9647 |
! ! |
9648 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9649 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9650 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9651 |
printOn:aStream |
9922 | 9652 |
|method| |
9653 |
||
9654 |
(method := self method) isNil ifTrue:[ |
|
15413 | 9655 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
9656 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9657 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9658 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9659 |
aStream nextPutAll:'Ignore '. |
11704 | 9660 |
method isSymbol ifTrue:[ |
15413 | 9661 |
method printOn:aStream. |
11704 | 9662 |
] ifFalse:[ |
15413 | 9663 |
method whoString printOn:aStream. |
11704 | 9664 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9665 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9666 |
|
11704 | 9667 |
"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
|
9668 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9669 |
|
8170 | 9670 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
9671 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9672 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9673 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9674 |
|
12941 | 9675 |
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
|
9676 |
^ super isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9677 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9678 |
"Modified: / 06-03-2012 / 12:40:20 / cg" |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9679 |
! |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9680 |
|
8170 | 9681 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9682 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 9683 |
weakMethodHolder == #all ifTrue:[^ true]. |
9684 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9685 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 9686 |
|
9687 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 9688 |
! |
9689 |
||
9690 |
isHaltIgnoredInMethod:aMethod line:line |
|
12937 | 9691 |
^ self isHaltIgnoredInMethod:aMethod line:line context:nil |
9692 |
! |
|
9693 |
||
9694 |
isHaltIgnoredInMethod:aMethod line:line context:context |
|
9095 | 9695 |
"/ 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
|
9696 |
|
13059 | 9697 |
"/ Transcript showCR:'-----------------------------'. |
9698 |
"/ Transcript showCR:aMethod. |
|
9699 |
"/ Transcript showCR:line. |
|
9700 |
"/ Transcript showCR:context. |
|
9701 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9702 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 9703 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 9704 |
|
12937 | 9705 |
context notNil ifTrue:[ |
15413 | 9706 |
ignoredReceiverClasses notNil ifTrue:[ |
9707 |
^ ignoredReceiverClasses includes:(context receiver class) |
|
9708 |
]. |
|
12941 | 9709 |
]. |
13059 | 9710 |
|
9711 |
"/ Transcript showCR:ignoredProcesses. |
|
9712 |
"/ Transcript showCR:Processor activeProcess. |
|
12941 | 9713 |
ignoredProcesses notNil ifTrue:[ |
15413 | 9714 |
^ ignoredProcesses includes:(Processor activeProcess) |
12937 | 9715 |
]. |
14608 | 9716 |
ignoredSendingClassAndSelectors notNil ifTrue:[ |
15413 | 9717 |
context withAllSendersDo:[:each | |
9718 |
|m className selector cls| |
|
9719 |
||
9720 |
(m := each method) notNil ifTrue:[ |
|
9721 |
cls := m mclass. |
|
9722 |
cls notNil ifTrue:[ |
|
9723 |
className := cls name. |
|
9724 |
selector := m selector. |
|
9725 |
(ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]]) |
|
9726 |
ifTrue:[^ true]. |
|
9727 |
]. |
|
9728 |
] |
|
9729 |
] |
|
14608 | 9730 |
]. |
9731 |
||
9732 |
^ self isHaltIgnored "/ unconditionally |
|
8170 | 9733 |
! ! |
9734 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9735 |
!DebugView::IgnoredBreakpoint methodsFor:'accessing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9736 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9737 |
parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9738 |
^ parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9739 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9740 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9741 |
parameter:something |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9742 |
parameter := something. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9743 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9744 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9745 |
!DebugView::IgnoredBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9746 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9747 |
printOn:aStream |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9748 |
aStream nextPutAll:'Ignore breakpoint:#', parameter. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9749 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9750 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9751 |
"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
|
9752 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9753 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9754 |
!DebugView::IgnoredBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9755 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9756 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9757 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9758 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9759 |
"Created: / 06-03-2012 / 12:54:35 / cg" |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9760 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9761 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9762 |
isForBreakpointWithParameter:paramArg |
15730 | 9763 |
Transcript showCR:parameter. |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9764 |
^ paramArg = parameter |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9765 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9766 |
"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
|
9767 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9768 |
|
4122 | 9769 |
!DebugView class methodsFor:'documentation'! |
9770 |
||
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9771 |
version |
15730 | 9772 |
^ '$Header$' |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9773 |
! |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9774 |
|
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
9775 |
version_CVS |
15730 | 9776 |
^ '$Header$' |
10628 | 9777 |
! |
9778 |
||
9779 |
version_SVN |
|
15730 | 9780 |
^ '$Id$' |
4122 | 9781 |
! ! |
9782 |
||
12106 | 9783 |
|
4122 | 9784 |
DebugView initialize! |