author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 09 Feb 2017 09:56:47 +0000 | |
branch | jv |
changeset 17459 | 9f54cb54204c |
parent 17379 | 028adf14bc05 |
child 17519 | 94661347fc81 |
permissions | -rw-r--r-- |
17181 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
4 | 4 |
COPYRIGHT (c) 1989 by Claus Gittinger |
17185 | 5 |
All Rights Reserved |
0 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
14 |
"{ Package: 'stx:libtool' }" |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
15 |
|
15084 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
0 | 18 |
StandardSystemView subclass:#DebugView |
17305 | 19 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
20 |
receiverInspector contextInspector contextArray selectedContext |
|
21 |
catchBlock grabber mayProceed traceView tracing bigStep |
|
22 |
skipLineNr abortButton terminateButton continueButton stepButton |
|
23 |
nextButton nextOverButton nextOutButton sendButton returnButton |
|
24 |
restartButton exclusive inspecting nChainShown inspectedProcess |
|
25 |
updateProcess updateButton defineButton monitorToggle stepping |
|
26 |
steppedContextLineno actualContext inWrap stackInspector |
|
27 |
steppedContext wrapperContext firstContext stepHow cachable |
|
28 |
currentMethod ignoreBreakpoints stepUntilEntering |
|
29 |
lastStepUntilEntering lastSelectionInReceiverInspector |
|
30 |
lastSelectionInContextInspector canShowMore reportButton |
|
31 |
setOfHiddenCallingSelectors isStoppedAtHaltOrBreakPoint |
|
32 |
exceptionInfoLabel methodCodeToggle |
|
33 |
methodCodeToggleSelectionHolder |
|
34 |
isStoppedAtBreakPointWithParameter breakPointParameter |
|
35 |
hideSupportCode contextInfoLabel resendButton |
|
36 |
gotoDialogOpenerButton isStoppedInModalDialog selectorToDefine |
|
37 |
classToDefineIn gotoApplicationActionMethodButton |
|
38 |
isStoppedInApplicationAction isStoppedAtStatementBreakpoint |
|
39 |
verboseBacktraceHolder' |
|
40 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
|
41 |
DebuggingDebugger DebuggingDebugger2 DebuggingContextWalk |
|
42 |
DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts |
|
43 |
ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration |
|
44 |
LastExtent LastOrigin RememberedCallChain DebuggingDebugger3 |
|
45 |
NumberOfDebuggers DebuggerOnMainDisplayOnly' |
|
46 |
poolDictionaries:'' |
|
47 |
category:'Interface-Debugger' |
|
0 | 48 |
! |
49 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
50 |
Object subclass:#IgnoredHaltOrBreakpoint |
17305 | 51 |
instanceVariableNames:'ignoreEndTime ignoreCount ignoreUntilShiftKeyPressed |
52 |
ignoredReceiverClasses ignoredProcesses |
|
53 |
ignoredSendingClassAndSelectors' |
|
54 |
classVariableNames:'' |
|
55 |
poolDictionaries:'' |
|
56 |
privateIn:DebugView |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
57 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
58 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
59 |
DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredHalt |
17305 | 60 |
instanceVariableNames:'weakMethodHolder lineNumber' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:DebugView |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
64 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
65 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
66 |
DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredBreakpoint |
17305 | 67 |
instanceVariableNames:'parameter' |
68 |
classVariableNames:'' |
|
69 |
poolDictionaries:'' |
|
70 |
privateIn:DebugView |
|
8170 | 71 |
! |
72 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
73 |
!DebugView class methodsFor:'documentation'! |
29 | 74 |
|
75 |
copyright |
|
76 |
" |
|
77 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
17185 | 78 |
All Rights Reserved |
29 | 79 |
|
80 |
This software is furnished under a license and may be used |
|
81 |
only in accordance with the terms of that license and with the |
|
82 |
inclusion of the above copyright notice. This software may not |
|
83 |
be provided or otherwise made available to, or used by, any |
|
84 |
other person. No title to or ownership of the software is |
|
85 |
hereby transferred. |
|
86 |
" |
|
87 |
! |
|
0 | 88 |
|
29 | 89 |
documentation |
90 |
" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
91 |
This class implements a graphical debugger interface. |
29 | 92 |
The debugger usually sits on top of the faulting process, |
10205 | 93 |
taking over its event processing. |
12840 | 94 |
|
2358 | 95 |
(this is different from other Smalltalk debuggers, which control |
96 |
the debuggee as a separate process. Consider this an historic |
|
14680 | 97 |
leftover - the debugger was one of the first applications written for ST/X. |
98 |
||
12840 | 99 |
The whole setup might be changed, once the required process primitives |
100 |
are available, which allow control of another processes execution |
|
101 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
14680 | 102 |
to have the debugger control the debuggee (i.e. two processes). |
15413 | 103 |
However, as it works as it is, and is reliable enough, |
14680 | 104 |
why should we change it without a particular need...). |
2358 | 105 |
|
106 |
Only the 'stopped' debugged process is affected; |
|
29 | 107 |
other processes continue to respond to events. |
12840 | 108 |
The one exception to this is when an error occurs within the dispatcher process |
109 |
or in one of the eventhandler processes. In this case, the debugger |
|
29 | 110 |
will sit on an exclusive display connection. |
111 |
||
35 | 112 |
See additional information in 'doc/misc/debugger.doc'. |
53 | 113 |
|
14680 | 114 |
Notice & Warning (attention when changing thingslike menus, window spec etc. here): |
17185 | 115 |
the DebugView class caches the last used debugger in a class variable, |
116 |
and hides/shows this window without recreating one from scratch. This is done to make |
|
117 |
the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint. |
|
118 |
||
119 |
It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one) |
|
120 |
is kept there. You will notice this, if a debugger comes up without showing any contents. |
|
121 |
In this case, close (or destroy) the broken debugView, and execute |
|
122 |
Debugger newDebugger |
|
123 |
which removes the cached debugger and forces creation of a new one the next time. |
|
124 |
This is a temporary workaround - the debugger should be fixed to avoid this situation. |
|
125 |
||
126 |
You must also flush the cached debugger, if you change the debugger's |
|
127 |
initialization code (buttons, menu, etc.) or the debugger's class layout, |
|
128 |
and you want the new code to become effective. |
|
508 | 129 |
|
130 |
[author:] |
|
17185 | 131 |
Claus Gittinger |
508 | 132 |
|
133 |
[see also:] |
|
17185 | 134 |
Exception Signal |
135 |
Process |
|
29 | 136 |
" |
137 |
! ! |
|
0 | 138 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
139 |
!DebugView class methodsFor:'initialization'! |
243 | 140 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
141 |
initialize |
13362 | 142 |
DebuggingDebugger := DebuggingDebugger2 := MoreDebuggingDetail := false. |
143 |
||
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
144 |
InitialNChainShown := 50. |
8148 | 145 |
"/ DefaultDebuggerBackgroundColor := nil. |
3387 | 146 |
"/ DefaultDebuggerBackgroundColor := Color red lightened. |
147 |
"/ DefaultDebuggerBackgroundColor := Color blue lightened lightened. |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
148 |
|
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
149 |
"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
|
150 |
"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
|
151 |
! |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
152 |
|
243 | 153 |
reinitialize |
7822 | 154 |
"reinitialize after an image-restart" |
155 |
||
243 | 156 |
self newDebugger |
157 |
! ! |
|
158 |
||
10203 | 159 |
!DebugView class methodsFor:'cleanup'! |
160 |
||
10205 | 161 |
lowSpaceCleanup |
10203 | 162 |
"in low memory situations, give up cached debuggers" |
163 |
||
16750 | 164 |
CachedDebugger notNil ifTrue:[ |
165 |
CachedDebugger destroy. |
|
166 |
CachedDebugger := nil. |
|
167 |
]. |
|
10203 | 168 |
CachedExclusive := nil. |
169 |
OpenDebuggers := nil. |
|
11391 | 170 |
RememberedCallChain := nil. |
10203 | 171 |
|
172 |
" |
|
173 |
DebugView lowSpaceCleanup |
|
174 |
" |
|
175 |
||
11391 | 176 |
"Modified: / 08-03-2012 / 01:30:21 / cg" |
10203 | 177 |
! |
178 |
||
179 |
newDebugger |
|
13488 | 180 |
"force creation of a new debugger (give up cached debuggers). |
181 |
Call this, if you changed the debugger heavily, and you want to avoid |
|
182 |
that an old, cached debugger gets reused when the next error comes around." |
|
10203 | 183 |
|
16750 | 184 |
CachedDebugger notNil ifTrue:[ |
185 |
CachedDebugger destroy. |
|
186 |
CachedDebugger := nil. |
|
187 |
]. |
|
10203 | 188 |
CachedExclusive := nil. |
189 |
OpenDebuggers := nil. |
|
190 |
||
16262 | 191 |
"/ only assign to the global debugger, if it has not been redefined |
192 |
"/ to another class. |
|
10203 | 193 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
16262 | 194 |
Smalltalk at:#Debugger put:self |
10203 | 195 |
]. |
196 |
||
197 |
" |
|
198 |
DebugView newDebugger |
|
199 |
" |
|
200 |
! ! |
|
201 |
||
202 |
!DebugView class methodsFor:'defaults'! |
|
203 |
||
14695 | 204 |
debuggerOnMainDisplayOnly |
205 |
^ DebuggerOnMainDisplayOnly ? true |
|
206 |
! |
|
207 |
||
10203 | 208 |
defaultIcon |
209 |
"return the browsers default window icon" |
|
210 |
||
211 |
<resource: #programImage> |
|
212 |
||
10205 | 213 |
^ ToolbarIconLibrary debug22x22Icon |
10203 | 214 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
215 |
||
216 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
217 |
! |
|
218 |
||
219 |
defaultIconForAboutBox |
|
220 |
<resource: #programImage> |
|
221 |
||
10205 | 222 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
10203 | 223 |
! |
224 |
||
225 |
defaultVerboseBacktrace |
|
226 |
<resource: #obsolete> |
|
227 |
self obsoleteMethodWarning. |
|
228 |
^ UserPreferences current verboseBacktraceInDebugger |
|
229 |
||
230 |
"Created: 11.1.1997 / 12:14:35 / cg" |
|
231 |
! |
|
232 |
||
233 |
defaultVerboseBacktrace:aBoolean |
|
234 |
<resource: #obsolete> |
|
235 |
self obsoleteMethodWarning. |
|
236 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
237 |
! |
|
238 |
||
13111 | 239 |
maxNumberOfDebuggers |
240 |
"to prevent debuggers from flooding the screen, |
|
241 |
in case of an error in an ever-forked background process |
|
242 |
(such as tooltip process)" |
|
243 |
||
17176 | 244 |
^ 20 |
13111 | 245 |
! |
246 |
||
10203 | 247 |
updateStyleCache |
248 |
"extract values from the styleSheet and cache them in class variables" |
|
249 |
||
250 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
251 |
||
252 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
|
253 |
||
254 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
255 |
! ! |
|
256 |
||
257 |
!DebugView class methodsFor:'ignoring halts'! |
|
258 |
||
259 |
haltIgnoreInformationFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
260 |
"the information (if any) about the ignore-state of a halt" |
|
261 |
||
262 |
IgnoredHalts isNil ifTrue:[^ nil]. |
|
263 |
||
10205 | 264 |
IgnoredHalts do:[:ign | |
17185 | 265 |
(ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
266 |
"/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) |
|
267 |
ifTrue:[ |
|
268 |
^ ign |
|
269 |
]. |
|
10203 | 270 |
]. |
271 |
^ nil. |
|
272 |
! |
|
273 |
||
274 |
hasIgnoredHalts |
|
275 |
self removeInactiveIgnores. |
|
276 |
^ IgnoredHalts notEmptyOrNil |
|
277 |
! |
|
278 |
||
15413 | 279 |
ignoreBreakpointWithParameter:parameterOrNil |
17185 | 280 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
281 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
14608 | 282 |
|
12937 | 283 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
284 |
or until some time has elapsed. |
|
285 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
|
286 |
||
15413 | 287 |
self |
17185 | 288 |
ignoreHaltOrBreakpoint:#halt |
289 |
method:nil line:nil |
|
290 |
parameter:parameterOrNil |
|
291 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
292 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
293 |
orIfCalledFromMethod:nil |
|
15413 | 294 |
! |
295 |
||
296 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
17185 | 297 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
298 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
14608 | 299 |
|
12937 | 300 |
"remember to ignore a halt in some method for some number of invocations |
301 |
or until some time has elapsed. |
|
302 |
With nil count and time arguments, such an ignored halt is reactivated" |
|
303 |
||
15413 | 304 |
self |
17185 | 305 |
ignoreHaltOrBreakpoint:#halt |
306 |
method:haltingMethod line:lineNrOfHalt |
|
307 |
parameter:nil |
|
308 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
309 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
310 |
orIfCalledFromMethod:nil |
|
15413 | 311 |
! |
312 |
||
313 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
16434 | 314 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
315 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
316 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
14608 | 317 |
|
318 |
"remember to ignore a halt in some method for some number of invocations |
|
16434 | 319 |
or until some time has elapsed. |
320 |
With a count of -1, it is ignored forever (i.e. until reenabled via the |
|
321 |
settings). |
|
14608 | 322 |
With nil count and time arguments, such an ignored halt is reactivated" |
323 |
||
15413 | 324 |
self |
16434 | 325 |
ignoreHaltOrBreakpoint:#halt |
326 |
method:haltingMethod line:lineNrOfHalt |
|
327 |
parameter:nil |
|
328 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
329 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
330 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
15413 | 331 |
! |
332 |
||
333 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
|
17185 | 334 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
335 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
12937 | 336 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
337 |
"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
|
338 |
or until some time has elapsed. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
339 |
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
|
340 |
|
14608 | 341 |
^ self |
17185 | 342 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
343 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
344 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
345 |
orIfCalledFromMethod:nil |
|
15413 | 346 |
! |
347 |
||
348 |
ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil |
|
16434 | 349 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
350 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
351 |
orIfCalledFromMethod:ifCalledFromMethodOrNil |
|
14608 | 352 |
|
353 |
"remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations |
|
354 |
or until some time has elapsed. |
|
355 |
With nil count and time arguments, such an ignored breakpoint is reactivated" |
|
356 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
357 |
|oldEntry ign| |
12947 | 358 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
359 |
IgnoredHalts notNil ifTrue:[ |
16434 | 360 |
self removeInactiveIgnores. |
361 |
type == #halt ifTrue:[ |
|
362 |
oldEntry := IgnoredHalts |
|
363 |
detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil] |
|
364 |
ifNone:nil. |
|
365 |
] ifFalse:[ |
|
366 |
oldEntry := IgnoredHalts |
|
367 |
detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil] |
|
368 |
ifNone:nil. |
|
369 |
]. |
|
370 |
oldEntry notNil ifTrue:[ |
|
371 |
(processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[ |
|
372 |
receiverClassOrNil notNil ifTrue:[ |
|
373 |
oldEntry ignoreForReceiverClass:receiverClassOrNil. |
|
374 |
]. |
|
375 |
processOrNil notNil ifTrue:[ |
|
376 |
oldEntry ignoreForProcess:processOrNil. |
|
377 |
]. |
|
378 |
^ self. |
|
379 |
]. |
|
380 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
381 |
] |
|
15413 | 382 |
]. |
383 |
||
384 |
(countOrNil notNil |
|
385 |
or:[dTOrNil notNil |
|
12937 | 386 |
or:[untilShiftKey == true |
387 |
or:[receiverClassOrNil notNil |
|
14608 | 388 |
or:[processOrNil notNil |
389 |
or:[ifCalledFromMethodOrNil notNil]]]]] |
|
12937 | 390 |
) ifTrue:[ |
16434 | 391 |
IgnoredHalts isNil ifTrue:[ |
392 |
IgnoredHalts := OrderedCollection new. |
|
393 |
]. |
|
394 |
type == #halt ifTrue:[ |
|
395 |
ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil. |
|
396 |
] ifFalse:[ |
|
397 |
ign := IgnoredHalt new breakpointWithParameter:parameterOrNil. |
|
398 |
]. |
|
399 |
||
400 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
401 |
ign ignoreCount:countOrNil. |
|
402 |
]. |
|
403 |
(dTOrNil notNil) ifTrue:[ |
|
404 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
405 |
]. |
|
406 |
untilShiftKey == true ifTrue:[ |
|
407 |
ign ignoreUntilShiftKeyPressed:true. |
|
408 |
]. |
|
409 |
receiverClassOrNil notNil ifTrue:[ |
|
410 |
ign ignoreForReceiverClass:receiverClassOrNil. |
|
411 |
]. |
|
412 |
processOrNil notNil ifTrue:[ |
|
413 |
ign ignoreForProcess:processOrNil. |
|
414 |
]. |
|
415 |
ifCalledFromMethodOrNil notNil ifTrue:[ |
|
416 |
ign ignoreIfCalledFromMethod:ifCalledFromMethodOrNil. |
|
417 |
]. |
|
418 |
IgnoredHalts add:ign. |
|
11366
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 |
Smalltalk changed:#ignoredHalts. |
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 |
"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
|
423 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
424 |
|
12937 | 425 |
isBreakpointToBeIgnoredForParameter:parameter context:aContext modifyEntryCount:modifyCount |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
426 |
"/ should a breakpoint be ignored ? |
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 |
IgnoredHalts isNil ifTrue:[^ false]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
429 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
430 |
"/ 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
|
431 |
IgnoredHalts do:[:ign | |
17185 | 432 |
(ign isForBreakpointWithParameter:parameter) ifTrue:[ |
433 |
Transcript show:'Debugger [info]: break ignored for ', parameter. |
|
434 |
||
435 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
436 |
ign isHaltIgnored ifFalse:[ |
|
437 |
Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter. |
|
438 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
439 |
]. |
|
440 |
^ true. |
|
441 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
442 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
443 |
|
13162 | 444 |
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
|
445 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
446 |
^ false. |
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 |
"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
|
449 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
450 |
|
12937 | 451 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod context:aContext modifyEntryCount:modifyCount |
12562 | 452 |
"should a halt be ignored ?" |
453 |
||
454 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
455 |
||
456 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
|
457 |
IgnoredHalts do:[:ign | |
|
16376 | 458 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[ |
459 |
Transcript showCR:'Debugger [info]: halt/break ignored: %1' with:ign. |
|
460 |
||
461 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
462 |
ign isHaltIgnored ifFalse:[ |
|
463 |
Transcript showCR:'Debugger [info]: no longer ignored (rest count=0)'. |
|
464 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
465 |
]. |
|
466 |
^ true. |
|
467 |
]. |
|
12562 | 468 |
]. |
469 |
||
13162 | 470 |
IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty. |
12562 | 471 |
|
472 |
^ false. |
|
473 |
||
474 |
"Modified (comment): / 06-03-2012 / 12:51:43 / cg" |
|
475 |
! |
|
476 |
||
10203 | 477 |
removeInactiveIgnores |
478 |
IgnoredHalts notNil ifTrue:[ |
|
17185 | 479 |
IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
10203 | 480 |
]. |
481 |
! |
|
482 |
||
483 |
stopIgnoringHalts |
|
484 |
"forget about all ignored halts" |
|
485 |
||
486 |
IgnoredHalts := nil. |
|
487 |
Smalltalk changed:#ignoredHalts. |
|
15302 | 488 |
! |
489 |
||
490 |
stopIgnoringHaltsFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
491 |
"remove the information (if any) about the ignore-state of a halt; |
|
492 |
effectively reenables the breakpoint/halt" |
|
493 |
||
494 |
IgnoredHalts isNil ifTrue:[^ self]. |
|
495 |
||
496 |
IgnoredHalts := IgnoredHalts reject:[:ign | |
|
17185 | 497 |
(ign isForMethod:haltingMethod line:lineNrInHaltingMethod) |
15302 | 498 |
]. |
10203 | 499 |
! ! |
500 |
||
501 |
!DebugView class methodsFor:'instance creation / entering'! |
|
0 | 502 |
|
2421 | 503 |
enter |
504 |
"enter a debugger" |
|
505 |
||
5455 | 506 |
<context: #return> |
507 |
||
10205 | 508 |
^ self |
17185 | 509 |
enter:thisContext sender |
510 |
withMessage:'Debugger Entered' |
|
511 |
mayProceed:true. |
|
10205 | 512 |
! |
513 |
||
514 |
enter:aContext withMessage:aString |
|
2355 | 515 |
"enter a debugger" |
516 |
||
5455 | 517 |
<context: #return> |
518 |
||
2355 | 519 |
^ self |
17185 | 520 |
enter:aContext |
521 |
withMessage:aString |
|
522 |
mayProceed:true |
|
2355 | 523 |
! |
524 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
525 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 526 |
"enter a debugger; if this is a recursive invocation, enter |
527 |
a MiniDebugger instead. |
|
528 |
This is the standard way of entering the debugger; |
|
529 |
sent from error- and halt messages." |
|
0 | 530 |
|
3447 | 531 |
<context: #return> |
532 |
||
17176 | 533 |
|nDebuggers display| |
534 |
||
535 |
nDebuggers := (NumberOfDebuggers ? 0). |
|
536 |
(nDebuggers < 0 or:[nDebuggers > self maxNumberOfDebuggers]) ifTrue:[ |
|
537 |
"/ ouch - we lost track of some... |
|
538 |
nDebuggers := NumberOfDebuggers := self allSubInstances count:[:d | d isOpen]. |
|
539 |
]. |
|
540 |
nDebuggers > self maxNumberOfDebuggers ifTrue:[ |
|
541 |
MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true. |
|
13111 | 542 |
]. |
543 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
544 |
DebuggingDebugger == true ifTrue:[ |
17176 | 545 |
'==> enter1: (' print. aContext print. ')' printCR. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
546 |
]. |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
547 |
|
14695 | 548 |
display := (self debuggerOnMainDisplayOnly) |
17176 | 549 |
ifTrue:[ Display ] |
550 |
ifFalse:[ Screen current ]. |
|
14695 | 551 |
|
552 |
Screen currentScreenQuerySignal answer:display |
|
553 |
do:[ |
|
17176 | 554 |
StepInterruptPending := nil. |
555 |
ControlInterrupt handle:[:ex | |
|
556 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
|
557 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
558 |
ex proceed |
|
559 |
] do:[ |
|
560 |
|debugger| |
|
561 |
||
562 |
" |
|
563 |
well, it could be a stepping or sending debugger up there; |
|
564 |
in this case, return to it. This happens, when a stepping process |
|
565 |
runs into an error (for example, a halt). In this case, we want the |
|
566 |
stepping debugger to come up again instead of a new one. |
|
567 |
" |
|
568 |
(debugger := self openDebuggerForActiveProcess) notNil ifTrue:[ |
|
569 |
debugger unstep. |
|
570 |
debugger setLabelFor:aString in:Processor activeProcess. |
|
571 |
debugger mayProceed:mayProceed. |
|
572 |
^ debugger enter:aContext select:nil. |
|
573 |
]. |
|
574 |
]. |
|
575 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
|
14695 | 576 |
]. |
526 | 577 |
|
13666 | 578 |
"Modified: / 06-11-2013 / 20:58:54 / cg" |
53 | 579 |
! |
580 |
||
8347 | 581 |
enterException:ex |
582 |
"enter a debugger; if this is a recursive invocation, enter |
|
583 |
a MiniDebugger instead. |
|
584 |
This is the standard way of entering the debugger; |
|
585 |
sent from error- and halt messages." |
|
586 |
||
15730 | 587 |
"/ a quick check for ignored breakpoints here, |
588 |
"/ to shortcut the expensive debugger setup. |
|
589 |
"/ big speedup when many ignored breakpoints are reached. |
|
590 |
IgnoredHalts notNil ifTrue:[ |
|
591 |
((ex creator == NoHandlerError) |
|
592 |
and:[ ex exception creator == BreakPointInterrupt ]) ifTrue:[ |
|
593 |
(self |
|
594 |
isHaltToBeIgnoredIn:(ex suspendedContext method) |
|
595 |
atLineNr:1 |
|
596 |
context:(ex suspendedContext) |
|
597 |
modifyEntryCount:true |
|
598 |
) ifTrue:[ |
|
599 |
"/ Transcript showCR:'quick ignored'. |
|
600 |
^ true. |
|
601 |
]. |
|
602 |
]. |
|
603 |
]. |
|
8347 | 604 |
^ self |
15730 | 605 |
enter:ex returnableSuspendedContext |
606 |
withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger) |
|
607 |
mayProceed:(ex mayProceed). |
|
8347 | 608 |
! |
609 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
610 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 611 |
"enter a debugger - do not check for recursive invocation" |
612 |
||
5455 | 613 |
<context: #return> |
614 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
615 |
|aDebugger| |
266 | 616 |
|
617 |
StepInterruptPending := nil. |
|
13111 | 618 |
NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1. |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
619 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
620 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
621 |
"/ to avoid recursive debugging ... |
3447 | 622 |
ControlInterrupt handle:[:ex | |
17185 | 623 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
624 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
625 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
626 |
] do:[ |
17185 | 627 |
aDebugger := self new. |
3447 | 628 |
]. |
629 |
||
630 |
aDebugger isNil ifTrue:[ |
|
17185 | 631 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
632 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
633 |
mayProceed ifTrue:[ |
|
634 |
(Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs |
|
635 |
yesLabel:'Continue' noLabel:'Abort') |
|
636 |
ifTrue:[ |
|
637 |
^ nil |
|
638 |
]. |
|
639 |
] ifFalse:[ |
|
640 |
self information:'Error caught.\\Press OK to abort the operation.' withCRs. |
|
641 |
]. |
|
642 |
AbortOperationRequest raise. |
|
643 |
"not reached" |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
644 |
]. |
3447 | 645 |
|
646 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
647 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 648 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
649 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
650 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
651 |
" |
17185 | 652 |
nil halt |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
653 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
654 |
|
3447 | 655 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 656 |
! |
657 |
||
6430 | 658 |
enterWithMessage:message |
659 |
"enter a debugger" |
|
660 |
||
661 |
<context: #return> |
|
662 |
||
10205 | 663 |
^ self |
17185 | 664 |
enter:(thisContext sender) |
665 |
withMessage:message |
|
666 |
mayProceed:true. |
|
6430 | 667 |
! |
668 |
||
266 | 669 |
new |
10205 | 670 |
"return a new DebugView. |
2358 | 671 |
- return a cached debugger if it already exists. |
672 |
Also, care for remote displays on which no debugger is wanted |
|
673 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
674 |
||
14695 | 675 |
|debugger currentScreen debuggerScreen| |
2358 | 676 |
|
677 |
currentScreen := Screen current. |
|
14 | 678 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
679 |
currentScreen notNil ifTrue:[ |
17185 | 680 |
(currentScreen suppressDebugger) ifTrue:[ |
681 |
"/ no debuggers with that device - show an alertBox which aborts... |
|
682 |
^ nil. |
|
683 |
]. |
|
684 |
(currentScreen mayOpenDebugger) ifFalse:[ |
|
685 |
"/ no debugger on that device - but on the main screen |
|
686 |
currentScreen := Display ? Screen default. |
|
687 |
]. |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
688 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
689 |
|
266 | 690 |
" |
10205 | 691 |
need a blocking debugger if no processes or |
692 |
or if its a timing/interrupt process |
|
266 | 693 |
(because otherwise we would not get any events here ... |
694 |
" |
|
695 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
17185 | 696 |
((debugger := CachedExclusive) isNil |
697 |
or:[debugger device ~~ currentScreen |
|
698 |
or:[currentScreen isNil |
|
699 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
|
700 |
debugger := self newExclusive |
|
701 |
]. |
|
702 |
CachedExclusive := nil. |
|
266 | 703 |
] ifFalse:[ |
17185 | 704 |
CachedDebugger notNil ifTrue:[ |
705 |
(CachedDebugger device ~~ currentScreen |
|
706 |
or:[currentScreen isNil |
|
707 |
or:[currentScreen isOpen not |
|
708 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
|
709 |
CachedDebugger := nil |
|
710 |
] |
|
711 |
]. |
|
712 |
||
713 |
(debugger := CachedDebugger) notNil ifTrue:[ |
|
714 |
CachedDebugger := nil. |
|
715 |
] ifFalse:[ |
|
716 |
debuggerScreen := currentScreen. |
|
717 |
debuggerScreen isNil ifTrue:[ |
|
718 |
"/ use the default display |
|
719 |
debuggerScreen := Screen default. |
|
720 |
]. |
|
721 |
(debuggerScreen isNil |
|
722 |
or:[debuggerScreen isOpen not |
|
723 |
"/ or:[debuggerDevice mayOpenDebugger not] |
|
724 |
]) ifTrue:[ |
|
725 |
"/ no debugger |
|
726 |
^ nil. |
|
727 |
]. |
|
728 |
||
729 |
Screen currentScreenQuerySignal answer:debuggerScreen |
|
730 |
do:[ |
|
731 |
debugger := super new. |
|
732 |
]. |
|
733 |
debugger label:'Debugger'. |
|
734 |
debugger icon:self defaultIcon. |
|
735 |
] |
|
266 | 736 |
]. |
73 | 737 |
^ debugger |
875 | 738 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
739 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 740 |
! |
0 | 741 |
|
266 | 742 |
newExclusive |
743 |
"return a debugger for exclusive display access" |
|
744 |
||
745 |
|debugger| |
|
105 | 746 |
|
266 | 747 |
debugger := super new. |
748 |
debugger label:'Debugger'. |
|
875 | 749 |
debugger icon:self defaultIcon. |
266 | 750 |
debugger exclusive:true. |
751 |
^ debugger |
|
875 | 752 |
|
753 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 754 |
! |
755 |
||
13666 | 756 |
openDebuggerForActiveProcess |
757 |
"return an already open debugger for the active process, or nil, if there is none. |
|
758 |
Open debuggers exist when stepping only, as then, the debugger is left open until the step |
|
759 |
is reached, to avoid too much flickering and redrawing on the screen" |
|
760 |
||
17188 | 761 |
" |
762 |
well, it could be a stepping or sending debugger up there; |
|
763 |
in this case, return to it. This happens, when a stepping process |
|
764 |
runs into an error (for example, a halt). In this case, we want the |
|
765 |
stepping debugger to come up again instead of a new one. |
|
766 |
" |
|
767 |
OpenDebuggers notNil ifTrue:[ |
|
768 |
^ self openDebuggerForProcess:(Processor activeProcess) |
|
769 |
]. |
|
770 |
^ nil |
|
771 |
||
772 |
"Created: / 06-11-2013 / 20:57:49 / cg" |
|
773 |
! |
|
774 |
||
775 |
openDebuggerForProcess:aProcess |
|
776 |
"if aProcess is being debugged and has an open debugger on it, |
|
777 |
then return it, or nil, if there is none. |
|
778 |
Open debuggers also exist as unmapped windows when single-stepping" |
|
13666 | 779 |
|
780 |
" |
|
781 |
well, it could be a stepping or sending debugger up there; |
|
782 |
in this case, return to it. This happens, when a stepping process |
|
783 |
runs into an error (for example, a halt). In this case, we want the |
|
784 |
stepping debugger to come up again instead of a new one. |
|
785 |
" |
|
786 |
OpenDebuggers notNil ifTrue:[ |
|
17185 | 787 |
OpenDebuggers do:[:aDebugger | |
788 |
|debuggersProcess| |
|
789 |
||
790 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
|
791 |
debuggersProcess := aDebugger inspectedProcess. |
|
17188 | 792 |
debuggersProcess == aProcess ifTrue:[ |
17185 | 793 |
aDebugger device isOpen ifTrue:[ |
794 |
DebuggingDebugger == true ifTrue:[ |
|
795 |
'reusing cached debugger' errorPrintCR. |
|
796 |
]. |
|
797 |
aDebugger unstep. |
|
798 |
^ aDebugger. |
|
799 |
] |
|
800 |
]. |
|
801 |
(debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[ |
|
802 |
aDebugger destroy. |
|
803 |
]. |
|
804 |
] |
|
805 |
] |
|
13666 | 806 |
]. |
807 |
^ nil |
|
808 |
! |
|
809 |
||
29 | 810 |
openOn:aProcess |
17188 | 811 |
"start a debugger on aProcess |
29 | 812 |
(actually not more than a good-looking inspector)" |
15 | 813 |
|
52 | 814 |
|aDebugger label nm| |
15 | 815 |
|
816 |
aDebugger := super new. |
|
875 | 817 |
aDebugger icon:self defaultIcon. |
29 | 818 |
aProcess notNil ifTrue:[ |
17185 | 819 |
nm := aProcess name. |
820 |
nm notNil ifTrue:[ |
|
821 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
822 |
] ifFalse:[ |
|
823 |
nm := aProcess id printString |
|
824 |
]. |
|
825 |
label := 'Debugger [' , nm , ']'. |
|
29 | 826 |
] ifFalse:[ |
17185 | 827 |
label := 'no process' |
29 | 828 |
]. |
1114 | 829 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 830 |
aDebugger openOn:aProcess. |
831 |
^ nil |
|
875 | 832 |
|
1114 | 833 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 834 |
! ! |
835 |
||
3269 | 836 |
!DebugView class methodsFor:'menu specs'! |
837 |
||
12437 | 838 |
breakPointMenuSpec |
839 |
"This resource specification was automatically generated |
|
840 |
by the MenuEditor of ST/X." |
|
841 |
||
842 |
"Do not manually edit this!! If it is corrupted, |
|
843 |
the MenuEditor may not be able to read the specification." |
|
844 |
||
845 |
||
846 |
" |
|
847 |
MenuEditor new openOnClass:DebugView andSelector:#breakPointMenuSpec |
|
848 |
(Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp |
|
849 |
" |
|
850 |
||
851 |
<resource: #menu> |
|
852 |
||
15413 | 853 |
^ |
12437 | 854 |
#(Menu |
17185 | 855 |
( |
856 |
(MenuItem |
|
857 |
enabled: canRemoveBreakpoint |
|
858 |
label: 'Remove Breakpoint' |
|
859 |
itemValue: removeBreakpoint |
|
860 |
) |
|
861 |
(MenuItem |
|
862 |
label: 'Remove all Breakpoints' |
|
863 |
itemValue: removeAllBreakpoints |
|
864 |
) |
|
865 |
(MenuItem |
|
866 |
label: '-' |
|
867 |
) |
|
868 |
(MenuItem |
|
869 |
label: 'Ignore this Halt/BreakPoint' |
|
870 |
submenu: |
|
871 |
(Menu |
|
872 |
( |
|
873 |
(MenuItem |
|
874 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
875 |
label: 'Forever (Until Ignoring is Stopped)' |
|
876 |
itemValue: ignoreHaltForever |
|
877 |
) |
|
878 |
(MenuItem |
|
879 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
880 |
label: 'For Some Time...' |
|
881 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
882 |
) |
|
883 |
(MenuItem |
|
884 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
885 |
label: 'For the Next N Times...' |
|
886 |
itemValue: openIgnoreHaltNTimesDialog |
|
887 |
) |
|
888 |
(MenuItem |
|
889 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
890 |
label: 'Until Shift-Key is Pressed' |
|
891 |
itemValue: ignoreHaltUntilShiftKeyIsPressed |
|
892 |
) |
|
893 |
(MenuItem |
|
894 |
label: '-' |
|
895 |
) |
|
896 |
(MenuItem |
|
897 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
898 |
label: 'In Current Process' |
|
899 |
itemValue: ignoreHaltForCurrentProcess |
|
900 |
) |
|
901 |
(MenuItem |
|
902 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
903 |
label: 'For this Receiver Class' |
|
904 |
itemValue: ignoreHaltForThisReceiverClass |
|
905 |
) |
|
906 |
(MenuItem |
|
907 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
908 |
label: 'If Called from Any Of' |
|
909 |
submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf |
|
910 |
) |
|
911 |
) |
|
912 |
nil |
|
913 |
nil |
|
914 |
) |
|
915 |
) |
|
916 |
(MenuItem |
|
917 |
enabled: isStoppedAtBreakPointWithParameter |
|
918 |
label: 'Ignore all BreakPoints with this Parameter' |
|
919 |
submenu: |
|
920 |
(Menu |
|
921 |
( |
|
922 |
(MenuItem |
|
923 |
enabled: isStoppedAtBreakPointWithParameter |
|
924 |
label: 'Forever (Reenable in BreakPoint-Browser)' |
|
925 |
itemValue: ignoreBreakpointsWithThisParameterForever |
|
926 |
) |
|
927 |
(MenuItem |
|
928 |
enabled: isStoppedAtBreakPointWithParameter |
|
929 |
label: 'For Some Time...' |
|
930 |
itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
|
931 |
) |
|
932 |
(MenuItem |
|
933 |
enabled: isStoppedAtBreakPointWithParameter |
|
934 |
label: 'For the Next N Times...' |
|
935 |
itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog |
|
936 |
) |
|
937 |
(MenuItem |
|
938 |
enabled: isStoppedAtBreakPointWithParameter |
|
939 |
label: 'Until Shift-Key is Pressed' |
|
940 |
itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
|
941 |
) |
|
942 |
(MenuItem |
|
943 |
label: '-' |
|
944 |
) |
|
945 |
(MenuItem |
|
946 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
947 |
label: 'In Current Process' |
|
948 |
itemValue: ignoreAllHaltsForCurrentProcess |
|
949 |
) |
|
950 |
(MenuItem |
|
951 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
952 |
label: 'For this Receiver Class' |
|
953 |
itemValue: ignoreAllHaltsForThisReceiverClass |
|
954 |
) |
|
955 |
(MenuItem |
|
956 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
957 |
label: 'If Called from Any Of' |
|
958 |
submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
|
959 |
) |
|
960 |
) |
|
961 |
nil |
|
962 |
nil |
|
963 |
) |
|
964 |
) |
|
965 |
(MenuItem |
|
966 |
label: 'Ignore all Halts/BreakPoints' |
|
967 |
submenu: |
|
968 |
(Menu |
|
969 |
( |
|
970 |
(MenuItem |
|
971 |
label: 'Forever (Until Ignoring is Stopped)' |
|
972 |
itemValue: ignoreAllHaltsForever |
|
973 |
) |
|
974 |
(MenuItem |
|
975 |
label: 'For Some Time...' |
|
976 |
itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
|
977 |
) |
|
978 |
(MenuItem |
|
979 |
label: 'Until Shift-Key is Pressed' |
|
980 |
itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
|
981 |
) |
|
982 |
) |
|
983 |
nil |
|
984 |
nil |
|
985 |
) |
|
986 |
) |
|
987 |
(MenuItem |
|
988 |
enabled: hasHaltsToIgnore |
|
989 |
label: 'Stop Ignoring' |
|
990 |
itemValue: stopIgnoringHalts |
|
991 |
) |
|
992 |
(MenuItem |
|
993 |
label: '-' |
|
994 |
) |
|
995 |
(MenuItem |
|
996 |
enabled: canAddBreakpoint |
|
997 |
label: 'Add Breakpoint' |
|
998 |
itemValue: addBreakpoint |
|
999 |
) |
|
1000 |
(MenuItem |
|
1001 |
label: 'Manage Breakpoints' |
|
1002 |
itemValue: openBreakPointBrowser |
|
1003 |
) |
|
1004 |
(MenuItem |
|
1005 |
label: '-' |
|
1006 |
) |
|
1007 |
(MenuItem |
|
1008 |
label: 'Allow Halt in Debugger' |
|
1009 |
itemValue: allowBreakPointsInDebugger: |
|
1010 |
indication: allowBreakPointsInDebugger |
|
1011 |
) |
|
1012 |
) |
|
1013 |
nil |
|
1014 |
nil |
|
12437 | 1015 |
) |
1016 |
! |
|
1017 |
||
1018 |
classMenuSpec |
|
1019 |
"This resource specification was automatically generated |
|
1020 |
by the MenuEditor of ST/X." |
|
1021 |
||
1022 |
"Do not manually edit this!! If it is corrupted, |
|
1023 |
the MenuEditor may not be able to read the specification." |
|
1024 |
||
1025 |
||
1026 |
" |
|
12840 | 1027 |
MenuEditor new openOnClass:DebugView andSelector:#receiverMenuSpec |
1028 |
(Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp |
|
12437 | 1029 |
" |
1030 |
||
1031 |
<resource: #menu> |
|
1032 |
||
15413 | 1033 |
^ |
12437 | 1034 |
#(Menu |
17106 | 1035 |
( |
1036 |
(MenuItem |
|
1037 |
enabled: canBrowseImplementingClass |
|
1038 |
label: 'Browse Implementing Class' |
|
1039 |
itemValue: browseImplementingClass |
|
1040 |
) |
|
1041 |
(MenuItem |
|
1042 |
enabled: canBrowseReceiversClass |
|
1043 |
label: 'Browse Receiver''s Class' |
|
1044 |
itemValue: browseReceiversClass |
|
1045 |
) |
|
1046 |
(MenuItem |
|
1047 |
enabled: canBrowseProcessesApplication |
|
1048 |
label: 'Browse Application Class' |
|
1049 |
itemValue: browseProcessesApplication |
|
1050 |
) |
|
1051 |
(MenuItem |
|
1052 |
label: '-' |
|
1053 |
) |
|
1054 |
(MenuItem |
|
1055 |
enabled: canBrowseClassHierarchy |
|
1056 |
label: 'Browse Receiver''s Class Hierarchy' |
|
1057 |
itemValue: browseClassHierarchy |
|
1058 |
isVisible: false |
|
1059 |
) |
|
1060 |
(MenuItem |
|
1061 |
enabled: canBrowseFullClassProtocol |
|
1062 |
label: 'Browse Receiver''s Full Protocol' |
|
1063 |
itemValue: browseFullClassProtocol |
|
1064 |
isVisible: false |
|
1065 |
) |
|
1066 |
(MenuItem |
|
1067 |
label: '-' |
|
1068 |
isVisible: false |
|
1069 |
) |
|
1070 |
(MenuItem |
|
1071 |
enabled: canBrowseProcessesApplication |
|
17107 | 1072 |
label: 'Inspect Application' |
17106 | 1073 |
itemValue: inspectProcessesApplication |
1074 |
) |
|
1075 |
(MenuItem |
|
1076 |
enabled: canInspectWidgetHierarchy |
|
1077 |
label: 'Inspect Widget Hierarchy' |
|
1078 |
itemValue: inspectWidgetHierarchy |
|
1079 |
) |
|
1080 |
) |
|
1081 |
nil |
|
1082 |
nil |
|
12437 | 1083 |
) |
17107 | 1084 |
|
1085 |
"Modified: / 25-11-2016 / 13:14:28 / cg" |
|
12437 | 1086 |
! |
1087 |
||
1088 |
contextMenuSpec |
|
1089 |
"This resource specification was automatically generated |
|
1090 |
by the MenuEditor of ST/X." |
|
1091 |
||
1092 |
"Do not manually edit this!! If it is corrupted, |
|
1093 |
the MenuEditor may not be able to read the specification." |
|
1094 |
||
1095 |
||
1096 |
" |
|
1097 |
MenuEditor new openOnClass:DebugView andSelector:#contextMenuSpec |
|
1098 |
(Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp |
|
1099 |
" |
|
1100 |
||
1101 |
<resource: #menu> |
|
1102 |
||
15413 | 1103 |
^ |
12437 | 1104 |
#(Menu |
17185 | 1105 |
( |
1106 |
(MenuItem |
|
1107 |
enabled: canReturn |
|
1108 |
label: 'Return' |
|
1109 |
itemValue: doReturn |
|
1110 |
) |
|
1111 |
(MenuItem |
|
1112 |
enabled: canRestart |
|
1113 |
label: 'Restart' |
|
1114 |
itemValue: doRestart |
|
1115 |
) |
|
1116 |
(MenuItem |
|
1117 |
label: '-' |
|
1118 |
) |
|
1119 |
(MenuItem |
|
1120 |
enabled: hasContextSelected |
|
1121 |
label: 'Inspect' |
|
1122 |
itemValue: inspectContext |
|
1123 |
) |
|
1124 |
(MenuItem |
|
1125 |
label: 'Copy WalkBack Text' |
|
1126 |
itemValue: copyWalkbackText |
|
1127 |
) |
|
1128 |
(MenuItem |
|
1129 |
label: 'Inspect Method' |
|
1130 |
itemValue: inspectContextsMethod |
|
1131 |
) |
|
1132 |
(MenuItem |
|
1133 |
label: 'Bookmark Method in SystemBrowser' |
|
1134 |
itemValue: addBrowserBookmark |
|
1135 |
) |
|
1136 |
(MenuItem |
|
1137 |
label: '-' |
|
1138 |
) |
|
1139 |
(MenuItem |
|
1140 |
enabled: hasBlockContextSelected |
|
1141 |
label: 'Find Home Context in Caller Chain...' |
|
1142 |
itemValue: findHomeContext |
|
1143 |
) |
|
1144 |
(MenuItem |
|
1145 |
enabled: hasContextSelected |
|
1146 |
label: 'Find Context with String in Source...' |
|
1147 |
itemValue: findContextWithStringInSource |
|
1148 |
) |
|
1149 |
(MenuItem |
|
1150 |
enabled: hasContextSelected |
|
1151 |
label: 'Find Context with Value in Variable...' |
|
1152 |
itemValue: findContextWithValueInVariable |
|
1153 |
) |
|
1154 |
(MenuItem |
|
1155 |
enabled: hasContextSelected |
|
1156 |
label: 'Find Next Exception Handler' |
|
1157 |
itemValue: findNextExceptionHandlerContext |
|
1158 |
) |
|
1159 |
(MenuItem |
|
1160 |
enabled: hasContextSelected |
|
1161 |
label: 'Find Handler For...' |
|
1162 |
itemValue: findHandlerFor |
|
1163 |
) |
|
1164 |
(MenuItem |
|
1165 |
label: 'Find Dialog Opener...' |
|
1166 |
itemValue: doGotoDialogOpener |
|
1167 |
) |
|
1168 |
(MenuItem |
|
1169 |
label: 'Find Application Action Method...' |
|
1170 |
itemValue: doGotoApplicationActionMethod |
|
1171 |
) |
|
1172 |
(MenuItem |
|
1173 |
label: '-' |
|
1174 |
) |
|
1175 |
(MenuItem |
|
1176 |
label: 'Remember Callchain && Highlight on Next Entry' |
|
1177 |
itemValue: rememberCallchain |
|
1178 |
) |
|
1179 |
(MenuItem |
|
1180 |
label: 'Clear Remembered Callchain' |
|
1181 |
itemValue: clearRememberedCallchain |
|
1182 |
) |
|
1183 |
) |
|
1184 |
nil |
|
1185 |
nil |
|
12437 | 1186 |
) |
1187 |
! |
|
1188 |
||
1189 |
fileMenuSpec |
|
1190 |
"This resource specification was automatically generated |
|
1191 |
by the MenuEditor of ST/X." |
|
1192 |
||
1193 |
"Do not manually edit this!! If it is corrupted, |
|
1194 |
the MenuEditor may not be able to read the specification." |
|
1195 |
||
1196 |
||
1197 |
" |
|
1198 |
MenuEditor new openOnClass:DebugView andSelector:#fileMenuSpec |
|
1199 |
(Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp |
|
1200 |
" |
|
1201 |
||
1202 |
<resource: #menu> |
|
1203 |
||
15413 | 1204 |
^ |
12437 | 1205 |
#(Menu |
17185 | 1206 |
( |
1207 |
(MenuItem |
|
1208 |
enabled: canSendEmail |
|
1209 |
label: 'Report a Bug via eMail...' |
|
1210 |
itemValue: doOpenReportMailApp |
|
1211 |
) |
|
1212 |
(MenuItem |
|
1213 |
label: '-' |
|
1214 |
) |
|
1215 |
(MenuItem |
|
1216 |
enabled: canCloseAllDebuggers |
|
1217 |
label: 'Close all Debuggers...' |
|
1218 |
itemValue: closeAllDebuggers |
|
1219 |
isVisible: isNotInspecting |
|
1220 |
) |
|
1221 |
(MenuItem |
|
1222 |
label: '-' |
|
1223 |
) |
|
1224 |
(MenuItem |
|
1225 |
label: 'Exit' |
|
1226 |
itemValue: closeRequest |
|
1227 |
isVisible: isInspecting |
|
1228 |
) |
|
1229 |
(MenuItem |
|
1230 |
label: 'Close Debugger and Abort' |
|
1231 |
itemValue: closeRequest |
|
1232 |
isVisible: isNotInspecting |
|
1233 |
) |
|
1234 |
) |
|
1235 |
nil |
|
1236 |
nil |
|
12437 | 1237 |
) |
1238 |
! |
|
1239 |
||
1240 |
helpMenuSpec |
|
1241 |
"This resource specification was automatically generated |
|
1242 |
by the MenuEditor of ST/X." |
|
1243 |
||
1244 |
"Do not manually edit this!! If it is corrupted, |
|
1245 |
the MenuEditor may not be able to read the specification." |
|
1246 |
||
1247 |
||
1248 |
" |
|
1249 |
MenuEditor new openOnClass:DebugView andSelector:#helpMenuSpec |
|
1250 |
(Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp |
|
1251 |
" |
|
1252 |
||
1253 |
<resource: #menu> |
|
1254 |
||
15413 | 1255 |
^ |
12437 | 1256 |
#(Menu |
17185 | 1257 |
( |
1258 |
(MenuItem |
|
1259 |
label: 'Debugger''s Documentation' |
|
1260 |
itemValue: openHTMLDocument: |
|
1261 |
argument: 'tools/debugger/TOP.html' |
|
1262 |
) |
|
1263 |
(MenuItem |
|
1264 |
label: '-' |
|
1265 |
) |
|
1266 |
(MenuItem |
|
1267 |
label: 'About DebugView...' |
|
1268 |
itemValue: openAboutThisApplication |
|
1269 |
) |
|
1270 |
) |
|
1271 |
nil |
|
1272 |
nil |
|
12437 | 1273 |
) |
1274 |
! |
|
1275 |
||
3269 | 1276 |
menuSpec |
1277 |
"This resource specification was automatically generated |
|
1278 |
by the MenuEditor of ST/X." |
|
1279 |
||
1280 |
"Do not manually edit this!! If it is corrupted, |
|
1281 |
the MenuEditor may not be able to read the specification." |
|
1282 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
1283 |
|
3269 | 1284 |
" |
1285 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
1286 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
1287 |
" |
|
1288 |
||
1289 |
<resource: #menu> |
|
1290 |
||
15413 | 1291 |
^ |
5875 | 1292 |
#(Menu |
17185 | 1293 |
( |
1294 |
(MenuItem |
|
1295 |
label: 'File' |
|
1296 |
submenuChannel: fileMenuSpec |
|
1297 |
) |
|
1298 |
(MenuItem |
|
1299 |
label: 'View' |
|
1300 |
submenuChannel: viewMenuSpec |
|
1301 |
) |
|
1302 |
(MenuItem |
|
1303 |
label: 'Process' |
|
1304 |
submenuChannel: processMenuSpec |
|
1305 |
) |
|
1306 |
(MenuItem |
|
1307 |
label: 'Context' |
|
1308 |
submenuChannel: contextMenuSpec |
|
1309 |
) |
|
1310 |
(MenuItem |
|
1311 |
label: 'Receiver' |
|
1312 |
submenuChannel: classMenuSpec |
|
1313 |
) |
|
1314 |
(MenuItem |
|
1315 |
label: 'Selector' |
|
1316 |
submenuChannel: selectorMenuSpec |
|
1317 |
) |
|
1318 |
(MenuItem |
|
1319 |
label: 'Breakpoint' |
|
1320 |
submenuChannel: breakPointMenuSpec |
|
1321 |
) |
|
1322 |
(MenuItem |
|
1323 |
label: 'MENU_Help' |
|
1324 |
startGroup: conditionalRight |
|
1325 |
submenuChannel: helpMenuSpec |
|
1326 |
) |
|
1327 |
) |
|
1328 |
nil |
|
1329 |
nil |
|
12437 | 1330 |
) |
1331 |
! |
|
1332 |
||
1333 |
processMenuSpec |
|
1334 |
"This resource specification was automatically generated |
|
1335 |
by the MenuEditor of ST/X." |
|
1336 |
||
1337 |
"Do not manually edit this!! If it is corrupted, |
|
1338 |
the MenuEditor may not be able to read the specification." |
|
1339 |
||
1340 |
||
1341 |
" |
|
1342 |
MenuEditor new openOnClass:DebugView andSelector:#processMenuSpec |
|
1343 |
(Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp |
|
1344 |
" |
|
1345 |
||
1346 |
<resource: #menu> |
|
1347 |
||
15413 | 1348 |
^ |
12437 | 1349 |
#(Menu |
17185 | 1350 |
( |
1351 |
(MenuItem |
|
1352 |
label: 'Continue' |
|
1353 |
itemValue: doContinue |
|
1354 |
) |
|
1355 |
(MenuItem |
|
1356 |
label: 'Next (Line-Step)' |
|
1357 |
itemValue: doNext |
|
1358 |
) |
|
1359 |
(MenuItem |
|
1360 |
label: 'Step' |
|
1361 |
itemValue: doStep |
|
1362 |
) |
|
1363 |
(MenuItem |
|
1364 |
label: '-' |
|
1365 |
) |
|
1366 |
(MenuItem |
|
1367 |
label: 'After 5 Seconds' |
|
1368 |
submenu: |
|
1369 |
(Menu |
|
1370 |
( |
|
1371 |
(MenuItem |
|
1372 |
label: 'Continue' |
|
1373 |
itemValue: doContinueAfterDelay |
|
1374 |
) |
|
1375 |
(MenuItem |
|
1376 |
label: 'Next (Line-Step)' |
|
1377 |
itemValue: doNextAfterDelay |
|
1378 |
) |
|
1379 |
(MenuItem |
|
1380 |
label: 'Step' |
|
1381 |
itemValue: doStepAfterDelay |
|
1382 |
) |
|
1383 |
) |
|
1384 |
nil |
|
1385 |
nil |
|
1386 |
) |
|
1387 |
) |
|
1388 |
(MenuItem |
|
1389 |
label: '-' |
|
1390 |
) |
|
1391 |
(MenuItem |
|
1392 |
label: 'Skip to Cursor Line' |
|
1393 |
itemValue: skip |
|
1394 |
) |
|
1395 |
(MenuItem |
|
1396 |
label: 'Step Out (Skip until Return)' |
|
1397 |
itemValue: skipForReturn |
|
1398 |
) |
|
1399 |
(MenuItem |
|
1400 |
label: 'Skip until Entering...' |
|
1401 |
itemValue: skipUntilEntering |
|
1402 |
) |
|
1403 |
(MenuItem |
|
1404 |
label: '-' |
|
1405 |
) |
|
1406 |
(MenuItem |
|
1407 |
label: 'Abort' |
|
1408 |
itemValue: doAbort |
|
1409 |
) |
|
1410 |
(MenuItem |
|
1411 |
enabled: abortAllIsHandled |
|
1412 |
label: 'Abort All' |
|
1413 |
itemValue: doAbortAll |
|
1414 |
) |
|
1415 |
(MenuItem |
|
1416 |
label: '-' |
|
1417 |
) |
|
1418 |
(MenuItem |
|
1419 |
label: 'Inspect' |
|
1420 |
itemValue: doInspectProcess |
|
1421 |
) |
|
1422 |
(MenuItem |
|
1423 |
label: 'Change Priority...' |
|
1424 |
itemValue: doChangeProcessPriority |
|
1425 |
) |
|
1426 |
(MenuItem |
|
1427 |
label: '-' |
|
1428 |
) |
|
1429 |
(MenuItem |
|
1430 |
label: 'Terminate' |
|
1431 |
itemValue: doTerminate |
|
1432 |
) |
|
1433 |
(MenuItem |
|
1434 |
label: 'Hard Terminate (Danger)' |
|
1435 |
itemValue: quickTerminate |
|
1436 |
isVisible: false |
|
1437 |
) |
|
1438 |
) |
|
1439 |
nil |
|
1440 |
nil |
|
12437 | 1441 |
) |
1442 |
! |
|
1443 |
||
1444 |
selectorMenuSpec |
|
1445 |
"This resource specification was automatically generated |
|
1446 |
by the MenuEditor of ST/X." |
|
1447 |
||
1448 |
"Do not manually edit this!! If it is corrupted, |
|
1449 |
the MenuEditor may not be able to read the specification." |
|
1450 |
||
1451 |
||
1452 |
" |
|
1453 |
MenuEditor new openOnClass:DebugView andSelector:#selectorMenuSpec |
|
1454 |
(Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp |
|
1455 |
" |
|
1456 |
||
1457 |
<resource: #menu> |
|
1458 |
||
15413 | 1459 |
^ |
12437 | 1460 |
#(Menu |
17185 | 1461 |
( |
1462 |
(MenuItem |
|
1463 |
label: 'Browse Implementors...' |
|
1464 |
itemValue: browseImplementorsOf |
|
1465 |
) |
|
1466 |
(MenuItem |
|
1467 |
label: 'Browse Senders...' |
|
1468 |
itemValue: browseSendersOf |
|
1469 |
) |
|
1470 |
(MenuItem |
|
1471 |
label: '-' |
|
1472 |
) |
|
1473 |
(MenuItem |
|
1474 |
enabled: canDefineMethod |
|
1475 |
label: 'Define Missing Method' |
|
1476 |
itemValue: doDefineMethod |
|
1477 |
) |
|
1478 |
) |
|
1479 |
nil |
|
1480 |
nil |
|
12437 | 1481 |
) |
1482 |
! |
|
1483 |
||
1484 |
viewMenuSpec |
|
1485 |
"This resource specification was automatically generated |
|
1486 |
by the MenuEditor of ST/X." |
|
1487 |
||
1488 |
"Do not manually edit this!! If it is corrupted, |
|
1489 |
the MenuEditor may not be able to read the specification." |
|
1490 |
||
1491 |
||
1492 |
" |
|
1493 |
MenuEditor new openOnClass:DebugView andSelector:#viewMenuSpec |
|
1494 |
(Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp |
|
1495 |
" |
|
1496 |
||
1497 |
<resource: #menu> |
|
1498 |
||
15413 | 1499 |
^ |
12437 | 1500 |
#(Menu |
17185 | 1501 |
( |
1502 |
(MenuItem |
|
1503 |
enabled: canShowMore |
|
1504 |
label: 'Show More WalkBack' |
|
1505 |
itemValue: showMoreWalkback |
|
1506 |
) |
|
1507 |
(MenuItem |
|
1508 |
enabled: canShowMore |
|
1509 |
label: 'Show Full WalkBack' |
|
1510 |
itemValue: showFullWalkback |
|
1511 |
) |
|
1512 |
(MenuItem |
|
1513 |
label: '-' |
|
1514 |
) |
|
1515 |
(MenuItem |
|
1516 |
label: 'Show Dense WalkBack' |
|
1517 |
itemValue: showingDenseWalkback: |
|
1518 |
hideMenuOnActivated: false |
|
1519 |
indication: showingDenseWalkback |
|
1520 |
) |
|
1521 |
(MenuItem |
|
1522 |
enabled: notShowingDenseWalkbackHolder |
|
1523 |
label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)' |
|
1524 |
itemValue: showingSupportCode: |
|
1525 |
hideMenuOnActivated: false |
|
1526 |
indication: showingSupportCode |
|
1527 |
) |
|
1528 |
(MenuItem |
|
1529 |
label: '-' |
|
1530 |
) |
|
1531 |
(MenuItem |
|
1532 |
label: 'Raise Debugger when Entering' |
|
1533 |
itemValue: autoRaiseView: |
|
1534 |
hideMenuOnActivated: false |
|
1535 |
indication: autoRaiseView |
|
1536 |
) |
|
1537 |
(MenuItem |
|
1538 |
label: '-' |
|
1539 |
) |
|
1540 |
(MenuItem |
|
1541 |
label: 'Settings...' |
|
1542 |
itemValue: openSettingsDialog |
|
1543 |
) |
|
1544 |
) |
|
1545 |
nil |
|
1546 |
nil |
|
3269 | 1547 |
) |
1548 |
! ! |
|
1549 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1550 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1551 |
|
4121 | 1552 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1553 |
"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
|
1554 |
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
|
1555 |
and Exception contexts, to present the context in which the error |
16801 | 1556 |
actually occurred. |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1557 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1558 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1559 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1560 |
|
12839 | 1561 |
"/ fetch some contexts... |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1562 |
someContexts := Array new:25. |
2042 | 1563 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1564 |
idx := 1. |
10205 | 1565 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
16801 | 1566 |
someContexts at:idx put:con. |
1567 |
con := con sender. |
|
1568 |
idx := idx + 1. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1569 |
]. |
12839 | 1570 |
"/ search... |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1571 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1572 |
^ someContexts at:idx. |
13398 | 1573 |
|
1574 |
"Modified: / 28-08-2013 / 20:12:47 / cg" |
|
3447 | 1575 |
! |
1576 |
||
10205 | 1577 |
interestingContextIndexIn:aContextArray |
12039 | 1578 |
"return an interesting context's index, or nil. |
1579 |
This is the context initially shown (selected) in the walkback. |
|
3447 | 1580 |
We move up the calling chain, skipping all intermediate Signal |
16801 | 1581 |
and Exception contexts, to present the context in which the error actually occurred. |
13398 | 1582 |
Just for your (my) convenience :-)" |
3447 | 1583 |
|
13309 | 1584 |
|con found offset sel prev rcvr nMax idx methodHome method| |
3447 | 1585 |
|
13398 | 1586 |
"/ Transcript showCR:'x'. |
7713 | 1587 |
"/ Transcript showCR:aContextArray. |
7648 | 1588 |
|
3447 | 1589 |
nMax := aContextArray size. |
1590 |
nMax <= 1 ifTrue:[^ 1]. |
|
1591 |
con := aContextArray at:1. |
|
1592 |
con isBlockContext ifTrue:[^ 1]. |
|
12039 | 1593 |
(con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1]. "/ we are already there |
3447 | 1594 |
|
1595 |
"/ somewhere, at the bottom, there must be a raise ... |
|
1596 |
"/ find the exception |
|
1597 |
1 to:5 do:[:i | |
|
16730 | 1598 |
found isNil ifTrue:[ |
1599 |
con := aContextArray at:i ifAbsent:nil. |
|
1600 |
con notNil ifTrue:[ |
|
1601 |
sel := con selector ? ''. |
|
1602 |
(sel isSymbol |
|
1603 |
and:[ (sel startsWith:'raise') |
|
17122 | 1604 |
and:[ ((rcvr := con receiver) isProtoObject not) |
16730 | 1605 |
and:[ rcvr isExceptionCreator]]]) ifTrue:[ |
1606 |
offset := i. |
|
1607 |
found := con. |
|
1608 |
||
1609 |
"/ if this is a noHandler exception, |
|
1610 |
"/ skip forward to the erroneous context |
|
1611 |
(rcvr isException) ifTrue:[ |
|
1612 |
rcvr creator == Signal noHandlerSignal ifTrue:[ |
|
1613 |
found := rcvr suspendedContext. |
|
1614 |
offset := aContextArray identityIndexOf:found. |
|
1615 |
] |
|
1616 |
]. |
|
1617 |
]. |
|
1618 |
]. |
|
1619 |
]. |
|
3447 | 1620 |
]. |
12039 | 1621 |
"/ Transcript showCR:con. |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1622 |
"/ Transcript show:'1 '; showCR:found. |
12839 | 1623 |
|
3447 | 1624 |
found isNil ifTrue:[ |
16730 | 1625 |
"/ this is a kludge, but convenient. |
1626 |
"/ show the place where the error (divisionByZero...) happend, |
|
1627 |
"/ not where the signal was raised. |
|
1628 |
con := (aContextArray at:1). |
|
1629 |
sel := con methodHome selector. |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1630 |
|
13398 | 1631 |
"/ Transcript show:'2 '; showCR:con. |
16730 | 1632 |
"/ typically a DivisionByZero - show caller of division |
1633 |
(sel == #// |
|
1634 |
or:[sel == #/ |
|
1635 |
or:[sel == #\\]]) ifTrue:[ |
|
1636 |
^ 2 |
|
1637 |
]. |
|
1638 |
||
1639 |
"/ show the place of the bad message; not where the Signal was raised... |
|
1640 |
(sel == #doesNotUnderstand:) ifTrue:[ |
|
1641 |
idx := 3. |
|
1642 |
nMax > 2 ifTrue:[ |
|
1643 |
sel := (aContextArray at:idx) selector ? ''. |
|
1644 |
sel == #doesNotUnderstand: ifTrue:[ |
|
1645 |
idx := 4 |
|
1646 |
]. |
|
1647 |
nMax > idx ifTrue:[ |
|
1648 |
sel := (aContextArray at:idx) selector ? ''. |
|
1649 |
"/ show the place of the perfor-send; not where the Signal was raised... |
|
1650 |
((sel == #perform:) |
|
1651 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
|
1652 |
idx := idx + 1 |
|
1653 |
]. |
|
1654 |
] |
|
1655 |
]. |
|
1656 |
^ idx min:nMax |
|
1657 |
]. |
|
1658 |
||
1659 |
"/ show the bad method; not where the Signal was raised... |
|
1660 |
(sel == #noByteCode) ifTrue:[ |
|
1661 |
^ 2 |
|
1662 |
]. |
|
3447 | 1663 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1664 |
"/ "/ 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
|
1665 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1666 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1667 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1668 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1669 |
"/ "/ 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
|
1670 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1671 |
"/ ^ 2 |
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 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1674 |
"/ "/ 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
|
1675 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1676 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1677 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1678 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1679 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1680 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1681 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1682 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1683 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1684 |
"/ ]. |
7862 | 1685 |
|
16730 | 1686 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
1687 |
(sel == #signalInterrupt:) ifTrue:[ |
|
1688 |
^ 2 |
|
1689 |
]. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1690 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1691 |
"/ "/ 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
|
1692 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1693 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1694 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1695 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1696 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1697 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1698 |
"/ "/ 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
|
1699 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1700 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1701 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
1702 |
|
16730 | 1703 |
"/ show the place of the bad index; not where the Signal was raised... |
1704 |
( #(#notIndexed |
|
1705 |
#indexNotIntegerOrOutOfBounds: |
|
1706 |
#subscriptBoundsError: |
|
1707 |
#elementBoundsError: |
|
1708 |
"/ #subclassResponsibility |
|
1709 |
) includes:sel) ifTrue:[ |
|
1710 |
idx := 2. |
|
1711 |
[ idx <= 3 |
|
1712 |
and:[ |
|
1713 |
sel := (aContextArray at:idx) selector. |
|
1714 |
#(#notIndexed |
|
1715 |
#indexNotIntegerOrOutOfBounds: |
|
1716 |
#subscriptBoundsError: |
|
1717 |
#elementBoundsError: ) includes:sel |
|
1718 |
] |
|
1719 |
] whileTrue:[ idx := idx + 1 ]. |
|
1720 |
sel := (aContextArray at:idx) selector. |
|
1721 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1722 |
ifTrue:[ |
|
1723 |
sel := (aContextArray at:idx+1) selector. |
|
1724 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1725 |
ifTrue:[ |
|
1726 |
sel := (aContextArray at:idx+2) selector. |
|
1727 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
|
1728 |
ifTrue:[ |
|
1729 |
^ idx+3 |
|
1730 |
]. |
|
1731 |
^ idx+2 |
|
1732 |
]. |
|
1733 |
^ idx+1 |
|
1734 |
]. |
|
1735 |
^ idx |
|
1736 |
]. |
|
1737 |
offset := 1. |
|
8152 | 1738 |
]. |
1739 |
||
1740 |
"/ the above is all too hard-coded; |
|
1741 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1742 |
"/ as more methods get flagged, remove code from above. |
|
1743 |
con := aContextArray at:offset ifAbsent:nil. |
|
13398 | 1744 |
"/ Transcript show:'2 '; showCR:con. |
10205 | 1745 |
[ |
16730 | 1746 |
con notNil |
1747 |
and:[ (methodHome := con methodHome) notNil |
|
1748 |
and:[ (method := methodHome method) notNil |
|
1749 |
and:[ method shouldBeSkippedInDebuggersWalkBack ]]] |
|
8152 | 1750 |
] whileTrue:[ |
1751 |
"/ Transcript showCR:con methodHome method. |
|
16730 | 1752 |
offset := offset + 1. |
1753 |
con := aContextArray at:offset ifAbsent:nil. |
|
8152 | 1754 |
]. |
13309 | 1755 |
methodHome := nil. "/ help GC |
3447 | 1756 |
|
1757 |
" |
|
1758 |
got it; move up, skipping all intermediate Signal and |
|
1759 |
Exception contexts |
|
1760 |
" |
|
1761 |
prev := nil. |
|
1762 |
rcvr := con receiver. |
|
10205 | 1763 |
[ |
17122 | 1764 |
rcvr isProtoObject not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1765 |
] whileTrue:[ |
16730 | 1766 |
prev := con. |
1767 |
nMax > offset ifFalse:[^ offset]. |
|
1768 |
||
1769 |
offset := offset + 1. |
|
1770 |
con := aContextArray at:offset. |
|
1771 |
rcvr := con receiver. |
|
3447 | 1772 |
]. |
1773 |
||
1774 |
" |
|
1775 |
now, we are one above the raising context |
|
1776 |
" |
|
13398 | 1777 |
"/ Transcript show:'3 '; showCR:con. |
1778 |
||
1779 |
(con selector == #retry:coercing:) ifTrue:[ |
|
16730 | 1780 |
"/ show the operation which failed to coerce, not the coerce |
1781 |
^ offset + 1 |
|
13398 | 1782 |
]. |
3447 | 1783 |
|
1784 |
" |
|
13398 | 1785 |
if the sender-method of the raise is one of object's error methods ... |
3447 | 1786 |
" |
10205 | 1787 |
( #( halt halt: |
16730 | 1788 |
error error: |
1789 |
doesNotUnderstand: |
|
1790 |
subclassResponsibility |
|
1791 |
primitiveFailed) includes:con selector) |
|
3447 | 1792 |
ifTrue:[ |
16730 | 1793 |
con selector == #doesNotUnderstand: ifTrue:[ |
1794 |
" |
|
1795 |
one more up, to get to the originating context |
|
1796 |
" |
|
1797 |
con := aContextArray at:(offset + 1). |
|
1798 |
con isNil ifTrue:[^ offset]. |
|
1799 |
offset := offset + 1. |
|
1800 |
]. |
|
1801 |
con := aContextArray at:(offset + 1). |
|
1802 |
con isNil ifTrue:[^ offset]. |
|
1803 |
offset := offset + 1. |
|
3447 | 1804 |
] ifFalse:[ |
16730 | 1805 |
" |
1806 |
ok, got the raise - if its a BreakPoint, look for the sender |
|
1807 |
" |
|
1808 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
|
1809 |
offset := offset + 1 |
|
1810 |
]. |
|
3447 | 1811 |
]. |
1812 |
||
1813 |
^ offset |
|
1814 |
||
7713 | 1815 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
13398 | 1816 |
"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
|
1817 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1818 |
|
16434 | 1819 |
!DebugView class methodsFor:'utilities'! |
1820 |
||
1821 |
withOptionToIgnoreException:exceptionOrHandlerSet do:aBlock |
|
1822 |
"execute aBlock; |
|
1823 |
if any from exceptionOrHandlerSet is raised during the execution, |
|
1824 |
open a confitmation dialog, asking if the debugger should be entered. |
|
1825 |
For halts/breakpoints, honors the ignored halt/break list; |
|
1826 |
also, two checkboxes are added, to also ignore them in the future" |
|
1827 |
||
1828 |
^ exceptionOrHandlerSet |
|
1829 |
handle:[:ex | |
|
1830 |
|msg descr where whatError showIgnoreOptions |
|
1831 |
ignoreForSomeTimeHolder ignoreForEverHolder |
|
1832 |
lineNrOfHalt haltingMethod resources| |
|
1833 |
||
1834 |
showIgnoreOptions := false. |
|
1835 |
ignoreForSomeTimeHolder := false asValue. |
|
1836 |
ignoreForEverHolder := false asValue. |
|
1837 |
||
1838 |
(ControlInterrupt accepts:ex creator) ifTrue:[ |
|
16994 | 1839 |
|suspendedContext sender| |
1840 |
||
16434 | 1841 |
"/ also deal with ignored breakpoints here; |
1842 |
"/ otherwise, it is almost impossible to place a breakpoint into |
|
1843 |
"/ RB-code, and ignoring it... |
|
16994 | 1844 |
suspendedContext := ex suspendedContext. |
1845 |
sender := suspendedContext sender. |
|
1846 |
"/ suspendedContext selector == #break ifTrue:[ |
|
1847 |
"/ lineNrOfHalt := sender lineNumber. |
|
1848 |
"/ haltingMethod := sender method. |
|
1849 |
"/ ] ifFalse:[ |
|
1850 |
lineNrOfHalt := sender lineNumber. |
|
1851 |
haltingMethod := sender method. |
|
1852 |
"/ ]. |
|
1853 |
suspendedContext := sender := nil. |
|
16434 | 1854 |
"/ Transcript showCR:haltingMethod. |
1855 |
"/ Transcript showCR:lineNrOfHalt. |
|
1856 |
(self |
|
1857 |
isHaltToBeIgnoredIn:haltingMethod |
|
1858 |
atLineNr:lineNrOfHalt |
|
1859 |
context:nil |
|
1860 |
modifyEntryCount:false |
|
1861 |
) ifTrue:[ |
|
1862 |
Transcript showCR:'breakpoint ignored in background processing'. |
|
1863 |
^ ex proceed. |
|
1864 |
]. |
|
1865 |
showIgnoreOptions := true. |
|
1866 |
whatError := 'Halt/Breakpoint:' |
|
1867 |
] ifFalse:[ |
|
1868 |
whatError := 'Error encountered:' |
|
1869 |
]. |
|
1870 |
||
1871 |
resources := self resources. |
|
1872 |
descr := ex description allBold. |
|
1873 |
where := ex suspendedContext printString. |
|
1874 |
||
1875 |
Dialog modifyingBoxWith:[:box | |
|
1876 |
showIgnoreOptions ifTrue:[ |
|
1877 |
box verticalPanel |
|
1878 |
add:(View new height:20); |
|
1879 |
add:(CheckBox |
|
1880 |
label:(resources string:'Ignore this Halt/Break for some time (30s)') |
|
1881 |
model:ignoreForSomeTimeHolder); |
|
1882 |
add:(CheckBox |
|
16580 | 1883 |
label:(resources string:'Ignore this Halt/Break forever') |
16434 | 1884 |
model:ignoreForEverHolder). |
1885 |
]. |
|
1886 |
] do:[ |
|
16611 | 1887 |
|answer canRemove labels actions| |
1888 |
||
16811 | 1889 |
"/ cannot remove halts or coded breakpoints. |
1890 |
canRemove := haltingMethod notNil and:[haltingMethod isMethodWithBreakpoints or:[ haltingMethod isBreakpointed ]]. |
|
16611 | 1891 |
labels := #('Ignore' 'Remove Breakpoint' 'Debug' ). |
1892 |
actions := #(ignore remove debug). |
|
1893 |
canRemove ifFalse:[ |
|
1894 |
labels := #('Ignore' 'Debug' ). |
|
1895 |
actions := #(ignore debug). |
|
1896 |
]. |
|
1897 |
||
1898 |
answer := OptionBox |
|
1899 |
choose:(self resources |
|
16434 | 1900 |
stringWithCRs:'%1\%2\\%3' |
1901 |
with:whatError |
|
1902 |
with:descr |
|
1903 |
with:where) |
|
16611 | 1904 |
label:whatError |
1905 |
image:nil |
|
1906 |
labels:(resources array:labels) |
|
1907 |
values:actions |
|
1908 |
default:#ignore |
|
1909 |
onCancel:#ignore. |
|
1910 |
"/ answer := Dialog |
|
1911 |
"/ confirm:(self resources |
|
1912 |
"/ stringWithCRs:'%1\%2\\%3' |
|
1913 |
"/ with:whatError |
|
1914 |
"/ with:descr |
|
1915 |
"/ with:where) |
|
1916 |
"/ yesLabel:(resources string:'Debug') |
|
1917 |
"/ noLabel:(resources string:'Ignore'). |
|
16434 | 1918 |
|
1919 |
(ignoreForSomeTimeHolder value or:[ignoreForEverHolder value]) ifTrue:[ |
|
1920 |
self |
|
1921 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
|
1922 |
forCount:(ignoreForEverHolder value ifTrue:[-1] ifFalse:[nil]) |
|
1923 |
orTimeDuration:(ignoreForSomeTimeHolder value ifTrue:[30 seconds] ifFalse:[nil]) |
|
1924 |
orUntilShiftKey:false |
|
1925 |
orReceiverClass:nil orProcess:nil |
|
1926 |
orIfCalledFromMethod:nil. |
|
1927 |
]. |
|
1928 |
||
16611 | 1929 |
answer == #remove ifTrue:[ |
1930 |
haltingMethod isMethodWithBreakpoints ifTrue:[ |
|
1931 |
haltingMethod disableBreakpointInLine:lineNrOfHalt |
|
1932 |
] ifFalse:[ |
|
1933 |
haltingMethod isBreakpointed ifTrue:[ |
|
1934 |
haltingMethod clearBreakPoint |
|
1935 |
]. |
|
16623 | 1936 |
]. |
1937 |
ex proceed |
|
16611 | 1938 |
]. |
16623 | 1939 |
answer == #debug ifTrue:[ |
16434 | 1940 |
ex reject. |
16623 | 1941 |
]. |
1942 |
ex proceed |
|
16434 | 1943 |
] |
1944 |
] |
|
1945 |
do:aBlock. |
|
1946 |
||
1947 |
" |
|
1948 |
HaltInterrupt withOptionToIgnoreDo:[self halt] -- catches this |
|
1949 |
HaltInterrupt withOptionToIgnoreDo:[self error] -- but not this |
|
1950 |
||
1951 |
-- catches both, but disable buttons are only shown for halt/breaks |
|
1952 |
ControlInterrupt withOptionToIgnore:(HaltInterrupt,Error) do:[self halt] |
|
1953 |
ControlInterrupt withOptionToIgnore:(HaltInterrupt,Error) do:[self error] |
|
1954 |
" |
|
16765
589cf9d699fe
Fix in DebugView>>withOptionToIgnoreException:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16753
diff
changeset
|
1955 |
|
589cf9d699fe
Fix in DebugView>>withOptionToIgnoreException:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16753
diff
changeset
|
1956 |
"Modified: / 25-07-2016 / 19:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
16434 | 1957 |
! ! |
1958 |
||
14662 | 1959 |
!DebugView methodsFor:'accessing'! |
1960 |
||
1961 |
contextInspector |
|
1962 |
^ contextInspector |
|
1963 |
! |
|
1964 |
||
1965 |
inspectedProcess |
|
1966 |
^ inspectedProcess |
|
1967 |
! ! |
|
1968 |
||
15257 | 1969 |
!DebugView methodsFor:'aspects'! |
1970 |
||
1971 |
verboseBacktraceHolder |
|
1972 |
verboseBacktraceHolder isNil ifTrue:[ |
|
17185 | 1973 |
verboseBacktraceHolder := ValueHolder with:false |
15257 | 1974 |
]. |
1975 |
^ verboseBacktraceHolder |
|
1976 |
! ! |
|
1977 |
||
73 | 1978 |
!DebugView methodsFor:'basic'! |
1979 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1980 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1981 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1982 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1983 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1984 |
m notNil ifTrue:[ |
17185 | 1985 |
self updateMenuItems. |
1986 |
||
1987 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
|
1988 |
abortButton enable. |
|
1989 |
m enable:#doAbort. |
|
1990 |
] ifFalse:[ |
|
1991 |
abortButton disable. |
|
1992 |
m disable:#doAbort. |
|
1993 |
]. |
|
1994 |
exclusive ifTrue:[ |
|
1995 |
terminateButton disable. |
|
1996 |
m disable:#doTerminate. |
|
1997 |
] ifFalse:[ |
|
1998 |
terminateButton enable. |
|
1999 |
m enable:#doTerminate. |
|
2000 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2001 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2002 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2003 |
mayProceed == false ifTrue:[ |
17185 | 2004 |
continueButton disable. |
2005 |
m notNil ifTrue:[m disable:#doContinue]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2006 |
] ifFalse:[ |
17185 | 2007 |
continueButton enable. |
2008 |
m notNil ifTrue:[m enable:#doContinue] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2009 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2010 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2011 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2012 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2013 |
|
13842 | 2014 |
enter |
2015 |
"enter a debugger" |
|
2016 |
||
2017 |
<context: #return> |
|
2018 |
||
2019 |
^ self |
|
17185 | 2020 |
enter:thisContext sender |
2021 |
select: nil. |
|
13842 | 2022 |
|
2023 |
"Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2024 |
! |
|
2025 |
||
1364 | 2026 |
enter:aContext select:initialSelectionOrNil |
73 | 2027 |
"enter the debugger - get and display the context, then start an |
2028 |
exclusive event loop on top of eveything else" |
|
2029 |
||
3447 | 2030 |
<context: #return> |
2031 |
||
16058 | 2032 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c |
2033 |
userprefs logFile| |
|
3447 | 2034 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2035 |
DebuggingDebugger == true ifTrue:[ |
16058 | 2036 |
'==> enter2: (' print. aContext print. |
2037 |
') select: ' print. initialSelectionOrNil printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
2038 |
]. |
3447 | 2039 |
thisContext isRecursive ifTrue:[ |
16058 | 2040 |
"/ care for the special case, were the Debugger was autoloaded. |
16860 | 2041 |
"/ in this case, thisContext IS recursive, but that's no error condition. |
16058 | 2042 |
foundNoByteCodeContext := false. |
2043 |
foundExitContext := false. |
|
2044 |
||
2045 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
2046 |
[ |
|
2047 |
foundNoByteCodeContext not |
|
2048 |
and:[ foundExitContext not |
|
2049 |
and:[c notNil |
|
2050 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
2051 |
]]]] |
|
2052 |
whileTrue:[ |
|
2053 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
2054 |
foundExitContext := true |
|
2055 |
]. |
|
2056 |
c selector == #noByteCode ifTrue:[ |
|
2057 |
foundNoByteCodeContext := true |
|
2058 |
]. |
|
2059 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
2060 |
]. |
|
2061 |
||
2062 |
(foundNoByteCodeContext not |
|
2063 |
and:[ foundExitContext not]) ifFalse:[ |
|
2064 |
('DebugView [warning]: reentered') errorPrintCR. |
|
2065 |
||
2066 |
^ MiniDebugger |
|
2067 |
enter:aContext |
|
2068 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
2069 |
mayProceed:mayProceed. |
|
2070 |
]. |
|
2071 |
foundExitContext ifTrue:[ |
|
2072 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
2073 |
^ self. |
|
2074 |
]. |
|
3447 | 2075 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
2076 |
|
10203 | 2077 |
"/'entering: ' print. aContext printCR. |
2078 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 2079 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
2080 |
||
11890 | 2081 |
(self isHaltToBeIgnored) ifTrue:[ |
16058 | 2082 |
^ self. |
8170 | 2083 |
]. |
11892 | 2084 |
"/ "/ does not work yet - but we should ignore any breakpoints while stepping |
2085 |
"/ (stepping and:[steppedContext notNil]) ifTrue:[ |
|
2086 |
"/ self isEnteredDueToBreakpointOrHalt ifTrue:[ |
|
2087 |
"/ 'DebugView [info]: ignored other interrupt while stepping' infoPrintCR. |
|
2088 |
"/ ^ self |
|
2089 |
"/ ]. |
|
2090 |
"/ ]. |
|
16058 | 2091 |
userprefs := UserPreferences current. |
2092 |
"/ optionally log this debugger entry |
|
2093 |
(logFile := userprefs debuggerLogFile) notNil ifTrue:[ |
|
2094 |
logFile asFilename appendingFileDo:[:s | |
|
2095 |
s cr. |
|
2096 |
s nextPutLine:'-----------------------'. |
|
2097 |
Timestamp now printOn:s. |
|
2098 |
s nextPutAll:' ['; nextPutAll:Processor activeProcess name; nextPutAll:']'; cr. |
|
2099 |
s cr. |
|
2100 |
aContext fullPrintAllOn:s |
|
2101 |
]. |
|
2102 |
]. |
|
2103 |
||
13965 | 2104 |
iAmNew := self drawableId isNil. |
73 | 2105 |
|
16058 | 2106 |
self verboseBacktraceHolder value:(userprefs verboseBacktraceInDebugger). |
939 | 2107 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
2108 |
busy := cachable := true. |
73 | 2109 |
inspecting := false. |
2110 |
inspectedProcess := Processor activeProcess. |
|
2111 |
stepping := false. |
|
2112 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2113 |
stepHow := nil. |
8148 | 2114 |
nChainShown := InitialNChainShown. |
73 | 2115 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2116 |
"/ if debugger is entered while a box has grabbed the |
9076 | 2117 |
"/ 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
|
2118 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2119 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2120 |
"/ 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
|
2121 |
"/ 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
|
2122 |
"/ 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
|
2123 |
Screen allScreens do:[:aScreen | |
16058 | 2124 |
aScreen ungrabPointer. |
2125 |
aScreen ungrabKeyboard. |
|
10205 | 2126 |
]. |
2127 |
||
2128 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
2129 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
16058 | 2130 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2131 |
] ifFalse:[ |
16058 | 2132 |
terminateButton enable. |
2133 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2134 |
]. |
73 | 2135 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
2136 |
iAmNew ifFalse:[ |
16058 | 2137 |
"/ not the first time - disable buttons & menus |
2138 |
"/ from the previous life |
|
2139 |
self turnOffAllButtons. |
|
2140 |
||
2141 |
m := contextView middleButtonMenu. |
|
2142 |
m notNil ifTrue:[ |
|
2143 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
2144 |
]. |
|
2145 |
self showingDenseWalkback:(self verboseBacktraceHolder value not). |
|
132 | 2146 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2147 |
self iconLabel:'Debugger'. |
132 | 2148 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2149 |
windowGroup isNil ifTrue:[ |
16058 | 2150 |
self windowGroup: WindowGroup new. |
2151 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2152 |
]. |
132 | 2153 |
exclusive ifFalse:[ |
16058 | 2154 |
"/ create a (modal) windowGroup for myself |
2155 |
||
2156 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2157 |
] ifTrue:[ |
16058 | 2158 |
"/ create a windowGroup with a synchronous sensor for me |
2159 |
||
2160 |
windowGroup beSynchronous. |
|
73 | 2161 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2162 |
windowGroup setProcess:Processor activeProcess. |
15027 | 2163 |
IsDebuggingQuery answer:true do:[ |
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2164 |
|
16058 | 2165 |
" |
2166 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
|
2167 |
" |
|
12039 | 2168 |
"/Transcript show:'0 '; showCR:aContext. |
2169 |
"/Transcript show:'0 '; showCR:thisContext sender. |
|
2170 |
"/Transcript show:'0 '; showCR:thisContext sender sender. |
|
2171 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender. |
|
2172 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender. |
|
2173 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender. |
|
2174 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender. |
|
2175 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender. |
|
2176 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender . |
|
2177 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender. |
|
2178 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender. |
|
2179 |
"/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender. |
|
2180 |
"/Transcript showCR:initialSelectionOrNil. |
|
16058 | 2181 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
2182 |
"/'after setContext; first is ' print. |
|
2183 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
2184 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
2185 |
||
2186 |
self updateButtonsAndMenuItemsForContext:aContext. |
|
2187 |
||
2188 |
" |
|
2189 |
If this is a new debugger, do a realize. |
|
2190 |
Otherwise, its probably better to do a map, which shows the |
|
2191 |
view at the previous position, without a need for the user to set the |
|
2192 |
position again |
|
2193 |
" |
|
2194 |
iAmNew ifTrue:[ |
|
2195 |
self realize. |
|
2196 |
] ifFalse:[ |
|
2197 |
self remap. |
|
2198 |
]. |
|
2199 |
self setForegroundWindow. |
|
2200 |
||
2201 |
exclusive ifTrue:[ |
|
2202 |
self showError:' |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2203 |
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
|
2204 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2205 |
This is a modal debugger - all event processing is stopped.. |
10205 | 2206 |
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
|
2207 |
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
|
2208 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2209 |
Also, there is no event processing (redraw) for other views.' |
16058 | 2210 |
]. |
2211 |
||
2212 |
self autoRaiseView ifTrue:[ |
|
2213 |
"/ self raise. |
|
2214 |
self raiseDeiconified. |
|
2215 |
self topView activate; setForegroundWindow; activate. |
|
2216 |
]. |
|
2217 |
||
2218 |
canContinue := true. |
|
2219 |
exitAction := nil. |
|
2220 |
||
2221 |
"/ enter private event handling loop. This is left (and we come back here again) |
|
2222 |
"/ when any button was pressed which requires continuation of the debuggee or |
|
2223 |
"/ closedown of the debugger. |
|
2224 |
[self controlLoop] ifCurtailed:[ |
|
2225 |
windowGroup notNil ifTrue:[ |
|
2226 |
windowGroup setProcess:nil. |
|
2227 |
]. |
|
2228 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
2229 |
self destroy |
|
2230 |
]. |
|
2231 |
NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1. |
|
11857
e561b4e978d0
Answer IsDebuggingQuery (with true).
Stefan Vogel <sv@exept.de>
parents:
11837
diff
changeset
|
2232 |
]. |
10203 | 2233 |
"/ here after my own control loop is finished. |
2234 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2235 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2236 |
"/ 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
|
2237 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 2238 |
contextView contents:nil. |
2239 |
||
73 | 2240 |
codeView acceptAction:nil. |
942 | 2241 |
codeView doItAction:nil. |
73 | 2242 |
|
4892 | 2243 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
16058 | 2244 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 2245 |
]. |
2246 |
||
11911 | 2247 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
2248 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
2249 |
||
73 | 2250 |
(exitAction ~~ #step) ifTrue:[ |
16058 | 2251 |
"/ not stepping or continue - close window |
2252 |
self cacheMyself. |
|
2253 |
receiverInspector release. |
|
2254 |
contextInspector release. |
|
2255 |
||
2256 |
self unmap. |
|
2257 |
self flush. |
|
2258 |
||
2259 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
2260 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
2261 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
2262 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
2263 |
(exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ]. |
|
2264 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
2265 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
2266 |
exitAction isBlock ifTrue:[ |
|
2267 |
self exit_unwindThenDo:exitAction. |
|
2268 |
"does not return" |
|
2269 |
]. |
|
2270 |
"not reached" |
|
2271 |
^ self |
|
73 | 2272 |
]. |
2273 |
||
3447 | 2274 |
"/ stepping - window stays open |
940 | 2275 |
selectedContext := actualContext := firstContext := nil. |
73 | 2276 |
|
2472 | 2277 |
"/ restore the previous pointer grab |
73 | 2278 |
grabber notNil ifTrue:[ |
16253 | 2279 |
device grabPointerInView:grabber. |
16058 | 2280 |
grabber := nil. |
61 | 2281 |
]. |
73 | 2282 |
|
2283 |
(exitAction == #step) ifTrue:[ |
|
16058 | 2284 |
" |
2285 |
schedule another stepInterrupt |
|
2286 |
- must enter myself into the collection of open debuggers, |
|
2287 |
in case the stepping process comes back again via a halt or signal |
|
2288 |
before the step is finished. In this case, the stepping debugger should |
|
2289 |
come up (instead of a new one) |
|
2290 |
- must flush caches since optimized methods not always |
|
2291 |
look for pending interrupts |
|
2292 |
" |
|
2293 |
||
2294 |
"/ |
|
2295 |
"/ also must care for stepping into a return |
|
2296 |
"/ |
|
2297 |
steppedContext notNil ifTrue:[ |
|
2298 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
2299 |
]. |
|
2300 |
||
2301 |
OpenDebuggers isNil ifTrue:[ |
|
2302 |
OpenDebuggers := WeakIdentitySet new. |
|
2303 |
]. |
|
2304 |
OpenDebuggers add:self. |
|
2305 |
||
2306 |
self label:'single stepping - please wait ...'. |
|
2307 |
stepping := true. |
|
2308 |
||
2309 |
ObjectMemory stepInterruptHandler:self. |
|
2310 |
Processor activeProcess stepInterruptHandler:self. |
|
2311 |
ObjectMemory flushCaches. |
|
2312 |
||
2313 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
2314 |
Context singleStepInterruptRequest |
|
2315 |
raiseWith: |
|
2316 |
(("bigStep" steppedContextLineno notNil) |
|
2317 |
ifTrue:[#next] |
|
2318 |
ifFalse:[#step]) |
|
2319 |
] ifFalse:[ |
|
2320 |
"/ see if we came here through an interrupt-action |
|
2321 |
"/ (i.e. aProcess interruptWith:...) |
|
2322 |
||
2323 |
enteredByInterrupt := false. |
|
2324 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2325 |
[enteredByInterrupt not |
|
2326 |
and:[con notNil |
|
2327 |
and:[con ~~ aContext]]] whileTrue:[ |
|
2328 |
((sel := con selector) == #timerInterrupt |
|
2329 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
2330 |
enteredByInterrupt := true. |
|
2331 |
] ifFalse:[ |
|
2332 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
2333 |
]. |
|
2334 |
]. |
|
2335 |
||
2336 |
ObjectMemory flushInlineCaches. |
|
2337 |
||
2338 |
DebuggingDebugger == true ifTrue:[ |
|
2339 |
enteredByInterrupt printCR. |
|
2340 |
]. |
|
2341 |
enteredByInterrupt ifTrue:[ |
|
2342 |
"/ don't want to step through all intermediate |
|
2343 |
"/ (scheduler-) contexts; place a return-trap on the |
|
2344 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2345 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2346 |
"/ 'special unwind return' printCR. |
16058 | 2347 |
con unwindThenDo:[ |
2348 |
Processor activeProcess stepInterruptHandler:self. |
|
2349 |
ObjectMemory stepInterruptHandler:self. |
|
2350 |
InStepInterrupt := nil. |
|
2351 |
StepInterruptPending := 1. |
|
2352 |
InterruptPending := 1]. |
|
2353 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2354 |
"/ 'normal step return' printCR. |
16058 | 2355 |
skipLineNr ~~ #return ifTrue:[ |
2356 |
StepInterruptPending := 1. |
|
2357 |
InterruptPending := 1. |
|
2358 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
2359 |
"/ 'step for return' printCR. |
16058 | 2360 |
] |
2361 |
]. |
|
2362 |
InStepInterrupt := nil |
|
2363 |
] |
|
73 | 2364 |
] ifFalse:[ |
16058 | 2365 |
OpenDebuggers notNil ifTrue:[ |
2366 |
OpenDebuggers remove:self ifAbsent:[]. |
|
2367 |
]. |
|
2368 |
self cacheMyself. |
|
73 | 2369 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
2370 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
2371 |
"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
|
2372 |
"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
|
2373 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
11697 | 2374 |
"Modified: / 27-07-2012 / 17:35:56 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2375 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2376 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2377 |
exit_abort |
5455 | 2378 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
2379 |
"/ that one would run on top of this context. |
|
2380 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2381 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2382 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2383 |
"/ done in the #enter:select method. |
5455 | 2384 |
"/ You are not expected to understand this. |
2385 |
||
6487 | 2386 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
2387 |
! |
|
2388 |
||
2389 |
exit_abortAll |
|
2390 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2391 |
"/ that one would run on top of this context. |
|
2392 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2393 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2394 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2395 |
"/ done in the #enter:select method. |
6487 | 2396 |
"/ You are not expected to understand this. |
2397 |
||
2398 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2399 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2400 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2401 |
exit_quickTerminate |
3447 | 2402 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2403 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2404 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2405 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 2406 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2407 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2408 |
|
13360 | 2409 |
exit_resend |
2410 |
|con| |
|
2411 |
||
2412 |
selectedContext notNil ifTrue:[ |
|
17185 | 2413 |
con := selectedContext. |
2414 |
self cacheMyself. |
|
2415 |
" |
|
2416 |
have to catch errors occuring in unwind-blocks |
|
2417 |
" |
|
2418 |
Error handle:[:ex | |
|
2419 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2420 |
ex description infoPrintCR. |
|
2421 |
ex proceed |
|
2422 |
] do:[ |
|
2423 |
^ con unwindThenResend. |
|
2424 |
]. |
|
2425 |
'DebugView [warning]: cannot resend selected context''s message' errorPrintCR |
|
13360 | 2426 |
] |
2427 |
! |
|
2428 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2429 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2430 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2431 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2432 |
selectedContext notNil ifTrue:[ |
17185 | 2433 |
con := selectedContext. |
2434 |
self cacheMyself. |
|
2435 |
" |
|
2436 |
have to catch errors occuring in unwind-blocks |
|
2437 |
" |
|
2438 |
Error handle:[:ex | |
|
2439 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2440 |
ex description infoPrintCR. |
|
2441 |
ex proceed |
|
2442 |
] do:[ |
|
2443 |
con unwindAndRestart. |
|
2444 |
]. |
|
2445 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
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 |
|
11818 | 2448 |
"Created: / 16-11-2001 / 17:23:17 / cg" |
11819 | 2449 |
"Modified: / 26-09-2012 / 15:09:52 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2450 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2451 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2452 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2453 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2454 |
|
14902 | 2455 |
retVal := nil. |
2456 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2457 |
selectedContext notNil ifTrue:[ |
17185 | 2458 |
" |
2459 |
if there is a selection in the codeView, |
|
2460 |
evaluate it and use the result as return value |
|
2461 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2462 |
"/ 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
|
2463 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2464 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2465 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2466 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2467 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2468 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2469 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2470 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2471 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2472 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2473 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2474 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2475 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2476 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2477 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2478 |
|
17185 | 2479 |
con := selectedContext. |
2480 |
self cacheMyself. |
|
2481 |
" |
|
2482 |
have to catch errors occuring in unwind-blocks |
|
2483 |
" |
|
2484 |
Error handle:[:ex | |
|
2485 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
2486 |
ex description infoPrintCR. |
|
2487 |
ex proceed |
|
2488 |
] do:[ |
|
2489 |
con unwind:retVal. |
|
2490 |
]. |
|
2491 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2492 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2493 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2494 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 2495 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2496 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2497 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2498 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2499 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2500 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2501 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2502 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2503 |
Error handle:[:ex | |
17185 | 2504 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2505 |
ex description infoPrintCR. |
|
2506 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2507 |
] do:[ |
17185 | 2508 |
self cacheMyself. |
2509 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2510 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2511 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2512 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2513 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 2514 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
2515 |
! |
|
2516 |
||
6487 | 2517 |
exit_unwindThenDo:aBlock |
2518 |
|con| |
|
2519 |
||
2520 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
2521 |
"/ that one would run on top of this context. |
|
2522 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
2523 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
2524 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 2525 |
"/ done in the #enter:select method. |
6487 | 2526 |
"/ You are not expected to understand this. |
2527 |
||
2528 |
" |
|
2529 |
have to catch errors occuring in unwind-blocks |
|
2530 |
" |
|
2531 |
self cacheMyself. |
|
12743 | 2532 |
con := thisContext sender. |
6487 | 2533 |
|
2534 |
Error handle:[:ex | |
|
17185 | 2535 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
2536 |
ex description infoPrintCR. |
|
2537 |
ex proceed |
|
6487 | 2538 |
] do:[ |
17185 | 2539 |
"/ find the enter:select context. |
2540 |
[(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ |
|
2541 |
con := con sender |
|
2542 |
]. |
|
2543 |
||
2544 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
2545 |
con sender receiver == self class ifTrue:[ |
|
2546 |
con := con sender. |
|
2547 |
con sender receiver == self class ifTrue:[ |
|
2548 |
con := con sender methodHome. |
|
2549 |
]. |
|
2550 |
]. |
|
2551 |
||
2552 |
con unwindThenDo:aBlock. |
|
6487 | 2553 |
]. |
2554 |
'DebugView [warning]: abort failed' errorPrintCR |
|
2555 |
||
2556 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
2557 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
2558 |
! |
|
2559 |
||
3447 | 2560 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
2561 |
|selection con1 con2 h| |
|
2562 |
||
2563 |
initialSelectionOrNil notNil ifTrue:[ |
|
16801 | 2564 |
^ initialSelectionOrNil |
3447 | 2565 |
]. |
2566 |
||
2567 |
" |
|
2568 |
and find the one context to show initially |
|
2569 |
- if we came here by a send (single step), its the top context; |
|
2570 |
- if we came here by a step (i.e. bigStep), its the top context |
|
2571 |
(for ifs and whiles) or the sender (for regular sends). |
|
2572 |
- otherwise, we came here by some signal raise, and we are interested |
|
16801 | 2573 |
in the context where the raise actually occurred. |
3447 | 2574 |
" |
2575 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
2576 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
12039 | 2577 |
"/ Transcript show:'x '; showCR:exitAction. |
2578 |
||
2579 |
"/ came here via a step? |
|
3447 | 2580 |
exitAction == #step ifTrue:[ |
16801 | 2581 |
selection := 1. |
2582 |
steppedContext notNil ifTrue:[ |
|
2583 |
||
2584 |
" |
|
2585 |
if we came here by a big-step, show the method where we are |
|
2586 |
" |
|
2587 |
con1 == steppedContext ifTrue:[ |
|
2588 |
selection := 1 |
|
2589 |
] ifFalse:[ |
|
2590 |
con2 == steppedContext ifTrue:[ |
|
2591 |
selection := 2 |
|
2592 |
] |
|
2593 |
]. |
|
2594 |
" |
|
2595 |
for bigStep, we could also be in a block below the actual method ... |
|
2596 |
" |
|
2597 |
((h := con1 home) notNil |
|
2598 |
and:[h == steppedContext]) ifTrue:[ |
|
2599 |
selection := 1 |
|
2600 |
] ifFalse:[ |
|
2601 |
(con2 notNil |
|
2602 |
and:[(h := con2 home) notNil |
|
2603 |
and:[h == steppedContext]]) ifTrue:[ |
|
2604 |
selection := 2 |
|
2605 |
] |
|
2606 |
]. |
|
2607 |
h := nil. |
|
2608 |
] |
|
3447 | 2609 |
] ifFalse:[ |
16801 | 2610 |
steppedContext isNil ifTrue:[ |
2611 |
" |
|
2612 |
preselect a more interesting context, (where halt/raise was ...) |
|
2613 |
" |
|
2614 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
2615 |
selection := self class interestingContextIndexIn:contextArray. |
|
12039 | 2616 |
"/ Transcript show:'x '; showCR:selection. |
16801 | 2617 |
selection := selection min:(contextArray size). |
2618 |
] ifFalse:[ |
|
2619 |
" |
|
2620 |
if we came here by a big-step, show the method where we are |
|
2621 |
" |
|
2622 |
con1 == steppedContext ifTrue:[ |
|
2623 |
selection := 1 |
|
2624 |
] ifFalse:[ |
|
2625 |
con2 == steppedContext ifTrue:[ |
|
2626 |
selection := 2. |
|
2627 |
] |
|
2628 |
] |
|
2629 |
] |
|
3447 | 2630 |
]. |
2631 |
^ selection |
|
2632 |
||
2633 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
2634 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 2635 |
! |
2636 |
||
5110 | 2637 |
isInspecting |
2638 |
^ inspecting |
|
2639 |
! |
|
2640 |
||
2641 |
isNotInspecting |
|
2642 |
^ inspecting not |
|
2643 |
! |
|
2644 |
||
73 | 2645 |
openOn:aProcess |
10205 | 2646 |
"enter the debugger on a process - |
73 | 2647 |
in this case, we are just inspecting the context chain of the process, |
2648 |
not running on top of the debugged process, but as a separate |
|
2649 |
one. (think of it as an inspector showing more detail, and offering |
|
2650 |
some more control operations)" |
|
2651 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2652 |
|bpanel dummy w| |
73 | 2653 |
|
15257 | 2654 |
self verboseBacktraceHolder value:( UserPreferences current verboseBacktraceInDebugger ). |
939 | 2655 |
|
73 | 2656 |
busy := true. |
2657 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2658 |
stepHow := nil. |
73 | 2659 |
inspecting := true. |
2660 |
inspectedProcess := aProcess. |
|
8148 | 2661 |
nChainShown := InitialNChainShown. |
73 | 2662 |
|
2663 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2664 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2665 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2666 |
"/ get the max size & freeze button |
6647 | 2667 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2668 |
w := continueButton preferredWidth. |
6647 | 2669 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2670 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2671 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2672 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2673 |
aProcess state == #run ifTrue:[ |
16253 | 2674 |
device hasColors ifTrue:[ |
2675 |
continueButton foregroundColor:Color red darkened. |
|
2676 |
]. |
|
2677 |
continueButton label:(resources string:'Stop'). |
|
2678 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2679 |
] ifFalse:[ |
16253 | 2680 |
device hasColors ifTrue:[ |
2681 |
continueButton foregroundColor:Color green darkened darkened. |
|
2682 |
]. |
|
2683 |
continueButton label:(resources string:'Continue'). |
|
2684 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2685 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2686 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 2687 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2688 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2689 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2690 |
|
92 | 2691 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 2692 |
dummy borderWidth:0; level:0. |
61 | 2693 |
|
73 | 2694 |
"/ stepButton destroy. |
2695 |
"/ sendButton destroy. |
|
2696 |
||
2697 |
updateButton := Button |
|
16253 | 2698 |
label:(resources string:'Update') |
2699 |
action:[self updateContext] |
|
2700 |
in:bpanel. |
|
73 | 2701 |
monitorToggle := Toggle in:bpanel. |
6647 | 2702 |
monitorToggle label:(resources string:'Monitor'). |
73 | 2703 |
monitorToggle pressAction:[self autoUpdateOn]. |
2704 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
2705 |
||
2706 |
"can only look into process - context chain is not active" |
|
2707 |
canContinue := true. |
|
2708 |
||
2709 |
terminateButton enable. |
|
2710 |
abortButton enable. |
|
2711 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2712 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2713 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2714 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2715 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2716 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 2717 |
|
2718 |
aProcess isNil ifTrue:[ |
|
16253 | 2719 |
terminateButton disable. |
2720 |
abortButton disable. |
|
2721 |
continueButton disable. |
|
2722 |
returnButton disable. |
|
2723 |
restartButton disable. |
|
73 | 2724 |
] ifFalse:[ |
16253 | 2725 |
(aProcess suspendedContext isNil |
2726 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
2727 |
terminateButton disable. |
|
2728 |
]. |
|
2729 |
||
2730 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
2731 |
||
2732 |
catchBlock := [ |
|
2733 |
catchBlock := nil. |
|
2734 |
contextArray := nil. |
|
2735 |
selectedContext := actualContext := firstContext := nil. |
|
2736 |
steppedContext := wrapperContext := nil. |
|
2737 |
||
2738 |
(exitAction == #terminate) ifTrue:[ |
|
2739 |
aProcess terminate. |
|
2740 |
]. |
|
2741 |
(exitAction == #quickTerminate) ifTrue:[ |
|
2742 |
aProcess terminateNoSignal. |
|
2743 |
]. |
|
2744 |
super destroy |
|
2745 |
]. |
|
73 | 2746 |
]. |
2747 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2748 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2749 |
"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
|
2750 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2751 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2752 |
|
13388 | 2753 |
selectContextWithIndex:index |
13362 | 2754 |
self showSelection:index. |
2755 |
contextView setSelection:index. |
|
2756 |
index > 1 ifTrue:[ |
|
17185 | 2757 |
contextView scrollToLine:(index - 1) |
13362 | 2758 |
]. |
2759 |
! |
|
2760 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2761 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 2762 |
|selection| |
2763 |
||
2764 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2765 |
selection notNil ifTrue:[ |
17185 | 2766 |
self selectContextWithIndex:selection |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2767 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2768 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2769 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 2770 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2771 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2772 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2773 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2774 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2775 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2776 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2777 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2778 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2779 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2780 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2781 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2782 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2783 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2784 |
! ! |
2785 |
||
15950 | 2786 |
|
266 | 2787 |
!DebugView methodsFor:'help'! |
2788 |
||
8212 | 2789 |
flyByHelpDependsOnPositionIn:aView |
2790 |
"subclasses where the help-text depends upon the pointer position might |
|
2791 |
want to redefine this" |
|
2792 |
||
2793 |
^ aView == codeView |
|
2794 |
! |
|
2795 |
||
3510 | 2796 |
flyByHelpTextFor:aComponent |
2797 |
|s| |
|
2798 |
||
15774 | 2799 |
aComponent == codeView ifTrue:[ |
2800 |
|point localPoint| |
|
2801 |
||
16253 | 2802 |
point := device pointerPosition. |
2803 |
localPoint := device translatePointFromRoot:point toView:codeView. |
|
15774 | 2804 |
((localPoint x between:0 and:codeView width) |
2805 |
and:[localPoint y between:0 and:codeView height]) |
|
2806 |
ifTrue:[ |
|
2807 |
^ self flyByHelpTextFor:codeView at:localPoint |
|
2808 |
]. |
|
2809 |
^ nil |
|
2810 |
]. |
|
2811 |
||
3510 | 2812 |
aComponent == abortButton ifTrue:[ |
15774 | 2813 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2814 |
]. |
2815 |
aComponent == terminateButton ifTrue:[ |
|
15774 | 2816 |
Processor activeProcess isGUIProcess ifTrue:[ |
16958 | 2817 |
s := 'Terminate the process.\Attention: closes view and shuts down application.' |
15774 | 2818 |
] ifFalse:[ |
16958 | 2819 |
s := 'Terminate the process.\Attention: do not kill a system thread' |
15774 | 2820 |
] |
3510 | 2821 |
]. |
2822 |
aComponent == continueButton ifTrue:[ |
|
15774 | 2823 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2824 |
s := 'Stop' |
|
2825 |
] ifFalse:[ |
|
2826 |
s := 'Continue execution' |
|
2827 |
] |
|
3510 | 2828 |
]. |
2829 |
aComponent == stepButton ifTrue:[ |
|
15774 | 2830 |
s := 'Step to next send in selected context (don''t enter into called methods)' |
3510 | 2831 |
]. |
2832 |
aComponent == nextButton ifTrue:[ |
|
15774 | 2833 |
s := 'Step to next line in selected context (don''t enter into called methods)' |
3510 | 2834 |
]. |
2835 |
aComponent == nextOverButton ifTrue:[ |
|
15774 | 2836 |
s := 'Step over to cursor-line' |
3510 | 2837 |
]. |
2838 |
aComponent == nextOutButton ifTrue:[ |
|
15774 | 2839 |
s := 'Step out to caller' |
3510 | 2840 |
]. |
2841 |
aComponent == sendButton ifTrue:[ |
|
15774 | 2842 |
s := 'Send next message (enter into called methods)' |
3510 | 2843 |
]. |
2844 |
aComponent == returnButton ifTrue:[ |
|
15774 | 2845 |
restartButton enabled ifTrue:[ |
2846 |
s := 'Return from the selected method' |
|
2847 |
] ifFalse:[ |
|
2848 |
s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2849 |
] |
|
3510 | 2850 |
]. |
2851 |
aComponent == restartButton ifTrue:[ |
|
15774 | 2852 |
restartButton enabled ifTrue:[ |
2853 |
s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again' |
|
2854 |
] ifFalse:[ |
|
2855 |
s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2856 |
] |
|
3510 | 2857 |
]. |
13361 | 2858 |
aComponent == resendButton ifTrue:[ |
15774 | 2859 |
resendButton enabled ifTrue:[ |
2860 |
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.' |
|
2861 |
] ifFalse:[ |
|
2862 |
s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs |
|
2863 |
] |
|
13361 | 2864 |
]. |
3510 | 2865 |
aComponent == monitorToggle ifTrue:[ |
15774 | 2866 |
s := 'Toggle monitoring' |
3510 | 2867 |
]. |
2868 |
aComponent == updateButton ifTrue:[ |
|
15774 | 2869 |
s := 'Update' |
3510 | 2870 |
]. |
13464 | 2871 |
aComponent == defineButton ifTrue:[ |
15774 | 2872 |
s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then' |
13464 | 2873 |
]. |
8656 | 2874 |
aComponent == reportButton ifTrue:[ |
15774 | 2875 |
s := 'Send a defect report via eMail' |
8656 | 2876 |
]. |
3510 | 2877 |
s notNil ifTrue:[ |
15774 | 2878 |
^ resources stringWithCRs:s |
3510 | 2879 |
]. |
2880 |
^ nil |
|
2881 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2882 |
"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
|
2883 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2884 |
! |
2885 |
||
8212 | 2886 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2887 |
|s vline line col pos interval| |
8212 | 2888 |
|
2889 |
aComponent == codeView ifFalse:[^ nil]. |
|
2890 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2891 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2892 |
|
8396 | 2893 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2894 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2895 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2896 |
|
2897 |
pos := codeView characterPositionOfLine:line col:col. |
|
2898 |
interval := pos to:pos. |
|
2899 |
||
10205 | 2900 |
self |
17126 | 2901 |
withNodeValueAtInterval:interval |
2902 |
do:[:value :description | |
|
2903 |
|valueClassOrSizeString valueString| |
|
2904 |
||
2905 |
valueClassOrSizeString := valueString := ''. |
|
2906 |
||
2907 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2908 |
value isString ifTrue:[ |
|
2909 |
value isText ifTrue:[ |
|
2910 |
valueString := '"',(value contractTo:80),'"'. |
|
2911 |
] ifFalse:[ |
|
2912 |
valueString := value storeString contractTo:80. |
|
2913 |
]. |
|
2914 |
] ifFalse:[ |
|
2915 |
(value isBoolean |
|
2916 |
or:[ value isInteger |
|
2917 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2918 |
valueString := value printString. |
|
2919 |
] ifFalse:[ |
|
2920 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2921 |
||
2922 |
(value isArray |
|
2923 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2924 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2925 |
]. |
|
2926 |
||
2927 |
Error handle:[:ex | |
|
2928 |
valueString := '??? (',ex description,')' |
|
2929 |
] do:[ |
|
2930 |
[ |
|
2931 |
valueString := value printString contractTo:80. |
|
2932 |
] valueWithWatchDog:[ valueString := value class nameWithArticle ] afterMilliseconds:30. |
|
2933 |
"do not use classNameWithArticle - it is missing in ProtoObject!!" |
|
2934 |
] |
|
2935 |
] |
|
2936 |
]. |
|
2937 |
description isEmptyOrNil ifTrue:[ |
|
2938 |
s := valueString , valueClassOrSizeString |
|
2939 |
] ifFalse:[ |
|
2940 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2941 |
]. |
|
2942 |
]. |
|
8592 | 2943 |
"/ Transcript showCR:s. |
2944 |
^ s |
|
9446 | 2945 |
|
2946 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2947 |
! |
2948 |
||
266 | 2949 |
helpTextFor:aComponent |
2950 |
|s| |
|
2951 |
||
2952 |
aComponent == abortButton ifTrue:[ |
|
17185 | 2953 |
s := 'HELP_ABORT' |
266 | 2954 |
]. |
2955 |
aComponent == terminateButton ifTrue:[ |
|
17185 | 2956 |
s := 'HELP_TERMINATE' |
266 | 2957 |
]. |
2958 |
aComponent == continueButton ifTrue:[ |
|
17185 | 2959 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2960 |
s := 'HELP_STOP' |
|
2961 |
] ifFalse:[ |
|
2962 |
s := 'HELP_CONTINUE' |
|
2963 |
] |
|
266 | 2964 |
]. |
2965 |
aComponent == stepButton ifTrue:[ |
|
17185 | 2966 |
s := 'HELP_STEP' |
266 | 2967 |
]. |
2968 |
aComponent == nextButton ifTrue:[ |
|
17185 | 2969 |
s := 'HELP_NEXT' |
266 | 2970 |
]. |
1065 | 2971 |
aComponent == nextOverButton ifTrue:[ |
17185 | 2972 |
s := 'HELP_NEXTOVER' |
1065 | 2973 |
]. |
2974 |
aComponent == nextOutButton ifTrue:[ |
|
17185 | 2975 |
s := 'HELP_NEXTOUT' |
1065 | 2976 |
]. |
266 | 2977 |
aComponent == stepButton ifTrue:[ |
17185 | 2978 |
s := 'HELP_STEP' |
266 | 2979 |
]. |
2980 |
aComponent == sendButton ifTrue:[ |
|
17185 | 2981 |
s := 'HELP_SEND' |
266 | 2982 |
]. |
2983 |
aComponent == returnButton ifTrue:[ |
|
17185 | 2984 |
returnButton enabled ifTrue:[ |
2985 |
s := 'HELP_RETURN' |
|
2986 |
] ifFalse:[ |
|
2987 |
s := 'HELP_RETURN_DISABLED' |
|
2988 |
]. |
|
266 | 2989 |
]. |
2990 |
aComponent == restartButton ifTrue:[ |
|
17185 | 2991 |
restartButton enabled ifTrue:[ |
2992 |
s := 'HELP_RESTART' |
|
2993 |
] ifFalse:[ |
|
2994 |
s := 'HELP_RESTART_DISABLED' |
|
2995 |
]. |
|
266 | 2996 |
]. |
13361 | 2997 |
aComponent == resendButton ifTrue:[ |
17185 | 2998 |
resendButton enabled ifTrue:[ |
2999 |
s := 'HELP_RESEND' |
|
3000 |
] ifFalse:[ |
|
3001 |
s := 'HELP_RESEND_DISABLED' |
|
3002 |
]. |
|
13361 | 3003 |
]. |
266 | 3004 |
aComponent == contextView ifTrue:[ |
17185 | 3005 |
s := 'HELP_WALKBACK' |
266 | 3006 |
]. |
3007 |
aComponent == codeView ifTrue:[ |
|
17185 | 3008 |
s := 'HELP_CODEVIEW' |
266 | 3009 |
]. |
3010 |
aComponent == monitorToggle ifTrue:[ |
|
17185 | 3011 |
s := 'HELP_MONITOR' |
266 | 3012 |
]. |
3013 |
aComponent == updateButton ifTrue:[ |
|
17185 | 3014 |
s := 'HELP_UPDATE' |
266 | 3015 |
]. |
14523 | 3016 |
aComponent == gotoDialogOpenerButton ifTrue:[ |
17185 | 3017 |
s := 'HELP_GOTO_DIALOG_OPENER' |
14523 | 3018 |
]. |
3019 |
aComponent == gotoApplicationActionMethodButton ifTrue:[ |
|
17185 | 3020 |
s := 'HELP_GOTO_APPLICATION_ACTION' |
14523 | 3021 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
3022 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
3023 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
3024 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
3025 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
17185 | 3026 |
s := 'HELP_REC_INSP' |
266 | 3027 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
3028 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
17185 | 3029 |
s := 'HELP_CON_INSP' |
266 | 3030 |
]. |
3031 |
||
3032 |
s notNil ifTrue:[ |
|
17185 | 3033 |
^ resources stringWithCRs:s |
266 | 3034 |
]. |
3035 |
^ nil |
|
3036 |
||
3037 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 3038 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 3039 |
! ! |
3040 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3041 |
!DebugView methodsFor:'initialization & release'! |
266 | 3042 |
|
3043 |
addToCurrentProject |
|
3044 |
"ignored here" |
|
3045 |
||
3046 |
^ self |
|
3047 |
! |
|
3048 |
||
2115 | 3049 |
destroy |
3050 |
"closing the debugger implies an abort or continue" |
|
3051 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3052 |
self destroyWithConfirmation:true |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3053 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3054 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3055 |
"Modified: / 23-03-2012 / 12:50:01 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3056 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3057 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3058 |
destroyWithConfirmation:withConfirmation |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3059 |
"closing the debugger implies an abort or continue" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3060 |
|
2404 | 3061 |
|m| |
3062 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3063 |
withConfirmation ifTrue:[ |
16960 | 3064 |
self checkIfCodeIsReallyModified ifTrue:[ |
3065 |
(self confirm:('Code was modified.\\Exit anyway ?')) |
|
3066 |
ifFalse:[ |
|
3067 |
^ self |
|
3068 |
] |
|
3069 |
] |
|
2115 | 3070 |
]. |
3071 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
3072 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
3073 |
|
2404 | 3074 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 3075 |
inspecting ifFalse:[ |
16960 | 3076 |
"I am running on top of a process, abort or continue it" |
3077 |
||
3078 |
windowGroup notNil ifTrue:[ |
|
3079 |
windowGroup setProcess:nil. |
|
3080 |
]. |
|
3081 |
self uncacheMyself. |
|
3082 |
||
3083 |
"/ |
|
3084 |
"/ catch invalid return; |
|
3085 |
"/ this happens, when my process has somehow died (quickterminate) |
|
3086 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
3087 |
"/ #destroy-window function. |
|
3088 |
"/ |
|
3089 |
Context cannotReturnSignal handle:[:ex | |
|
3090 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
3091 |
self uncacheMyself. |
|
3092 |
Debugger newDebugger. |
|
3093 |
ex return. |
|
3094 |
] do:[ |
|
3095 |
AbortOperationRequest isHandled ifTrue:[ |
|
3096 |
self doAbort. |
|
3097 |
] ifFalse:[ |
|
3098 |
self doContinue |
|
3099 |
] |
|
3100 |
]. |
|
3101 |
"/ We don't reach this point normally |
|
3102 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2115 | 3103 |
]. |
3104 |
||
2299 | 3105 |
Debugger newDebugger. |
2115 | 3106 |
"/ since I am going to be destroyed, remove me from the cache |
3107 |
self uncacheMyself. |
|
3108 |
super destroy. |
|
3109 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3110 |
"Modified: / 10-07-1997 / 17:15:41 / stefan" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
3111 |
"Created: / 23-03-2012 / 12:49:50 / cg" |
2115 | 3112 |
! |
3113 |
||
266 | 3114 |
initialize |
10205 | 3115 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
17181 | 3116 |
newLayout v exceptionAndTogglePanel codeToggleLabels| |
266 | 3117 |
|
3118 |
super initialize. |
|
3119 |
||
17176 | 3120 |
self initializeFlags. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
3121 |
|
266 | 3122 |
busy := false. |
3123 |
exclusive := false. |
|
3124 |
inspecting := false. |
|
3125 |
exitAction := nil. |
|
3126 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3127 |
stepHow := nil. |
266 | 3128 |
canContinue := false. |
3129 |
||
3269 | 3130 |
mH := 0. |
3131 |
||
3447 | 3132 |
menuPanel := MenuPanel in:self. |
8131 | 3133 |
menuPanel receiver:self. |
3447 | 3134 |
menuPanel verticalLayout:false. |
8131 | 3135 |
menu := self class menuSpec decodeAsLiteralArray. |
3136 |
menu findGuiResourcesIn:self. |
|
3137 |
menuPanel menu:menu. |
|
3447 | 3138 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
3139 |
mH := menuPanel preferredHeight. |
3447 | 3140 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
3141 |
||
17181 | 3142 |
newLayout := UserPreferences current useNewLayoutInDebugger. |
8148 | 3143 |
newLayout ifFalse:[ |
17176 | 3144 |
bpanel := HorizontalPanelView in:self. |
3145 |
||
3146 |
self initializeButtonsIn:bpanel. |
|
3147 |
||
3148 |
bH := bpanel preferredHeight + 5. |
|
3149 |
bpanel origin:(0.0 @ mH) |
|
3150 |
extent:(1.0 @ bH). |
|
3151 |
panel := VariableVerticalPanel |
|
3152 |
origin:(0.0 @ (mH + bH)) |
|
3153 |
corner:(1.0 @ 1.0) |
|
3154 |
in:self. |
|
3155 |
||
3156 |
v := self initializeContextListViewIn:panel. |
|
3157 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
3158 |
||
3159 |
codePanel := View in:panel. |
|
3160 |
v := self initializeCodeViewIn:codePanel. |
|
3161 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
3162 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3163 |
||
3164 |
v := self initializeInspectorViewsIn:panel. |
|
3165 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3166 |
|
8148 | 3167 |
] ifTrue:[ |
17176 | 3168 |
bpanel1 := HorizontalPanelView in:self. |
3169 |
self initializeButtons1In:bpanel1. |
|
3170 |
||
3171 |
contextInfoLabel := Label label:''. |
|
3172 |
contextInfoLabel adjust:#left. |
|
3173 |
bpanel1 add:contextInfoLabel. |
|
3174 |
||
3175 |
bH1 := bpanel1 preferredHeight + 5. |
|
3176 |
bpanel1 origin:(0.0 @ mH) |
|
3177 |
extent:(1.0 @ bH1). |
|
3178 |
panel := VariableVerticalPanel |
|
3179 |
origin:(0.0 @ (mH + bH1)) |
|
3180 |
corner:(1.0 @ 1.0) |
|
3181 |
in:self. |
|
3182 |
"/ panel showHandle:true. |
|
3183 |
"/ panel handlePosition:#left. |
|
3184 |
||
3185 |
v := self initializeContextListViewIn:panel. |
|
3186 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
3187 |
||
3188 |
codePanel := View in:panel. |
|
3189 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
3190 |
self initializeButtons2In:bpanel2. |
|
3191 |
||
3192 |
bH2 := bpanel2 preferredHeight + 5. |
|
3193 |
bpanel2 origin:(0.0 @ 0.0) |
|
3194 |
extent:(1.0 @ bH2). |
|
3195 |
||
3196 |
exceptionInfoLabel := Label label:''. |
|
3197 |
exceptionInfoLabel adjust:#left. |
|
3198 |
||
3199 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
3200 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
3201 |
exceptionAndTogglePanel |
|
3202 |
geometryLayout: |
|
3203 |
((LayoutFrame |
|
3204 |
origin:(0.0 @ 0.0) |
|
3205 |
corner:(1.0 @ 0.0)) |
|
3206 |
topOffset:bH2; |
|
3207 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
3208 |
rightOffset:-2). |
|
3209 |
||
3210 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
3211 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
3212 |
codeToggleLabels := resources array:{ |
|
3213 |
'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
|
3214 |
'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
|
3215 |
}. |
|
3216 |
methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
|
3217 |
methodCodeToggle list:codeToggleLabels. |
|
3218 |
methodCodeToggle useIndex:true. |
|
3219 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
3220 |
methodCodeToggle beInvisible. |
|
3221 |
||
3222 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
3223 |
||
3224 |
v := self initializeCodeViewIn:codePanel. |
|
3225 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
3226 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
3227 |
||
3228 |
v := self initializeInspectorViewsIn:panel. |
|
3229 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 3230 |
]. |
3231 |
||
3387 | 3232 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
17176 | 3233 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3234 |
]. |
9626 | 3235 |
LastExtent notNil ifTrue:[ |
17176 | 3236 |
self extent:LastExtent. |
9626 | 3237 |
]. |
3238 |
LastOrigin notNil ifTrue:[ |
|
17176 | 3239 |
self origin:LastOrigin. |
9626 | 3240 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
3241 |
|
3269 | 3242 |
" |
3243 |
Debugger newDebugger |
|
3244 |
" |
|
3447 | 3245 |
|
11693 | 3246 |
"Modified: / 27-07-2012 / 14:46:07 / cg" |
3269 | 3247 |
! |
3248 |
||
10205 | 3249 |
initializeAbortButtonIn:bpanel |
3250 |
abortButton := Button |
|
16134 | 3251 |
label:(resources string:'Abort') |
3252 |
action:[ |
|
3253 |
abortButton turnOffWithoutRedraw. |
|
3254 |
self doAbort |
|
3255 |
] |
|
3256 |
in:bpanel. |
|
3257 |
||
3258 |
abortButton name:'abortButton'. |
|
3447 | 3259 |
|
3260 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
3261 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
3262 |
! |
|
3263 |
||
10205 | 3264 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3265 |
"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
|
3266 |
|
16958 | 3267 |
|separator buttonWidth| |
3268 |
||
3269 |
buttonWidth := 170. |
|
3270 |
||
10205 | 3271 |
bpanel horizontalLayout:#left. |
3447 | 3272 |
bpanel verticalLayout:#centerMax. |
3273 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3274 |
||
8194 | 3275 |
self initializeContinueButtonIn:bpanel. |
16958 | 3276 |
continueButton width:buttonWidth. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3277 |
|
9131 | 3278 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
3279 |
"/ separator borderWidth:0; level:0. |
|
3447 | 3280 |
self initializeAbortButtonIn:bpanel. |
16958 | 3281 |
abortButton width:buttonWidth. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3282 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3283 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3284 |
separator borderWidth:0; level:0. |
3269 | 3285 |
|
3447 | 3286 |
self initializeTerminateButtonIn:bpanel. |
3287 |
||
9131 | 3288 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 3289 |
separator borderWidth:0; level:0. |
3290 |
||
13362 | 3291 |
self initializeGotoDialogOpenerButtonIn:bpanel. |
14523 | 3292 |
self initializeGotoApplicationActionMethodButtonIn:bpanel. |
3447 | 3293 |
self initializeDefineButtonIn:bpanel. |
14523 | 3294 |
|
4356 | 3295 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
16958 | 3296 |
separator := View extent:(10 @ 5) in:bpanel. |
3297 |
separator borderWidth:0; level:0. |
|
3298 |
self initializeReportButtonIn:bpanel. |
|
4356 | 3299 |
]. |
3447 | 3300 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 3301 |
! |
3302 |
||
10205 | 3303 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
3304 |
"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
|
3305 |
|
16958 | 3306 |
|separator buttonWidth| |
3307 |
||
3308 |
buttonWidth := 130. |
|
3269 | 3309 |
|
9131 | 3310 |
bpanel horizontalLayout:#left. |
3269 | 3311 |
bpanel verticalLayout:#centerMax. |
3312 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3313 |
||
3447 | 3314 |
self initializeNextButtonIn:bpanel. |
16958 | 3315 |
nextButton width:buttonWidth. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3316 |
|
3447 | 3317 |
self initializeStepButtonIn:bpanel. |
16958 | 3318 |
stepButton width:buttonWidth. |
3447 | 3319 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3320 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3321 |
"/ 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
|
3322 |
"/ 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
|
3323 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3324 |
|
3269 | 3325 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3326 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3327 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3328 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3329 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3330 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3331 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3332 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3333 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3334 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3335 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3336 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3337 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3338 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3339 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3340 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3341 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3342 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3343 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3344 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3345 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3346 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3347 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3348 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3349 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3350 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
3351 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3352 |
|
3447 | 3353 |
self initializeSendButtonIn:bpanel. |
16958 | 3354 |
sendButton width:buttonWidth. |
3447 | 3355 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3356 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
3357 |
separator borderWidth:0; level:0. |
3269 | 3358 |
|
3447 | 3359 |
self initializeReturnButtonIn:bpanel. |
16958 | 3360 |
returnButton width:buttonWidth. |
3447 | 3361 |
self initializeRestartButtonIn:bpanel. |
16958 | 3362 |
restartButton width:buttonWidth. |
13360 | 3363 |
self initializeResendButtonIn:bpanel. |
16958 | 3364 |
resendButton width:buttonWidth. |
3447 | 3365 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
3366 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 3367 |
! |
3368 |
||
10205 | 3369 |
initializeButtonsIn:bpanel |
3269 | 3370 |
|separator| |
3371 |
||
3372 |
bpanel horizontalLayout:#left. |
|
3373 |
bpanel verticalLayout:#centerMax. |
|
3374 |
bpanel verticalSpace:ViewSpacing // 2. |
|
3375 |
||
3447 | 3376 |
self initializeAbortButtonIn:bpanel. |
3377 |
||
3269 | 3378 |
separator := View extent:(10 @ 5) in:bpanel. |
3379 |
separator borderWidth:0; level:0. |
|
3380 |
||
3447 | 3381 |
self initializeContinueButtonIn:bpanel. |
3269 | 3382 |
|
3383 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3384 |
separator borderWidth:0; level:0. |
|
3385 |
||
10205 | 3386 |
self initializeReturnButtonIn:bpanel. |
3387 |
self initializeRestartButtonIn:bpanel. |
|
13360 | 3388 |
self initializeResendButtonIn:bpanel. |
3269 | 3389 |
|
3390 |
separator := View extent:(10 @ 5) in:bpanel. |
|
3391 |
separator borderWidth:0; level:0. |
|
3392 |
||
3447 | 3393 |
self initializeNextButtonIn:bpanel. |
3394 |
self initializeStepButtonIn:bpanel. |
|
3395 |
||
3269 | 3396 |
"/ cg: |
3397 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
3398 |
"/ they do not work relyable with inlined blocks yet. |
|
3399 |
"/ |
|
3400 |
||
3401 |
||
3402 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
3403 |
"/ img isNil ifTrue:[ |
|
3404 |
"/ img := (resources at:'next') |
|
3405 |
"/ ]. |
|
3406 |
"/ nextButton := Button |
|
3407 |
"/ label:img |
|
3408 |
"/ action:[stepButton turnOff. self doNext] |
|
3409 |
"/ in:bpanel. |
|
3410 |
"/ |
|
3411 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
3412 |
"/ img isNil ifTrue:[ |
|
3413 |
"/ img := (resources at:'over') |
|
3414 |
"/ ]. |
|
3415 |
"/ nextOverButton := Button |
|
3416 |
"/ label:img |
|
3417 |
"/ action:[stepButton turnOff. self doNextOver] |
|
3418 |
"/ in:bpanel. |
|
3419 |
"/ |
|
3420 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
3421 |
"/ img isNil ifTrue:[ |
|
3422 |
"/ img := (resources at:'out') |
|
3423 |
"/ ]. |
|
3424 |
"/ nextOutButton := Button |
|
3425 |
"/ label:img |
|
3426 |
"/ action:[stepButton turnOff. self doNextOut] |
|
3427 |
"/ in:bpanel. |
|
3428 |
||
3447 | 3429 |
self initializeSendButtonIn:bpanel. |
3430 |
||
3187 | 3431 |
separator := View extent:(30 @ 5) in:bpanel. |
3432 |
separator borderWidth:0; level:0. |
|
3269 | 3433 |
|
3447 | 3434 |
self initializeTerminateButtonIn:bpanel. |
3435 |
||
3269 | 3436 |
separator := View extent:(30 @ 5) in:bpanel. |
3437 |
separator borderWidth:0; level:0. |
|
3438 |
||
3447 | 3439 |
self initializeDefineButtonIn:bpanel. |
4356 | 3440 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
17185 | 3441 |
self initializeReportButtonIn:bpanel. |
4356 | 3442 |
]. |
3443 |
||
3447 | 3444 |
|
3445 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
3446 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 3447 |
! |
3448 |
||
3449 |
initializeCodeViewIn:panel |
|
13519 | 3450 |
|scrollableCodeView| |
3269 | 3451 |
|
10628 | 3452 |
(UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
17185 | 3453 |
scrollableCodeView := codeView := Tools::CodeView2 new. |
3454 |
codeView model: ValueHolder new. |
|
3455 |
codeView methodHolder: ValueHolder new. |
|
3456 |
codeView classHolder: ValueHolder new. |
|
10628 | 3457 |
] ifFalse:[ |
17185 | 3458 |
scrollableCodeView := HVScrollableView |
3459 |
for:CodeView |
|
3460 |
miniScrollerH:true |
|
3461 |
miniScrollerV:false |
|
3462 |
in:panel. |
|
3463 |
||
3464 |
codeView := scrollableCodeView scrolledView. |
|
3465 |
codeView enableMotionEvents. "/ for active help |
|
15413 | 3466 |
]. |
3467 |
||
3468 |
(UserPreferences current showAcceptCancelBarInBrowser |
|
17185 | 3469 |
and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[ |
3470 |
ViewWithAcceptAndCancelBar notNil ifTrue:[ |
|
3471 |
|v| |
|
3472 |
||
3473 |
v := ViewWithAcceptAndCancelBar new. |
|
3474 |
v slaveView:scrollableCodeView. |
|
3475 |
v reallyModifiedHolder:(codeView isCodeView2 |
|
3476 |
ifTrue:[ codeView reallyModifiedChannel ] |
|
3477 |
ifFalse:[ |
|
3478 |
BlockValue |
|
3479 |
with:[:m | |
|
3480 |
|same| |
|
3481 |
||
3482 |
same := (codeView contentsAsString string = currentMethod source string). |
|
3483 |
codeView modifiedChannel setValue:false. "/ so it triggers again |
|
3484 |
same not. |
|
3485 |
] |
|
3486 |
argument:codeView modifiedChannel |
|
3487 |
]). |
|
3488 |
v cancelAction: |
|
3489 |
[ |
|
3490 |
"/ codeView setClipboardText:(codeView contents). "/ for undo |
|
3491 |
codeView device rememberInCopyBufferHistory:(codeView contents). "/ for undo |
|
3492 |
codeView contents:(currentMethod source). |
|
3493 |
codeView modifiedChannel setValue:false; changed. "/ trigger |
|
3494 |
codeView requestFocus. |
|
3495 |
]. |
|
3496 |
v compareAction: |
|
3497 |
[ |
|
3498 |
v := DiffCodeView |
|
3499 |
openOn:codeView contentsAsString |
|
3500 |
label:(resources string:'Changed definition (to be accepted ?)') |
|
3501 |
and:currentMethod source |
|
3502 |
label:(resources string:'Method''s Original Code'). |
|
3503 |
v label:(resources string:'Changed Code in Debugger'). |
|
3504 |
v waitUntilVisible. |
|
3505 |
"/ codeView requestFocus |
|
3506 |
]. |
|
3507 |
scrollableCodeView := v. |
|
3508 |
] |
|
13519 | 3509 |
]. |
3510 |
||
3511 |
panel add:scrollableCodeView. |
|
3512 |
^ scrollableCodeView |
|
10628 | 3513 |
|
13842 | 3514 |
"Modified: / 06-12-2013 / 17:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3269 | 3515 |
! |
3516 |
||
3517 |
initializeContextListViewIn:panel |
|
3518 |
|v| |
|
266 | 3519 |
|
10205 | 3520 |
v := HVScrollableView |
17185 | 3521 |
for:SelectionInListView |
3522 |
miniScrollerH:true |
|
3523 |
miniScrollerV:false |
|
3524 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
3525 |
v autoHideHorizontalScrollBar:true. |
266 | 3526 |
|
3527 |
contextView := v scrolledView. |
|
3528 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 3529 |
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
|
3530 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 3531 |
|
10205 | 3532 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 3533 |
|
3269 | 3534 |
^ v |
3535 |
! |
|
3536 |
||
5453 | 3537 |
initializeContextViewsMiddleButtonMenu |
3538 |
<resource: #programMenu > |
|
3539 |
||
10205 | 3540 |
contextView middleButtonMenu:(self middleButtonMenu). |
3541 |
! |
|
3542 |
||
3543 |
initializeContinueButtonIn:bpanel |
|
3544 |
continueButton := Button |
|
16134 | 3545 |
label:(resources string:'Continue') |
3546 |
action:[ |
|
3547 |
continueButton turnOffWithoutRedraw. |
|
3548 |
self doContinue |
|
3549 |
] |
|
3550 |
in:bpanel. |
|
3551 |
||
3552 |
continueButton name:'continueButton'. |
|
3447 | 3553 |
|
3554 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
3555 |
! |
|
3556 |
||
10205 | 3557 |
initializeDefineButtonIn:bpanel |
3558 |
defineButton := Button |
|
16134 | 3559 |
label:(resources string:'Define') |
3560 |
action:[ |
|
3561 |
defineButton turnOffWithoutRedraw. |
|
3562 |
self doDefine |
|
3563 |
] |
|
3564 |
in:bpanel. |
|
3565 |
||
3566 |
defineButton name:'defineButton'. |
|
3447 | 3567 |
defineButton beInvisible |
3568 |
||
3569 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
3570 |
! |
|
3571 |
||
17176 | 3572 |
initializeFlags |
3573 |
|userPrefs| |
|
3574 |
||
3575 |
userPrefs := UserPreferences current. |
|
3576 |
self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger). |
|
3577 |
hideSupportCode := userPrefs hideSupportCodeInDebugger ? false. |
|
3578 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
|
3579 |
"/ the debugger |
|
3580 |
! |
|
3581 |
||
14523 | 3582 |
initializeGotoApplicationActionMethodButtonIn:bpanel |
3583 |
gotoApplicationActionMethodButton := Button |
|
16134 | 3584 |
label:(resources string:'Goto Responsible Application Method') |
3585 |
action:[ |
|
3586 |
gotoApplicationActionMethodButton turnOffWithoutRedraw. |
|
3587 |
self doGotoApplicationActionMethod |
|
3588 |
] |
|
3589 |
in:bpanel. |
|
3590 |
||
3591 |
gotoApplicationActionMethodButton name:'gotoAppMethodButton'. |
|
14523 | 3592 |
gotoApplicationActionMethodButton beInvisible |
3593 |
! |
|
3594 |
||
13362 | 3595 |
initializeGotoDialogOpenerButtonIn:bpanel |
3596 |
gotoDialogOpenerButton := Button |
|
16134 | 3597 |
label:(resources string:'Goto Dialog Opener') |
3598 |
action:[ |
|
3599 |
gotoDialogOpenerButton turnOffWithoutRedraw. |
|
3600 |
self doGotoDialogOpener |
|
3601 |
] |
|
3602 |
in:bpanel. |
|
3603 |
||
3604 |
gotoDialogOpenerButton name:'gotoDialogOpenerButton'. |
|
13362 | 3605 |
gotoDialogOpenerButton beInvisible |
3606 |
! |
|
3607 |
||
3269 | 3608 |
initializeInspectorViewsIn:panel |
3609 |
|hpanel| |
|
266 | 3610 |
|
3611 |
hpanel := VariableHorizontalPanel in:panel. |
|
3612 |
||
3613 |
receiverInspector := InspectorView |
|
17185 | 3614 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
3615 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3616 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 3617 |
|
3618 |
contextInspector := ContextInspectorView |
|
17185 | 3619 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
3620 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
3621 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3622 |
|
3269 | 3623 |
^ hpanel |
266 | 3624 |
! |
3625 |
||
10205 | 3626 |
initializeNextButtonIn:bpanel |
3627 |
nextButton := Button |
|
16134 | 3628 |
label:(resources string:'Debug_Next') |
3629 |
action:[ |
|
3630 |
stepButton turnOff. |
|
3631 |
self doNext |
|
3632 |
] |
|
3633 |
in:bpanel. |
|
3634 |
||
3635 |
nextButton name:'nextButton'. |
|
3636 |
||
3637 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
3447 | 3638 |
! |
3639 |
||
10205 | 3640 |
initializeReportButtonIn:bpanel |
3641 |
reportButton := Button |
|
16134 | 3642 |
label:(resources string:'Report by Mail...') |
3643 |
action:[ |
|
3644 |
reportButton turnOffWithoutRedraw. |
|
3645 |
self doOpenReportMailApp. |
|
3646 |
] |
|
3647 |
in:bpanel. |
|
3648 |
||
3649 |
reportButton name:'reportButton'. |
|
4356 | 3650 |
|
3651 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
3652 |
! |
|
3653 |
||
13360 | 3654 |
initializeResendButtonIn:bpanel |
3655 |
resendButton := Button |
|
16134 | 3656 |
label:(resources string:'Resend') |
3657 |
action:[ |
|
3658 |
resendButton turnOff. |
|
3659 |
self doResend |
|
3660 |
] |
|
3661 |
in:bpanel. |
|
3662 |
||
3663 |
resendButton name:'resendButton'. |
|
13490 | 3664 |
|
3665 |
"/ if we have this, we do not need the restart button |
|
3666 |
restartButton beInvisible. |
|
13360 | 3667 |
! |
3668 |
||
10205 | 3669 |
initializeRestartButtonIn:bpanel |
3670 |
restartButton := Button |
|
16134 | 3671 |
label:(resources string:'Restart') |
3672 |
action:[ |
|
3673 |
restartButton turnOff. |
|
3674 |
self doRestart |
|
3675 |
] |
|
3676 |
in:bpanel. |
|
3677 |
||
3678 |
restartButton name:'restartButton' |
|
3679 |
||
3447 | 3680 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
3681 |
! |
|
3682 |
||
10205 | 3683 |
initializeReturnButtonIn:bpanel |
3684 |
returnButton := Button |
|
16134 | 3685 |
label:(resources string:'Return') |
3686 |
action:[ |
|
3687 |
returnButton turnOff. |
|
3688 |
self doReturn |
|
3689 |
] |
|
3690 |
in:bpanel. |
|
3691 |
||
3692 |
returnButton name:'returnButton'. |
|
3447 | 3693 |
|
3694 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
3695 |
! |
|
3696 |
||
10205 | 3697 |
initializeSendButtonIn:bpanel |
3698 |
sendButton := Button |
|
16134 | 3699 |
label:(resources string:'Send') |
3700 |
action:[ |
|
3701 |
sendButton turnOff. |
|
3702 |
self doSend |
|
3703 |
] |
|
3704 |
in:bpanel. |
|
3705 |
||
3706 |
sendButton name:'sendButton'. |
|
3447 | 3707 |
|
3708 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
3709 |
! |
|
3710 |
||
10205 | 3711 |
initializeStepButtonIn:bpanel |
3712 |
stepButton := Button |
|
16134 | 3713 |
label:(resources string:'Debug_Step') |
3714 |
action:[ |
|
3715 |
stepButton turnOff. |
|
3716 |
self doStep |
|
3717 |
] |
|
3718 |
in:bpanel. |
|
3719 |
||
3720 |
stepButton name:'stepButton'. |
|
3447 | 3721 |
|
3722 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
3723 |
! |
|
3724 |
||
10205 | 3725 |
initializeTerminateButtonIn:bpanel |
3726 |
terminateButton := Button |
|
16134 | 3727 |
label:(resources string:'Debug_Terminate') |
3728 |
action:[ |
|
3729 |
terminateButton turnOffWithoutRedraw. |
|
3730 |
self doTerminate |
|
3731 |
] |
|
3732 |
in:bpanel. |
|
3733 |
||
3734 |
terminateButton name:'terminateButton'. |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3735 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3736 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
3737 |
|
3447 | 3738 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 3739 |
! |
3740 |
||
1249 | 3741 |
postRealize |
3742 |
super postRealize. |
|
266 | 3743 |
|
3744 |
inspecting ifTrue:[ |
|
17185 | 3745 |
inspectedProcess notNil ifTrue:[ |
3746 |
" |
|
3747 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
3748 |
to run between mine and the debugged processes prio) |
|
3749 |
" |
|
3750 |
Processor activeProcess |
|
3751 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
3752 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3753 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3754 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3755 |
self sensor addEventListener:self. |
1249 | 3756 |
|
3757 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 3758 |
! |
3759 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3760 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3761 |
"/ 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
|
3762 |
"/ 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
|
3763 |
|
13965 | 3764 |
self drawableId notNil ifTrue:[ |
17185 | 3765 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3766 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3767 |
"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
|
3768 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3769 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3770 |
|
11818 | 3771 |
releaseDebuggee |
3772 |
"We have to be careful to release all refs to the debuggee, |
|
3773 |
because we may be in the cache. |
|
3774 |
Otherwise, the GC will not be able to release it" |
|
3775 |
||
3776 |
busy := false. |
|
3777 |
||
3778 |
codeView acceptAction:nil. |
|
3779 |
codeView doItAction:nil. |
|
3780 |
codeView contents:nil. |
|
3781 |
||
3782 |
receiverInspector release. |
|
3783 |
contextInspector release. |
|
3784 |
inspectedProcess := nil. |
|
3785 |
contextArray := nil. |
|
13361 | 3786 |
((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[ |
17185 | 3787 |
selectedContext := nil. |
11818 | 3788 |
]. |
3789 |
actualContext := firstContext := nil. |
|
3790 |
steppedContext := wrapperContext := nil. |
|
3791 |
catchBlock := nil. |
|
3792 |
grabber := nil. |
|
3793 |
self autoUpdateOff. |
|
3794 |
||
3795 |
"Created: / 10-07-1997 / 14:57:51 / stefan" |
|
3796 |
"Modified: / 26-09-2012 / 15:08:21 / cg" |
|
3797 |
! |
|
3798 |
||
266 | 3799 |
setLabelFor:aMessage in:aProcess |
16984 | 3800 |
|l lines processNameOrNil pidOrNil osPidString colorUsed| |
6821 | 3801 |
|
3802 |
lines := aMessage asStringCollection. |
|
3803 |
lines size > 1 ifTrue:[ |
|
16501 | 3804 |
l := lines first |
6821 | 3805 |
] ifFalse:[ |
16501 | 3806 |
l := aMessage. |
6821 | 3807 |
]. |
3808 |
||
3809 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
3810 |
Error handle:[:ex | |
16501 | 3811 |
l := l , '???' |
1030 | 3812 |
] do:[ |
16501 | 3813 |
processNameOrNil := aProcess name. |
3814 |
processNameOrNil notNil ifTrue:[ |
|
3815 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
3816 |
]. |
|
3817 |
pidOrNil := aProcess id printString. |
|
3818 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 3819 |
]. |
1030 | 3820 |
l := l , ')'. |
266 | 3821 |
self label:l. |
6821 | 3822 |
|
10205 | 3823 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
16501 | 3824 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
9403 | 3825 |
]. |
3826 |
||
8305 | 3827 |
exceptionInfoLabel notNil ifTrue:[ |
16984 | 3828 |
colorUsed := isStoppedAtHaltOrBreakPoint |
3829 |
ifTrue:[ Color orange ] |
|
3830 |
ifFalse:[ Color red ]. |
|
16985 | 3831 |
colorUsed := colorUsed contrastingColorFor:exceptionInfoLabel backgroundColor. |
16984 | 3832 |
|
16501 | 3833 |
exceptionInfoLabel |
3834 |
label:(resources |
|
3835 |
string:'%1 in process %2 [%3]%4' |
|
16984 | 3836 |
with:(lines first withColor:colorUsed) |
16501 | 3837 |
with:(processNameOrNil ? '') |
3838 |
with:(pidOrNil ? '') |
|
3839 |
with:(osPidString ? '')) |
|
8305 | 3840 |
]. |
3841 |
||
6821 | 3842 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 3843 |
! ! |
3844 |
||
3845 |
!DebugView methodsFor:'interrupt handling'! |
|
3846 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3847 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3848 |
DebuggingDebugger == true ifTrue:[ |
17185 | 3849 |
'contextIRQ' printCR. |
3850 |
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
|
3851 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3852 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3853 |
|
1364 | 3854 |
"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
|
3855 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3856 |
|
0 | 3857 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3858 |
DebuggingDebugger == true ifTrue:[ |
17185 | 3859 |
'stepIRQ' print. |
3860 |
"/ ' in ' print. thisContext sender fullPrint. |
|
3861 |
'' printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3862 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
3863 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3864 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3865 |
|
11636 | 3866 |
"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
|
3867 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3868 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3869 |
stepOrNext |
15413 | 3870 |
|where here con s isWrap method wrappedMethod |
11636 | 3871 |
originalMethodOfWrappedMethod originalMethodsContext |
3872 |
inBlock subBlockLeft ignore contextBelow wrapContext |
|
10205 | 3873 |
leftWrap enteredWrap anyStepBlocks |
16373 | 3874 |
oneMore initiallyShown inBlockBelow receiver processName |
3875 |
inBreakPointHandlingCode bpntReceiver| |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3876 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3877 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3878 |
"/ DebuggingDebugger := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3879 |
"/ DebuggingDebugger2 := true |
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3880 |
"/ DebuggingDebugger2 := false |
11636 | 3881 |
"/ DebuggingDebugger3 := false |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3882 |
"/ '' printCR |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3883 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3884 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3885 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3886 |
skipLineNr == #return ifTrue:[ |
16373 | 3887 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
3888 |
here := thisContext sender sender. |
|
3889 |
here setLineNumber:nil. |
|
3890 |
here := nil. |
|
3891 |
con := thisContext sender sender sender. |
|
3892 |
||
3893 |
HaltInterrupt handle:[:ex | |
|
3894 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
3895 |
ex proceed |
|
3896 |
] do:[ |
|
3897 |
self enter:con select:nil. |
|
3898 |
]. |
|
3899 |
con := nil. |
|
3900 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3901 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
3902 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3903 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3904 |
"/ "/ 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
|
3905 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3906 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3907 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3908 |
"/ 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
|
3909 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3910 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3911 |
|
52 | 3912 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
16373 | 3913 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
3914 |
^ self |
|
52 | 3915 |
]. |
3916 |
||
29 | 3917 |
here := thisContext. "stepInterrupt" |
10205 | 3918 |
here := here sender. "the caller; step- or contextIRQ" |
3919 |
here := here sender. "the interrupted context" |
|
29 | 3920 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
3921 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 3922 |
'***************************' printCR. |
3923 |
'here in ' print. |
|
3924 |
inWrap ifTrue:['(wrap) ' print.]. |
|
3925 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
3926 |
here selector printCR. |
|
3927 |
'stepping in ' print. |
|
3928 |
steppedContext notNil ifTrue:[ |
|
3929 |
((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print. |
|
3930 |
]. |
|
3931 |
steppedContext printCR. |
|
3932 |
]. |
|
3933 |
||
3934 |
(inBreakPointHandlingCode := (here selector == #break)) ifTrue:[ |
|
3935 |
bpntReceiver := here receiver. |
|
3936 |
] ifFalse:[ |
|
3937 |
(inBreakPointHandlingCode := (here sender selector == #break)) ifTrue:[ |
|
3938 |
bpntReceiver := here sender receiver. |
|
3939 |
] |
|
3940 |
]. |
|
17058 | 3941 |
|
13197 | 3942 |
"/ when single stepping, ignore breakpoints |
16373 | 3943 |
inBreakPointHandlingCode ifTrue:[ |
16376 | 3944 |
(bpntReceiver notNil and:[ bpntReceiver isKindOf:Breakpoint ]) ifTrue:[ |
16373 | 3945 |
false "here receiver isEnabled" ifFalse:[ |
3946 |
con := nil. |
|
3947 |
where := nil. here := nil. |
|
3948 |
StepInterruptPending := 1. |
|
3949 |
InterruptPending := 1. |
|
3950 |
InStepInterrupt := nil. |
|
3951 |
^ self |
|
3952 |
] |
|
3953 |
]. |
|
13197 | 3954 |
]. |
3955 |
||
3956 |
"/ kludge: a bug-workaround; |
|
3957 |
"/ I should not see those... |
|
2581 | 3958 |
|
3959 |
here selector == #ioInterrupt ifTrue:[ |
|
16373 | 3960 |
DebuggingDebugger2 == true ifTrue:[ |
3961 |
'oops - should not get that one' printCR. |
|
3962 |
]. |
|
3963 |
Processor ioInterrupt. |
|
3964 |
StepInterruptPending := 1. |
|
3965 |
InterruptPending := 1. |
|
3966 |
where := nil. here := nil. |
|
3967 |
InStepInterrupt := nil. |
|
3968 |
^ self |
|
2581 | 3969 |
]. |
3970 |
||
3971 |
stepUntilEntering notNil ifTrue:[ |
|
16373 | 3972 |
DebuggingDebugger2 == true ifTrue:[ |
3973 |
'check if entering ' print. stepUntilEntering printCR. |
|
3974 |
]. |
|
3975 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
3976 |
DebuggingDebugger2 == true ifTrue:[ |
|
3977 |
'entering...' printCR. |
|
3978 |
]. |
|
3979 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
3980 |
||
3981 |
lastStepUntilEntering := stepUntilEntering. |
|
3982 |
stepUntilEntering := nil. |
|
3983 |
self enter:here select:nil. |
|
3984 |
con := nil. |
|
3985 |
^ self |
|
3986 |
]. |
|
3987 |
"/ see if stepping context is still active ... |
|
3988 |
||
3989 |
con := here. |
|
3990 |
||
3991 |
DebuggingDebugger2 == true ifTrue:[ |
|
3992 |
'start searching at: ' print. |
|
3993 |
con fullPrint. |
|
3994 |
]. |
|
3995 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
3996 |
con := con sender |
|
3997 |
]. |
|
3998 |
con notNil ifTrue:[ |
|
3999 |
DebuggingDebugger2 == true ifTrue:[ |
|
4000 |
'steppingContext still active - continue stepping' printCR. |
|
4001 |
]. |
|
4002 |
con := nil. |
|
4003 |
where := nil. here := nil. |
|
4004 |
StepInterruptPending := 1. |
|
4005 |
InterruptPending := 1. |
|
4006 |
InStepInterrupt := nil. |
|
4007 |
^ self |
|
4008 |
]. |
|
4009 |
stepUntilEntering := nil. |
|
2581 | 4010 |
]. |
4011 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
4012 |
" |
11636 | 4013 |
kludge to hide breakpoint wrappers in the context list and when single stepping: |
16373 | 4014 |
check if we are in a wrapper method's hidden setup-sequence |
4015 |
if so, ignore the interrupt and continue single sending. |
|
4016 |
Assume we are in a wrappers setup code, if there is another context above, |
|
4017 |
which is for the wrapper method (i.e. if there is context with an originalmethod |
|
4018 |
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
|
4019 |
" |
29 | 4020 |
isWrap := false. |
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4021 |
subBlockLeft := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4022 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4023 |
|
57 | 4024 |
inWrap ifTrue:[ |
16373 | 4025 |
"/ situation1: |
4026 |
"/ valueWithReceiver or other |
|
4027 |
"/ foo (wrapped) <- wrapContext |
|
4028 |
"/ |
|
4029 |
"/ situation2: |
|
4030 |
"/ foo (original) <- originalMethodsContext |
|
4031 |
"/ valueWithReceiver |
|
4032 |
"/ foo (wrapped) <- wrapContext |
|
4033 |
"/ |
|
4034 |
"/ situation3: |
|
4035 |
"/ other |
|
4036 |
"/ foo (original) <- originalMethodsContext |
|
4037 |
"/ valueWithReceiver |
|
4038 |
"/ foo (wrapped) <- wrapContext |
|
4039 |
"/ |
|
4040 |
"/ situation4: |
|
4041 |
"/ ... many-contexts ... (more than 8) |
|
4042 |
"/ possibly foo (original) |
|
4043 |
"/ valueWithReceiver or other |
|
4044 |
"/ foo (wrapped) |
|
4045 |
"/ |
|
4046 |
||
4047 |
"/ search for the wrapped method's context and extract the original method |
|
4048 |
where := here. |
|
4049 |
8 timesRepeat:[ |
|
4050 |
wrapContext isNil ifTrue:[ |
|
4051 |
where notNil ifTrue:[ |
|
4052 |
DebuggingDebugger2 == true ifTrue:[ |
|
4053 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
4054 |
where printCR |
|
4055 |
]. |
|
4056 |
where isBlockContext ifFalse:[ |
|
4057 |
method := where method. |
|
4058 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4059 |
originalMethodOfWrappedMethod := method originalMethod. |
|
4060 |
wrappedMethod := method. |
|
4061 |
wrapContext := where. |
|
4062 |
]. |
|
4063 |
]. |
|
4064 |
where := where sender |
|
4065 |
] |
|
4066 |
] |
|
4067 |
]. |
|
4068 |
DebuggingDebugger2 == true ifTrue:[ |
|
4069 |
'wrap-context is: ' print. |
|
4070 |
wrapContext notNil ifTrue:[ |
|
4071 |
((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print. |
|
4072 |
]. |
|
4073 |
wrapContext printCR |
|
4074 |
]. |
|
4075 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
4076 |
'oops no wrap?' errorPrintCR. |
|
4077 |
]. |
|
11636 | 4078 |
]. |
4079 |
||
4080 |
(inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[ |
|
16373 | 4081 |
isWrap := false. |
4082 |
"/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ]. |
|
4083 |
where := here. |
|
4084 |
8 timesRepeat:[ |
|
4085 |
originalMethodsContext isNil ifTrue:[ |
|
4086 |
where notNil ifTrue:[ |
|
4087 |
DebuggingDebugger2 ifTrue:[ |
|
4088 |
((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print. |
|
4089 |
where printCR |
|
4090 |
]. |
|
4091 |
where isBlockContext ifFalse:[ |
|
4092 |
method := where method. |
|
4093 |
method == originalMethodOfWrappedMethod ifTrue:[ |
|
4094 |
originalMethodsContext := here. |
|
4095 |
where == here ifTrue:[ |
|
4096 |
"/ situation2 |
|
4097 |
DebuggingDebugger2 ifTrue:[ 's2' printCR ]. |
|
4098 |
isWrap := true. |
|
4099 |
"/ here setSender:(wrapContext sender). --- leads to a crash |
|
4100 |
] ifFalse: [ |
|
4101 |
"/ situation3 |
|
4102 |
DebuggingDebugger2 ifTrue:[ 's3' printCR ]. |
|
4103 |
inWrap := false. |
|
4104 |
isWrap := false. |
|
4105 |
]. |
|
4106 |
steppedContext := where |
|
11636 | 4107 |
"/ ] ifFalse:[ |
4108 |
"/ where selector == wrapContext selector ifTrue:[ |
|
4109 |
"/ where receiver == wrapContext receiver ifTrue:[ |
|
4110 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
4111 |
"/ method printCR. |
|
4112 |
"/ method originalMethod printCR. |
|
4113 |
"/ originalMethodOfWrappedMethod printCR. |
|
4114 |
"/ '!!!!!!!!!!!!!!!!!!!!!!!!' printCR. |
|
4115 |
"/ ]. |
|
4116 |
"/ ]. |
|
16373 | 4117 |
]. |
4118 |
where := where sender |
|
4119 |
]. |
|
4120 |
]. |
|
4121 |
]. |
|
4122 |
]. |
|
4123 |
DebuggingDebugger2 ifTrue:[ |
|
4124 |
'original method-context is: ' print. |
|
4125 |
originalMethodsContext notNil ifTrue:[ |
|
4126 |
((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print. |
|
4127 |
]. |
|
4128 |
originalMethodsContext printCR |
|
4129 |
]. |
|
4130 |
originalMethodsContext isNil ifTrue:[ |
|
4131 |
originalMethodOfWrappedMethod isNil ifTrue:[ |
|
4132 |
"/ situation4 |
|
4133 |
DebuggingDebugger2 ifTrue:[ 's4' printCR ]. |
|
4134 |
DebuggingDebugger2 ifTrue:[ steppedContext printCR ]. |
|
4135 |
isWrap := false. |
|
4136 |
] ifFalse:[ |
|
4137 |
"/ situation1 |
|
4138 |
DebuggingDebugger2 ifTrue:[ 's1' printCR ]. |
|
4139 |
isWrap := true. |
|
4140 |
"/ steppedContext := wrapContext |
|
4141 |
]. |
|
4142 |
]. |
|
29 | 4143 |
]. |
4144 |
||
4145 |
isWrap ifTrue:[ |
|
16373 | 4146 |
DebuggingDebugger2 == true ifTrue:[ |
4147 |
'ignore wrap' printCR. |
|
4148 |
]. |
|
4149 |
||
4150 |
"/ |
|
4151 |
"/ ignore, while in wrappers hidden setup |
|
4152 |
"/ |
|
4153 |
where := nil. here := nil. |
|
4154 |
ObjectMemory flushInlineCaches. |
|
4155 |
||
4156 |
DebuggingDebugger2 == true ifTrue:[ |
|
4157 |
skipLineNr == #return ifTrue:[ |
|
4158 |
'skipRet in wrap' printCR. |
|
4159 |
] |
|
4160 |
]. |
|
4161 |
||
4162 |
StepInterruptPending := 1. |
|
4163 |
InterruptPending := 1. |
|
4164 |
InStepInterrupt := nil. |
|
4165 |
^ self |
|
29 | 4166 |
]. |
4167 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4168 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 4169 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4170 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4171 |
'bigStep is: ' print. bigStep printCR. |
4172 |
'steppedContext is: ' print. steppedContext printCR. |
|
4173 |
]. |
|
4174 |
||
4175 |
s := 'Debugger: after step'. |
|
2581 | 4176 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4177 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4178 |
"/ 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
|
4179 |
"/ |
16373 | 4180 |
(bigStep and:[steppedContext notNil]) ifTrue:[ |
4181 |
" |
|
4182 |
a step or next - ignore all contexts below the interesting one |
|
4183 |
" |
|
4184 |
where := here. "the interrupted context" |
|
4185 |
contextBelow := nil. |
|
4186 |
||
4187 |
where home notNil ifTrue:[ |
|
4188 |
"/ |
|
4189 |
"/ in a block called by 'our' context ? |
|
4190 |
"/ |
|
4191 |
where home == steppedContext ifTrue:[ |
|
4192 |
"/ '*block*' printCR. |
|
4193 |
inBlock := true |
|
4194 |
] |
|
4195 |
]. |
|
4196 |
(where == steppedContext) ifFalse:[ |
|
4197 |
where := where sender. |
|
4198 |
||
4199 |
where notNil ifTrue:[ |
|
4200 |
where home == steppedContext ifTrue:[ |
|
4201 |
"/ '*block*' printCR. |
|
4202 |
inBlock := true. |
|
4203 |
] |
|
4204 |
]. |
|
57 | 4205 |
|
4206 |
"/ 'looking for ' print. |
|
3055 | 4207 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 4208 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4209 |
"/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
|
4210 |
"/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
|
4211 |
|
16373 | 4212 |
where == steppedContext ifFalse:[ |
4213 |
||
4214 |
"/ check if we are in a context below steppedContext |
|
4215 |
"/ (i.e. if steppedContext can be reached from |
|
4216 |
"/ interrupted context. Not using context-ref but its |
|
4217 |
"/ address to avoid creation of many useless contexts.) |
|
4218 |
||
4219 |
(inBlock) ifFalse:[ |
|
4220 |
[where notNil] whileTrue:[ |
|
4221 |
||
4222 |
"/ if either the receiver or any arg of this context |
|
4223 |
"/ is a block of the steppedContext, we must really |
|
4224 |
"/ do a single step. Otherwise, stepping through a |
|
4225 |
"/ do:-loop would be very difficult. |
|
4226 |
receiver := where receiver. |
|
13197 | 4227 |
where selector == #critical: ifTrue:[ |
4228 |
anyStepBlocks := true. |
|
4229 |
] ifFalse:[ |
|
16373 | 4230 |
(receiver isBlock |
4231 |
and:[(receiver isKindOf:Block) |
|
4232 |
and:[receiver homeMethod == steppedContext method |
|
4233 |
"receiver home == steppedContext"]]) |
|
4234 |
ifTrue:[ |
|
4235 |
anyStepBlocks := true. |
|
4236 |
] ifFalse:[ |
|
4237 |
where args do:[:arg | |
|
4238 |
(arg isBlock |
|
4239 |
and:[(arg isKindOf:Block) |
|
4240 |
and:[arg homeMethod == steppedContext method |
|
4241 |
"arg home == steppedContext"]]) |
|
4242 |
ifTrue:[ |
|
4243 |
anyStepBlocks := true. |
|
4244 |
] ifFalse:[ |
|
4245 |
(where methodHome notNil |
|
4246 |
and:[where methodHome receiver isBlock |
|
4247 |
and:[(where methodHome receiver isKindOf:Block) |
|
4248 |
and:[where methodHome receiver homeMethod == steppedContext method |
|
4249 |
"where methodHome receiver home == steppedContext"]]]) |
|
4250 |
ifTrue:[ |
|
4251 |
anyStepBlocks := true. |
|
4252 |
] |
|
4253 |
]. |
|
4254 |
] |
|
4255 |
]. |
|
13197 | 4256 |
]. |
16373 | 4257 |
DebuggingDebugger2 == true ifTrue:[ |
4258 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
4259 |
where selector printCR. |
|
4260 |
]. |
|
4261 |
||
4262 |
where == steppedContext ifTrue:[ |
|
3055 | 4263 |
"/ 'found it - below; ignore' printCR. |
16373 | 4264 |
" |
17058 | 4265 |
found the interesting context somewhere up in the |
16373 | 4266 |
chain. We seem to be still below the interesting one ... |
4267 |
" |
|
4268 |
tracing == true ifTrue:[ |
|
4269 |
here printString printCR |
|
4270 |
]. |
|
4271 |
" |
|
4272 |
yes, a context below |
|
4273 |
- continue and schedule another stepInterrupt. |
|
4274 |
Must flush caches since optimized methods not always |
|
4275 |
look for pending interrupts |
|
4276 |
" |
|
4277 |
||
4278 |
contextBelow notNil ifTrue:[ |
|
3055 | 4279 |
"/ '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
|
4280 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4281 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4282 |
"/ 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
|
4283 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4284 |
|
16373 | 4285 |
DebuggingDebugger2 == true ifTrue:[ |
4286 |
'below stepCon; continue until unwind of: ' print. |
|
4287 |
contextBelow printCR. |
|
4288 |
]. |
|
4289 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
4290 |
StepInterruptPending := nil. |
|
4291 |
] ifFalse:[ |
|
4292 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4293 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4294 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
4295 |
"/ 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
|
4296 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4297 |
|
16373 | 4298 |
DebuggingDebugger2 == true ifTrue:[ |
4299 |
'in stepCon; continue single stepping' printCR. |
|
4300 |
]. |
|
4301 |
StepInterruptPending := 1. |
|
4302 |
InterruptPending := 1. |
|
4303 |
]. |
|
4304 |
where := nil. here := nil. |
|
4305 |
InStepInterrupt := nil. |
|
4306 |
||
4307 |
^ self |
|
4308 |
]. |
|
4309 |
||
4310 |
(steppedContext notNil and:[ |
|
4311 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
4312 |
inBlockBelow := true. |
|
4313 |
]. |
|
4314 |
||
4315 |
anyStepBlocks ifFalse:[ |
|
4316 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4317 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4318 |
"/ 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
|
4319 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4320 |
where isBlockContext ifFalse:[ |
16373 | 4321 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
4322 |
]. |
16373 | 4323 |
] |
4324 |
]. |
|
4325 |
where := where sender |
|
4326 |
]. |
|
4327 |
s := 'Debugger: context returned'. |
|
4328 |
subBlockLeft := true. |
|
4329 |
]. |
|
4330 |
] ifTrue:[ |
|
3055 | 4331 |
"/ 'found it right in sender' printCR. |
16373 | 4332 |
s := 'Debugger: after step' |
4333 |
]. |
|
4334 |
] ifTrue:[ |
|
3055 | 4335 |
"/ 'found it right away' printCR. |
16373 | 4336 |
s := 'Debugger: after step' |
4337 |
]. |
|
0 | 4338 |
] ifFalse:[ |
3055 | 4339 |
"/ ' send' printCR. |
16373 | 4340 |
" |
4341 |
a send |
|
4342 |
" |
|
4343 |
DebuggingDebugger2 == true ifTrue:[ |
|
4344 |
'clear steppedContext' printCR. |
|
4345 |
]. |
|
4346 |
steppedContext := nil. |
|
4347 |
s := 'Debugger: after send' |
|
0 | 4348 |
]. |
7 | 4349 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4350 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4351 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
16373 | 4352 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4353 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4354 |
|
790 | 4355 |
"/ handle the case, when a subBlock leaves; |
4356 |
"/ continue stepping in the home context. |
|
4357 |
||
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4358 |
subBlockLeft ifTrue:[ |
16373 | 4359 |
steppedContext home notNil ifTrue:[ |
4360 |
steppedContext := steppedContext home. |
|
4361 |
s := 'Debugger: after step'. |
|
4362 |
subBlockLeft := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4363 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
4364 |
|
16373 | 4365 |
] |
790 | 4366 |
]. |
4367 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4368 |
" |
10205 | 4369 |
kludge to hide breakpoint wrappers in the context list: |
16373 | 4370 |
check if we are in a wrapper methods hidden exit-sequence |
4371 |
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
|
4372 |
" |
10205 | 4373 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4374 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4375 |
ifTrue:[ |
16373 | 4376 |
"/ did not find our steppedContext along the chain; |
4377 |
"/ could be in a wrappedMethods exitBlock ... |
|
4378 |
||
4379 |
leftWrap ifFalse:[ |
|
4380 |
where := here. |
|
4381 |
wrappedMethod := nil. |
|
4382 |
5 timesRepeat:[ |
|
4383 |
where notNil ifTrue:[ |
|
4384 |
where isBlockContext ifFalse:[ |
|
4385 |
method := where method. |
|
4386 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
4387 |
where == wrapperContext ifTrue:[ |
|
4388 |
DebuggingDebugger2 == true ifTrue:[ |
|
4389 |
'change stepCon fromWrapped: ' print. |
|
4390 |
steppedContext print. |
|
4391 |
' to: ' print. |
|
4392 |
wrapperContext printCR. |
|
4393 |
]. |
|
4394 |
||
4395 |
inWrap := true. |
|
4396 |
enteredWrap := true. |
|
4397 |
steppedContext := wrapperContext. |
|
4398 |
wrapperContext := nil. |
|
4399 |
] |
|
4400 |
]. |
|
4401 |
]. |
|
4402 |
where := where sender |
|
4403 |
] |
|
4404 |
]. |
|
4405 |
]. |
|
4406 |
enteredWrap ifTrue:[ |
|
4407 |
ignore := true |
|
4408 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4409 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4410 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4411 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4412 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4413 |
subBlockLeft ifTrue:[ |
16373 | 4414 |
"/ special care for stepInterrupt in send, |
4415 |
"/ when created a dummy context (lineNr == 1) |
|
4416 |
||
4417 |
steppedContext lineNumber isNil ifTrue:[ |
|
4418 |
steppedContext selector == here sender selector ifTrue:[ |
|
4419 |
subBlockLeft := false. |
|
4420 |
s := 'Debugger: after step'. |
|
4421 |
steppedContext := here sender. |
|
4422 |
]. |
|
4423 |
]. |
|
4424 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4425 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
4426 |
|
57 | 4427 |
inBlock ifTrue:[ |
16376 | 4428 |
DebuggingDebugger2 == true ifTrue:[ 'inBlock' printCR ]. |
16373 | 4429 |
s := 'Debugger: in block'. |
57 | 4430 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4431 |
inBlockBelow ifTrue:[ |
16376 | 4432 |
DebuggingDebugger2 == true ifTrue:[ 'inBlockBelow' printCR ]. |
16373 | 4433 |
ignore := true |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
4434 |
]. |
57 | 4435 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4436 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4437 |
where notNil ifTrue:[ |
4438 |
'(' print. steppedContextLineno print. ') ' print. |
|
4439 |
where printCR. |
|
4440 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
4441 |
]. |
57 | 4442 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4443 |
ignore ifFalse:[ |
16373 | 4444 |
(bigStep |
4445 |
and:[steppedContextLineno notNil |
|
4446 |
and:[where notNil |
|
4447 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
4448 |
(here isBlockContext |
|
4449 |
and:[(here methodHome == steppedContext) |
|
4450 |
or:[here home == steppedContext]]) ifTrue:[ |
|
4451 |
DebuggingDebugger2 == true ifTrue:[ |
|
4452 |
'same line but in block' printCR. |
|
4453 |
]. |
|
4454 |
||
4455 |
steppedContext := actualContext := here. |
|
4456 |
steppedContextLineno := here lineNumber. |
|
4457 |
] ifFalse:[ |
|
4458 |
"/ kludge - I only have the info for up to 255 lines |
|
4459 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
4460 |
DebuggingDebugger2 == true ifTrue:[ |
|
4461 |
'same line - ignored' printCR. |
|
4462 |
]. |
|
4463 |
ignore := true |
|
4464 |
]. |
|
4465 |
]. |
|
4466 |
]. |
|
4467 |
||
4468 |
(subBlockLeft not |
|
4469 |
and:[skipLineNr notNil |
|
4470 |
and:[where notNil |
|
4471 |
and:[where lineNumber notNil |
|
4472 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
4473 |
DebuggingDebugger2 == true ifTrue:[ |
|
4474 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
4475 |
]. |
|
4476 |
ignore := true |
|
4477 |
]. |
|
4478 |
||
4479 |
(steppedContextLineno isNil |
|
4480 |
and:[skipLineNr isNil |
|
4481 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
4482 |
DebuggingDebugger2 == true ifTrue:[ |
|
4483 |
'same line2 (after conIRQ) - ignored' printCR. |
|
4484 |
]. |
|
4485 |
ignore := true |
|
4486 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4487 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4488 |
|
57 | 4489 |
ignore ifTrue:[ |
3055 | 4490 |
"/' ' printCR. |
16373 | 4491 |
where := nil. here := nil. |
4492 |
" |
|
4493 |
yes, a context below |
|
4494 |
- continue and schedule another stepInterrupt. |
|
4495 |
Must flush caches since optimized methods not always |
|
4496 |
look for pending interrupts |
|
4497 |
" |
|
4498 |
ObjectMemory flushInlineCaches. |
|
4499 |
StepInterruptPending := 1. |
|
4500 |
InterruptPending := 1. |
|
4501 |
InStepInterrupt := nil. |
|
4502 |
^ self |
|
57 | 4503 |
]. |
4504 |
||
3055 | 4505 |
"/ ' ' printCR. |
57 | 4506 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4507 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 4508 |
|
57 | 4509 |
tracing := false. |
4510 |
bigStep := false. |
|
4511 |
||
0 | 4512 |
"release refs to context" |
4513 |
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
|
4514 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4515 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4516 |
DebuggingDebugger2 == true ifTrue:[ |
16373 | 4517 |
'==> 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
|
4518 |
]. |
1364 | 4519 |
|
4520 |
initiallyShown := nil. |
|
4521 |
(oneMore == true) ifTrue:[ |
|
16373 | 4522 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
4523 |
initiallyShown := 2 |
|
4524 |
] ifFalse:[ |
|
4525 |
initiallyShown := 1 |
|
4526 |
] |
|
1364 | 4527 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4528 |
con := thisContext sender sender. |
3435 | 4529 |
|
9235 | 4530 |
HaltInterrupt handle:[:ex | |
16373 | 4531 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
4532 |
ex proceed |
|
3435 | 4533 |
] do:[ |
16373 | 4534 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4535 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
4536 |
con := nil |
1364 | 4537 |
|
11602
b04d5d5e02c7
single stepping in wrapped methods
Claus Gittinger <cg@exept.de>
parents:
11595
diff
changeset
|
4538 |
"Created: / 14-10-1996 / 12:53:39 / cg" |
16373 | 4539 |
"Modified: / 30-04-2016 / 11:47:01 / cg" |
0 | 4540 |
! ! |
4541 |
||
4867 | 4542 |
!DebugView methodsFor:'menu & button actions'! |
266 | 4543 |
|
5875 | 4544 |
addBrowserBookmark |
4545 |
"add a browser-bookmark for the selected contexts method" |
|
4546 |
||
4547 |
|cls sel| |
|
4548 |
||
4549 |
selectedContext isNil ifTrue:[^ self]. |
|
4550 |
||
4551 |
cls := selectedContext receiver class. |
|
4552 |
sel := selectedContext selector. |
|
4553 |
(cls includesSelector:sel) ifFalse:[ |
|
17185 | 4554 |
sel := nil |
5875 | 4555 |
]. |
4556 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
4557 |
! |
|
4558 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4559 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4560 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4561 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4562 |
"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
|
4563 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4564 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4565 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4566 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4567 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4568 |
"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
|
4569 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
4570 |
|
266 | 4571 |
autoUpdateOff |
4572 |
"stop the update process" |
|
4573 |
||
4574 |
updateProcess notNil ifTrue:[ |
|
17185 | 4575 |
monitorToggle lampColor:(Color yellow). |
4576 |
updateProcess terminate. |
|
4577 |
updateProcess := nil |
|
266 | 4578 |
] |
4579 |
! |
|
4580 |
||
4581 |
autoUpdateOn |
|
4582 |
"fork a subprocess which updates the contextList in regular intervals" |
|
4583 |
||
4584 |
updateProcess isNil ifTrue:[ |
|
17185 | 4585 |
updateProcess := |
4586 |
[ |
|
4587 |
[true] whileTrue:[ |
|
4588 |
monitorToggle showLamp ifTrue:[ |
|
4589 |
monitorToggle lampColor:(Color yellow). |
|
4590 |
] ifFalse:[ |
|
4591 |
monitorToggle activeForegroundColor:Color black. |
|
4592 |
]. |
|
4593 |
(Delay forSeconds:0.25) wait. |
|
4594 |
self updateContext. |
|
4595 |
monitorToggle showLamp ifTrue:[ |
|
4596 |
monitorToggle lampColor:(Color red). |
|
4597 |
] ifFalse:[ |
|
4598 |
monitorToggle activeForegroundColor:Color red. |
|
4599 |
]. |
|
4600 |
(Delay forSeconds:0.25) wait. |
|
4601 |
self updateContext. |
|
4602 |
] |
|
4603 |
] forkAt:(Processor activePriority - 1) |
|
266 | 4604 |
] |
4605 |
||
4606 |
! |
|
4607 |
||
13408 | 4608 |
browseBlocksHome |
4609 |
"browse the receiver block's home method (if a value-like send is selected)" |
|
4610 |
||
13414 | 4611 |
|cls sel block mthd| |
13408 | 4612 |
|
4613 |
selectedContext isNil ifTrue:[^ self]. |
|
4614 |
(block := selectedContext receiver) isBlock ifFalse:[ ^ self ]. |
|
4615 |
||
13414 | 4616 |
mthd := block method. |
4617 |
cls := mthd mclass. |
|
4618 |
sel := mthd selector. |
|
4619 |
||
4620 |
(cls notNil and:[(cls includesSelector:sel)]) ifTrue:[ |
|
15835 | 4621 |
cls browserClass openInClass:cls selector:sel. |
4622 |
^ self |
|
13414 | 4623 |
]. |
4624 |
||
4625 |
mthd source notEmptyOrNil ifTrue:[ |
|
15835 | 4626 |
(Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs) |
4627 |
ifTrue:[ |
|
4628 |
SystemBrowser default browseMethods:{ mthd } title:'Unbound Method' sort:false |
|
4629 |
"/ TextView openWith:mthd source title:'Unbound Method''s Source'. |
|
4630 |
]. |
|
4631 |
^ self |
|
13414 | 4632 |
]. |
4633 |
cls notNil ifTrue:[ |
|
15835 | 4634 |
(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) |
4635 |
ifTrue:[ |
|
4636 |
cls browserClass openInClass:cls selector:nil. |
|
4637 |
]. |
|
4638 |
^ self |
|
13414 | 4639 |
]. |
4640 |
Dialog information:'Block''s home method is (no longer) present in any class.'. |
|
13408 | 4641 |
! |
4642 |
||
3269 | 4643 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4644 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4645 |
|
4646 |
|cls sel| |
|
4647 |
||
4648 |
selectedContext isNil ifTrue:[^ self]. |
|
4649 |
||
4650 |
cls := selectedContext receiver class. |
|
4651 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4652 |
(cls includesSelector:sel) ifFalse:[ |
17185 | 4653 |
sel := nil |
3269 | 4654 |
]. |
4655 |
cls browserClass openInClass:cls selector:sel. |
|
4656 |
||
4657 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
4658 |
! |
|
4659 |
||
4660 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4661 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 4662 |
|
4663 |
|cls mthd| |
|
4664 |
||
4665 |
selectedContext isNil ifTrue:[^ self]. |
|
4666 |
||
4667 |
mthd := selectedContext method. |
|
3447 | 4668 |
mthd notNil ifTrue:[ |
16373 | 4669 |
cls := mthd containingClass. |
4670 |
"/ still nil if unbound - then use receiver's class |
|
3447 | 4671 |
]. |
4672 |
cls isNil ifTrue:[ |
|
16373 | 4673 |
cls := selectedContext receiver class |
3269 | 4674 |
]. |
4675 |
cls browserClass browseClassHierarchy:cls. |
|
4676 |
||
16373 | 4677 |
"Modified: / 17-11-2001 / 19:43:06 / cg" |
4678 |
"Modified (comment): / 30-04-2016 / 15:51:28 / cg" |
|
3269 | 4679 |
! |
4680 |
||
4681 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4682 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 4683 |
|
4684 |
|cls mthd| |
|
4685 |
||
4686 |
selectedContext isNil ifTrue:[^ self]. |
|
4687 |
||
4688 |
mthd := selectedContext method. |
|
3447 | 4689 |
mthd notNil ifTrue:[ |
16373 | 4690 |
cls := mthd containingClass. |
4691 |
"/ still nil if unbound - then use receiver's class |
|
3447 | 4692 |
]. |
4693 |
cls isNil ifTrue:[ |
|
16373 | 4694 |
cls := selectedContext receiver class |
3269 | 4695 |
]. |
4696 |
cls browserClass browseFullClassProtocol:cls. |
|
4697 |
||
16373 | 4698 |
"Modified: / 17-11-2001 / 19:43:43 / cg" |
4699 |
"Modified (comment): / 30-04-2016 / 15:51:32 / cg" |
|
3269 | 4700 |
! |
4701 |
||
4702 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4703 |
"browse the implementing class (of the selected context's message)" |
3269 | 4704 |
|
11610 | 4705 |
|con mthd who sel cls home| |
4706 |
||
4707 |
con := selectedContext ? actualContext. |
|
4708 |
con isNil ifTrue:[^ self]. |
|
4709 |
||
4710 |
mthd := con method. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4711 |
mthd notNil ifTrue:[ |
17185 | 4712 |
who := mthd who. |
4713 |
who notNil ifTrue:[ |
|
4714 |
cls := who methodClass. |
|
4715 |
sel := who methodSelector. |
|
4716 |
] ifFalse:[ |
|
4717 |
"might have been re-accepted" |
|
4718 |
(home := con methodHome) notNil ifTrue:[ |
|
4719 |
(sel := home selector) notNil ifTrue:[ |
|
4720 |
cls := home receiver class |
|
4721 |
whichClassImplements:selectedContext selector. |
|
4722 |
cls notNil ifTrue:[ |
|
4723 |
Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
|
4724 |
]. |
|
4725 |
] |
|
4726 |
]. |
|
4727 |
]. |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4728 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4729 |
cls isNil ifTrue:[ |
17185 | 4730 |
"/ class not found - try receiver |
4731 |
cls := con receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4732 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4733 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
4734 |
cls browserClass openInClass:cls selector:sel. |
266 | 4735 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
4736 |
"Created: / 22-11-1995 / 21:27:01 / cg" |
11610 | 4737 |
"Modified: / 19-07-2012 / 11:27:32 / cg" |
266 | 4738 |
! |
4739 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4740 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4741 |
"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
|
4742 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4743 |
selectedContext isNil ifTrue:[ |
17185 | 4744 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4745 |
]. |
4153 | 4746 |
"/ selectedContext receiver class browserClass |
11610 | 4747 |
self withWaitCursorDo:[ |
17185 | 4748 |
UserPreferences systemBrowserClass |
4749 |
browseImplementorsOf:selectedContext selector. |
|
11610 | 4750 |
] |
4751 |
||
4752 |
"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
|
4753 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4754 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4755 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4756 |
"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
|
4757 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4758 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4759 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4760 |
(sel := codeView selection) notNil ifTrue:[ |
17185 | 4761 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4762 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4763 |
initial isNil ifTrue:[ |
17185 | 4764 |
initial := selectedContext isNil |
4765 |
ifTrue:[nil] |
|
4766 |
ifFalse:[selectedContext selector]. |
|
10205 | 4767 |
]. |
4768 |
selector := Dialog |
|
17185 | 4769 |
requestSelector:'Selector to browse implementors of:' |
4770 |
initialAnswer:initial. |
|
11610 | 4771 |
|
4772 |
selector notEmptyOrNil ifTrue:[ |
|
17185 | 4773 |
self withWaitCursorDo:[ |
4774 |
UserPreferences systemBrowserClass |
|
4775 |
browseImplementorsMatching:selector. |
|
4776 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4777 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4778 |
|
11610 | 4779 |
"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
|
4780 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4781 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4782 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4783 |
"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
|
4784 |
|
13488 | 4785 |
|app appClass| |
4786 |
||
4787 |
(app := self processesApplication) notNil ifTrue:[ |
|
17106 | 4788 |
appClass := app class. |
4789 |
appClass browserClass openInClass:appClass selector:nil. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4790 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4791 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4792 |
|
3269 | 4793 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4794 |
"browse the receiver's class (of the selected context's message)" |
3269 | 4795 |
|
4796 |
|cls sel| |
|
4797 |
||
4798 |
selectedContext isNil ifTrue:[^ self]. |
|
4799 |
||
11610 | 4800 |
selectedContext isCheapBlockContext ifTrue:[ |
17185 | 4801 |
cls := selectedContext method mclass. |
4802 |
sel := selectedContext method selector. |
|
11610 | 4803 |
] ifFalse:[ |
17185 | 4804 |
cls := selectedContext receiver class. |
4805 |
sel := selectedContext selector. |
|
11610 | 4806 |
]. |
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
4807 |
(cls includesSelector:sel) ifFalse:[ |
17185 | 4808 |
sel := nil |
3269 | 4809 |
]. |
4810 |
cls browserClass openInClass:cls selector:sel. |
|
4811 |
||
11610 | 4812 |
"Modified: / 19-07-2012 / 11:29:48 / cg" |
3269 | 4813 |
! |
4814 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4815 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4816 |
"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
|
4817 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4818 |
selectedContext isNil ifTrue:[ |
17185 | 4819 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4820 |
]. |
11610 | 4821 |
self withWaitCursorDo:[ |
17185 | 4822 |
UserPreferences systemBrowserClass |
4823 |
browseAllCallsOn:selectedContext selector. |
|
11610 | 4824 |
] |
4825 |
||
4826 |
"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
|
4827 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4828 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4829 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4830 |
"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
|
4831 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4832 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4833 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4834 |
(sel := codeView selection) notNil ifTrue:[ |
17185 | 4835 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4836 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4837 |
initial isNil ifTrue:[ |
17185 | 4838 |
initial := selectedContext isNil |
4839 |
ifTrue:[nil] |
|
4840 |
ifFalse:[selectedContext selector]. |
|
10205 | 4841 |
]. |
4842 |
selector := Dialog |
|
17185 | 4843 |
requestSelector:'Selector to browse senders of:' |
4844 |
initialAnswer:initial. |
|
11610 | 4845 |
|
4846 |
selector notEmptyOrNil ifTrue:[ |
|
17185 | 4847 |
self withWaitCursorDo:[ |
4848 |
UserPreferences systemBrowserClass |
|
4849 |
browseAllCallsOn:selector asSymbol. |
|
4850 |
] |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4851 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
4852 |
|
11610 | 4853 |
"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
|
4854 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
4855 |
|
11391 | 4856 |
clearRememberedCallchain |
4857 |
"clear the remembered callchain." |
|
4858 |
||
4859 |
RememberedCallChain := nil |
|
4860 |
||
4861 |
"Created: / 08-03-2012 / 01:29:46 / cg" |
|
4862 |
! |
|
4863 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4864 |
closeAllDebuggers |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4865 |
(Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4866 |
ifFalse:[ |
17185 | 4867 |
^ self |
15413 | 4868 |
]. |
4869 |
||
4870 |
self class allInstancesDo:[:debugger | |
|
17185 | 4871 |
debugger ~~ self ifTrue:[ |
4872 |
debugger busy ifTrue:[ |
|
4873 |
debugger destroyWithConfirmation:true. |
|
4874 |
]. |
|
4875 |
]. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4876 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4877 |
self closeRequest. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4878 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4879 |
"Created: / 23-03-2012 / 12:40:22 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4880 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
4881 |
|
9626 | 4882 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 4883 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 4884 |
LastExtent := self extent. |
4885 |
LastOrigin := self origin. |
|
4886 |
||
4887 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
4888 |
! |
|
4889 |
||
266 | 4890 |
copyWalkbackText |
4891 |
"place the contents of the walkback view into the copy-paste buffer. |
|
12884 | 4892 |
This allows pasting it into some other view for printing. |
4893 |
||
4894 |
Show the full verbose context without filtering." |
|
266 | 4895 |
|
10760 | 4896 |
|infoText| |
4897 |
||
12884 | 4898 |
firstContext isNil ifTrue:[ |
17185 | 4899 |
infoText := 'No context, no walkback'. |
10760 | 4900 |
] ifFalse:[ |
17185 | 4901 |
exceptionInfoLabel notNil ifTrue:[ |
4902 |
infoText := exceptionInfoLabel label , '\\' withCRs. |
|
4903 |
] ifFalse:[ |
|
4904 |
infoText := '' |
|
4905 |
]. |
|
4906 |
infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection. |
|
10760 | 4907 |
]. |
4908 |
||
4909 |
self setClipboardText:infoText |
|
266 | 4910 |
|
4911 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
4912 |
! |
|
4913 |
||
4914 |
doAbort |
|
1187 | 4915 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 4916 |
at save places (for example: in the event loop) and returns back |
4917 |
from whatever the process is doing, but does not terminate it." |
|
4918 |
||
17109 | 4919 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Abort anyway ?') |
4920 |
ifFalse:[ ^ self ]. |
|
16960 | 4921 |
^ self doAbortWithoutConfirmation |
17109 | 4922 |
|
4923 |
"Modified: / 25-11-2016 / 13:37:05 / cg" |
|
266 | 4924 |
! |
4925 |
||
6487 | 4926 |
doAbortAll |
4927 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
4928 |
at save places (for example: in the event loop) and returns back |
|
4929 |
from whatever the process is doing, but does not terminate it." |
|
4930 |
||
17109 | 4931 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Abort anyway ?') |
4932 |
ifFalse:[ ^ self ]. |
|
6487 | 4933 |
|
4934 |
inspecting ifTrue:[ |
|
17109 | 4935 |
inspectedProcess isDead ifTrue:[ |
4936 |
self showTerminated. |
|
4937 |
^ self |
|
4938 |
]. |
|
4939 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4940 |
self showError:'** the process does not handle the abort signal **' |
|
4941 |
] ifTrue:[ |
|
4942 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
4943 |
]. |
|
4944 |
^ self |
|
6487 | 4945 |
]. |
4946 |
||
4947 |
steppedContext := wrapperContext := nil. |
|
4948 |
haveControl := false. |
|
4949 |
exitAction := #abortAll. |
|
4950 |
||
4951 |
"exit private event-loop" |
|
4952 |
catchBlock notNil ifTrue:[ |
|
17109 | 4953 |
abortButton turnOff. |
4954 |
catchBlock value. |
|
4955 |
||
4956 |
"/ not reached |
|
4957 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 4958 |
]. |
4959 |
||
4960 |
^ self. |
|
4961 |
||
17109 | 4962 |
"Modified: / 25-11-2016 / 13:36:15 / cg" |
6487 | 4963 |
! |
4964 |
||
16960 | 4965 |
doAbortWithoutConfirmation |
4966 |
"abort - send Object>>abortSignal, which is usually caught |
|
4967 |
at save places (for example: in the event loop) and returns back |
|
4968 |
from whatever the process is doing, but does not terminate it." |
|
4969 |
||
4970 |
inspecting ifTrue:[ |
|
4971 |
inspectedProcess isDead ifTrue:[ |
|
4972 |
self showTerminated. |
|
4973 |
^ self |
|
4974 |
]. |
|
4975 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
4976 |
self showError:'** the process does not handle the abort signal **' |
|
4977 |
] ifTrue:[ |
|
4978 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
4979 |
]. |
|
4980 |
^ self |
|
4981 |
]. |
|
4982 |
||
4983 |
steppedContext := wrapperContext := nil. |
|
4984 |
haveControl := false. |
|
4985 |
exitAction := #abort. |
|
4986 |
||
4987 |
"exit private event-loop" |
|
4988 |
catchBlock notNil ifTrue:[ |
|
4989 |
abortButton turnOff. |
|
4990 |
catchBlock value. |
|
4991 |
||
4992 |
"/ not reached |
|
4993 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
4994 |
]. |
|
4995 |
||
4996 |
^ self. |
|
4997 |
||
4998 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
4999 |
! |
|
5000 |
||
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5001 |
doChangeProcessPriority |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5002 |
"ask for and change the process's priority" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5003 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5004 |
|oldPrio newPrio s| |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5005 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5006 |
oldPrio := (inspectedProcess ? Processor activeProcess) priority. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5007 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5008 |
[ |
17185 | 5009 |
s := Dialog |
5010 |
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)\') |
|
5011 |
initialAnswer:oldPrio printString. |
|
5012 |
s isEmptyOrNil ifTrue:[^ self]. |
|
5013 |
newPrio := Integer readFrom:s onError:nil. |
|
5014 |
newPrio isNil |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5015 |
] whileTrue. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5016 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5017 |
newPrio := newPrio max:(Processor lowestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5018 |
newPrio := newPrio min:(Processor highestPriority). |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5019 |
newPrio >= Processor highIOPriority ifTrue:[ |
17185 | 5020 |
(Dialog |
5021 |
confirm:(resources |
|
5022 |
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?')) |
|
5023 |
ifFalse:[^ self]. |
|
11378
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5024 |
]. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5025 |
(inspectedProcess ? Processor activeProcess) priority:newPrio. |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5026 |
|
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5027 |
"Created: / 07-03-2012 / 14:15:09 / cg" |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5028 |
! |
d7e8d0227a78
added: #doChangeProcessPriority
Claus Gittinger <cg@exept.de>
parents:
11372
diff
changeset
|
5029 |
|
266 | 5030 |
doContinue |
5031 |
"continue from menu" |
|
5032 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
5033 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
5034 |
|
17109 | 5035 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Continue anyway ?') |
5036 |
ifFalse:[ ^ self ]. |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5037 |
|
266 | 5038 |
inspecting ifTrue:[ |
16253 | 5039 |
device hasColors ifTrue:[ |
5040 |
continueButton foregroundColor:Color red darkened. |
|
5041 |
]. |
|
5042 |
continueButton label:(resources string:'Stop'). |
|
5043 |
continueButton action:[self doStop]. |
|
5044 |
||
5045 |
self processPerform:#resume. |
|
5046 |
||
5047 |
^ self |
|
266 | 5048 |
]. |
5049 |
canContinue ifTrue:[ |
|
16253 | 5050 |
exContext := thisContext findSpecialHandle:false raise:true. |
5051 |
||
5052 |
(exContext notNil |
|
17122 | 5053 |
and:[ (ex := exContext receiver) isProtoObject not |
16253 | 5054 |
and:[ ex isException |
5055 |
and:[ ex creator == NoHandlerError |
|
5056 |
and:[ ex exception creator == RecursionError]]]]) |
|
5057 |
ifTrue:[ |
|
5058 |
"/ debug due to unhandled recursionInterrupt. |
|
5059 |
"/ ask if we should proceed with more stack. |
|
5060 |
||
5061 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
5062 |
answer == true ifTrue:[ |
|
5063 |
proc := Processor activeProcess. |
|
5064 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
5065 |
]. |
|
5066 |
]. |
|
5067 |
||
5068 |
steppedContext := wrapperContext := nil. |
|
5069 |
tracing := false. |
|
5070 |
haveControl := false. |
|
5071 |
exitAction := #continue. |
|
5072 |
||
5073 |
"exit private event-loop" |
|
5074 |
catchBlock value. |
|
5075 |
||
5076 |
"/ not reached. |
|
5077 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
5078 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5079 |
|
266 | 5080 |
] ifFalse:[ |
16253 | 5081 |
inspecting ifFalse:[ |
5082 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
5083 |
self showSelection:1. |
|
5084 |
self doReturn |
|
5085 |
] |
|
266 | 5086 |
] |
477 | 5087 |
|
17109 | 5088 |
"Modified: / 26-07-1999 / 15:38:45 / stefan" |
5089 |
"Modified: / 25-11-2016 / 13:37:20 / cg" |
|
266 | 5090 |
! |
5091 |
||
13351 | 5092 |
doContinueAfterDelay |
5093 |
Delay waitForSeconds:5. |
|
5094 |
self doContinue. |
|
5095 |
! |
|
5096 |
||
3187 | 5097 |
doDefine |
5955 | 5098 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5099 |
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
|
5100 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5101 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5102 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5103 |
|
13488 | 5104 |
selectorToDefine notNil ifTrue:[ |
17185 | 5105 |
selector := selectorToDefine. |
5106 |
receiversClass := classToDefineIn. |
|
13488 | 5107 |
] ifFalse:[ |
17185 | 5108 |
selector := actualContext selector. |
5109 |
receiversClass := actualContext receiver class. |
|
13538 | 5110 |
]. |
5111 |
||
5112 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
|
5113 |
implClass notNil ifTrue:[ |
|
17185 | 5114 |
"/ must be a subclassResponsibility |
5115 |
||
5116 |
idx := contextArray identityIndexOf:actualContext. |
|
5117 |
idx > 1 ifTrue:[ |
|
5118 |
callee := contextArray at:idx-1. |
|
5119 |
||
5120 |
callee selector == #subclassResponsibility ifTrue:[ |
|
5121 |
restart := false. |
|
5122 |
] |
|
5123 |
]. |
|
13538 | 5124 |
]. |
5125 |
||
5126 |
"generate nice argument names" |
|
5127 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
5128 |
bagOfUsedClassNames := Bag new. |
|
5129 |
argNames := actualContext args |
|
17185 | 5130 |
collect: |
5131 |
[:eachArg | |
|
5132 |
|nm| |
|
5133 |
||
5134 |
nm := eachArg class nameWithoutPrefix. |
|
5135 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
5136 |
nm article , nm |
|
5137 |
] ifFalse:[ |
|
5138 |
bagOfUsedClassNames add:nm. |
|
5139 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
5140 |
]. |
|
5141 |
]. |
|
5955 | 5142 |
|
5143 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 5144 |
|
3447 | 5145 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
5146 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
5147 |
||
13488 | 5148 |
|
5149 |
( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[ |
|
17185 | 5150 |
(self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?') |
5151 |
ifFalse:[ |
|
5152 |
^ self |
|
5153 |
] |
|
3447 | 5154 |
]. |
5155 |
||
5156 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5157 |
"/ code for a getter |
3447 | 5158 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
17185 | 5159 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
5160 |
cat := 'accessing'. |
|
3447 | 5161 |
]. |
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5162 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5163 |
"/ code for a setter |
3447 | 5164 |
(selector numArgs == 1 |
5165 |
and:[(selector endsWith:':') |
|
12716
062e27d32904
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12687
diff
changeset
|
5166 |
and:[receiversClass instVarNames includes:(selector copyButLast:1)]]) |
3447 | 5167 |
ifTrue:[ |
17185 | 5168 |
varName := selector copyButLast:1. |
5169 |
argName := argNames first. |
|
5170 |
code := '%1\' , haltStmtFix , '\ %3 := %4.'. |
|
5171 |
cat := 'accessing'. |
|
3447 | 5172 |
]. |
5173 |
||
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5174 |
"/ code for a tester |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5175 |
(selector numArgs == 0 |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5176 |
and:[(selector startsWith:'is') |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5177 |
and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]]) |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5178 |
ifTrue:[ |
17185 | 5179 |
(receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[ |
5180 |
code := '%1\' , haltStmtFix , '\ ^ true.'. |
|
5181 |
] ifFalse:[ |
|
5182 |
code := '%1\' , haltStmtFix , '\ ^ false.'. |
|
5183 |
]. |
|
5184 |
cat := 'testing'. |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5185 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5186 |
|
3447 | 5187 |
"/ actualContext receiver isClass ifTrue:[ |
5188 |
"/ selector == #new ifTrue:[ |
|
5189 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
5190 |
"/ ]. |
|
5191 |
"/ selector == #'new:' ifTrue:[ |
|
5192 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
5193 |
"/ ]. |
|
5194 |
"/ ]. |
|
5195 |
code isNil ifTrue:[ |
|
17185 | 5196 |
code := '%1\' , haltStmtDef |
10205 | 5197 |
]. |
5198 |
||
5199 |
self |
|
17185 | 5200 |
codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs |
5201 |
inClass:receiversClass |
|
5202 |
unwind:false |
|
5203 |
category:cat |
|
5204 |
onCancel:[^ self]. |
|
3269 | 5205 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
5206 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5207 |
restart ifTrue:[ |
17185 | 5208 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5209 |
] |
3427 | 5210 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
5211 |
"Modified: / 23-03-2012 / 09:49:31 / cg" |
3187 | 5212 |
! |
5213 |
||
14523 | 5214 |
doGotoApplicationActionMethod |
5215 |
"select the first application-model context. |
|
5216 |
This is another great helper, when you hit an exception, |
|
5217 |
to quickly navigate to the responsible code of you application" |
|
5218 |
||
5219 |
contextArray keysAndValuesDo:[:i :c | |
|
17185 | 5220 |
|nextCon nextRcvr dialog| |
5221 |
||
5222 |
"/ find the first appModel context |
|
5223 |
nextCon := contextArray at:i+1. |
|
5224 |
"/ |
|
5225 |
"/ while not in the appModel |
|
5226 |
"/ |
|
5227 |
[ |
|
5228 |
nextRcvr := nextCon receiver. |
|
5229 |
(nextRcvr isKindOf:ApplicationModel) |
|
5230 |
] whileFalse:[ |
|
5231 |
nextCon := nextCon sender |
|
5232 |
]. |
|
5233 |
self selectContext:nextCon. |
|
5234 |
^ self. |
|
14523 | 5235 |
]. |
5236 |
"/ not found |
|
5237 |
gotoApplicationActionMethodButton disable. |
|
5238 |
! |
|
5239 |
||
13362 | 5240 |
doGotoDialogOpener |
14523 | 5241 |
"select the context where the dialog was opened. |
5242 |
This is a great helper, when you press interrupt while a modal dialog |
|
5243 |
is open, to quickly navigate to the corresponding opening code of you application" |
|
13362 | 5244 |
|
5245 |
contextArray keysAndValuesDo:[:i :c | |
|
17185 | 5246 |
|nextCon nextRcvr dialog| |
5247 |
||
5248 |
"/ find the openModal, then walk upward |
|
5249 |
((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[ |
|
5250 |
dialog := c receiver. |
|
5251 |
nextCon := contextArray at:i+1. |
|
5252 |
"/ |
|
5253 |
"/ while still in dialog code |
|
5254 |
"/ |
|
5255 |
[ |
|
5256 |
nextRcvr := nextCon receiver. |
|
5257 |
(nextRcvr == dialog) |
|
5258 |
or:[ nextRcvr == dialog class |
|
5259 |
or:[ nextRcvr == DialogBox ]] |
|
5260 |
] whileTrue:[ |
|
5261 |
(nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ |
|
5262 |
nextCon := nextCon methodHome |
|
5263 |
]. |
|
5264 |
nextCon := nextCon sender. |
|
5265 |
]. |
|
5266 |
"/ |
|
5267 |
"/ while still in a Notification |
|
5268 |
"/ |
|
5269 |
[ |
|
5270 |
nextRcvr := nextCon receiver. |
|
5271 |
(nextRcvr isKindOf:UserInformation) |
|
5272 |
or:[ nextRcvr isBehavior |
|
5273 |
and:[nextRcvr includesBehavior:UserInformation]] |
|
5274 |
] whileTrue:[ |
|
5275 |
nextCon := nextCon sender |
|
5276 |
]. |
|
5277 |
"/ |
|
5278 |
"/ while still in UIBuilder |
|
5279 |
"/ |
|
5280 |
[ |
|
5281 |
nextRcvr := nextCon receiver. |
|
5282 |
(nextRcvr isKindOf:WindowBuilder) |
|
5283 |
] whileTrue:[ |
|
5284 |
nextCon := nextCon sender |
|
5285 |
]. |
|
5286 |
"/ |
|
5287 |
"/ while still in SimpleDialog |
|
5288 |
"/ |
|
5289 |
[ |
|
5290 |
nextRcvr := nextCon receiver. |
|
5291 |
(nextRcvr class == SimpleDialog) |
|
5292 |
] whileTrue:[ |
|
5293 |
nextCon := nextCon sender |
|
5294 |
]. |
|
5295 |
"/ |
|
5296 |
"/ while still in applicationModel support code |
|
5297 |
"/ |
|
5298 |
[ |
|
5299 |
(nextCon selector startsWith:'openDialogSpec'). |
|
5300 |
] whileTrue:[ |
|
5301 |
nextCon := nextCon sender |
|
5302 |
]. |
|
5303 |
self selectContext:nextCon. |
|
5304 |
^ self. |
|
5305 |
] |
|
13362 | 5306 |
]. |
13388 | 5307 |
"/ not found |
13362 | 5308 |
gotoDialogOpenerButton disable. |
5309 |
! |
|
5310 |
||
12671 | 5311 |
doInspectProcess |
5312 |
(inspectedProcess ? Processor activeProcess) inspect. |
|
5313 |
! |
|
5314 |
||
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5315 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5316 |
"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
|
5317 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5318 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5319 |
|
17109 | 5320 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Step anyway ?') |
5321 |
ifFalse:[ ^ self ]. |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5322 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5323 |
canContinue ifTrue:[ |
16961 | 5324 |
steppedContext := wrapperContext := nil. |
5325 |
haveControl := false. |
|
5326 |
exitAction := #step. |
|
5327 |
||
5328 |
"exit private event-loop" |
|
5329 |
catchBlock value. |
|
5330 |
||
5331 |
"/ not reached |
|
5332 |
'DebugView [warning]: send failed' errorPrintCR. |
|
5333 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5334 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5335 |
|
17109 | 5336 |
"Created: / 06-03-1997 / 21:09:36 / cg" |
5337 |
"Modified: / 25-11-2016 / 13:37:34 / cg" |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5338 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5339 |
|
266 | 5340 |
doNext |
1072 | 5341 |
"skip for next source-code line; entering blocks" |
266 | 5342 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5343 |
stepHow := #nextIn. |
266 | 5344 |
self doStep:nil |
790 | 5345 |
|
1072 | 5346 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5347 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5348 |
|
13351 | 5349 |
doNextAfterDelay |
5350 |
Delay waitForSeconds:5. |
|
5351 |
self doNext. |
|
5352 |
! |
|
5353 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5354 |
doNextOut |
1072 | 5355 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5356 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5357 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5358 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5359 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5360 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 5361 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5362 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5363 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5364 |
doNextOver |
1072 | 5365 |
"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
|
5366 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5367 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5368 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5369 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5370 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 5371 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 5372 |
! |
5373 |
||
5374 |
doNoTrace |
|
5375 |
traceView notNil ifTrue:[ |
|
17185 | 5376 |
traceView topView destroy. |
5377 |
traceView := nil. |
|
266 | 5378 |
]. |
5379 |
tracing := false |
|
5380 |
! |
|
5381 |
||
4356 | 5382 |
doOpenReportMailApp |
5383 |
"open a mail report tool" |
|
5384 |
||
5385 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5386 |
|
4356 | 5387 |
str := '' writeStream. |
5388 |
||
5389 |
str nextPutLine:('Error notification from ' |
|
17185 | 5390 |
, OperatingSystem getLoginName |
5391 |
, '@' |
|
5392 |
, OperatingSystem getHostName). |
|
4356 | 5393 |
str cr. |
5394 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
5395 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 5396 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
5397 |
str nextPutLine:('Description: ' , self label). |
|
5398 |
"/ str nextPutLine:('Error: ', printedException description). |
|
5399 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
5400 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
5401 |
str nextPutLine:'Backtrace:'. |
|
5402 |
str cr. |
|
5403 |
||
5404 |
firstContext notNil ifTrue:[ |
|
17185 | 5405 |
firstContext fullPrintAllOn:str. |
4356 | 5406 |
]. |
5407 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5408 |
|
10205 | 5409 |
SendMailTool |
17185 | 5410 |
openForMessage:(str contents) |
5411 |
withSubject:('STX Error:[', self label, ']') |
|
5412 |
preOpenBlock:[:inst| |
|
5413 |
inst recipientEntryField value:'error@exept.de' |
|
5414 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5415 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
5416 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 5417 |
! |
5418 |
||
13360 | 5419 |
doResend |
5420 |
"resend - the selected context is unwound and its message resent. |
|
5421 |
To be done after a cde change, to get nto the new method" |
|
5422 |
||
5423 |
inspecting ifTrue:[ |
|
17109 | 5424 |
^ self showError:'** not avail in inspecting debugger **' |
5425 |
]. |
|
5426 |
||
5427 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Resend anyway ?') |
|
5428 |
ifFalse:[ ^ self ]. |
|
5429 |
||
13360 | 5430 |
steppedContext := wrapperContext := nil. |
5431 |
haveControl := false. |
|
5432 |
exitAction := #resend. "exit private event-loop" |
|
5433 |
||
5434 |
catchBlock value. |
|
5435 |
||
5436 |
"/ normally not reached |
|
5437 |
||
5438 |
'DebugView [warning]: resend failed' errorPrintCR. |
|
5439 |
resendButton turnOff. |
|
17109 | 5440 |
|
5441 |
"Modified: / 25-11-2016 / 13:37:56 / cg" |
|
13360 | 5442 |
! |
5443 |
||
266 | 5444 |
doRestart |
5445 |
"restart - the selected context will be restarted" |
|
10205 | 5446 |
|
17109 | 5447 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Restart anyway ?') |
5448 |
ifFalse:[ ^ self ]. |
|
5449 |
||
266 | 5450 |
inspecting ifTrue:[ |
17109 | 5451 |
selectedContext isNil ifTrue:[ |
5452 |
^ self showError:'** select a context first **' |
|
5453 |
]. |
|
5454 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
5455 |
^ self |
|
266 | 5456 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5457 |
steppedContext := wrapperContext := nil. |
266 | 5458 |
haveControl := false. |
6365 | 5459 |
exitAction := #restart. "exit private event-loop" |
5460 |
||
5461 |
catchBlock value. |
|
5462 |
||
5463 |
"/ normally not reached |
|
10205 | 5464 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5465 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5466 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5467 |
|
17109 | 5468 |
"Modified: / 25-11-2016 / 13:38:14 / cg" |
266 | 5469 |
! |
5470 |
||
5471 |
doReturn |
|
5472 |
"return - the selected context will do a ^nil" |
|
5473 |
||
17109 | 5474 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Return anyway ?') |
5475 |
ifFalse:[ ^ self ]. |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5476 |
|
266 | 5477 |
inspecting ifTrue:[ |
17109 | 5478 |
selectedContext isNil ifTrue:[ |
5479 |
^ self showError:'** select a context first **' |
|
5480 |
]. |
|
5481 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
5482 |
^ self |
|
266 | 5483 |
]. |
5484 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5485 |
steppedContext := wrapperContext := nil. |
266 | 5486 |
haveControl := false. |
5487 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5488 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5489 |
"exit private event-loop" |
6365 | 5490 |
catchBlock value. |
477 | 5491 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5492 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
5493 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5494 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5495 |
|
17109 | 5496 |
"Modified: / 25-11-2016 / 13:38:27 / cg" |
266 | 5497 |
! |
5498 |
||
5499 |
doSend |
|
5500 |
"single send; reenter with next message send" |
|
5501 |
||
1072 | 5502 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5503 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5504 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5505 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5506 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5507 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5508 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5509 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5510 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5511 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5512 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5513 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5514 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5515 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5516 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5517 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5518 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
5519 |
|
1072 | 5520 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 5521 |
! |
5522 |
||
5523 |
doStep |
|
5524 |
"skip for next send in selected method" |
|
5525 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
5526 |
stepHow := #step. |
790 | 5527 |
self doStep:-1 |
5528 |
||
1072 | 5529 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 5530 |
! |
5531 |
||
13197 | 5532 |
doStep:lineNrOrNilOrMinus1 |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5533 |
"common helper for step, skip & next. |
10205 | 5534 |
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
|
5535 |
or to next line (if nil) or to next send (if -1)" |
266 | 5536 |
|
5537 |
|con method| |
|
5538 |
||
5539 |
inspecting ifTrue:[^ self]. |
|
5540 |
||
17109 | 5541 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Step anyway ?') |
5542 |
ifFalse:[ ^ self ]. |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5543 |
|
266 | 5544 |
canContinue ifTrue:[ |
16961 | 5545 |
selectedContext notNil ifTrue:[ |
5546 |
con := actualContext. "/ selectedContext. |
|
5547 |
steppedContextLineno := actualContext lineNumber. |
|
5548 |
] ifFalse:[ |
|
5549 |
con := contextArray at:2. |
|
5550 |
steppedContextLineno := con lineNumber. |
|
5551 |
]. |
|
5552 |
||
5553 |
skipLineNr := lineNrOrNilOrMinus1. |
|
5554 |
||
5555 |
lineNrOrNilOrMinus1 == -1 ifTrue:[ |
|
5556 |
steppedContextLineno := skipLineNr := nil. |
|
5557 |
]. |
|
5558 |
||
5559 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
5560 |
steppedContext := contextArray at:1. |
|
5561 |
stepHow := #nextIn. |
|
5562 |
] ifFalse:[ |
|
5563 |
stepHow == #nextOut ifTrue:[ |
|
5564 |
steppedContext := con home. |
|
5565 |
] ifFalse:[ |
|
5566 |
steppedContext := con. |
|
5567 |
]. |
|
5568 |
]. |
|
5569 |
||
5570 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
5571 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
5572 |
"/ ' 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
|
5573 |
|
16961 | 5574 |
" |
5575 |
if we step in a wrapped method, |
|
5576 |
prepare to skip the prolog ... |
|
5577 |
" |
|
5578 |
||
5579 |
inWrap := false. |
|
5580 |
method := con method. |
|
5581 |
(method notNil |
|
5582 |
and:[method isWrapped |
|
5583 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
5584 |
inWrap := true |
|
5585 |
]. |
|
5586 |
||
5587 |
lineNrOrNilOrMinus1 == #return ifTrue:[ |
|
5588 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
5589 |
]. |
|
5590 |
||
5591 |
con := nil. |
|
5592 |
bigStep := true. |
|
5593 |
haveControl := false. |
|
5594 |
exitAction := #step. |
|
5595 |
||
5596 |
"exit private event-loop" |
|
5597 |
catchBlock value. |
|
5598 |
||
5599 |
"/ not reached |
|
5600 |
'DebugView [warning]: step failed' errorPrintCR. |
|
5601 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 5602 |
] |
477 | 5603 |
|
17109 | 5604 |
"Modified: / 25-11-2016 / 13:38:40 / cg" |
266 | 5605 |
! |
5606 |
||
13351 | 5607 |
doStepAfterDelay |
5608 |
Delay waitForSeconds:5. |
|
5609 |
self doStep. |
|
5610 |
! |
|
5611 |
||
266 | 5612 |
doStop |
5613 |
"stop the process (if its running, otherwise this is a no-op)" |
|
5614 |
||
5615 |
inspecting ifTrue:[ |
|
16253 | 5616 |
device hasColors ifTrue:[ |
5617 |
continueButton foregroundColor:Color green darkened darkened. |
|
5618 |
]. |
|
5619 |
continueButton label:(resources string:'Continue'). |
|
5620 |
continueButton action:[self doContinue]. |
|
5621 |
||
5622 |
self processPerform:#stop. |
|
5623 |
||
5624 |
^ self |
|
266 | 5625 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5626 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5627 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 5628 |
! |
5629 |
||
5630 |
doTerminate |
|
5631 |
"terminate - the process has a chance for cleanup" |
|
5632 |
||
17109 | 5633 |
(self checkIfCodeIsReallyModifiedAndConfirmWith:'Code was modified.\\Terminate anyway ?') |
5634 |
ifFalse:[ ^ self ]. |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5635 |
|
266 | 5636 |
inspecting ifTrue:[ |
17109 | 5637 |
self processPerform:#terminate. |
5638 |
^ self |
|
266 | 5639 |
]. |
5640 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
5641 |
steppedContext := wrapperContext := nil. |
266 | 5642 |
haveControl := false. |
10205 | 5643 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5644 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5645 |
"exit private event-loop" |
6365 | 5646 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5647 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5648 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5649 |
inspecting ifFalse:[ |
17109 | 5650 |
'DebugView [warning]: terminate failed' errorPrintCR. |
5651 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
5652 |
Debugger newDebugger. |
|
5653 |
Processor activeProcess terminate. |
|
5654 |
] |
|
266 | 5655 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
5656 |
terminateButton turnOff. |
477 | 5657 |
|
17109 | 5658 |
"Modified: / 25-11-2016 / 13:38:51 / cg" |
266 | 5659 |
! |
5660 |
||
5661 |
doTrace |
|
5662 |
"tracing - not really implemented ..." |
|
5663 |
||
5664 |
self warn:'this function is not yet implemented'. |
|
5665 |
||
5666 |
"/ |v b| |
|
5667 |
"/ |
|
5668 |
"/ traceView isNil ifTrue:[ |
|
5669 |
"/ v := StandardSystemView on:Display. |
|
5670 |
"/ v label:'Debugger-Trace'. |
|
5671 |
"/ v icon:icon. |
|
5672 |
"/ |
|
5673 |
"/ b := Button label:'untrace' in:v. |
|
5674 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
5675 |
"/ b action:[ |
|
5676 |
"/ StepInterruptPending := nil. |
|
5677 |
"/ tracing := false. |
|
5678 |
"/ v unrealize. |
|
5679 |
"/ traceView := nil |
|
5680 |
"/ ]. |
|
5681 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
5682 |
"/ traceView origin:(0 @ (b height)) |
|
5683 |
"/ extent:[v width @ (v height - b height)] |
|
5684 |
"/ ]. |
|
5685 |
"/ v realize. |
|
5686 |
"/ |
|
5687 |
"/ tracing := true. |
|
5688 |
! |
|
5689 |
||
5690 |
doTraceStep |
|
5691 |
"tracestep - not implemented yet" |
|
5692 |
||
5693 |
canContinue ifTrue:[ |
|
17185 | 5694 |
tracing := true. |
5695 |
self doStep |
|
266 | 5696 |
] |
5697 |
! |
|
5698 |
||
5699 |
exit |
|
5700 |
"exit from menu: immediate exit from smalltalk" |
|
5701 |
||
14129 | 5702 |
OperatingSystem exit:10 |
266 | 5703 |
! |
5704 |
||
13388 | 5705 |
findContextForWhich:aBlock thenDo:additionalAction |
5706 |
|con| |
|
5707 |
||
5708 |
con := self selectedContext. |
|
5709 |
con isNil ifTrue:[^ self]. |
|
5710 |
||
5711 |
con := con sender. |
|
5712 |
[con notNil] whileTrue:[ |
|
17185 | 5713 |
(aBlock value:con) ifTrue:[ |
5714 |
(self selectContext:con) ifTrue:[ |
|
5715 |
additionalAction value:con. |
|
5716 |
^ self. |
|
5717 |
] |
|
5718 |
]. |
|
5719 |
con := con sender. |
|
13388 | 5720 |
]. |
5721 |
||
5722 |
Dialog information:'None found'. |
|
5723 |
! |
|
5724 |
||
5725 |
findContextWithStringInSource |
|
5726 |
|stringToSearch source| |
|
5727 |
||
5728 |
stringToSearch := Dialog request:'Search what:'. |
|
5729 |
stringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5730 |
||
15413 | 5731 |
self |
17185 | 5732 |
findContextForWhich:[:con | |
5733 |
con method notNil |
|
5734 |
and:[ (source := con method source) notNil |
|
5735 |
and:[ (source includesString:stringToSearch) ]] |
|
5736 |
] |
|
5737 |
thenDo:[:con | |
|
5738 |
codeView searchFwd:stringToSearch. |
|
5739 |
] |
|
13388 | 5740 |
! |
5741 |
||
5742 |
findContextWithValueInVariable |
|
5743 |
|valueStringToSearch| |
|
5744 |
||
5745 |
valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'. |
|
5746 |
valueStringToSearch isEmptyOrNil ifTrue:[^ self]. |
|
5747 |
||
15413 | 5748 |
self |
17185 | 5749 |
findContextForWhich:[:con | |
5750 |
con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase] |
|
5751 |
] |
|
5752 |
thenDo:[:con | ] |
|
13388 | 5753 |
! |
5754 |
||
11595 | 5755 |
findHandlerFor |
13388 | 5756 |
|exClass con| |
11595 | 5757 |
|
15413 | 5758 |
(con := self selectedContext) isNil ifTrue:[ |
17185 | 5759 |
con := contextArray at:1 |
11595 | 5760 |
]. |
5761 |
con sender isNil ifTrue:[ |
|
17185 | 5762 |
self information:'Context has already returned'. |
5763 |
^ self |
|
15413 | 5764 |
]. |
5765 |
||
5766 |
exClass := Dialog |
|
17185 | 5767 |
choose:'Exception class:' |
5768 |
fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name]) |
|
5769 |
lines:25 |
|
5770 |
title:'Choose Exception class'. |
|
14523 | 5771 |
exClass isNil ifTrue:[^ self]. |
13388 | 5772 |
|
15413 | 5773 |
self |
17185 | 5774 |
findContextForWhich:[:con | |
5775 |
con isHandleContext |
|
5776 |
and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] |
|
5777 |
] |
|
5778 |
thenDo:[:con | |
|
5779 |
self selectContext:con sender. |
|
5780 |
] |
|
13388 | 5781 |
! |
5782 |
||
15255 | 5783 |
findHomeContext |
5784 |
|con home| |
|
5785 |
||
5786 |
(con := self selectedContext) isNil ifTrue:[ |
|
17185 | 5787 |
self beep. |
5788 |
^ self. |
|
15255 | 5789 |
]. |
5790 |
(home := con home) isNil ifTrue:[ |
|
17185 | 5791 |
self beep. |
5792 |
^ self. |
|
15255 | 5793 |
]. |
5794 |
||
5795 |
"/ still have to find it - home could be elsewhere (another process) |
|
5796 |
"/ (i.e. cannot simply select it) |
|
5797 |
||
15413 | 5798 |
self |
17185 | 5799 |
findContextForWhich:[:con | |
5800 |
con == home |
|
5801 |
] |
|
5802 |
thenDo:[:con | |
|
5803 |
self selectContext:con. |
|
5804 |
] |
|
15255 | 5805 |
! |
5806 |
||
13388 | 5807 |
findNextExceptionHandlerContext |
15413 | 5808 |
self |
17185 | 5809 |
findContextForWhich:[:con | |
5810 |
con isHandleContext |
|
5811 |
] |
|
5812 |
thenDo:[:con | |
|
5813 |
self selectContext:con sender. |
|
5814 |
] |
|
11595 | 5815 |
! |
5816 |
||
266 | 5817 |
inspectContext |
5818 |
"launch an inspector on the currently selected context" |
|
5819 |
||
11595 | 5820 |
|con| |
5821 |
||
5822 |
(con := self selectedContext) notNil ifTrue:[ |
|
17185 | 5823 |
con inspect. |
266 | 5824 |
] |
11595 | 5825 |
|
5826 |
"Modified: / 17-07-2012 / 12:52:34 / cg" |
|
266 | 5827 |
! |
5828 |
||
15247 | 5829 |
inspectContextsMethod |
5830 |
"launch an inspector on the currently selected context's method" |
|
5831 |
||
5832 |
|con| |
|
5833 |
||
5834 |
(con := self selectedContext) notNil ifTrue:[ |
|
17185 | 5835 |
con method inspect. |
15247 | 5836 |
] |
5837 |
! |
|
5838 |
||
17106 | 5839 |
inspectProcessesApplication |
5840 |
"inspect the application (of the process, if it is a GUI process)" |
|
5841 |
||
5842 |
|app| |
|
5843 |
||
5844 |
(app := self processesApplication) notNil ifTrue:[ |
|
5845 |
app inspect. |
|
5846 |
]. |
|
5847 |
! |
|
5848 |
||
12840 | 5849 |
inspectWidgetHierarchy |
17109 | 5850 |
|rcvr view app| |
5851 |
||
12840 | 5852 |
Tools::ViewTreeInspectorApplication isNil ifTrue:[ |
17109 | 5853 |
Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'. |
5854 |
^ self. |
|
5855 |
]. |
|
5856 |
||
5857 |
selectedContext notNil ifTrue:[ |
|
5858 |
rcvr := selectedContext receiver. |
|
5859 |
rcvr isView ifTrue:[ |
|
5860 |
view := rcvr |
|
5861 |
] ifFalse:[ |
|
5862 |
(rcvr isKindOf:ApplicationModel) ifTrue:[ |
|
5863 |
view := rcvr window |
|
5864 |
]. |
|
5865 |
]. |
|
5866 |
]. |
|
5867 |
view isNil ifTrue:[ |
|
5868 |
(app := self processesApplication) notNil ifTrue:[ |
|
5869 |
view := app window |
|
5870 |
] ifFalse:[ |
|
5871 |
Dialog warn:'Please select a context with the app as receiver'. |
|
5872 |
^ self. |
|
5873 |
] |
|
12840 | 5874 |
]. |
5875 |
Tools::ViewTreeInspectorApplication openOn:view |
|
17109 | 5876 |
|
5877 |
"Modified: / 25-11-2016 / 13:21:45 / cg" |
|
12840 | 5878 |
! |
5879 |
||
8142 | 5880 |
middleButtonMenu |
5881 |
<resource: #programMenu > |
|
5882 |
||
9488 | 5883 |
|items m nameOfExecutable| |
8142 | 5884 |
|
5885 |
exclusive ifTrue:[ |
|
17177 | 5886 |
items := #( |
5887 |
('Show More WalkBack' showMore ) |
|
5888 |
('-' ) |
|
5889 |
('Add Breakpoint' addBreakpoint ) |
|
5890 |
('Remove Breakpoint' removeBreakpoint ) |
|
5891 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
5892 |
('-' ) |
|
5893 |
). |
|
8142 | 5894 |
] ifFalse:[ |
17177 | 5895 |
items := #( |
5896 |
('Show More WalkBack' showMore ) |
|
5897 |
('-' ) |
|
5898 |
('Skip' skip ) |
|
5899 |
('Step Out' skipForReturn ) |
|
5900 |
('Skip until Entering...' skipUntilEntering ) |
|
5901 |
('-' ) |
|
8142 | 5902 |
" |
17177 | 5903 |
('Continue' doContinue ) |
5904 |
('Terminate' doTerminate ) |
|
5905 |
('Abort' doAbort ) |
|
5906 |
('-' ) |
|
5907 |
('Step' doStep ) |
|
5908 |
('Send' doSend ) |
|
5909 |
('-' ) |
|
5910 |
('Return' doReturn ) |
|
5911 |
('Restart' doRestart ) |
|
5912 |
('-' ) |
|
8142 | 5913 |
" |
17177 | 5914 |
('Add Breakpoint' addBreakpoint ) |
5915 |
('Remove Breakpoint' removeBreakpoint ) |
|
5916 |
('Remove all Break- & Tracepoints' removeAllBreakpoints ) |
|
5917 |
). |
|
11210 | 5918 |
|
12840 | 5919 |
"/ self allowBreakPointsInDebugger ifFalse:[ |
5920 |
"/ items := items , #( |
|
5921 |
"/ ('Allow Breakpoints & halt in Debugger' doNotIgnoreBreakpoints ) |
|
5922 |
"/ ). |
|
5923 |
"/ ] ifTrue:[ |
|
5924 |
"/ items := items , #( |
|
5925 |
"/ ('Ignore Breakpoints & halt in Debugger' doIgnoreBreakpoints ) |
|
5926 |
"/ ). |
|
5927 |
"/ ]. |
|
11210 | 5928 |
|
17177 | 5929 |
items := items , #( |
5930 |
('-' ) |
|
5931 |
('Browse Implementing Class' browseImplementingClass ) |
|
5932 |
('Browse Receiver''s Class' browseReceiversClass ) |
|
5933 |
('Browse Blocks''s Home' browseBlocksHome ) |
|
11610 | 5934 |
"/ ('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
5935 |
"/ ('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
17177 | 5936 |
('Implementors' browseImplementors ) |
5937 |
('Implementors Of...' browseImplementorsOf ) |
|
5938 |
('Senders' browseSenders ) |
|
5939 |
('Senders Of...' browseSendersOf ) |
|
5940 |
('-' ) |
|
5941 |
('Inspect Context' inspectContext ) |
|
5942 |
). |
|
8142 | 5943 |
]. |
5944 |
||
9488 | 5945 |
items := items , #( |
17177 | 5946 |
('Copy WalkBack Text' copyWalkbackText ) |
5947 |
('-' ) |
|
5948 |
('Hard Terminate (Danger)' quickTerminate ) |
|
5949 |
('=' )). |
|
9488 | 5950 |
|
5951 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
5952 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
5953 |
||
5954 |
items := items , { |
|
17177 | 5955 |
{ 'Exit %1 (Danger: No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
10205 | 5956 |
|
5957 |
m := PopUpMenu |
|
17177 | 5958 |
itemList:items |
5959 |
resources:resources |
|
5960 |
receiver:self |
|
5961 |
for:contextView. |
|
8142 | 5962 |
|
5963 |
inspecting ifTrue:[ |
|
17177 | 5964 |
m notNil ifTrue:[ |
5965 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
5966 |
browseClassHierarchy browseFullClassProtocol |
|
5967 |
browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut). |
|
5968 |
]. |
|
8142 | 5969 |
]. |
5970 |
self updateMenuItems. |
|
5971 |
||
5972 |
^ m. |
|
9488 | 5973 |
|
13210 | 5974 |
"Modified: / 22-07-2013 / 15:30:05 / cg" |
8142 | 5975 |
! |
5976 |
||
15257 | 5977 |
notShowingDenseWalkbackHolder |
5978 |
^ BlockValue forLogicalNot: self showingDenseWalkbackHolder. |
|
5979 |
! |
|
5980 |
||
11573 | 5981 |
notShowingSupportCode |
5982 |
^ hideSupportCode == true. |
|
5983 |
||
5984 |
"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
|
5985 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
5986 |
|
3447 | 5987 |
openAboutThisApplication |
5988 |
"opens an about box for this application." |
|
5989 |
||
7112 | 5990 |
Dialog aboutClass:self class. |
5991 |
||
5992 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 5993 |
! |
5994 |
||
8620 | 5995 |
openSettingsDialog |
14559 | 5996 |
|settingsList| |
8620 | 5997 |
|
10205 | 5998 |
settingsList := |
17185 | 5999 |
#( |
6000 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
6001 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
6002 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
6003 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
6004 |
). |
|
15413 | 6005 |
|
6006 |
SettingsDialog |
|
17185 | 6007 |
openWithList:settingsList |
6008 |
label:(resources string:'Debugger Settings'). |
|
8620 | 6009 |
! |
6010 |
||
13488 | 6011 |
processesApplication |
6012 |
"if the debugged process is a GUI process, |
|
6013 |
AND it has an applicaiton, return it. |
|
6014 |
Otherwise, return nil" |
|
6015 |
||
14430 | 6016 |
|p wgs app nonModalWGs| |
13488 | 6017 |
|
6018 |
p := inspectedProcess ? Processor activeProcess. |
|
6019 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
|
17185 | 6020 |
wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p]. |
6021 |
nonModalWGs := wgs reject:[:wg | wg isModal]. |
|
6022 |
nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application]. |
|
6023 |
||
6024 |
wgs do:[:wg | |
|
6025 |
|wgi| |
|
6026 |
||
6027 |
wgi := wg. |
|
6028 |
[wgi notNil] whileTrue:[ |
|
6029 |
(app := wgi application) notNil ifTrue:[^ app]. |
|
6030 |
wgi isModal ifTrue:[ |
|
6031 |
wgi := wgi previousGroup |
|
6032 |
] ifFalse:[ |
|
6033 |
wgi := nil. |
|
6034 |
] |
|
6035 |
] |
|
6036 |
] |
|
13488 | 6037 |
]. |
6038 |
^ nil |
|
6039 |
! |
|
6040 |
||
266 | 6041 |
quickTerminate |
6042 |
"quick terminate - the process will get no chance for cleanup actions" |
|
6043 |
||
6044 |
inspecting ifTrue:[ |
|
17185 | 6045 |
self processPerform:#terminateNoSignal. |
6046 |
^ self |
|
266 | 6047 |
]. |
6048 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
6049 |
steppedContext := wrapperContext := nil. |
266 | 6050 |
haveControl := false. |
6051 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6052 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6053 |
"exit private event-loop" |
6365 | 6054 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6055 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6056 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6057 |
inspecting ifFalse:[ |
17185 | 6058 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
6059 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
6060 |
Debugger newDebugger. |
|
6061 |
Processor activeProcess terminateNoSignal. |
|
6062 |
] |
|
266 | 6063 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
6064 |
terminateButton turnOff. |
477 | 6065 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
6066 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 6067 |
! |
6068 |
||
11391 | 6069 |
rememberCallchain |
6070 |
"remember the callchain in a classvar. |
|
6071 |
When entered the next time, highlight already entered contexts. |
|
6072 |
This makes it possible to identitfy the caller as the first common context |
|
6073 |
along the chain (i.e. the context which is responsible for the debugger to be entered)" |
|
6074 |
||
6075 |
RememberedCallChain := contextArray copy |
|
6076 |
||
6077 |
"Created: / 07-03-2012 / 23:07:07 / cg" |
|
6078 |
! |
|
6079 |
||
13388 | 6080 |
selectContext:aContext |
6081 |
|idx| |
|
6082 |
||
6083 |
idx := contextArray identityIndexOf:aContext. |
|
6084 |
idx == 0 ifTrue:[ |
|
17185 | 6085 |
"/ some contexts hidden? |
6086 |
(self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[ |
|
6087 |
Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'. |
|
6088 |
self showFullWalkback. |
|
6089 |
self showingDenseWalkback:false. |
|
6090 |
self showingSupportCode:true. |
|
6091 |
]. |
|
6092 |
idx := contextArray identityIndexOf:aContext. |
|
13388 | 6093 |
]. |
6094 |
idx ~~ 0 ifTrue:[ |
|
17185 | 6095 |
self selectContextWithIndex:idx. |
6096 |
^ true. |
|
13388 | 6097 |
]. |
6098 |
^ false |
|
6099 |
! |
|
6100 |
||
11595 | 6101 |
selectedContext |
15960 | 6102 |
|selIdx| |
6103 |
||
6104 |
(selIdx := contextView selection) notNil ifTrue:[ |
|
6105 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
|
6106 |
^ (contextArray at:selIdx). |
|
6107 |
] |
|
11595 | 6108 |
]. |
6109 |
^ nil |
|
6110 |
||
6111 |
"Created: / 17-07-2012 / 12:52:10 / cg" |
|
6112 |
! |
|
6113 |
||
11647 | 6114 |
showFullWalkback |
6115 |
"double the number of contexts shown" |
|
6116 |
||
6117 |
contextArray notNil ifTrue:[ |
|
17185 | 6118 |
nChainShown := 9999. |
6119 |
self redisplayBacktrace. |
|
11647 | 6120 |
] |
6121 |
||
6122 |
"Created: / 23-07-2012 / 12:24:02 / cg" |
|
6123 |
! |
|
6124 |
||
266 | 6125 |
showMore |
3447 | 6126 |
"double the number of contexts shown" |
266 | 6127 |
|
6128 |
contextArray notNil ifTrue:[ |
|
17185 | 6129 |
nChainShown := nChainShown * 2. |
6130 |
self redisplayBacktrace. |
|
266 | 6131 |
] |
563 | 6132 |
|
3447 | 6133 |
"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
|
6134 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6135 |
|
11573 | 6136 |
showSupportCode |
6137 |
hideSupportCode := false. |
|
6138 |
self redisplayBacktrace. |
|
6139 |
||
6140 |
"Created: / 10-06-2012 / 21:27:53 / cg" |
|
6141 |
! |
|
6142 |
||
3447 | 6143 |
showingDenseWalkback |
15257 | 6144 |
^ self verboseBacktraceHolder value not |
3447 | 6145 |
|
6146 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
6147 |
! |
|
6148 |
||
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6149 |
showingDenseWalkback:aBoolean |
15257 | 6150 |
self verboseBacktraceHolder value:aBoolean not. |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6151 |
self redisplayBacktrace. |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6152 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6153 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6154 |
! |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6155 |
|
15257 | 6156 |
showingDenseWalkbackHolder |
6157 |
^ BlockValue forLogicalNot:self verboseBacktraceHolder |
|
6158 |
! |
|
6159 |
||
11573 | 6160 |
showingSupportCode |
6161 |
^ hideSupportCode == false. |
|
6162 |
||
6163 |
"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
|
6164 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6165 |
|
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6166 |
showingSupportCode:aBoolean |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6167 |
hideSupportCode := aBoolean not. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6168 |
self redisplayBacktrace. |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6169 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6170 |
"Created: / 27-07-2012 / 14:58:00 / cg" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6171 |
! |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
6172 |
|
3447 | 6173 |
showingVerboseWalkback |
15257 | 6174 |
^ self verboseBacktraceHolder value |
3447 | 6175 |
|
6176 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
6177 |
! |
|
6178 |
||
9626 | 6179 |
sizeChanged:how |
10205 | 6180 |
super sizeChanged:how. |
9626 | 6181 |
LastExtent := self extent. |
6182 |
||
6183 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
6184 |
! |
|
6185 |
||
266 | 6186 |
skip |
6187 |
"skip for cursor line in selected method" |
|
6188 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6189 |
stepHow := #skip. |
266 | 6190 |
self doStep:codeView cursorLine. |
790 | 6191 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6192 |
"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
|
6193 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6194 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6195 |
skipForReturn |
2581 | 6196 |
"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
|
6197 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6198 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6199 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
6200 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
6201 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 6202 |
! |
6203 |
||
6204 |
skipUntilEntering |
|
6205 |
"skip until some particular method is invoked." |
|
6206 |
||
6207 |
|selector| |
|
6208 |
||
10205 | 6209 |
selector := Dialog |
17185 | 6210 |
request:'Skip until entering what (matchpattern):' |
6211 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 6212 |
selector size == 0 ifTrue:[^ self]. |
6213 |
||
6214 |
stepUntilEntering := selector asSymbol. |
|
6215 |
stepHow := #send. |
|
6216 |
self doStep:-1. |
|
6217 |
||
6218 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 6219 |
! |
6220 |
||
11573 | 6221 |
toggleShowSupportCode |
6222 |
hideSupportCode ifTrue:[ |
|
17185 | 6223 |
self showSupportCode |
11645
4f39a925956d
changed: #toggleShowSupportCode
Stefan Vogel <sv@exept.de>
parents:
11636
diff
changeset
|
6224 |
] ifFalse:[ |
17185 | 6225 |
self hideSupportCode |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6226 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6227 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6228 |
"Modified: / 17-11-2001 / 20:07:45 / cg" |
11573 | 6229 |
"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
|
6230 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
6231 |
|
3447 | 6232 |
toggleVerboseWalkback |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6233 |
self showingDenseWalkback:(self showingDenseWalkback not) |
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6234 |
|
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
6235 |
"Modified: / 27-07-2012 / 15:00:15 / cg" |
11610 | 6236 |
! |
6237 |
||
6238 |
updateMenuItems |
|
13408 | 6239 |
"enable/disable some menu items, depending on the current selected context" |
6240 |
||
11610 | 6241 |
|m mthd cls mCls rCls| |
6242 |
||
6243 |
m := contextView middleButtonMenu. |
|
6244 |
m notNil ifTrue:[ |
|
17185 | 6245 |
m disable:#removeBreakpoint. |
6246 |
m disable:#addBreakpoint. |
|
6247 |
canShowMore ifFalse:[ |
|
6248 |
m disable:#showMore |
|
6249 |
]. |
|
6250 |
||
6251 |
selectedContext notNil ifTrue:[ |
|
6252 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
6253 |
||
6254 |
mthd := selectedContext method. |
|
6255 |
mthd notNil ifTrue:[ |
|
6256 |
cls := mCls := mthd containingClass. |
|
6257 |
mthd isBreakpointed ifTrue:[ |
|
6258 |
m enable:#removeBreakpoint. |
|
6259 |
] ifFalse:[ |
|
6260 |
m enable:#addBreakpoint. |
|
6261 |
] |
|
6262 |
]. |
|
6263 |
(selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[ |
|
6264 |
"/ a cheap block's context |
|
6265 |
] ifFalse:[ |
|
6266 |
rCls := selectedContext receiver class. |
|
6267 |
cls isNil ifTrue:[ |
|
6268 |
cls := rCls |
|
6269 |
]. |
|
6270 |
]. |
|
6271 |
cls notNil ifTrue:[ |
|
6272 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6273 |
rCls == mCls ifTrue:[ |
|
6274 |
m disable:#browseReceiversClass |
|
6275 |
]. |
|
6276 |
mCls isNil ifTrue:[ |
|
6277 |
m disable:#browseImplementingClass |
|
6278 |
] |
|
6279 |
||
6280 |
] ifFalse:[ |
|
6281 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6282 |
]. |
|
6283 |
mthd notNil ifTrue:[ |
|
6284 |
m enableAll:#(browseImplementingClass). |
|
6285 |
]. |
|
6286 |
selectedContext isCheapBlockContext ifTrue:[ |
|
6287 |
m disableAll:#(browseReceiversClass). |
|
6288 |
]. |
|
6289 |
selectedContext receiver isBlock ifTrue:[ |
|
6290 |
m enableAll:#(browseBlocksHome). |
|
6291 |
] ifFalse:[ |
|
6292 |
m disableAll:#(browseBlocksHome). |
|
6293 |
]. |
|
6294 |
] ifFalse:[ |
|
6295 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy |
|
6296 |
browseBlocksHome browseFullClassProtocol). |
|
6297 |
] |
|
11610 | 6298 |
] |
6299 |
||
6300 |
"Modified: / 19-07-2012 / 11:53:30 / cg" |
|
266 | 6301 |
! ! |
6302 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6303 |
!DebugView methodsFor:'menu & button actions-breakpoints'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6304 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6305 |
addBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6306 |
"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
|
6307 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6308 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6309 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6310 |
selectedContext isNil ifTrue:[ |
17185 | 6311 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6312 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6313 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
17185 | 6314 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6315 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6316 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6317 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6318 |
implementorClass notNil ifTrue:[ |
17185 | 6319 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6320 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
6321 |
method setBreakPoint |
|
6322 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6323 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6324 |
contextView middleButtonMenu disable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6325 |
contextView middleButtonMenu enable:#removeBreakpoint. |
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 |
"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
|
6328 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6329 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6330 |
allowBreakPointsInDebugger |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6331 |
^ ignoreBreakpoints not |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6332 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6333 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6334 |
allowBreakPointsInDebugger:aBoolean |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6335 |
ignoreBreakpoints := aBoolean not. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6336 |
self initializeMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6337 |
self initializeContextViewsMiddleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6338 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6339 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6340 |
doIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6341 |
self allowBreakPointsInDebugger:false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6342 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6343 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6344 |
doNotIgnoreBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6345 |
self allowBreakPointsInDebugger:true |
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 |
|
14680 | 6348 |
ignoreAllHaltsForCurrentProcess |
15413 | 6349 |
self |
17185 | 6350 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6351 |
orThisReceiverClass:false orCurrentProcess:true |
|
6352 |
orIfCalledFromMethod:nil |
|
6353 |
forAll:true. |
|
14680 | 6354 |
|
6355 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6356 |
! |
|
6357 |
||
6358 |
ignoreAllHaltsForThisReceiverClass |
|
15413 | 6359 |
self |
17185 | 6360 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6361 |
orThisReceiverClass:true orCurrentProcess:false |
|
6362 |
orIfCalledFromMethod:nil |
|
6363 |
forAll:true. |
|
14680 | 6364 |
|
6365 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6366 |
! |
|
6367 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6368 |
ignoreAllHaltsForever |
15413 | 6369 |
self |
17185 | 6370 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
6371 |
orThisReceiverClass:false orCurrentProcess:false |
|
6372 |
orIfCalledFromMethod:nil |
|
6373 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6374 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6375 |
"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
|
6376 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6377 |
|
14680 | 6378 |
ignoreAllHaltsIfCalledFromMethod:aMethod |
15413 | 6379 |
self |
17185 | 6380 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6381 |
orThisReceiverClass:false orCurrentProcess:false |
|
6382 |
orIfCalledFromMethod:aMethod |
|
6383 |
forAll:true. |
|
14680 | 6384 |
! |
6385 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6386 |
ignoreAllHaltsUntilShiftKeyIsPressed |
15413 | 6387 |
self |
17185 | 6388 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6389 |
orThisReceiverClass:false orCurrentProcess:false |
|
6390 |
orIfCalledFromMethod:nil |
|
6391 |
forAll:true. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6392 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6393 |
"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
|
6394 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6395 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6396 |
ignoreBreakpointsWithThisParameterForever |
11370 | 6397 |
Object disableBreakPoint:breakPointParameter. |
6398 |
"/ self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:false. |
|
6399 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6400 |
"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
|
6401 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6402 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6403 |
ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed |
15413 | 6404 |
self |
17185 | 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: / 06-03-2012 / 12:35:22 / 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 |
|
12937 | 6413 |
ignoreHaltForCurrentProcess |
15413 | 6414 |
self |
17185 | 6415 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6416 |
orThisReceiverClass:false orCurrentProcess:true |
|
6417 |
orIfCalledFromMethod:nil |
|
6418 |
forAll:false. |
|
12937 | 6419 |
|
6420 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6421 |
! |
|
6422 |
||
6423 |
ignoreHaltForThisReceiverClass |
|
15413 | 6424 |
self |
17185 | 6425 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6426 |
orThisReceiverClass:true orCurrentProcess:false |
|
6427 |
orIfCalledFromMethod:nil |
|
6428 |
forAll:false. |
|
12937 | 6429 |
|
6430 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
6431 |
! |
|
6432 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6433 |
ignoreHaltForever |
15413 | 6434 |
self |
17185 | 6435 |
addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false |
6436 |
orThisReceiverClass:false orCurrentProcess:false |
|
6437 |
orIfCalledFromMethod:nil |
|
6438 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6439 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6440 |
"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
|
6441 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6442 |
|
14608 | 6443 |
ignoreHaltIfCalledFromMethod:aMethod |
15413 | 6444 |
self |
17185 | 6445 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false |
6446 |
orThisReceiverClass:false orCurrentProcess:false |
|
6447 |
orIfCalledFromMethod:aMethod |
|
6448 |
forAll:false. |
|
14608 | 6449 |
! |
6450 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6451 |
ignoreHaltUntilShiftKeyIsPressed |
15413 | 6452 |
self |
17185 | 6453 |
addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true |
6454 |
orThisReceiverClass:false orCurrentProcess:false |
|
6455 |
orIfCalledFromMethod:nil |
|
6456 |
forAll:false. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6457 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6458 |
"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
|
6459 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6460 |
|
14680 | 6461 |
menuForIgnoreAllBreakpointsIfCalledFromAnyOf |
6462 |
<resource: #programMenu > |
|
6463 |
||
6464 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:true |
|
6465 |
! |
|
6466 |
||
14608 | 6467 |
menuForIgnoreBreakpointIfCalledFromAnyOf |
6468 |
<resource: #programMenu > |
|
6469 |
||
14680 | 6470 |
^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:false |
6471 |
! |
|
6472 |
||
6473 |
menuForIgnoreBreakpointIfCalledFromAnyOfForAll:forAllHaltsBoolean |
|
6474 |
<resource: #programMenu > |
|
6475 |
||
14608 | 6476 |
|m count already| |
6477 |
||
6478 |
m := Menu new. |
|
6479 |
count := 0. |
|
6480 |
already := IdentitySet new. |
|
6481 |
||
6482 |
contextArray do:[:con | |
|
17185 | 6483 |
|mthd cls sel| |
6484 |
||
6485 |
mthd := con method. |
|
6486 |
mthd notNil ifTrue:[ |
|
6487 |
mthd isWrapped ifFalse:[ |
|
6488 |
(already includes:already) ifFalse:[ |
|
6489 |
already add:mthd. |
|
6490 |
m addItem:(MenuItem |
|
6491 |
label: (mthd whoString) |
|
6492 |
itemValue: [ forAllHaltsBoolean |
|
6493 |
ifTrue:[self ignoreHaltIfCalledFromMethod:mthd] |
|
6494 |
ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd] |
|
6495 |
] |
|
6496 |
translateLabel: false). |
|
6497 |
count := count + 1. |
|
6498 |
(count > 20) ifTrue:[ |
|
6499 |
^ m |
|
6500 |
]. |
|
6501 |
] |
|
6502 |
] |
|
6503 |
] |
|
14608 | 6504 |
]. |
6505 |
^ m |
|
6506 |
! |
|
6507 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6508 |
openBreakPointBrowser |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6509 |
Tools::BreakpointBrowser open |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6510 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6511 |
"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
|
6512 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6513 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6514 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6515 |
|answer dT| |
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 |
[ |
17185 | 6518 |
answer := Dialog |
6519 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
6520 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6521 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6522 |
||
6523 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6524 |
dT notNil ifTrue:[ |
|
6525 |
LastIgnoreHaltDuration := dT. |
|
6526 |
self |
|
6527 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6528 |
orThisReceiverClass:false orCurrentProcess:false |
|
6529 |
orIfCalledFromMethod:nil |
|
6530 |
forAll:true. |
|
6531 |
^ self. |
|
6532 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6533 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6534 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6535 |
"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
|
6536 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6537 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6538 |
openIgnoreBreakpointsWithThisParameterNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6539 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6540 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6541 |
[ |
17185 | 6542 |
answer := Dialog |
6543 |
request:(resources |
|
6544 |
string:'How often should breakpoints with parameter "%1" be ignored ?' |
|
6545 |
with:breakPointParameter) |
|
6546 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6547 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6548 |
||
6549 |
n := Integer readFrom:answer onError:nil. |
|
6550 |
n notNil ifTrue:[ |
|
6551 |
LastIgnoreHaltNTimes := n. |
|
6552 |
self |
|
6553 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6554 |
orThisReceiverClass:false orCurrentProcess:false |
|
6555 |
orIfCalledFromMethod:nil |
|
6556 |
forAll:false. |
|
6557 |
^ self. |
|
6558 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6559 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6560 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6561 |
"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
|
6562 |
"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
|
6563 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6564 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6565 |
openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6566 |
|answer dT| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6567 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6568 |
[ |
17185 | 6569 |
answer := Dialog |
6570 |
request:(resources |
|
6571 |
string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?' |
|
6572 |
with:breakPointParameter) |
|
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 |
"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
|
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 |
openIgnoreHaltNTimesDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6592 |
|answer n| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6593 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6594 |
[ |
17185 | 6595 |
answer := Dialog |
6596 |
request:(resources string:'How often should this halt be ignored ?') |
|
6597 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
6598 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6599 |
||
6600 |
n := Integer readFrom:answer onError:nil. |
|
6601 |
n notNil ifTrue:[ |
|
6602 |
LastIgnoreHaltNTimes := n. |
|
6603 |
self |
|
6604 |
addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false |
|
6605 |
orThisReceiverClass:false orCurrentProcess:false |
|
6606 |
orIfCalledFromMethod:nil |
|
6607 |
forAll:false. |
|
6608 |
^ self. |
|
6609 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6610 |
] loop. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6611 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6612 |
"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
|
6613 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6614 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6615 |
openIgnoreHaltUntilTimeElapsedDialog |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6616 |
|answer dT| |
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 |
[ |
17185 | 6619 |
answer := Dialog |
6620 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
6621 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
6622 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
6623 |
||
6624 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
6625 |
dT notNil ifTrue:[ |
|
6626 |
LastIgnoreHaltDuration := dT. |
|
6627 |
self |
|
6628 |
addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false |
|
6629 |
orThisReceiverClass:false orCurrentProcess:false |
|
6630 |
orIfCalledFromMethod:nil |
|
6631 |
forAll:false. |
|
6632 |
^ self. |
|
6633 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6634 |
] loop |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6635 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6636 |
"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
|
6637 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6638 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6639 |
removeAllBreakpoints |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6640 |
"remove all trace & breakpoints - if any" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6641 |
|
14532 | 6642 |
self withExecuteCursorDo:[ |
17185 | 6643 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
6644 |
MessageTracer unwrapAllMethods |
|
6645 |
]. |
|
6646 |
(MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[ |
|
6647 |
MethodWithBreakpoints removeAllBreakpoints |
|
6648 |
]. |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6649 |
] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6650 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6651 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6652 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6653 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6654 |
removeBreakpoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6655 |
"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
|
6656 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6657 |
|implementorClass method| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6658 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6659 |
selectedContext isNil ifTrue:[ |
17185 | 6660 |
^ self showError:'** select a context first **' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6661 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6662 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
17185 | 6663 |
^ self |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6664 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6665 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6666 |
implementorClass := selectedContext methodClass. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6667 |
implementorClass notNil ifTrue:[ |
17185 | 6668 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6669 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
6670 |
method clearBreakPoint |
|
6671 |
] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6672 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6673 |
contextView middleButtonMenu disable:#removeBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6674 |
contextView middleButtonMenu enable:#addBreakpoint. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6675 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6676 |
"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
|
6677 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6678 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6679 |
stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6680 |
self class stopIgnoringHalts |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6681 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
6682 |
|
266 | 6683 |
!DebugView methodsFor:'private'! |
6684 |
||
6487 | 6685 |
abortAllIsHandled |
9750 | 6686 |
^ AbortAllOperationWantedQuery query |
6687 |
||
6688 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 6689 |
! |
6690 |
||
266 | 6691 |
busy |
6692 |
^ busy |
|
6693 |
! |
|
6694 |
||
6695 |
exclusive:aBoolean |
|
6696 |
exclusive := aBoolean |
|
6697 |
! |
|
6698 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6699 |
explainSelection |
8212 | 6700 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6701 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6702 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6703 |
interval isEmpty ifTrue:[ |
17185 | 6704 |
crsrPos := codeView characterPositionOfCursor. |
6705 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
6706 |
crsrPos := (crsrPos - 1) max:1 |
|
6707 |
]. |
|
6708 |
interval := crsrPos to:crsrPos. |
|
10205 | 6709 |
]. |
6710 |
self |
|
17185 | 6711 |
withNodeValueAtInterval:interval |
6712 |
do:[:value :description | |
|
6713 |
self showValue:value |
|
6714 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6715 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6716 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6717 |
findNodeForInterval:interval |
8212 | 6718 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6719 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6720 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6721 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
6722 |
source := codeView contentsAsString string. |
10205 | 6723 |
"/ source := currentMethod notNil |
6724 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 6725 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
6726 |
source isNil ifTrue:[^ nil]. |
8214 | 6727 |
|
8212 | 6728 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
6729 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6730 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6731 |
|
7912 | 6732 |
findNodeIn:tree forInterval:interval |
6733 |
<resource: #obsolete> |
|
10205 | 6734 |
|
16933 | 6735 |
self obsoleteMethodWarning. |
6736 |
^ DoWhatIMeanSupport findNodeIn:tree forInterval:interval |
|
6737 |
"/ |node| |
|
6738 |
"/ |
|
6739 |
"/ node := nil. |
|
6740 |
"/ tree nodesDo:[:each | |
|
6741 |
"/ (each intersectsInterval:interval) ifTrue:[ |
|
6742 |
"/ (node isNil or:[node == each parent]) ifTrue:[ |
|
6743 |
"/ node := each |
|
6744 |
"/ ] ifFalse:[ |
|
6745 |
"/ (node parent notNil |
|
6746 |
"/ and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
6747 |
"/ ] |
|
6748 |
"/ ] |
|
6749 |
"/ ]. |
|
6750 |
"/ ^ node |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6751 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6752 |
|
2581 | 6753 |
goodSkipUntilSelector |
6754 |
|current| |
|
6755 |
||
6756 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
6757 |
selectedContext isNil ifTrue:[^ nil]. |
|
6758 |
current := selectedContext selector. |
|
6759 |
current isNil ifTrue:[^ nil]. |
|
6760 |
('change:*' match:current) ifTrue:[ |
|
17185 | 6761 |
^ 'update:*' |
2581 | 6762 |
]. |
6763 |
^ nil |
|
6764 |
! |
|
6765 |
||
8179 | 6766 |
haltSelectors |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6767 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break'). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6768 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
6769 |
"Modified (format): / 27-01-2012 / 11:10:00 / cg" |
8179 | 6770 |
! |
6771 |
||
266 | 6772 |
interruptProcessWith:aBlock |
6773 |
"let inspected process do something, then update the context list" |
|
6774 |
||
6775 |
inspectedProcess isDead ifTrue:[ |
|
17176 | 6776 |
self showTerminated. |
6777 |
^ self |
|
266 | 6778 |
]. |
6779 |
inspectedProcess interruptWith:aBlock. |
|
6780 |
" |
|
6781 |
give the process a chance to run, then update |
|
6782 |
" |
|
17176 | 6783 |
Delay waitForSeconds:0.2. |
266 | 6784 |
self setContext:(inspectedProcess suspendedContext). |
6785 |
! |
|
6786 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6787 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6788 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6789 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
6790 |
|
8194 | 6791 |
openHTMLDocument: anHTMLFilename |
6792 |
"open a HTMLDocumentView on anHTMLFilename" |
|
6793 |
||
6794 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
6795 |
! |
|
6796 |
||
266 | 6797 |
processPerform:aMessage |
6798 |
"do something, then update the context list" |
|
6799 |
||
6800 |
inspectedProcess isDead ifTrue:[ |
|
17185 | 6801 |
self showTerminated. |
6802 |
^ self |
|
266 | 6803 |
]. |
6804 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
6805 |
|
266 | 6806 |
" |
6807 |
give the process a chance to run, then update |
|
6808 |
" |
|
6809 |
(Delay forSeconds:0.2) wait. |
|
6810 |
self setContext:(inspectedProcess suspendedContext). |
|
6811 |
! |
|
6812 |
||
939 | 6813 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6814 |
"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
|
6815 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6816 |
|
939 | 6817 |
|oldSelection oldContext con idx| |
6818 |
||
6819 |
contextArray notNil ifTrue:[ |
|
16065 | 6820 |
self withExecuteCursorDo:[ |
6821 |
oldSelection := contextView selection. |
|
6822 |
oldSelection notNil ifTrue:[ |
|
6823 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
6824 |
]. |
|
6825 |
||
6826 |
con := firstContext. |
|
950 | 6827 |
"/ con := contextArray at:1. |
16065 | 6828 |
"/ force redisplay, even if same by changing the first entry |
6829 |
contextArray size > 0 ifTrue:[ |
|
6830 |
contextArray at:1 put:nil. |
|
6831 |
]. |
|
6832 |
self setContext:con. |
|
6833 |
||
6834 |
oldContext isNil ifTrue:[ |
|
6835 |
idx := oldSelection |
|
6836 |
] ifFalse:[ |
|
6837 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
6838 |
]. |
|
6839 |
contextView setSelection:idx. |
|
6840 |
idx notNil ifTrue:[ |
|
6841 |
self showSelection:idx |
|
6842 |
] |
|
6843 |
] |
|
939 | 6844 |
] |
6845 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6846 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 6847 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 6848 |
! |
6849 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6850 |
selectedInterval |
7912 | 6851 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6852 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6853 |
|
7823 | 6854 |
showError:message |
6855 |
codeView contents:(resources string:message). |
|
6856 |
shown ifTrue:[ |
|
17185 | 6857 |
exclusive ifTrue:[ |
6858 |
"/ consider this a kludge: |
|
6859 |
"/ if exclusive, cannot use flash, since it suspends |
|
6860 |
"/ (but we cannot suspend here ...) |
|
6861 |
codeView redrawInverted. self flush. |
|
6862 |
OperatingSystem millisecondDelay:200. |
|
6863 |
codeView redraw |
|
6864 |
] ifFalse:[ |
|
6865 |
codeView flash |
|
6866 |
] |
|
7823 | 6867 |
] |
6868 |
||
6869 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
6870 |
! |
|
6871 |
||
6872 |
showTerminated |
|
6873 |
self showError:'** the process has terminated **' |
|
6874 |
! |
|
6875 |
||
6876 |
showValue:aValue |
|
6877 |
"/ TODO: show value in info field |
|
6878 |
"/ Transcript showCR:aValue printString |
|
6879 |
! |
|
6880 |
||
10205 | 6881 |
stepping |
6882 |
^ stepping |
|
6883 |
! |
|
6884 |
||
6885 |
unstep |
|
7823 | 6886 |
stepping := false. |
6887 |
bigStep := false. |
|
6888 |
steppedContext := wrapperContext := nil. |
|
6889 |
exitAction := nil |
|
6890 |
||
6891 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
6892 |
! |
|
6893 |
||
10203 | 6894 |
updateButtonsAndMenuItemsForContext:aContext |
6895 |
|m| |
|
6896 |
||
6897 |
m := contextView middleButtonMenu. |
|
6898 |
m notNil ifTrue:[ |
|
17185 | 6899 |
self updateMenuItems. |
6900 |
||
6901 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
6902 |
abortButton enable. |
|
6903 |
m enable:#doAbort. |
|
6904 |
] ifFalse:[ |
|
6905 |
abortButton disable. |
|
6906 |
m disable:#doAbort. |
|
6907 |
]. |
|
6908 |
exclusive ifTrue:[ |
|
6909 |
terminateButton disable. |
|
6910 |
m disable:#doTerminate. |
|
6911 |
] ifFalse:[ |
|
6912 |
terminateButton enable. |
|
6913 |
m enable:#doTerminate. |
|
6914 |
]. |
|
10203 | 6915 |
]. |
6916 |
||
6917 |
mayProceed == false ifTrue:[ |
|
17185 | 6918 |
continueButton disable. |
6919 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 6920 |
] ifFalse:[ |
17185 | 6921 |
continueButton enable. |
6922 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 6923 |
]. |
6924 |
||
13363 | 6925 |
isStoppedInModalDialog ifTrue:[ |
17185 | 6926 |
gotoDialogOpenerButton enable. |
6927 |
gotoDialogOpenerButton beVisible. |
|
13362 | 6928 |
] ifFalse:[ |
17185 | 6929 |
gotoDialogOpenerButton beInvisible. |
13362 | 6930 |
]. |
6931 |
||
14523 | 6932 |
(isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[ |
17185 | 6933 |
gotoApplicationActionMethodButton enable. |
6934 |
gotoApplicationActionMethodButton beVisible. |
|
14523 | 6935 |
] ifFalse:[ |
17185 | 6936 |
gotoApplicationActionMethodButton beInvisible. |
14523 | 6937 |
]. |
6938 |
||
10203 | 6939 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
6940 |
! |
|
6941 |
||
7823 | 6942 |
updateContext |
6943 |
|oldContext idx| |
|
6944 |
||
6945 |
inspectedProcess state == #dead ifTrue:[ |
|
17185 | 6946 |
self showTerminated. |
6947 |
^ self |
|
7823 | 6948 |
]. |
6949 |
||
6950 |
oldContext := selectedContext. |
|
6951 |
[ |
|
17185 | 6952 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
6953 |
oldContext notNil ifTrue:[ |
|
6954 |
contextArray notNil ifTrue:[ |
|
6955 |
idx := contextArray identityIndexOf:oldContext. |
|
6956 |
idx ~~ 0 ifTrue:[ |
|
6957 |
self showSelection:idx |
|
6958 |
] ifFalse:[ |
|
6959 |
codeView contents:('** context returned **') |
|
6960 |
] |
|
6961 |
] |
|
6962 |
] |
|
6963 |
]. |
|
7823 | 6964 |
] valueUninterruptably. |
6965 |
||
6966 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 6967 |
! |
6968 |
||
6969 |
withNodeValueAtInterval:interval do:aBlock |
|
14122 | 6970 |
"helper for flyByHelp and explan-selection" |
6971 |
||
15413 | 6972 |
|node definingNode nm nmBold nameSymbol |
14122 | 6973 |
varIdx parentNode receiver con receiversNonMetaClass| |
6974 |
||
6975 |
"/ interval printCR. |
|
10205 | 6976 |
Error |
17185 | 6977 |
handle:[:ex | ] |
6978 |
do:[ |
|
6979 |
[ |
|
6980 |
node := self findNodeForInterval:interval |
|
6981 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
6982 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
6983 |
|
8212 | 6984 |
node isNil ifTrue:[ ^ self ]. |
10205 | 6985 |
node isVariable ifFalse:[ |
17185 | 6986 |
"/ Transcript showCR:node. |
6987 |
^ self |
|
8592 | 6988 |
]. |
8212 | 6989 |
|
6990 |
nm := node name. |
|
8214 | 6991 |
nmBold := nm allBold. |
8600 | 6992 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 6993 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 6994 |
receiver := actualContext methodHome receiver. |
8212 | 6995 |
|
6996 |
(nm = 'self') ifTrue:[ |
|
17185 | 6997 |
aBlock value:receiver value:'receiver' allBold. |
6998 |
^ self |
|
8212 | 6999 |
]. |
7000 |
(nm = 'super') ifTrue:[ |
|
17185 | 7001 |
aBlock value:receiver value:'receiver' allBold. |
7002 |
^ self |
|
8212 | 7003 |
]. |
7004 |
(nm = 'thisContext') ifTrue:[ |
|
17185 | 7005 |
aBlock value:actualContext value:'context' allBold. |
7006 |
^ self |
|
8212 | 7007 |
]. |
7008 |
||
7009 |
definingNode := node whoDefines:nm. |
|
7010 |
definingNode isNil ifTrue:[ |
|
17185 | 7011 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 7012 |
"/aBlock value:'xIII' value:'instVar'. |
17185 | 7013 |
receiver class isMetaclass ifTrue:[ |
7014 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
7015 |
] ifFalse:[ |
|
7016 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
7017 |
]. |
|
7018 |
^ self |
|
7019 |
]. |
|
7020 |
||
7021 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
7022 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
7023 |
aBlock value:'' value:'private class ',nmBold. |
|
7024 |
^ self |
|
7025 |
]. |
|
7026 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
7027 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
7028 |
^ self |
|
7029 |
]. |
|
7030 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
7031 |
|pool| |
|
7032 |
||
7033 |
pool := Smalltalk at:eachPoolName. |
|
7034 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
7035 |
(pool classVarNames includes:nm) ifTrue:[ |
|
7036 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
7037 |
^ self |
|
7038 |
]. |
|
7039 |
]. |
|
7040 |
nameSymbol := nm asSymbolIfInterned. |
|
7041 |
nameSymbol notNil ifTrue:[ |
|
7042 |
(Smalltalk includesKey:nameSymbol) ifTrue:[ |
|
7043 |
(Smalltalk at:nameSymbol) isClass ifTrue:[ |
|
7044 |
aBlock value:'class: ',nmBold value:nil. |
|
7045 |
] ifFalse:[ |
|
7046 |
aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold. |
|
7047 |
]. |
|
7048 |
^ self |
|
7049 |
]. |
|
7050 |
]. |
|
7051 |
aBlock value:'' value:'unknown'. |
|
7052 |
^ self |
|
8212 | 7053 |
]. |
7054 |
"/definingNode printCR. |
|
7055 |
||
7056 |
definingNode isMethod ifTrue:[ |
|
17185 | 7057 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
7058 |
varIdx ~~ 0 ifTrue:[ |
|
7059 |
Error |
|
7060 |
handle:[:ex | ] |
|
7061 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
7062 |
^ self |
|
7063 |
]. |
|
7064 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
7065 |
varIdx ~~ 0 ifTrue:[ |
|
7066 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
7067 |
Error |
|
7068 |
handle:[:ex | ] |
|
7069 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
7070 |
^ self |
|
7071 |
] |
|
7072 |
]. |
|
8212 | 7073 |
]. |
7074 |
||
7075 |
definingNode isBlock ifTrue:[ |
|
17185 | 7076 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
7077 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
7078 |
varIdx ~~ 0 ifTrue:[ |
|
7079 |
"/ am I in this block ? |
|
7080 |
(actualContext lineNumber notNil |
|
7081 |
and:[ definingNode lastLineNumber notNil |
|
7082 |
and:[ (actualContext lineNumber |
|
7083 |
between:definingNode firstLineNumber |
|
7084 |
and:definingNode lastLineNumber) |
|
7085 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
7086 |
ifTrue:[ |
|
7087 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
7088 |
^ self |
|
7089 |
]. |
|
7090 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
|
7091 |
^ self |
|
7092 |
] |
|
7093 |
]. |
|
8212 | 7094 |
]. |
7095 |
||
7096 |
parentNode := definingNode parent. |
|
7097 |
||
7098 |
[parentNode notNil] whileTrue:[ |
|
17185 | 7099 |
"/'isMethod ' print. parentNode isMethod printCR. |
7100 |
parentNode isMethod ifTrue:[ |
|
7101 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
7102 |
varIdx ~~ 0 ifTrue:[ |
|
7103 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
7104 |
Error |
|
7105 |
handle:[:ex | ] |
|
7106 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
7107 |
^ self |
|
7108 |
] |
|
7109 |
]. |
|
7110 |
]. |
|
7111 |
"/'isBlock ' print. parentNode isBlock printCR. |
|
7112 |
parentNode isBlock ifTrue:[ |
|
7113 |
"/ we don't have any information on the inlineability |
|
7114 |
"/ of this block here (RBParser does not know what |
|
7115 |
"/ the compiler does). |
|
7116 |
"/ therefore, it is questionable if we can use the |
|
7117 |
"/ context's home context here. |
|
7118 |
"/ am I in this block ? |
|
7119 |
con := actualContext. |
|
7120 |
[con notNil |
|
7121 |
and:[ parentNode lastLineNumber notNil |
|
7122 |
and:[ con lineNumber notNil |
|
7123 |
and:[ con lineNumber |
|
7124 |
between:parentNode firstLineNumber |
|
7125 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
7126 |
con := con sender. |
|
7127 |
]. |
|
7128 |
con notNil ifTrue:[ |
|
7129 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
7130 |
varIdx ~~ 0 ifTrue:[ |
|
7131 |
Error |
|
7132 |
handle:[:ex | ] |
|
7133 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
7134 |
^ self |
|
7135 |
]. |
|
7136 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
7137 |
varIdx ~~ 0 ifTrue:[ |
|
7138 |
Error |
|
7139 |
handle:[:ex | ] |
|
7140 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
7141 |
^ self |
|
7142 |
]. |
|
7143 |
]. |
|
7144 |
]. |
|
7145 |
parentNode := parentNode parent. |
|
8212 | 7146 |
]. |
8214 | 7147 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 7148 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
7149 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 7150 |
! ! |
7151 |
||
7152 |
!DebugView methodsFor:'private queries'! |
|
7153 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7154 |
canBrowseClassHierarchy |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7155 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7156 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7157 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7158 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7159 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7160 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7161 |
canBrowseFullClassProtocol |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7162 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7163 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7164 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7165 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
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 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7168 |
canBrowseImplementingClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7169 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7170 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7171 |
m := contextView middleButtonMenu. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7172 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7173 |
! |
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 |
canBrowseProcessesApplication |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7176 |
|p| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7177 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7178 |
p := inspectedProcess ? Processor activeProcess. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7179 |
p isNil ifTrue:[^ false]. |
14430 | 7180 |
^ p isGUIProcess and:[self processesApplication notNil ]. |
11366
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 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7183 |
canBrowseReceiversClass |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7184 |
|m| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7185 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7186 |
m := contextView middleButtonMenu. |
17109 | 7187 |
^ m notNil |
7188 |
and:[ |
|
7189 |
(m isEnabled:#browseReceiversClass) |
|
7190 |
or:[ m isEnabled:#browseImplementingClass ] |
|
7191 |
] |
|
7192 |
||
7193 |
"Modified: / 25-11-2016 / 13:25:55 / cg" |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7194 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7195 |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7196 |
canCloseAllDebuggers |
15413 | 7197 |
self class allInstancesDo:[:debugger | |
17185 | 7198 |
debugger ~~ self ifTrue:[ |
7199 |
debugger busy ifTrue:[^ true]. |
|
7200 |
] |
|
11457
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7201 |
]. |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7202 |
^ false |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7203 |
|
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7204 |
"Created: / 23-03-2012 / 12:40:18 / cg" |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7205 |
! |
b304a867b5e0
added: closeAllDebuggers functions
Claus Gittinger <cg@exept.de>
parents:
11443
diff
changeset
|
7206 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7207 |
canDefineMethod |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7208 |
^ defineButton isVisible |
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 |
|
12840 | 7211 |
canInspectWidgetHierarchy |
7212 |
|rcvr| |
|
7213 |
||
17109 | 7214 |
^ (selectedContext notNil |
17129 | 7215 |
and:[(rcvr := selectedContext receiver) isProtoObject not |
7216 |
and:[rcvr isView or:[rcvr isKindOf: ApplicationModel]]]) |
|
17109 | 7217 |
or:[ |
7218 |
self canBrowseProcessesApplication |
|
7219 |
] |
|
7220 |
||
7221 |
"Modified: / 25-11-2016 / 13:17:20 / cg" |
|
12840 | 7222 |
! |
7223 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7224 |
canRestart |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7225 |
^ restartButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7226 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7227 |
"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
|
7228 |
! |
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 |
canReturn |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7231 |
^ returnButton isEnabled |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7232 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7233 |
"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
|
7234 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7235 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7236 |
canSendEmail |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7237 |
^ SendMailTool notNil |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7238 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7239 |
"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
|
7240 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7241 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7242 |
canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7243 |
^ canShowMore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7244 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7245 |
|
15255 | 7246 |
hasBlockContextSelected |
7247 |
^ contextView hasSelection |
|
7248 |
and:[ self selectedContext isBlockContext ] |
|
7249 |
! |
|
7250 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7251 |
hasContextSelected |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7252 |
^ contextView hasSelection |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7253 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7254 |
"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
|
7255 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7256 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7257 |
hasHaltsToIgnore |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7258 |
^ IgnoredHalts notEmptyOrNil |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7259 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7260 |
|
7823 | 7261 |
isAborting |
7262 |
^ exitAction == #abort |
|
7263 |
! |
|
7264 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7265 |
isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7266 |
^ isStoppedAtBreakPointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7267 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7268 |
"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
|
7269 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7270 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7271 |
isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7272 |
^ isStoppedAtHaltOrBreakPoint |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7273 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7274 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7275 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7276 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7277 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7278 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7279 |
selectedContextIsWrapped |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7280 |
|con mthd| |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7281 |
|
11595 | 7282 |
(con := self selectedContext) notNil ifTrue:[ |
17185 | 7283 |
mthd := con method. |
7284 |
^ mthd notNil and:[mthd isWrapped] |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7285 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7286 |
^ false. |
11595 | 7287 |
|
11610 | 7288 |
"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
|
7289 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
7290 |
|
7823 | 7291 |
setOfHiddenCallingSelectors |
7292 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
7293 |
! |
|
7294 |
||
7295 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
7296 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
7297 |
! ! |
|
7298 |
||
9922 | 7299 |
!DebugView methodsFor:'private-breakpoints'! |
7300 |
||
15413 | 7301 |
addIgnoredHaltForCount:countOrNil |
17185 | 7302 |
orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
7303 |
orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess |
|
7304 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
7305 |
forAll:aBoolean |
|
14608 | 7306 |
|
12937 | 7307 |
|haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil| |
9922 | 7308 |
|
7309 |
aBoolean ifTrue:[ |
|
17185 | 7310 |
haltingMethod := #all |
9922 | 7311 |
] ifFalse:[ |
17185 | 7312 |
haltingContext := self findHaltingContext. |
7313 |
haltingContext isNil ifTrue:[ |
|
7314 |
Transcript showCR:'no halting context found'. |
|
7315 |
^ self |
|
7316 |
]. |
|
7317 |
||
7318 |
haltingMethod := haltingContext method. |
|
7319 |
lineNrOfHalt := haltingContext lineNumber. |
|
7320 |
(lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ |
|
7321 |
Transcript showCR:'no halt lineNr found'. |
|
7322 |
^ self |
|
7323 |
]. |
|
7324 |
forThisReceiverClass ifTrue:[ |
|
7325 |
receiverClassOrNil := haltingContext receiver class |
|
7326 |
]. |
|
7327 |
forCurrentProcess ifTrue:[ |
|
7328 |
processOrNil := Processor activeProcess |
|
7329 |
]. |
|
9922 | 7330 |
]. |
7331 |
||
7332 |
self class |
|
17185 | 7333 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
7334 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
|
7335 |
orReceiverClass:receiverClassOrNil orProcess:processOrNil |
|
7336 |
orIfCalledFromMethod:ifCalledForMethodOrNil |
|
11210 | 7337 |
|
7338 |
"Created: / 27-01-2012 / 11:31:12 / cg" |
|
9922 | 7339 |
! |
7340 |
||
7341 |
canAddBreakpoint |
|
7342 |
|m| |
|
7343 |
||
7344 |
m := contextView middleButtonMenu. |
|
7345 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
7346 |
! |
|
7347 |
||
7348 |
canRemoveBreakpoint |
|
7349 |
|m| |
|
7350 |
||
7351 |
m := contextView middleButtonMenu. |
|
7352 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
7353 |
! |
|
7354 |
||
7355 |
findHaltingContext |
|
7356 |
|haltSelectors| |
|
7357 |
||
7358 |
haltSelectors := self haltSelectors. |
|
7359 |
||
10205 | 7360 |
contextArray keysAndValuesDo:[:idx :con | |
17185 | 7361 |
|sel con2 sel2 method| |
7362 |
||
7363 |
sel := con selector. |
|
7364 |
(haltSelectors includes:sel) ifTrue:[ |
|
7365 |
(method := con method) notNil ifTrue:[ |
|
7366 |
method mclass == Object ifTrue:[ |
|
7367 |
con2 := contextArray at:idx+1. |
|
7368 |
sel2 := con2 selector. |
|
7369 |
(haltSelectors includes:sel2) ifTrue:[ |
|
7370 |
con2 method mclass == Object ifTrue:[ |
|
7371 |
^ contextArray at:idx+2. |
|
7372 |
] |
|
7373 |
]. |
|
7374 |
^ contextArray at:idx+1 |
|
7375 |
]. |
|
7376 |
method mclass == Breakpoint ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7377 |
(contextArray at:idx+1) infoPrintCR. |
17185 | 7378 |
^ contextArray at:idx+1 |
7379 |
]. |
|
7380 |
]. |
|
7381 |
]. |
|
7382 |
con method isWrapped ifTrue:[ |
|
7383 |
^ con |
|
7384 |
]. |
|
9922 | 7385 |
]. |
7386 |
^ nil |
|
7387 |
||
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
7388 |
"Modified: / 27-01-2012 / 11:06:02 / cg" |
9922 | 7389 |
! |
7390 |
||
7391 |
ignoreBreakpoints |
|
7392 |
^ ignoreBreakpoints |
|
7393 |
||
7394 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
7395 |
! ! |
|
7396 |
||
7823 | 7397 |
!DebugView methodsFor:'private-cache handling'! |
7398 |
||
7399 |
cacheMyself |
|
7400 |
"remember myself for next debug session" |
|
7401 |
||
7402 |
"caching the last debugger will make the next debugger appear |
|
7403 |
faster, since no resources have to be allocated in the display. |
|
7404 |
We have to be careful to release all refs to the debuggee, though. |
|
7405 |
Otherwise, the GC will not be able to release it." |
|
7406 |
||
7407 |
windowGroup notNil ifTrue:[ |
|
16253 | 7408 |
windowGroup setProcess:nil. |
7823 | 7409 |
]. |
7410 |
||
7411 |
self releaseDebuggee. |
|
7412 |
||
7413 |
cachable ~~ true ifTrue:[^ self]. |
|
7414 |
||
7415 |
"/ |
|
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
7416 |
"/ only cache if I am on the Display (i.e. the default screen) |
7823 | 7417 |
"/ |
16253 | 7418 |
device == Display ifTrue:[ |
7419 |
exclusive ifTrue:[ |
|
7420 |
CachedExclusive := self |
|
7421 |
] ifFalse:[ |
|
7422 |
CachedDebugger := self |
|
7423 |
]. |
|
7823 | 7424 |
]. |
7425 |
||
7426 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
16253 | 7427 |
ObjectMemory stepInterruptHandler:nil |
7823 | 7428 |
]. |
7429 |
||
7430 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
7431 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
7432 |
! |
|
7433 |
||
7434 |
isCached |
|
13226 | 7435 |
"tell whether we are a cached debugger" |
7823 | 7436 |
|
7437 |
CachedExclusive == self ifTrue:[ |
|
17185 | 7438 |
^ true. |
7823 | 7439 |
]. |
7440 |
CachedDebugger == self ifTrue:[ |
|
17185 | 7441 |
^ true. |
7823 | 7442 |
]. |
7443 |
||
7444 |
^ false. |
|
7445 |
||
13226 | 7446 |
"Created: / 10-07-1997 / 15:22:43 / stefan" |
7447 |
"Modified (comment): / 27-07-2013 / 15:38:47 / cg" |
|
7823 | 7448 |
! |
7449 |
||
7450 |
uncacheMyself |
|
7451 |
"do not remember myself any longer for next debug session" |
|
7452 |
||
7453 |
cachable := false. |
|
7454 |
||
7455 |
CachedExclusive == self ifTrue:[ |
|
17185 | 7456 |
CachedExclusive := nil. |
7823 | 7457 |
]. |
7458 |
CachedDebugger == self ifTrue:[ |
|
17185 | 7459 |
CachedDebugger := nil. |
7823 | 7460 |
]. |
7461 |
OpenDebuggers notNil ifTrue:[ |
|
17185 | 7462 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 7463 |
]. |
7464 |
||
7465 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
7466 |
! ! |
|
7467 |
||
10628 | 7468 |
!DebugView methodsFor:'private-code view'! |
7469 |
||
7470 |
codeAspect |
|
11704 | 7471 |
^ SyntaxHighlighter codeAspectMethod |
10628 | 7472 |
|
7473 |
"Created: / 27-07-2011 / 13:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11704 | 7474 |
"Modified: / 27-07-2012 / 22:20:27 / cg" |
10628 | 7475 |
! ! |
7476 |
||
7823 | 7477 |
!DebugView methodsFor:'private-context handling'! |
7478 |
||
11391 | 7479 |
contextListEntryFor:aContext |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7480 |
^ Error |
16501 | 7481 |
handle:[:ex | '???' ] |
7482 |
do:[ |
|
7483 |
|s| |
|
7484 |
||
7485 |
aContext selector == #doIt ifTrue:[ |
|
7486 |
aContext receiver isNil ifTrue:[ |
|
7487 |
s := 'doIt' allBold |
|
7488 |
] |
|
7489 |
]. |
|
7490 |
||
7491 |
s := Text streamContents:[:s | aContext printOn:s ]. |
|
7492 |
RememberedCallChain notNil ifTrue:[ |
|
7493 |
(RememberedCallChain includesIdentical:aContext) ifTrue:[ |
|
7494 |
s := s withColor:#red. |
|
7495 |
]. |
|
7496 |
]. |
|
7497 |
s |
|
7498 |
]. |
|
11391 | 7499 |
|
7500 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
7501 |
! |
|
7502 |
||
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7503 |
is:aHomeContext inCallingChainOf:aContext |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7504 |
|con| |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7505 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7506 |
con := aContext. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7507 |
[con notNil and:[con ~~ aHomeContext]] whileTrue:[ |
17185 | 7508 |
con := con sender |
11571
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7509 |
]. |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7510 |
^ con notNil |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7511 |
|
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7512 |
"Created: / 10-06-2012 / 18:46:29 / cg" |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7513 |
! |
797d5fa9c634
option to hide enumeration code impl.
Claus Gittinger <cg@exept.de>
parents:
11457
diff
changeset
|
7514 |
|
11890 | 7515 |
isEnteredDueToBreakpointOrHalt |
7516 |
"see if we came here due to a step interrupt" |
|
7517 |
||
7518 |
|c cReceiver| |
|
7519 |
||
7520 |
"/ look for a breakpoint-wrapper's context |
|
7521 |
c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil. |
|
7522 |
c isNil ifTrue:[ |
|
17185 | 7523 |
^ true. |
11890 | 7524 |
]. |
7525 |
cReceiver := c receiver. |
|
7526 |
^ cReceiver == BreakPointInterrupt |
|
13293 | 7527 |
|
7528 |
"Modified: / 01-08-2013 / 23:34:01 / cg" |
|
11890 | 7529 |
! |
7530 |
||
7531 |
isHaltToBeIgnored |
|
7532 |
"see if the current halt (if any) is in the ignore-list" |
|
7533 |
||
13059 | 7534 |
|c cReceiver sender haltingMethod lineNrInHaltingMethod breakpointParameter |
7535 |
sReceiver| |
|
11890 | 7536 |
|
7537 |
"/ should a halt be ignored ? |
|
7538 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
7539 |
||
13059 | 7540 |
"/ look for a method breakpoint-wrapper's context |
11890 | 7541 |
c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
7542 |
c notNil ifTrue:[ |
|
17185 | 7543 |
((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[ |
7544 |
c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
|
7545 |
cReceiver := c receiver. |
|
7546 |
]. |
|
7547 |
(cReceiver isKindOf:BreakPointInterrupt) ifFalse:[ |
|
7548 |
c := nil |
|
7549 |
] ifTrue:[ |
|
7550 |
[ |
|
7551 |
sender := c sender. |
|
7552 |
((sReceiver := sender receiver) isKindOf:BreakPointInterrupt) |
|
7553 |
or:[ sReceiver == BreakPointInterrupt ] |
|
7554 |
] whileTrue:[ |
|
7555 |
c := sender |
|
7556 |
]. |
|
7557 |
[ (sender := c sender) isBlockContext ] whileTrue:[ |
|
7558 |
c := sender |
|
7559 |
]. |
|
7560 |
sender := nil. "/ avoid keeping a reference to this context |
|
7561 |
]. |
|
11890 | 7562 |
]. |
14993 | 7563 |
"/ Transcript showCR:c. |
11890 | 7564 |
c isNil ifTrue:[ |
17185 | 7565 |
"/ look for halts or explicit breakpoints |
7566 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
7567 |
c isNil ifTrue:[ |
|
7568 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
7569 |
c isNil ifTrue:[ |
|
7570 |
^ false |
|
7571 |
]. |
|
7572 |
breakpointParameter := c argAt:1. |
|
7573 |
(self class |
|
7574 |
isBreakpointToBeIgnoredForParameter:breakpointParameter |
|
7575 |
context:(c sender) |
|
7576 |
modifyEntryCount:true |
|
7577 |
) ifTrue:[ |
|
7578 |
^ true. |
|
7579 |
]. |
|
7580 |
]. |
|
11890 | 7581 |
]. |
7582 |
||
7583 |
c := c sender. |
|
7584 |
"/ a code-breakpoint ? |
|
7585 |
(c receiver isKindOf:Breakpoint) ifTrue:[ |
|
17185 | 7586 |
c := c sender. |
11890 | 7587 |
]. |
7588 |
haltingMethod := c method. |
|
7589 |
||
7590 |
haltingMethod isWrapped ifTrue:[ |
|
17185 | 7591 |
lineNrInHaltingMethod := 1. |
11890 | 7592 |
] ifFalse:[ |
17185 | 7593 |
lineNrInHaltingMethod := c lineNumber. |
7594 |
"/ Transcript showCR:c. |
|
11890 | 7595 |
]. |
7596 |
||
12562 | 7597 |
^ self class |
17185 | 7598 |
isHaltToBeIgnoredIn:haltingMethod |
7599 |
atLineNr:lineNrInHaltingMethod |
|
7600 |
context:c |
|
7601 |
modifyEntryCount:true. |
|
11890 | 7602 |
|
7603 |
"Created: / 22-10-2010 / 12:09:53 / cg" |
|
7604 |
"Modified: / 06-03-2012 / 12:54:09 / cg" |
|
7605 |
! |
|
7606 |
||
266 | 7607 |
setContext:aContext |
7608 |
"show calling chain from aContext in the walk-back listview" |
|
7609 |
||
641 | 7610 |
^ 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
|
7611 |
|
641 | 7612 |
"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
|
7613 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7614 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7615 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
7616 |
"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
|
7617 |
Most complications here arise from filtering less-interesting contexts |
15256 | 7618 |
if not in verbose-context mode or when hiding implementation contexts. |
15413 | 7619 |
There is a lot of heuristic magic here, to make the debugger as useful |
15256 | 7620 |
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
|
7621 |
|
14531 | 7622 |
|con sel text method caller caller2 called called2 m count c cc sndr |
14523 | 7623 |
suspendContext calledBySuspendContext nm h calledContext show2 |
15257 | 7624 |
alreadyInApplicationCode verboseBacktrace| |
11836
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7625 |
|
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7626 |
"/ (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7627 |
"/ "no change" |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7628 |
"/ ^ false |
224a4d109673
added: #showingSupportCode:
Claus Gittinger <cg@exept.de>
parents:
11828
diff
changeset
|
7629 |
"/ ]. |
266 | 7630 |
|
14523 | 7631 |
isStoppedAtHaltOrBreakPoint := isStoppedAtBreakPointWithParameter := false. |
7632 |
isStoppedInModalDialog := isStoppedInApplicationAction := alreadyInApplicationCode := false. |
|
14531 | 7633 |
isStoppedAtStatementBreakpoint := false. |
939 | 7634 |
firstContext := aContext. |
15257 | 7635 |
verboseBacktrace := self verboseBacktraceHolder value. |
939 | 7636 |
|
266 | 7637 |
m := contextView middleButtonMenu. |
7638 |
m notNil ifTrue:[ |
|
15497 | 7639 |
m disable:#showMore. |
266 | 7640 |
]. |
3269 | 7641 |
canShowMore := false. |
266 | 7642 |
|
7643 |
aContext isNil ifTrue:[ |
|
15497 | 7644 |
text := Array with:'** no context **'. |
7645 |
contextArray := nil. |
|
266 | 7646 |
] ifFalse:[ |
15497 | 7647 |
text := OrderedCollection new:nChainShown. |
7648 |
contextArray := OrderedCollection new:nChainShown. |
|
7649 |
||
7650 |
con := aContext. |
|
7651 |
calledContext := nil. |
|
7652 |
||
7653 |
DebuggingContextWalk == true ifTrue:[ |
|
7654 |
'======================================' print. con printCR. |
|
7655 |
]. |
|
7656 |
alreadyInApplicationCode := |
|
17122 | 7657 |
con receiver isProtoObject not "/ careful to not force futures/lazy values |
7658 |
and:[con receiver class includesBehavior:ApplicationModel]. "do not use #isKindOf: - ProtoObject compat" |
|
15497 | 7659 |
|
7660 |
verboseBacktrace ~~ true ifTrue:[ |
|
7661 |
"/ with dense backtrace, hide the ProcessorScheduler |
|
7662 |
"/ contexts at the top; look for a Process>>suspend* |
|
7663 |
"/ context within the first 10 contexts |
|
7664 |
||
7665 |
suspendContext := nil. |
|
7666 |
c := con. |
|
7667 |
1 to:10 do:[:i | |
|
7668 |
|selector| |
|
7669 |
||
7670 |
c notNil ifTrue:[ |
|
7671 |
selector := c selector. |
|
7672 |
selector notNil ifTrue:[ |
|
7673 |
(selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[ |
|
7674 |
suspendContext := c. |
|
7675 |
calledBySuspendContext := cc. |
|
7676 |
]. |
|
7677 |
]. |
|
7678 |
cc := c. |
|
7679 |
c := c sender. |
|
7680 |
] |
|
7681 |
]. |
|
7682 |
suspendContext notNil ifTrue:[ |
|
7683 |
con := suspendContext. |
|
7684 |
calledContext := calledBySuspendContext. |
|
7685 |
suspendContext := nil |
|
7686 |
]. |
|
7687 |
]. |
|
7688 |
"/ Transcript show:'1 '; showCR:con. |
|
7689 |
con notNil ifTrue:[ |
|
7690 |
"/ hide the halt implementation |
|
7691 |
sel := con selector. |
|
7692 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7693 |
(method := con method) notNil ifTrue:[ |
|
7694 |
method mclass == Object ifTrue:[ |
|
7695 |
(sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[ |
|
7696 |
isStoppedAtBreakPointWithParameter := true. |
|
7697 |
breakPointParameter := con argAt:1. |
|
7698 |
]. |
|
7699 |
isStoppedAtHaltOrBreakPoint := true. |
|
7700 |
verboseBacktrace ~~ true ifTrue:[ |
|
7701 |
calledContext := con. |
|
7702 |
con := con sender. |
|
7703 |
] |
|
7704 |
] ifFalse:[ |
|
7705 |
method mclass == Breakpoint ifTrue:[ |
|
7706 |
isStoppedAtHaltOrBreakPoint := true. |
|
7707 |
isStoppedAtStatementBreakpoint := true. |
|
7708 |
verboseBacktrace ~~ true ifTrue:[ |
|
7709 |
calledContext := con. |
|
7710 |
con := con sender. |
|
7711 |
]. |
|
7712 |
"/ Transcript show:'2 '; showCR:con. |
|
7713 |
]. |
|
7714 |
]. |
|
7715 |
]. |
|
7716 |
]. |
|
7717 |
]. |
|
7718 |
||
7719 |
(verboseBacktrace not or:[ hideSupportCode]) ifTrue:[ |
|
7720 |
[ |
|
7721 |
con notNil |
|
7722 |
and:[ con isBlockContext not |
|
7723 |
and:[ con method notNil |
|
7724 |
and:[ (con method shouldBeSkippedInDebuggersWalkBack) |
|
7725 |
and:[ (self haltSelectors includes: con selector) not]]]] |
|
7726 |
] whileTrue:[ |
|
7727 |
"/ Transcript show:'xx '; showCR:con. |
|
7728 |
calledContext := con. |
|
7729 |
con := con sender |
|
7730 |
]. |
|
7731 |
]. |
|
7732 |
||
7733 |
" |
|
7734 |
get them all, by walking along the caller chain. |
|
7735 |
depending on the settings, skip some intermediate contexts |
|
7736 |
(such as collection enumeration implementations), which are usually not |
|
7737 |
of interest when debugging an application. |
|
7738 |
On the fly, gather some additional information |
|
7739 |
such as: are we at a halt/breakpoint, are we in a modal dialog opened, |
|
7740 |
are we coming from an application model's action etc. |
|
7741 |
" |
|
7742 |
count := 0. |
|
7743 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
|
7744 |
"/ remember any halt/breakpoint or openModal on the fly |
|
7745 |
DebuggingContextWalk == true ifTrue:[ '---' print. con printCR ]. |
|
7746 |
||
7747 |
sel := con selector. |
|
7748 |
(self haltSelectors includes:sel) ifTrue:[ |
|
7749 |
(method := con method) notNil ifTrue:[ |
|
7750 |
method mclass == Object ifTrue:[ |
|
7751 |
(sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[ |
|
7752 |
isStoppedAtBreakPointWithParameter := true. |
|
7753 |
breakPointParameter := con argAt:1. |
|
7754 |
]. |
|
7755 |
isStoppedAtHaltOrBreakPoint := true. |
|
7756 |
] ifFalse:[ |
|
7757 |
method mclass == Breakpoint ifTrue:[ |
|
7758 |
isStoppedAtHaltOrBreakPoint := true. |
|
7759 |
]. |
|
7760 |
] |
|
7761 |
] |
|
7762 |
] ifFalse:[ |
|
7763 |
((sel == #openModal) or:[sel == #openModal:]) ifTrue:[ |
|
7764 |
isStoppedInModalDialog := true. |
|
7765 |
] ifFalse:[ |
|
7766 |
alreadyInApplicationCode ifFalse:[ |
|
17122 | 7767 |
(con receiver isProtoObject not "/ careful to not force futures/lazy values |
17126 | 7768 |
and:[con receiver isKindOf:ApplicationModel]) ifTrue:[ |
15497 | 7769 |
isStoppedInApplicationAction := true. |
7770 |
] |
|
7771 |
] |
|
7772 |
] |
|
7773 |
]. |
|
7774 |
||
7775 |
[ |
|
7776 |
|show1| |
|
7777 |
||
7778 |
show1 := self showingContext1:con calling:calledContext. |
|
7779 |
DebuggingDebugger3 == true ifTrue:[ |
|
7780 |
'showingContext1: (' print. con print. ') --> ' print. show1 printCR. |
|
7781 |
]. |
|
7782 |
show1 |
|
7783 |
] whileFalse:[ |
|
7784 |
calledContext := con. |
|
7785 |
con := con sender. |
|
7786 |
]. |
|
7787 |
||
7788 |
show2 := self showingContext2:con nesting:count. |
|
7789 |
DebuggingDebugger3 == true ifTrue:[ |
|
7790 |
'showingContext2: (' print. con print. ') --> ' print. show2 printCR. |
|
7791 |
]. |
|
7792 |
||
7793 |
show2 ifTrue:[ |
|
7794 |
contextArray add:con. |
|
7795 |
||
7796 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
7797 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
7798 |
] ifFalse:[ |
|
7799 |
nm := self contextListEntryFor:con. |
|
7800 |
]. |
|
7801 |
text add:nm. |
|
7802 |
count := count + 1. |
|
7803 |
]. |
|
7804 |
||
7805 |
"/ with hidden support code, skip over internals of exceptions |
|
7806 |
hideSupportCode == true ifTrue:[ |
|
7807 |
"/ Transcript showCR:'x'. |
|
7808 |
(con isBlockContext |
|
7809 |
and:[ (h := con home) notNil |
|
7810 |
and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[ |
|
7811 |
|blocksReceiver| |
|
7812 |
blocksReceiver := con receiver. |
|
7813 |
c := con sender. |
|
7814 |
[ |
|
7815 |
c notNil |
|
7816 |
and:[ |
|
7817 |
sndr := c sender. |
|
7818 |
(sndr ~= h) |
|
7819 |
and:[ |
|
7820 |
blocksReceiver isCollection "/ skip collection implementations |
|
7821 |
or:[ ( #( #'handle:do:' "/ skip exception implementations |
|
7822 |
#'handleDo:' |
|
7823 |
#'answer:do:' |
|
7824 |
#'ensure:' ) includes: c selector ) |
|
7825 |
or:[ #'perform:*' "/ skip perform implementations |
|
7826 |
match: c selector ]] |
|
7827 |
] |
|
7828 |
] |
|
7829 |
] whileTrue:[ |
|
7830 |
c := sndr |
|
7831 |
]. |
|
7832 |
c notNil ifTrue:[ |
|
7833 |
con := c "sender". |
|
7834 |
]. |
|
7835 |
]. |
|
7836 |
]. |
|
7837 |
||
7838 |
"/ |
|
7839 |
"/ kludge: if it's a wrapped method, then hide the wrap-call |
|
7840 |
"/ |
|
7841 |
method := con method. |
|
7842 |
method notNil ifTrue:[ |
|
7843 |
called := con. |
|
7844 |
caller := con sender. |
|
7845 |
(caller notNil and:[caller receiver == method]) ifTrue:[ |
|
7846 |
called2 := caller. |
|
7847 |
caller2 := caller sender. |
|
7848 |
caller2 notNil ifTrue:[ |
|
7849 |
(caller2 method isWrapped |
|
7850 |
and:[ caller2 method originalMethod == method ]) ifTrue:[ |
|
7851 |
calledContext := called2. |
|
7852 |
con := caller2 |
|
7853 |
]. |
|
7854 |
]. |
|
7855 |
||
7856 |
]. |
|
7857 |
caller := caller2 := nil |
|
7858 |
]. |
|
7859 |
||
7860 |
"/ with dense backtrace, skip the doIt method's context |
|
7861 |
"/ (its dummy anyway) and fake that context's name |
|
7862 |
||
7863 |
verboseBacktrace ~~ true ifTrue:[ |
|
7864 |
(con isBlockContext |
|
7865 |
and:[(h := con home) == con sender |
|
7866 |
and:[h notNil |
|
7867 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
|
7868 |
and:[h method who isNil]]]]) ifTrue:[ |
|
7869 |
calledContext := con. |
|
7870 |
con := con sender. |
|
7871 |
text removeLast. |
|
7872 |
||
7873 |
text add:(self contextListEntryFor:con methodHome). |
|
7874 |
]. |
|
7875 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
|
7876 |
]. |
|
7877 |
||
7878 |
"/ with dense backtrace, don't show contexts below the doIt |
|
7879 |
( verboseBacktrace ~~ true |
|
7880 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
|
7881 |
con := nil. |
|
7882 |
] ifFalse:[ |
|
7883 |
calledContext := con. |
|
7884 |
con := con sender |
|
7885 |
]. |
|
7886 |
]. |
|
7887 |
||
7888 |
" |
|
7889 |
did we reach the end ? |
|
7890 |
" |
|
7891 |
(con isNil or:[con sender isNil]) ifTrue:[ |
|
7892 |
||
7893 |
"/ the very last one is the startup context |
|
7894 |
"/ (in main) - it has nil as receiver and nil as selector |
|
7895 |
||
7896 |
(contextArray notEmpty |
|
7897 |
and:[contextArray last selector isNil]) ifTrue:[ |
|
7898 |
contextArray removeLast. |
|
7899 |
text removeLast |
|
7900 |
]. |
|
7901 |
||
7902 |
verboseBacktrace ~~ true ifTrue:[ |
|
7903 |
"/ in dense mode, remove process startup contexts (if any) |
|
7904 |
||
7905 |
(contextArray size > 0 |
|
7906 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
7907 |
con selector == #start ifTrue:[ |
|
7908 |
contextArray removeLast. |
|
7909 |
text removeLast. |
|
7910 |
||
7911 |
[contextArray size > 0 |
|
7912 |
and:[contextArray last methodHome == con]] whileTrue:[ |
|
7913 |
contextArray removeLast. |
|
7914 |
text removeLast. |
|
7915 |
] |
|
7916 |
] |
|
7917 |
] |
|
7918 |
] |
|
7919 |
] ifFalse:[ |
|
7920 |
m notNil ifTrue:[ |
|
7921 |
m enable:#showMore. |
|
7922 |
]. |
|
7923 |
canShowMore := true. |
|
7924 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
|
7925 |
]. |
|
266 | 7926 |
]. |
7927 |
||
7928 |
contextView setList:text. |
|
944 | 7929 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7930 |
releaseInspectors ifTrue:[ |
15497 | 7931 |
receiverInspector release. |
7932 |
contextInspector release. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7933 |
]. |
266 | 7934 |
|
7935 |
m notNil ifTrue:[ |
|
15497 | 7936 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 7937 |
]. |
3511 | 7938 |
self updateMenuItems. |
266 | 7939 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
7940 |
|
7797 | 7941 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
11694
464f62536f09
menu changed to use checkboxes
Claus Gittinger <cg@exept.de>
parents:
11693
diff
changeset
|
7942 |
"Modified: / 27-07-2012 / 15:10:53 / cg" |
266 | 7943 |
! |
7944 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7945 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7946 |
"show calling chain from aContext in the walk-back listview. |
1213 | 7947 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7948 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7949 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7950 |
|
8152 | 7951 |
con := aContext. |
15257 | 7952 |
self verboseBacktraceHolder value ifFalse:[ |
17185 | 7953 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
7954 |
con := con sender. |
|
7955 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
7956 |
con := con sender. |
|
7957 |
]. |
|
7958 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7959 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7960 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7961 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7962 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
7963 |
"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
|
7964 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
7965 |
|
3447 | 7966 |
showingContext1:aContext calling:calledContext |
7823 | 7967 |
"return false, if this (top) context is to be skipped. |
10205 | 7968 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 7969 |
the set of methods which are suppressed is my (claus's) own choice." |
7970 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7971 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 7972 |
|
15257 | 7973 |
self verboseBacktraceHolder value ifTrue:[ ^true ]. |
3447 | 7974 |
aContext isNil ifTrue:[ ^true ]. |
7975 |
||
7976 |
sel := aContext selector. |
|
7977 |
rec := aContext receiver. |
|
7978 |
mthd := aContext method. |
|
7979 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
7980 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7981 |
"/ to avoid firing/waiting the lazy or future |
17122 | 7982 |
recIsException := (rec isProtoObject 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
|
7983 |
aContext sender notNil ifTrue:[ |
17122 | 7984 |
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
|
7985 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
7986 |
|
11636 | 7987 |
DebuggingDebugger3 == true ifTrue:[ |
17122 | 7988 |
'showingContext1: (' print. aContext print. |
7989 |
') calling: (' print. calledContext print. |
|
7990 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7991 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
7992 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7993 |
(#(doCallHandler: doRaise |
3447 | 7994 |
) includes:sel) |
17122 | 7995 |
ifTrue:[ |
7996 |
recIsException ifTrue:[ ^ false]. |
|
7997 |
]. |
|
3447 | 7998 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
7999 |
(#(raise raiseRequest |
3447 | 8000 |
) includes:sel) |
17122 | 8001 |
ifTrue:[ |
8002 |
recIsException ifTrue:[ |
|
8003 |
(senderRec isProtoObject not |
|
8004 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
8005 |
]. |
|
8006 |
]. |
|
3447 | 8007 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8008 |
(#(doWhile: |
3447 | 8009 |
) includes:sel) |
17122 | 8010 |
ifTrue:[ |
8011 |
rec isBlock ifTrue:[ |
|
8012 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
8013 |
]. |
|
8014 |
]. |
|
3447 | 8015 |
|
8620 | 8016 |
calledContext notNil ifTrue:[ |
17122 | 8017 |
calledSel := calledContext selector. |
8018 |
calledRec := calledContext receiver. |
|
8019 |
||
8020 |
calledRec isBlock ifTrue:[ |
|
8021 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
8022 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
8023 |
]. |
|
8024 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
8025 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8026 |
||
8027 |
"/ calledRec isProtoObject ifFalse:[ |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8028 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8029 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8030 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8031 |
"/ |
10205 | 8032 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8033 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8034 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8035 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8036 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8037 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8038 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8039 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
8040 |
"/ ]. |
8620 | 8041 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8042 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8043 |
(#(handleDo:) includes:sel) |
17122 | 8044 |
ifTrue:[ |
8045 |
(calledRec isProtoObject not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
8046 |
]. |
|
10205 | 8047 |
(#( |
17122 | 8048 |
withCursor:do: |
8049 |
withWaitCursorDo: |
|
8050 |
withReadCursorDo: |
|
8051 |
withWriteCursorDo: |
|
8052 |
withSearchCursorDo: |
|
3447 | 8053 |
) includes:sel) |
17122 | 8054 |
ifTrue:[ |
8055 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
8056 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
8057 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
8058 |
]. |
|
10205 | 8059 |
|
8060 |
(#( |
|
17122 | 8061 |
wait |
8062 |
waitWithTimeout: |
|
8063 |
waitWithTimeoutMs: |
|
3447 | 8064 |
) includes:sel) |
17122 | 8065 |
ifTrue:[ |
8066 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
8067 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
8068 |
]. |
|
3447 | 8069 |
|
8070 |
^ true |
|
8071 |
||
9662 | 8072 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
11696 | 8073 |
"Modified: / 27-07-2012 / 17:30:18 / cg" |
3447 | 8074 |
! |
8075 |
||
8076 |
showingContext2:aContext nesting:nesting |
|
7823 | 8077 |
"return false, if this (intermediate) context is to be skipped. |
13455 | 8078 |
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
|
8079 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 8080 |
|
10205 | 8081 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8082 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8083 |
|
15257 | 8084 |
self verboseBacktraceHolder value ifTrue:[^ true]. |
3447 | 8085 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8086 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8087 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8088 |
sel := aContext selector. |
939 | 8089 |
mClass := aContext methodClass. |
8090 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8091 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8092 |
sender notNil ifTrue:[ |
17122 | 8093 |
senderSelector := sender selector. |
8094 |
senderReceiver := sender receiver. |
|
8095 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8096 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8097 |
|
939 | 8098 |
sel == #withCursor:do: ifTrue:[ |
17122 | 8099 |
(mClass == WindowGroup) ifTrue:[^ false]. |
8100 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 8101 |
]. |
8102 |
(sel == #withExecuteCursorDo: |
|
8103 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
17122 | 8104 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 8105 |
]. |
8106 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
8107 |
(sel == #do: |
6600 | 8108 |
or:[sel == #from:to:do: |
6601 | 8109 |
or:[sel == #keysAndValuesDo: |
8110 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
17122 | 8111 |
mClass == Array ifTrue:[^ false]. |
8112 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
8113 |
mClass == Set ifTrue:[^ false]. |
|
8114 |
mClass == Dictionary ifTrue:[^ false]. |
|
8115 |
mClass == Interval ifTrue:[^ false]. |
|
10205 | 8116 |
]. |
8117 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8118 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8119 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8120 |
or:[sel == #perform:with:with:with: |
11696 | 8121 |
or:[sel == #perform:with:with:with:with: |
8122 |
or:[sel == #perform:withArguments: |
|
8123 |
or:[sel == #perform:with:ifNotUnderstood: |
|
8124 |
or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]) |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8125 |
ifTrue:[ |
17122 | 8126 |
hideSupportCode == true ifTrue:[ |
8127 |
"/ 'x' printCR. |
|
8128 |
mClass == Object ifTrue:[^ false] |
|
8129 |
]. |
|
8130 |
nesting == 0 ifTrue:[^ true]. |
|
8131 |
mClass == Array ifTrue:[^ false]. |
|
8132 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8133 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8134 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8135 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8136 |
|
939 | 8137 |
(mClass == Object) ifTrue:[ |
17122 | 8138 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 8139 |
]. |
8140 |
||
8141 |
(mClass == Method) ifTrue:[ |
|
17122 | 8142 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 8143 |
]. |
8144 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8145 |
(mClass == SmallInteger) ifTrue:[ |
17122 | 8146 |
(sel == #to:do:) ifTrue:[^ false]. |
8147 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8148 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
8149 |
|
939 | 8150 |
(mClass == Block) ifTrue:[ |
17122 | 8151 |
sel == #ensure: ifTrue:[^ false]. |
8152 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
8153 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
8154 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
8155 |
sel == #on:do: ifTrue:[^ false]. |
|
17305 | 8156 |
sel == #on:do:ensure: ifTrue:[^ false]. |
8157 |
sel == #on:do:ifCurtailed: ifTrue:[^ false]. |
|
17122 | 8158 |
|
8159 |
sel == #value ifTrue:[^ false]. |
|
8160 |
sel == #value: ifTrue:[^ false]. |
|
8161 |
sel == #value:value: ifTrue:[^ false]. |
|
8162 |
sel == #value:value:value: ifTrue:[^ false]. |
|
8163 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
8164 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
8165 |
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
|
8166 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8167 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8168 |
aContext isBlockContext ifTrue:[ |
17305 | 8169 |
|home| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8170 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8171 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8172 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8173 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8174 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8175 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8176 |
"/ 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
|
8177 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8178 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8179 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8180 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8181 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
8182 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8183 |
|
17305 | 8184 |
home := aContext home. |
8185 |
(home notNil |
|
8186 |
and:[home receiver isProtoObject not |
|
8187 |
and:[home receiver isKindOf:Semaphore]]) ifTrue:[ |
|
8188 |
(home selector == #wait) ifTrue:[^ false]. |
|
8189 |
(home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
8190 |
]. |
|
8191 |
]. |
|
8192 |
||
8193 |
rec isProtoObject ifTrue:[ |
|
8194 |
^ true. |
|
8195 |
]. |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
8196 |
(rec isExceptionHandler) ifTrue:[ |
17122 | 8197 |
sel == #handle:do: ifTrue:[^ false]. |
8198 |
sel == #handleDo: ifTrue:[^ false]. |
|
8199 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
8200 |
sel == #answer:do: ifTrue:[^ false]. |
|
8201 |
]. |
|
17305 | 8202 |
(rec isException) ifTrue:[ |
17122 | 8203 |
sel == #doRaise ifTrue:[^ false]. |
8204 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
8205 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
8206 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
8207 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8208 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8209 |
(mClass == Context) ifTrue:[ |
17122 | 8210 |
sel == #unwind ifTrue:[^ false]. |
8211 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8212 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8213 |
(mClass == ProcessorScheduler) ifTrue:[ |
17122 | 8214 |
sel == #interruptActive ifTrue:[^ false]. |
8215 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
8216 |
sel == #suspend: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8217 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8218 |
mClass == Process ifTrue:[ |
17122 | 8219 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
8220 |
]. |
15256 | 8221 |
(sel == #break) ifTrue:[ |
17122 | 8222 |
(mClass == Breakpoint) ifTrue:[^ false]. |
15256 | 8223 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8224 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
8225 |
|
9662 | 8226 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
11696 | 8227 |
"Modified: / 27-07-2012 / 17:26:54 / cg" |
17305 | 8228 |
"Modified: / 31-01-2017 / 20:21:32 / stefan" |
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
8229 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
8230 |
|
4859 | 8231 |
!DebugView methodsFor:'private-control loop'! |
266 | 8232 |
|
8233 |
controlLoop |
|
8234 |
"this is a kludge: |
|
17185 | 8235 |
start a dispatchloop which exits when |
8236 |
either continue, return or step is pressed |
|
266 | 8237 |
" |
8238 |
||
8239 |
haveControl := true. |
|
664 | 8240 |
[ |
17185 | 8241 |
[haveControl] whileTrue:[ |
13388 | 8242 |
AbortOperationRequest handle:[:ex | |
8243 |
] do:[ |
|
17185 | 8244 |
self controlLoopCatchingErrors |
13388 | 8245 |
] |
17185 | 8246 |
]. |
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
8247 |
] ensure:[ |
17185 | 8248 |
catchBlock := nil. |
8249 |
haveControl := false |
|
266 | 8250 |
]. |
664 | 8251 |
|
8252 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 8253 |
! |
8254 |
||
8255 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
8256 |
"this is the debuggers own private event handling loop; |
1187 | 8257 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
8258 |
|
266 | 8259 |
"setup a self removing catch-block" |
8260 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
8261 |
||
8262 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
15757 | 8263 |
"if we do not have multiple processes or its a system process |
8264 |
we start another dispatch loop, which exits when |
|
8265 |
either continue, return or step is pressed |
|
8266 |
or (via the catchBlock) if an error occurs. |
|
8267 |
Since our display is an extra exclusive one, |
|
8268 |
all processing for normal views stops here ... |
|
8269 |
" |
|
8270 |
||
8271 |
WindowGroup setActiveGroup:windowGroup. |
|
8272 |
SignalSet anySignal handle:[:ex | |
|
8273 |
|signal| |
|
8274 |
||
8275 |
signal := ex creator. |
|
8276 |
(UserInterruptSignal accepts:signal) ifTrue:[ |
|
14835 | 8277 |
Transcript showCR:'UserInterruptSignal'. |
15757 | 8278 |
self topView raiseDeiconified. |
8279 |
ex proceed. |
|
8280 |
]. |
|
8281 |
||
8282 |
(UserNotification accepts:signal) ifTrue:[ |
|
11890 | 8283 |
Transcript showCR:'UserNotification'. |
15757 | 8284 |
(signal ~~ ActivityNotificationSignal) ifTrue:[ |
8285 |
self showError:ex description. |
|
8286 |
]. |
|
8287 |
ex proceed. |
|
8288 |
]. |
|
8289 |
(HaltInterrupt accepts:signal) ifTrue:[ |
|
11890 | 8290 |
Transcript showCR:'HaltInterrupt'. |
15757 | 8291 |
Transcript showCR:'Halt/Break in debugger ignored'. |
8292 |
self topView raiseDeiconified. |
|
8293 |
ex proceed. |
|
8294 |
]. |
|
8295 |
||
8296 |
self showError:'*** Error in modal debugger: |
|
266 | 8297 |
|
334 | 8298 |
>>>> Signal: ' , signal printString , ' |
266 | 8299 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8300 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8301 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8302 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8303 |
>>>> : ' , 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
|
8304 |
>>>> : ' , 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
|
8305 |
>>>> : ' , 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
|
8306 |
>>>> : ' , 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
|
8307 |
>>>> : ' , 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
|
8308 |
>>>> : ' , 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
|
8309 |
>>>> : ' , 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
|
8310 |
>>>> : ' , 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
|
8311 |
>>>> : ' , 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
|
8312 |
>>>> : ' , 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
|
8313 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 8314 |
>>>> Message: ' , ex description , ' |
266 | 8315 |
|
1187 | 8316 |
caught & ignored.'. |
15757 | 8317 |
ex return. |
8318 |
] do:[ |
|
11890 | 8319 |
"/ UserNotification handle:[:ex | |
8320 |
"/ (ex signal == ActivityNotificationSignal) ifTrue:[ |
|
8321 |
"/ ex proceed |
|
8322 |
"/ ]. |
|
8323 |
"/ self showError:ex description. |
|
8324 |
"/ ex proceed. |
|
8325 |
"/ ] do:[ |
|
16960 | 8326 |
device isNil ifTrue:[^ self]. |
8327 |
||
16253 | 8328 |
device |
15757 | 8329 |
dispatchModalWhile:[ |
8330 |
Processor activeProcess state:#debug. |
|
8331 |
haveControl]. |
|
11890 | 8332 |
"/ ] |
15757 | 8333 |
]. |
8334 |
WindowGroup setActiveGroup:nil. |
|
266 | 8335 |
] ifFalse:[ |
15757 | 8336 |
"we do have multiple processes - |
8337 |
simply enter the DebugViews-Windowgroup event loop. |
|
8338 |
effectively suspending event processing for the currently |
|
8339 |
active group. |
|
8340 |
" |
|
8341 |
SignalSet anySignal handle:[:ex | |
|
8342 |
|answer signal eMsg| |
|
8343 |
||
8344 |
signal := ex creator. |
|
8345 |
||
8346 |
DebuggingDebugger ~~ true ifTrue:[ |
|
8347 |
(signal == ActivityNotification) ifTrue:[ |
|
8348 |
ex proceed |
|
8349 |
]. |
|
8350 |
"/ |
|
8351 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
8352 |
"/ |
|
8353 |
ex catchInDebugger ifTrue:[ |
|
8354 |
'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR. |
|
8355 |
self halt. "/ self destroy. |
|
8356 |
ex reject |
|
8357 |
]. |
|
8358 |
||
8359 |
"/ |
|
8360 |
"/ ignore recursive breakpoints |
|
8361 |
"/ |
|
8362 |
(signal isControlInterrupt) ifTrue:[ |
|
8363 |
ignoreBreakpoints == true ifTrue:[ |
|
8364 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
8365 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
8366 |
self topView raiseDeiconified. |
|
8367 |
ex proceed |
|
8368 |
]. |
|
8369 |
]. |
|
8370 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
8371 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
8372 |
answer := Dialog |
|
8373 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
8374 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
8375 |
values:#( #proceed #close ) |
|
8376 |
default:#close. |
|
8377 |
answer == #close ifTrue:[ |
|
8378 |
self destroy. |
|
8379 |
ex reject |
|
8380 |
]. |
|
8381 |
ex return. |
|
8382 |
]. |
|
8383 |
signal == RecursiveExceptionError ifTrue:[ |
|
8384 |
(ex exception creator == BreakPointInterrupt) |
|
8385 |
ifTrue:[ |
|
8386 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
8387 |
ex proceed. |
|
8388 |
]. |
|
8389 |
||
8390 |
self showError:'*** Recursive error in debugger: |
|
266 | 8391 |
|
12687
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8392 |
>>>> Signal: ' , ex creator printString , ' |
1d78c217e701
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
12671
diff
changeset
|
8393 |
>>>> ' , ex parameter creator printString , ' |
266 | 8394 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 8395 |
>>>> From: ' , ex suspendedContext sender printString , ' |
8396 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
8397 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
8398 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 8399 |
>>>> Message: ' , ex description , ' |
266 | 8400 |
|
1187 | 8401 |
caught & ignored.'. |
15757 | 8402 |
ex return |
8403 |
]. |
|
8404 |
]. |
|
8405 |
||
8406 |
self topView raiseDeiconified. |
|
8407 |
||
8408 |
eMsg := ex description. |
|
8409 |
(signal isControlInterrupt) ifTrue:[ |
|
8410 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
8411 |
]. |
|
8412 |
Dialog aboutToOpenBoxNotificationSignal |
|
8413 |
handle:[:ex | ex proceed ] |
|
8414 |
do:[ |
|
8415 |
answer := Dialog |
|
17185 | 8416 |
choose:(ex creator class theNonMetaclass name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
15757 | 8417 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
8418 |
values:#( #proceed #cancel #debug ) |
|
8419 |
default:#cancel. |
|
8420 |
]. |
|
8421 |
answer == #debug ifTrue:[ |
|
8422 |
'DebugView [info]: caught exception - debugging' infoPrintCR. |
|
8423 |
Debugger |
|
8424 |
enterUnconditional:(ex suspendedContext) |
|
17185 | 8425 |
withMessage:(ex creator class theNonMetaclass name,' in debugger: ' , eMsg) |
15757 | 8426 |
mayProceed:true. |
8427 |
ex proceed. |
|
8428 |
]. |
|
8429 |
answer == #proceed ifTrue:[ |
|
8430 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
8431 |
ex proceed. |
|
8432 |
]. |
|
8433 |
'DebugView [info]: caught exception - returning' infoPrintCR. |
|
8434 |
ex return. |
|
8435 |
] do:[ |
|
8436 |
"/ make certain that sub-debuggers, inspectors etc. |
|
8437 |
"/ come up on my device. |
|
16253 | 8438 |
Screen currentScreenQuerySignal answer:device |
15757 | 8439 |
do:[ |
8440 |
Dialog aboutToOpenBoxNotificationSignal |
|
8441 |
handle:[:ex | ex proceed ] |
|
8442 |
do:[ |
|
8443 |
windowGroup |
|
8444 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
8445 |
true] |
|
8446 |
onLeave:[] |
|
8447 |
] |
|
8448 |
] |
|
8449 |
]. |
|
266 | 8450 |
]. |
8451 |
catchBlock := nil. |
|
8452 |
||
11818 | 8453 |
"Created: / 24-11-1995 / 20:33:45 / cg" |
8454 |
"Modified: / 26-09-2012 / 15:03:39 / cg" |
|
266 | 8455 |
! ! |
8456 |
||
13416 | 8457 |
!DebugView methodsFor:'queries'! |
8458 |
||
13488 | 8459 |
canDefineForCallee:callee |
8460 |
"again, pure heuristics here" |
|
8461 |
||
16072 | 8462 |
|mthd app heuristic selector sender| |
8463 |
||
8464 |
callee isNil ifTrue:[^ false]. |
|
13488 | 8465 |
|
8466 |
classToDefineIn := selectorToDefine := nil. "/ sorry - left as info to define action |
|
8467 |
||
16072 | 8468 |
"/ clicked on an unimplemented method ? |
8469 |
sender := callee sender. |
|
8470 |
sender isNil ifTrue:[^ false]. |
|
8471 |
||
8472 |
mthd := sender method. |
|
8473 |
mthd isNil ifTrue:[ |
|
8474 |
sender isBlockContext ifFalse:[ |
|
8475 |
"/ an unimplemented method |
|
8476 |
selector := sender selector. |
|
8477 |
(sender receiver class canUnderstand:selector) ifFalse:[ |
|
8478 |
classToDefineIn := sender receiver class. |
|
8479 |
selectorToDefine := selector. |
|
8480 |
^ true |
|
8481 |
] |
|
8482 |
] |
|
8483 |
]. |
|
8484 |
||
8485 |
mthd := callee method. |
|
8486 |
mthd notNil ifTrue:[ |
|
8487 |
(mthd selector == #subclassResponsibility) ifTrue:[ |
|
8488 |
classToDefineIn := sender receiver class. |
|
8489 |
selectorToDefine := sender selector. |
|
8490 |
^ true. |
|
8491 |
]. |
|
8492 |
||
8493 |
"/ that's a big hack, but I am tired of navigating to find the missing menu message... |
|
8494 |
"/ you will thank me!! |
|
8495 |
mthd selector == #error:mayProceed: ifTrue:[ |
|
8496 |
(callee receiver isKindOf:MenuPanel) ifTrue:[ |
|
8497 |
|senderHome| |
|
8498 |
||
8499 |
(senderHome := sender home) notNil ifTrue:[ |
|
8500 |
(senderHome selector startsWith:'accept:') ifTrue:[ |
|
8501 |
(inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[ |
|
8502 |
(app := self processesApplication) notNil ifTrue:[ |
|
8503 |
heuristic := senderHome argsAndVars select:[:o | o isSymbol]. |
|
8504 |
heuristic size == 1 ifTrue:[ |
|
8505 |
classToDefineIn := app class. |
|
8506 |
selectorToDefine := heuristic first. |
|
8507 |
^ true |
|
8508 |
]. |
|
8509 |
]. |
|
8510 |
]. |
|
8511 |
]. |
|
8512 |
]. |
|
8513 |
]. |
|
8514 |
] |
|
13488 | 8515 |
]. |
8516 |
^ false |
|
8517 |
! |
|
8518 |
||
13489 | 8519 |
showingAlreadyModifiedCode |
8520 |
^ methodCodeToggle isVisible |
|
8521 |
and:[ methodCodeToggleSelectionHolder value = 2 ] |
|
8522 |
! ! |
|
8523 |
||
17156 | 8524 |
!DebugView methodsFor:'testing'! |
8525 |
||
8526 |
isDebugView |
|
8527 |
^ true |
|
8528 |
! ! |
|
8529 |
||
13489 | 8530 |
!DebugView methodsFor:'user interaction'! |
8531 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8532 |
checkIfCodeIsReallyModified |
16430 | 8533 |
|methodSource editorCode| |
6616 | 8534 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8535 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8536 |
|
16430 | 8537 |
currentMethod isNil ifTrue:[^ false]. |
8538 |
||
8539 |
methodSource := currentMethod source. |
|
8540 |
methodSource notNil ifTrue:[ |
|
8541 |
methodSource := methodSource string. |
|
8542 |
editorCode := codeView contents string. |
|
8543 |
methodSource = editorCode ifTrue:[ |
|
8544 |
^ false |
|
8545 |
]. |
|
8546 |
(methodSource withTabsExpanded:8) = (editorCode withTabsExpanded:8) ifTrue:[ |
|
8547 |
^ false |
|
8548 |
]. |
|
6616 | 8549 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8550 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8551 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8552 |
|
17109 | 8553 |
checkIfCodeIsReallyModifiedAndConfirmWith:questionString |
8554 |
"if code was not modified or confirmation answered with 'ok', |
|
8555 |
return true (i.e. whatever user wants to do should be done). |
|
8556 |
Otherwise, return false" |
|
8557 |
||
8558 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
|
8559 |
(self confirm:(resources stringWithCRs:questionString)) ifTrue:[^ true]. |
|
8560 |
^ false. |
|
8561 |
||
8562 |
"Created: / 25-11-2016 / 13:35:34 / cg" |
|
8563 |
! |
|
8564 |
||
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8565 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8566 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8567 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8568 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
8569 |
checkSelectionChangeAllowed:newSelection |
13388 | 8570 |
|answer v| |
8571 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8572 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8573 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8574 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8575 |
and:[newSelection = contextView selection]) ifTrue:[ |
17185 | 8576 |
^ true |
15413 | 8577 |
]. |
8578 |
||
8579 |
answer := Dialog |
|
17185 | 8580 |
confirmWithCancel:('Code modified - change selection anyway ?') |
8581 |
labels:#('No' 'No, Show Diffs' 'Yes'). |
|
13388 | 8582 |
answer isNil ifTrue:[^ false]. |
8583 |
answer == false ifTrue:[ |
|
17185 | 8584 |
v := DiffCodeView |
8585 |
openOn:codeView contents |
|
8586 |
label:(resources string:'Changed code (to be accepted ?)') |
|
8587 |
and:currentMethod source |
|
8588 |
label:(resources string:'Method''s actual (maybe original) code'). |
|
8589 |
v label:(resources string:'Comparing method''s code'). |
|
8590 |
v waitUntilVisible. |
|
8591 |
^ false |
|
13388 | 8592 |
]. |
8593 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
8594 |
codeView modified:false. |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8595 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8596 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
8597 |
|
266 | 8598 |
codeAccept:someCode |
13394 | 8599 |
"user wants some code to be recompiled" |
8600 |
||
14640 | 8601 |
ParseError handle:[:ex | |
17185 | 8602 |
ex lineNumber notNil ifTrue:[ |
8603 |
codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition. |
|
8604 |
]. |
|
8605 |
Dialog information:ex description. |
|
14640 | 8606 |
"/ ParseError new |
8607 |
"/ errorMessage:aMessage startPosition:position endPosition:endPos; |
|
8608 |
"/ parameter:self; |
|
8609 |
"/ lineNumber:tokenLineNr; "lineNr" |
|
8610 |
"/ raiseRequest. |
|
15413 | 8611 |
] do:[ |
17185 | 8612 |
^ self codeAccept:someCode unwind:false category:nil onCancel:nil |
14640 | 8613 |
]. |
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8614 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
8615 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 8616 |
! |
8617 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8618 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
13394 | 8619 |
"user wants some code to be recompiled. |
8620 |
Optionally unwind stack to right above the changed method. |
|
13455 | 8621 |
This undwind option is a leftover from times, when the debugger had no chance to |
15413 | 8622 |
show the original code. |
8623 |
Now, it can, and got a choice-field to select between original and changed code. |
|
8624 |
So the undwind option is not longer used and probably completely obsolete now |
|
13455 | 8625 |
(aka: this method is always called with doUnwind==false, these days)" |
3427 | 8626 |
|
13842 | 8627 |
|con newMethod| |
3427 | 8628 |
|
8629 |
codeView withWaitCursorDo:[ |
|
16430 | 8630 |
" |
8631 |
find the method-home context for this one |
|
8632 |
" |
|
8633 |
doUnwind ifTrue:[ |
|
8634 |
con := selectedContext. |
|
8635 |
top := con. |
|
8636 |
[con notNil] whileTrue:[ |
|
8637 |
(con methodHome == selectedContext) ifTrue:[ |
|
8638 |
top := con |
|
8639 |
]. |
|
8640 |
con := con sender |
|
8641 |
]. |
|
8642 |
]. |
|
8643 |
||
8644 |
"/ |
|
8645 |
"/ provide the classes nameSpace and changefile-update answers; |
|
8646 |
"/ in case we accept while in another context, to not capture these settings again |
|
8647 |
"/ |
|
8648 |
(Class updateChangeFileQuerySignal, |
|
8649 |
Class updateChangeListQuerySignal, |
|
8650 |
Class updateHistoryLineQuerySignal) answer:true |
|
8651 |
do:[ |
|
8652 |
Class nameSpaceQuerySignal answer:(aClass nameSpace) |
|
8653 |
do:[ |
|
8654 |
"/ the compiler nowadays already cares for the package... |
|
8655 |
"/ no, actually, it does not in case we are in the middle of a fileIn, |
|
8656 |
"/ and packageQuery is already answered by someone else. |
|
8657 |
"/ Better make it unpackaged, in case the user makes changes to other |
|
8658 |
"/ classes here (actually, I often change compiler, debugger, inspector here) |
|
8659 |
Class packageQuerySignal |
|
8660 |
answer:nil |
|
8661 |
do:[ |
|
8662 |
codeView contents:someCode. |
|
8663 |
Class methodRedefinitionNotification |
|
8664 |
answer:#keep |
|
8665 |
do:[ |
|
8666 |
| breakpoints newMethodOrClass | |
|
8667 |
||
8668 |
breakpoints := nil. |
|
8669 |
codeView isCodeView2 ifTrue:[ |
|
8670 |
breakpoints := codeView breakpoints. |
|
8671 |
]. |
|
8672 |
||
8673 |
BreakpointQuery answer: breakpoints do:[ |
|
8674 |
"/ Use original method's programming language instead of class's one. |
|
8675 |
"/ In most cases it's the same, but it may be that the method edited |
|
8676 |
"/ and accepted was an extension method written in another languages |
|
8677 |
"/ (such as Smalltalk extension to Java class or Ruby extension to |
|
8678 |
"/ Smalltalk class. |
|
8679 |
newMethodOrClass := selectedContext programmingLanguage |
|
8680 |
compilerClassForInteractiveTools |
|
8681 |
compile:someCode |
|
8682 |
forClass:aClass |
|
8683 |
inCategory:category |
|
8684 |
notifying:codeView. |
|
8685 |
"/ Kludge for accepting Java code in a debugger. The Java compiler |
|
8686 |
"/ does not compile single methods but always a full class and returns |
|
8687 |
"/ the compiled class(es) rather than a method. |
|
8688 |
"/ However, we need to update the method holder of a codeView. |
|
8689 |
"/ |
|
8690 |
"/ So, here we check whether the returned `newMethod` is really a method, |
|
8691 |
"/ if it's a class, try to search that class for a method with the |
|
8692 |
"/ same selector as selector of currently selected context. If found, |
|
8693 |
"/ that's the 'new' method we are going to show. |
|
8694 |
newMethodOrClass isBehavior ifTrue:[ |
|
8695 |
| selector | |
|
8696 |
||
8697 |
selector := selectedContext selector. |
|
8698 |
newMethod := newMethodOrClass compiledMethodAt: selector ifAbsent: nil. |
|
8699 |
] ifFalse:[ |
|
8700 |
newMethod := newMethodOrClass. |
|
8701 |
newMethod == #Error ifTrue:[ |
|
8702 |
"/ should now be obsolete |
|
8703 |
newMethod := nil |
|
8704 |
]. |
|
8705 |
]. |
|
8706 |
]. |
|
8707 |
]. |
|
8708 |
]. |
|
8709 |
]. |
|
8710 |
]. |
|
8711 |
||
8712 |
methodCodeToggleSelectionHolder value:2. "/ showing current code |
|
8713 |
methodCodeToggle beVisible. |
|
8714 |
||
8715 |
inspecting ifFalse:[ |
|
8716 |
(newMethod isNil) ifTrue:[^ cancelAction value]. |
|
8717 |
||
8718 |
codeView modified:false. |
|
8719 |
codeView isCodeView2 ifTrue:[ |
|
8720 |
codeView methodHolder value: newMethod. |
|
8721 |
]. |
|
8722 |
currentMethod := newMethod. |
|
8723 |
||
8724 |
doUnwind ifTrue:[ |
|
8725 |
"/ if it worked, and doUnwind is true, |
|
8726 |
"/ remove everything up to and including top |
|
8727 |
"/ from the context chain |
|
8728 |
||
8729 |
selectedContext canReturn ifTrue:[ |
|
8730 |
self setContext:(top "sender"). |
|
8731 |
exitAction := #restart. |
|
8732 |
selectedContext setLineNumber:1. |
|
8733 |
self doRestart. |
|
8734 |
] ifFalse:[ |
|
8735 |
self setContext:(top sender). |
|
8736 |
exitAction := #return. |
|
8737 |
]. |
|
8738 |
]. |
|
8739 |
]. |
|
3427 | 8740 |
]. |
8741 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
8742 |
"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
|
8743 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
14713 | 8744 |
"Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3427 | 8745 |
! |
8746 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8747 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
13394 | 8748 |
"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
|
8749 |
|
16422 | 8750 |
|sel implementorClass receiverClass method category wrapper| |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8751 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8752 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8753 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8754 |
"/ 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
|
8755 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8756 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8757 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8758 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8759 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8760 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8761 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8762 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8763 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8764 |
|
16422 | 8765 |
" |
8766 |
use class&selector to find the method for the compilation |
|
8767 |
and compile. |
|
8768 |
" |
|
8769 |
category := givenCategoryOrNil. |
|
8770 |
sel := selectedContext selector. |
|
8771 |
implementorClass := selectedContext methodClass. |
|
8772 |
method := selectedContext method. |
|
8773 |
||
8774 |
implementorClass isNil ifTrue:[ |
|
8775 |
(method notNil |
|
8776 |
and:[method mclass isNil |
|
8777 |
and:[(wrapper := method wrapper) notNil]] |
|
8778 |
) ifTrue:[ |
|
8779 |
method := wrapper. |
|
8780 |
]. |
|
8781 |
method notNil ifTrue:[ |
|
8782 |
implementorClass := method mclass. |
|
8783 |
implementorClass isNil ifTrue:[ |
|
8784 |
implementorClass := method getMclass |
|
8785 |
]. |
|
8786 |
]. |
|
8787 |
]. |
|
8788 |
implementorClass notNil ifTrue:[ |
|
8789 |
category isNil ifTrue:[ |
|
8790 |
method isNil ifTrue:[ |
|
8791 |
method := implementorClass compiledMethodAt:sel. |
|
8792 |
]. |
|
8793 |
category := method category |
|
8794 |
] |
|
8795 |
] ifFalse:[ |
|
8796 |
receiverClass := selectedContext receiver class. |
|
8797 |
implementorClass := receiverClass whichClassImplements:sel. |
|
8798 |
implementorClass := implementorClass ? receiverClass. |
|
8799 |
implementorClass ~~ Object ifTrue:[ |
|
8800 |
implementorClass := Dialog |
|
8801 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
8802 |
initialAnswer:implementorClass name |
|
8803 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
8804 |
implementorClass size == 0 ifTrue:[ |
|
8805 |
^ cancelAction value "/ cancelled |
|
8806 |
]. |
|
8807 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
8808 |
implementorClass isNil ifTrue:[ |
|
8809 |
Dialog warn:'No such class'. |
|
8810 |
^ cancelAction value "/ cancelled |
|
8811 |
]. |
|
8812 |
]. |
|
8813 |
]. |
|
8814 |
||
8815 |
self |
|
8816 |
codeAccept:someCode |
|
8817 |
inClass:implementorClass |
|
8818 |
unwind:doUnwind |
|
8819 |
category:category |
|
8820 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8821 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8822 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8823 |
"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
|
8824 |
"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
|
8825 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
8826 |
|
7912 | 8827 |
codeCompletion |
15413 | 8828 |
"/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
14109 | 8829 |
"/ (can we move that to a utility - probably DoWhatIMeanSupport) |
8830 |
||
8831 |
|cls language| |
|
7912 | 8832 |
|
8212 | 8833 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 8834 |
|
7912 | 8835 |
cls := currentMethod mclass. |
15413 | 8836 |
cls notNil ifTrue:[ |
17185 | 8837 |
language := cls programmingLanguage. |
14109 | 8838 |
]. |
8212 | 8839 |
|
7912 | 8840 |
UserInformation handle:[:ex | |
17185 | 8841 |
ex proceed. |
7912 | 8842 |
] do:[ |
17185 | 8843 |
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
|
8844 |
]. |
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8845 |
|
56d3659b75a0
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13553
diff
changeset
|
8846 |
"Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7912 | 8847 |
! |
8848 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8849 |
confirm:aString |
6971 | 8850 |
"open a modal yes-no dialog. |
8851 |
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
|
8852 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8853 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
16960 | 8854 |
^ true |
8855 |
]. |
|
8856 |
^ super confirm:(resources stringWithCRs:aString). |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8857 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
8858 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
8859 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
8860 |
"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
|
8861 |
Also sent to autoselect an interesting context on entry." |
0 | 8862 |
|
9235 | 8863 |
HaltInterrupt handle:[:ex | |
17185 | 8864 |
ignoreBreakpoints ifFalse:[ex reject]. |
8865 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
8866 |
ex proceed |
|
3447 | 8867 |
] do:[ |
17185 | 8868 |
self updateForContext:lineNr |
3269 | 8869 |
]. |
8870 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
8871 |
|
3447 | 8872 |
"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
|
8873 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
8874 |
|
10205 | 8875 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8876 |
stackInspector notNil ifTrue:[ |
17185 | 8877 |
stackInspector destroy. |
8878 |
stackInspector := nil. |
|
8879 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
8880 |
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
|
8881 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8882 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
8883 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8884 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8885 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8886 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8887 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8888 |
sel notNil ifTrue:[ |
17185 | 8889 |
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
|
8890 |
] |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8891 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8892 |
"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
|
8893 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
8894 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8895 |
processEvent:anEvent |
6129 | 8896 |
"filter keyboard events for popUp variable value display. |
8897 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8898 |
|
12106 | 8899 |
<resource: #keyboard (#CodeCompletion )> |
8900 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8901 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8902 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8903 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8904 |
evView notNil ifTrue:[ |
17185 | 8905 |
focusView := evView windowGroup focusView. |
8906 |
focusView isNil ifTrue:[ |
|
8907 |
focusView := evView. |
|
8908 |
]. |
|
8909 |
||
8910 |
anEvent isKeyPressEvent ifTrue:[ |
|
8911 |
key := anEvent key. |
|
8912 |
rawKey := anEvent rawKey. |
|
8913 |
||
8914 |
inCodeView := (focusView == codeView |
|
8915 |
or:[focusView isComponentOf:codeView]). |
|
8916 |
inCodeView ifTrue:[ |
|
8917 |
key == #CodeCompletion ifTrue:[ |
|
8918 |
"/ complete the word before/under the cursor. |
|
8919 |
self sensor |
|
8920 |
pushUserEvent:#codeCompletion |
|
8921 |
for:self |
|
8922 |
withArguments:#(). |
|
8923 |
^ true |
|
8924 |
]. |
|
8925 |
]. |
|
8926 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8927 |
|
3602 | 8928 |
false ifTrue:[ |
17185 | 8929 |
anEvent isButtonReleaseEvent ifTrue:[ |
8930 |
anEvent view == codeView ifTrue:[ |
|
8931 |
(RBParser notNil and:[RBParser isLoaded]) |
|
8932 |
ifTrue:[ |
|
8933 |
self sensor |
|
8934 |
pushEvent:anEvent. "/ must be first in queue |
|
8935 |
||
8936 |
self sensor |
|
8937 |
pushUserEvent:#explainSelection |
|
8938 |
for:self |
|
8939 |
withArguments:nil. |
|
8940 |
^ true "/ eaten |
|
8941 |
] |
|
8942 |
] |
|
8943 |
]. |
|
3602 | 8944 |
]. |
8945 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8946 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8947 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8948 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
8949 |
|
8212 | 8950 |
setCurrentMethod:aMethodOrNil |
8951 |
currentMethod := aMethodOrNil. |
|
8952 |
! |
|
8953 |
||
15413 | 8954 |
showSelection:lineNr |
1327 | 8955 |
"user clicked on a header line - show selected code in textView. |
8956 |
Also sent to autoselect an interesting context on entry." |
|
15413 | 8957 |
|
8958 |
UserNotification |
|
17185 | 8959 |
handle:[:ex | |
8960 |
"/ ex suspendedContext fullPrintAll. |
|
8961 |
Transcript showCR:ex description. |
|
8962 |
"/ Transcript showCR:ex parameter. |
|
8963 |
ex proceed |
|
8964 |
] |
|
8965 |
do:[ |
|
8966 |
Error |
|
8967 |
handle:[:ex | |
|
8968 |
|s con| |
|
8969 |
||
8970 |
ex creator isControlInterrupt ifTrue:[ |
|
8971 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' |
|
8972 |
infoPrintCR. |
|
8973 |
ex proceed |
|
8974 |
]. |
|
8975 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' |
|
8976 |
bindWith:ex suspendedContext) infoPrintCR. |
|
8977 |
s := '' writeStream. |
|
8978 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
8979 |
s nextPutLine:'****'. |
|
8980 |
s nextPutLine:'**** ',(ex description). |
|
8981 |
s nextPutLine:'****'. |
|
8982 |
con := ex suspendedContext. |
|
8983 |
s nextPutLine:'**** ',(con printString). |
|
8984 |
con := con sender. |
|
8985 |
HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ]. |
|
15413 | 8986 |
|
5842 | 8987 |
"/ [con notNil] whileTrue:[ |
8988 |
"/ Error catch:[:ex | |
|
8989 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
8990 |
"/ ]. |
|
4947 | 8991 |
"/ |
5842 | 8992 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
8993 |
"/ con := nil |
|
8994 |
"/ ] ifFalse:[ |
|
8995 |
"/ con := con sender. |
|
8996 |
"/ ] |
|
8997 |
"/ ]. |
|
15413 | 8998 |
|
17185 | 8999 |
codeView contents:(s contents). |
9000 |
ex return. |
|
9001 |
] |
|
9002 |
do:[ self doShowSelection:lineNr ] |
|
9003 |
] |
|
11610 | 9004 |
|
9005 |
"Modified: / 19-07-2012 / 10:56:58 / cg" |
|
1327 | 9006 |
! |
9007 |
||
10205 | 9008 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
9009 |
stackInspector isNil ifTrue:[ |
17185 | 9010 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
9011 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
9012 |
stackInspector := InspectorView |
|
9013 |
origin:(0.6 @ 0.0) |
|
9014 |
corner:(1.0 @ 1.0) |
|
9015 |
in:contextInspector superView. |
|
9016 |
stackInspector realize. |
|
9017 |
stackInspector fieldListLabel:'Stack'. |
|
9018 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
9019 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
9020 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
9021 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
9022 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
9023 |
|
12529 | 9024 |
updateContextInfoFor:aContext |
9025 |
"additional info as-per selected context; |
|
9026 |
for now: |
|
15656 | 9027 |
update:with:from: - show who was responsible |
12529 | 9028 |
" |
9029 |
||
12552 | 9030 |
|whatChanged changedObject receiver| |
12529 | 9031 |
|
9032 |
aContext selector == #'update:with:from:' ifTrue:[ |
|
15656 | 9033 |
receiver := aContext receiver. |
9034 |
whatChanged := aContext argAt:1. |
|
9035 |
changedObject := aContext argAt:3. |
|
9036 |
||
9037 |
changedObject isBehavior ifTrue:[ |
|
9038 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold). |
|
9039 |
^ self |
|
9040 |
]. |
|
9041 |
||
9042 |
receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm | |
|
9043 |
|val| |
|
9044 |
||
9045 |
IsDebuggingQuery answer:true do:[ |
|
17126 | 9046 |
val := receiver instVarAt:i. |
15656 | 9047 |
]. |
9048 |
val == changedObject ifTrue:[ |
|
9049 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold). |
|
9050 |
^ self |
|
9051 |
] |
|
9052 |
]. |
|
9053 |
||
17126 | 9054 |
(receiver isProtoObject not and:[receiver isKindOf:ApplicationModel]) ifTrue:[ |
15656 | 9055 |
receiver builder notNil ifTrue:[ |
9056 |
(receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue | |
|
9057 |
eachValue == changedObject ifTrue:[ |
|
9058 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold). |
|
9059 |
^ self |
|
9060 |
] |
|
9061 |
] |
|
9062 |
] |
|
9063 |
]. |
|
9064 |
||
17126 | 9065 |
"do not use classNameWithArticle - it is missing in ProtoObject!!" |
9066 |
contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject class nameWithArticle allBold). |
|
9067 |
^ self. |
|
12529 | 9068 |
]. |
9069 |
contextInfoLabel label:nil. |
|
9070 |
! |
|
9071 |
||
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
9072 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
9073 |
"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
|
9074 |
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
|
9075 |
|
56 | 9076 |
|con homeContext sel method code canAccept |
105 | 9077 |
implementorClass lineNrInMethod rec m line |
10205 | 9078 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 9079 |
codeSet highlighter evaluatorClass |
11912
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
9080 |
canDefine callee searchClass originalMethod cannotAcceptDueToOutdatedClass| |
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
9081 |
|
9bcd2727c37e
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
11911
diff
changeset
|
9082 |
canDefine := cannotAcceptDueToOutdatedClass := false. |
8212 | 9083 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
9084 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
9085 |
contextArray notNil ifTrue:[ |
16430 | 9086 |
lineNr <= contextArray size ifTrue:[ |
9087 |
con := contextArray at:lineNr. |
|
9088 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
9089 |
]. |
|
9090 |
" |
|
9091 |
clicking on the '** ...'-line shows more ... |
|
9092 |
" |
|
9093 |
con isNil ifTrue:[ |
|
9094 |
line := contextView list at:lineNr. |
|
9095 |
(line startsWith:'**') ifTrue:[ |
|
9096 |
self showMore. |
|
9097 |
lineNr >= contextArray size ifTrue:[ |
|
9098 |
contextView setSelection:lineNr. |
|
9099 |
con := contextArray at:lineNr ifAbsent:nil |
|
9100 |
] |
|
9101 |
]. |
|
9102 |
con isNil ifTrue:[ |
|
9103 |
codeView contents:nil. |
|
9104 |
^ self |
|
9105 |
]. |
|
9106 |
]. |
|
9107 |
||
9108 |
selectedContext := con. |
|
9109 |
m := contextView middleButtonMenu. |
|
9110 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
9111 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
9112 |
]. |
|
9113 |
||
9114 |
self withExecuteCursorDo:[ |
|
9115 |
codeSet := false. |
|
9116 |
||
9117 |
" |
|
9118 |
give it to the (lower right) inspector |
|
9119 |
" |
|
9120 |
Error handle:[:ex | |
|
9121 |
'DebugView [warning]: error while accessing context: ' errorPrint. |
|
9122 |
ex description errorPrintCR. |
|
9123 |
contextInspector inspect:nil. |
|
9124 |
contextInspector fieldListLabel:('Context'). |
|
9125 |
ex suspendedContext fullPrintAllOn: Transcript. |
|
9479 | 9126 |
"/ ex reject. |
16430 | 9127 |
] do:[ |
9128 |
contextInspector inspect:con. |
|
9129 |
"/ contextInspector fieldListLabel:('Context: ',con method whoString). |
|
9130 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
9131 |
]. |
|
9132 |
||
9133 |
"/ show a stack inspector sometimes |
|
9134 |
||
9135 |
con hasStackToShow ifTrue:[ |
|
9136 |
self showStackInspectorFor:con |
|
9137 |
] ifFalse:[ |
|
9138 |
self hideStackInspector |
|
9139 |
]. |
|
9140 |
||
9141 |
homeContext := con methodHome. |
|
9142 |
con canReturn ifTrue:[ |
|
9143 |
returnButton enable. restartButton enable. |
|
9144 |
] ifFalse:[ |
|
9145 |
returnButton disable. restartButton disable. |
|
9146 |
]. |
|
9147 |
||
9148 |
lineNrInMethod := con lineNumber. |
|
9149 |
||
9150 |
canAccept := false. |
|
9151 |
||
9152 |
homeContext isNil ifTrue:[ |
|
9153 |
" |
|
9154 |
mhmh - an optimized block |
|
9155 |
should get the block here, and get the method from |
|
9156 |
that one ... |
|
9157 |
But in the current version, there is no easy way to get to the block |
|
9158 |
since that one is not in the context. |
|
9159 |
A future new block calling scheme will fix this |
|
9160 |
(passing the block instead of the home as block argument). |
|
9161 |
" |
|
9162 |
(method := con method) isNil ifTrue:[ |
|
9163 |
"temporary kludge - peek into the sender context. |
|
9164 |
If its a do-like method and there is a single block variable |
|
9165 |
in the args or temporaries, that must be the one. |
|
9166 |
This helps in some cases. |
|
9167 |
" |
|
9168 |
(sender := con sender) notNil ifTrue:[ |
|
9169 |
tryVars := false. |
|
9170 |
(selSender := sender selector) notNil ifTrue:[ |
|
9171 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
9172 |
tryVars := true. |
|
9173 |
] |
|
9174 |
]. |
|
9175 |
tryVars ifTrue:[ |
|
9176 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
9177 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
9178 |
possibleBlocks size == 1 ifTrue:[ |
|
9179 |
method := possibleBlocks first method. |
|
9180 |
]. |
|
9181 |
] |
|
9182 |
]. |
|
9183 |
] |
|
9184 |
] ifFalse:[ |
|
9185 |
"fetch rec here - so we won't need context in doItAction" |
|
9186 |
rec := homeContext receiver. |
|
9187 |
sel := homeContext selector. |
|
9188 |
sel notNil ifTrue:[ |
|
9189 |
canAccept := true. |
|
9190 |
||
9191 |
implementorClass := homeContext methodClass. |
|
9192 |
implementorClass isNil ifTrue:[ |
|
9193 |
homeContext method notNil ifTrue:[ |
|
9194 |
WrappedMethod allInstancesDo:[:wrapped | |
|
9195 |
wrapped originalMethod == homeContext method ifTrue:[ |
|
9196 |
implementorClass := wrapped mclass |
|
9197 |
] |
|
9198 |
]. |
|
9199 |
implementorClass isNil ifTrue:[ |
|
9200 |
(homeContext searchClass notNil |
|
9201 |
and:[homeContext searchClass isObsolete]) ifTrue:[ |
|
9202 |
cannotAcceptDueToOutdatedClass := true. |
|
9203 |
] |
|
9204 |
]. |
|
9205 |
]. |
|
9206 |
]. |
|
9207 |
implementorClass isNil ifTrue:[ |
|
9208 |
Error handle:[:ex | |
|
11890 | 9209 |
"/ not covered by Error, anyway |
9210 |
"/ ex signal == BreakPointInterrupt ifTrue:[ |
|
9211 |
"/ ex proceed. |
|
9212 |
"/ ]. |
|
16430 | 9213 |
code := 'error while asking method for its source'. |
9214 |
code := code , Character cr , ex creator printString. |
|
9215 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
9216 |
||
9217 |
canAccept := false. |
|
9218 |
ex return. |
|
9219 |
] do:[ |
|
9220 |
" |
|
9221 |
special: look if this context was created by |
|
9222 |
valueWithReceiver kind of method invocation; |
|
9223 |
if so, grab the method from the sender and show it |
|
9224 |
" |
|
9225 |
((sender := homeContext sender) notNil |
|
9226 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
9227 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
9228 |
method := sender receiver. |
|
9229 |
canAccept := false. |
|
9230 |
] ifFalse:[ |
|
9231 |
(method := con method) notNil ifTrue:[ |
|
9232 |
canAccept := false. |
|
9233 |
] |
|
9234 |
]. |
|
9235 |
] |
|
9236 |
] ifFalse:[ |
|
9237 |
method := implementorClass compiledMethodAt:sel. |
|
9238 |
]. |
|
9239 |
] |
|
9240 |
]. |
|
9241 |
||
9242 |
homeContext notNil ifTrue:[ |
|
9243 |
searchClass := homeContext searchClass ? rec class. |
|
9244 |
currentMethod := searchClass lookupMethodFor:sel. |
|
9245 |
]. |
|
9246 |
originalMethod := currentMethod. |
|
9247 |
(currentMethod notNil |
|
9248 |
and:[currentMethod ~~ method |
|
9249 |
and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]] |
|
9250 |
) ifTrue:[ |
|
9251 |
originalMethod := method. |
|
9252 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
9253 |
method := originalMethod. "/ the one which is suspended / was executing |
|
9254 |
] ifFalse:[ |
|
9255 |
method := currentMethod. "/ the one which has already been accepted/modified. |
|
9256 |
lineNrInMethod := nil. |
|
9257 |
canAccept := true. |
|
9258 |
]. |
|
9259 |
methodCodeToggle beVisible. |
|
9260 |
] ifFalse:[ |
|
9261 |
methodCodeToggle beInvisible. |
|
9262 |
]. |
|
9263 |
||
9264 |
code isNil ifTrue:[ |
|
9265 |
errMsg := nil. |
|
9266 |
method isNil ifTrue:[ |
|
9267 |
"/ fall back heuristics (see how this was called, fetch block from caller) |
|
9268 |
sender := con sender. |
|
9269 |
con isBlockContext ifTrue:[ |
|
9270 |
(sender notNil |
|
9271 |
and:[((sender selector ? '') startsWith:'value') |
|
9272 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
9273 |
code := sender receiver source. |
|
9274 |
] |
|
9275 |
] ifFalse:[ |
|
9276 |
(sender notNil |
|
9277 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
9278 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
9279 |
method := sender receiver. |
|
9280 |
] |
|
9281 |
] |
|
9282 |
]. |
|
9283 |
method notNil ifTrue:[ |
|
9284 |
contextInspector fieldListLabel:(method selector "whoString"). |
|
9285 |
Error handle:[:ex | |
|
11890 | 9286 |
"/ not covered by Error, anyway |
9287 |
"/ ex signal isControlInterrupt ifTrue:[ |
|
9288 |
"/ ex proceed. |
|
9289 |
"/ ]. |
|
16430 | 9290 |
code := 'error while asking method for its source'. |
9291 |
code := code , Character cr , ex creator printString. |
|
9292 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
9293 |
||
9294 |
canAccept := false. |
|
9295 |
ex return. |
|
9296 |
] do:[ |
|
9297 |
self sensor shiftDown ifTrue:[ |
|
9298 |
code := method decompiledSource |
|
9299 |
] ifFalse:[ |
|
9300 |
code := method source. |
|
9301 |
]. |
|
9302 |
]. |
|
9303 |
||
9304 |
code isNil ifTrue:[ |
|
9305 |
method sourceFilename notNil ifTrue:[ |
|
9306 |
codeView contents:(resources |
|
9307 |
string:'** no sourcefile: %1 **' |
|
9308 |
with:method sourceFilename). |
|
9309 |
codeView realized ifTrue:[ |
|
9310 |
"codeView is not realized on initial startup" |
|
9311 |
codeView flash:'no source'. |
|
9312 |
]. |
|
9313 |
codeSet := true. |
|
9314 |
] ifFalse:[ |
|
9315 |
[ |
|
9316 |
|src| |
|
9317 |
||
9318 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
9319 |
codeView contents:src. |
|
9320 |
codeSet := true. |
|
9321 |
] on: Error do:[ |
|
9322 |
errMsg := '** no source **' |
|
9323 |
]. |
|
9324 |
] |
|
9325 |
]. |
|
9326 |
] ifFalse:[ |
|
9327 |
contextInspector fieldListLabel:'Context'. |
|
9328 |
homeContext isNil ifTrue:[ |
|
9329 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
9330 |
] ifFalse:[ |
|
9331 |
errMsg := '** no method - no source **'. |
|
16800 | 9332 |
canDefine := true. |
16430 | 9333 |
] |
9334 |
]. |
|
9335 |
errMsg notNil ifTrue:[ |
|
9336 |
self showError:errMsg. |
|
9337 |
codeSet := true. |
|
9338 |
] |
|
9339 |
]. |
|
9340 |
||
9341 |
code isNil ifTrue:[ |
|
9342 |
"/ canAccept := false. |
|
9343 |
codeSet ifFalse:[ |
|
9344 |
codeView contents:nil. |
|
9345 |
] |
|
9346 |
] ifFalse:[ |
|
9347 |
lineNrInMethod notNil ifTrue:[ |
|
9348 |
lineNrInMethod == 0 ifTrue:[ |
|
9349 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
9350 |
lineNrInMethod := method lineNumber |
|
9351 |
]. |
|
9352 |
"/ guess lineNumber from sent-messages selector |
|
9353 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
9354 |
lineNrInMethod == 0 ifTrue:[ |
|
9355 |
|conIdx sentContext messages| |
|
9356 |
||
9357 |
conIdx := contextArray identityIndexOf:con. |
|
9358 |
conIdx > 1 ifTrue:[ |
|
9359 |
sentContext := contextArray at:conIdx-1. |
|
9360 |
sentContext isBlockContext ifFalse:[ |
|
9361 |
(method notNil and:[code notNil]) ifTrue:[ |
|
9362 |
messages := method messagesSent. |
|
9363 |
messages size == 1 ifTrue:[ |
|
9364 |
sentContext selector == messages first ifTrue:[ |
|
9365 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
9366 |
] |
|
9367 |
] |
|
9368 |
]. |
|
9369 |
]. |
|
9370 |
]. |
|
9371 |
]. |
|
9372 |
]. |
|
9373 |
]. |
|
9374 |
codeView isCodeView2 ifTrue:[ |
|
9375 |
codeView model |
|
9376 |
setValue: code; |
|
9377 |
changed. |
|
9378 |
codeView methodHolder value: method. |
|
9379 |
codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
|
9380 |
] ifFalse:[ |
|
9381 |
UserPreferences current syntaxColoring ifTrue:[ |
|
9382 |
implementorClass isNil ifTrue:[ |
|
16933 | 9383 |
|guessedHome| |
16430 | 9384 |
(con isBlockContext |
9385 |
and:[con home isNil |
|
16933 | 9386 |
and:[(guessedHome := con guessedHome) notNil]]) |
16430 | 9387 |
ifTrue:[ |
16933 | 9388 |
implementorClass := guessedHome mclass |
16430 | 9389 |
] |
9390 |
]. |
|
9391 |
implementorClass notNil ifTrue:[ |
|
9392 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
9393 |
code size < 100000 ifTrue:[ |
|
9394 |
Error catch:[ |
|
9395 |
code := highlighter formatMethodSource:code in:implementorClass. |
|
9396 |
] |
|
9397 |
] |
|
9398 |
] |
|
9399 |
] |
|
9400 |
]. |
|
1555 | 9401 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9402 |
"/ code ~= (codeView contents) ifTrue:[ |
16430 | 9403 |
cannotAcceptDueToOutdatedClass ifTrue:[ |
16501 | 9404 |
codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' withColor:Color red),Character cr,Character cr,code asString). |
16430 | 9405 |
] ifFalse:[ |
9406 |
codeView setContents:code. |
|
9407 |
]. |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
9408 |
"/ ]. |
16430 | 9409 |
]. |
9410 |
(lineNrInMethod notNil |
|
9411 |
and:[lineNrInMethod ~~ 0 |
|
9412 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 9413 |
lineNrInMethod == 255 ifFalse:[ |
16430 | 9414 |
(lineNrInMethod == 255 |
9415 |
and:[method notNil |
|
9416 |
and:[method hasCode not]]) ifTrue:[ |
|
9417 |
"/ means: do not really know in interpreted methods |
|
9418 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
9419 |
] ifFalse:[ |
|
9420 |
codeView selectLine:lineNrInMethod. |
|
9421 |
]. |
|
9422 |
codeView makeSelectionVisible |
|
7000 | 9423 |
]. |
16430 | 9424 |
] ifFalse:[ |
9425 |
codeView unselect. |
|
9426 |
codeView scrollToTop |
|
9427 |
] |
|
9428 |
]. |
|
9429 |
||
9430 |
codeView acceptEnabled:canAccept. |
|
9431 |
canAccept ifTrue:[ |
|
9432 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
9433 |
] ifFalse:[ |
|
9434 |
codeView acceptAction:[:code | self beep] |
|
9435 |
]. |
|
9436 |
||
9437 |
receiverInspector inspect:rec. |
|
17126 | 9438 |
"do not use classNameWithArticle - it is missing in ProtoObject!!" |
9439 |
receiverInspector fieldListLabel:("'Receiver: ',"rec class nameWithArticle). |
|
16430 | 9440 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
9441 |
||
9442 |
" |
|
9443 |
the one below is wrong: currently, the |
|
9444 |
evaluator cannot handle passed contexts. |
|
9445 |
Once it does, pass con as in:-arg |
|
9446 |
" |
|
9447 |
(rec isJavaObject |
|
9448 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
9449 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
9450 |
evaluatorClass := Parser. |
|
9451 |
codeView commentStrings:#( '//' ( '/*' '*/' ) ). |
|
9452 |
] ifFalse:[ |
|
9453 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
9454 |
evaluatorClass := method mclass evaluatorClass. |
|
9455 |
codeView commentStrings:method mclass programmingLanguage commentStrings. |
|
9456 |
] ifFalse:[ |
|
9457 |
evaluatorClass := rec class evaluatorClass. |
|
9458 |
codeView commentStrings:rec class programmingLanguage commentStrings. |
|
9459 |
]. |
|
9460 |
]. |
|
9461 |
||
9462 |
codeView |
|
16933 | 9463 |
simulatedSelf:rec; |
16430 | 9464 |
doItAction: |
9465 |
[:theCode | |
|
9466 |
evaluatorClass |
|
9467 |
evaluate:theCode |
|
9468 |
in:actualContext "/ (selectedContext ? actualContext) |
|
9469 |
receiver:rec |
|
9470 |
notifying:codeView |
|
9471 |
logged:true |
|
9472 |
ifFail:nil |
|
9473 |
]; |
|
9474 |
editedMethodOrClass:(method ? rec class). |
|
9475 |
||
9476 |
||
9477 |
self setCurrentMethod:method. |
|
9478 |
||
9479 |
selectedContext := homeContext ? con. |
|
9480 |
actualContext := con |
|
9481 |
]. |
|
4122 | 9482 |
] ifFalse:[ |
16430 | 9483 |
codeView contents:nil. |
4122 | 9484 |
]. |
9485 |
codeView modified:false. |
|
9486 |
||
9487 |
con isContext ifFalse:[ |
|
16430 | 9488 |
sendButton disable. |
4122 | 9489 |
] ifTrue:[ |
16430 | 9490 |
sendButton enable. |
10205 | 9491 |
]. |
12529 | 9492 |
self updateContextInfoFor:con. |
10205 | 9493 |
|
9494 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 9495 |
(due to the block held in codeView). |
9496 |
(not really needed, since stuff gets collected away sooner or later ... |
|
9497 |
... but this makes it a bit sooner) |
|
9498 |
" |
|
9499 |
con := nil. |
|
9500 |
homeContext := nil. |
|
9501 |
||
13488 | 9502 |
(canDefine or:[self canDefineForCallee:callee]) ifTrue:[ |
16430 | 9503 |
defineButton beVisible. |
4122 | 9504 |
] ifFalse:[ |
16430 | 9505 |
defineButton beInvisible. |
4122 | 9506 |
]. |
9507 |
||
12529 | 9508 |
"/ enable/disable some menu items |
4122 | 9509 |
self updateMenuItems |
9510 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
9511 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
10752 | 9512 |
"Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13394 | 9513 |
"Modified: / 28-08-2013 / 15:13:02 / cg" |
4122 | 9514 |
! ! |
9515 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9516 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'accessing'! |
8170 | 9517 |
|
9518 |
ignoreCount:something |
|
9519 |
ignoreCount := something. |
|
9520 |
! |
|
9521 |
||
9522 |
ignoreEndTime:something |
|
9523 |
ignoreEndTime := something. |
|
9524 |
! |
|
9525 |
||
12937 | 9526 |
ignoreForProcess:aProcess |
9527 |
ignoredProcesses isNil ifTrue:[ |
|
17185 | 9528 |
ignoredProcesses := WeakIdentitySet new. |
12937 | 9529 |
]. |
9530 |
ignoredProcesses add:aProcess |
|
9531 |
! |
|
9532 |
||
9533 |
ignoreForReceiverClass:aClass |
|
9534 |
ignoredReceiverClasses isNil ifTrue:[ |
|
17185 | 9535 |
ignoredReceiverClasses := WeakIdentitySet new. |
12937 | 9536 |
]. |
9537 |
ignoredReceiverClasses add:aClass |
|
9538 |
! |
|
9539 |
||
14608 | 9540 |
ignoreIfCalledFromMethod:aMethod |
9541 |
ignoredSendingClassAndSelectors isNil ifTrue:[ |
|
17185 | 9542 |
ignoredSendingClassAndSelectors := OrderedCollection new. |
14608 | 9543 |
]. |
9544 |
||
9545 |
"/ remember the method's name, not the method. |
|
9546 |
"/ so it can be recompiled and we still detect ignores |
|
9547 |
ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector } |
|
9548 |
! |
|
9549 |
||
11210 | 9550 |
ignoreUntilShiftKeyPressed:aBoolean |
9551 |
ignoreUntilShiftKeyPressed := aBoolean. |
|
9552 |
||
9553 |
"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
|
9554 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9555 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9556 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'! |
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 |
decrementIgnoreCount |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9559 |
ignoreCount notNil ifTrue:[ |
17185 | 9560 |
ignoreCount > 0 ifTrue:[ |
9561 |
ignoreCount := ignoreCount - 1 |
|
9562 |
] |
|
11366
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 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9565 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9566 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9567 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9568 |
printConditionOn:aStream |
14608 | 9569 |
ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[ |
17181 | 9570 |
aStream nextPutAll:(' if called from %1 » %2' |
16535 | 9571 |
bindWith:ignoredSendingClassAndSelectors first first |
9572 |
with:ignoredSendingClassAndSelectors first second). |
|
9573 |
^ self. |
|
14608 | 9574 |
]. |
12937 | 9575 |
ignoredProcesses notEmptyOrNil ifTrue:[ |
16535 | 9576 |
aStream nextPutAll:(' in %1 processes (%2)' |
9577 |
bindWith:ignoredProcesses size |
|
9578 |
with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9579 |
^ self. |
|
14608 | 9580 |
]. |
9581 |
ignoredReceiverClasses notNil ifTrue:[ |
|
16535 | 9582 |
aStream nextPutAll:(' for %1 classes (%2)' |
9583 |
bindWith:ignoredReceiverClasses size |
|
9584 |
with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')). |
|
9585 |
^ self. |
|
14608 | 9586 |
]. |
9587 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
16535 | 9588 |
aStream nextPutAll:' until shiftKey pressed'. |
9589 |
^ self. |
|
14608 | 9590 |
]. |
9591 |
ignoreEndTime notNil ifTrue:[ |
|
16535 | 9592 |
aStream nextPutAll:' until '. |
9593 |
ignoreEndTime printOn:aStream. |
|
9594 |
^ self. |
|
14608 | 9595 |
]. |
9596 |
(ignoreCount notNil) ifTrue:[ |
|
16535 | 9597 |
(ignoreCount > 0) ifTrue:[ |
9598 |
aStream nextPutAll:' for '. |
|
9599 |
ignoreCount printOn:aStream. |
|
9600 |
^ self. |
|
9601 |
]. |
|
9602 |
(ignoreCount < 0) ifTrue:[ |
|
9603 |
aStream nextPutAll:' forEver'. |
|
9604 |
^ self. |
|
9605 |
]. |
|
9606 |
aStream nextPutAll:' no longer'. |
|
14608 | 9607 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9608 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9609 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9610 |
!DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9611 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9612 |
haltIgnoredInfoString |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9613 |
"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
|
9614 |
nil if not ignored" |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9615 |
|
12941 | 9616 |
^ String streamContents:[:s | |
17185 | 9617 |
s nextPutAll:'ignored '. |
9618 |
self printConditionOn:s |
|
12941 | 9619 |
]. |
9620 |
||
13764
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9621 |
"/ ignoreCount notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9622 |
"/ ignoreCount > 0 ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9623 |
"/ ^ '%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
|
9624 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9625 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9626 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9627 |
"/ ignoreEndTime notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9628 |
"/ (ignoreEndTime > Timestamp now) ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9629 |
"/ ^ 'ignored until %1' bindWith:ignoreEndTime |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9630 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9631 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9632 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9633 |
"/ ignoreUntilShiftKeyPressed == true ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9634 |
"/ Screen current shiftDown ifFalse:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9635 |
"/ ^ 'ignored until shiftKey is pressed' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9636 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9637 |
"/ ^ nil |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9638 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9639 |
"/ ignoredProcesses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9640 |
"/ ^ 'ignored in some processes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9641 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9642 |
"/ ignoredReceiverClasses notNil ifTrue:[ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9643 |
"/ ^ 'ignored for some receiver classes' |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9644 |
"/ ]. |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9645 |
"/ |
225df800cafd
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
13666
diff
changeset
|
9646 |
"/ ^ 'ignored until reenabled' |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9647 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9648 |
"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
|
9649 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9650 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9651 |
isActive |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9652 |
"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
|
9653 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9654 |
ignoreEndTime notNil ifTrue:[ |
17185 | 9655 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9656 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9657 |
ignoreCount notNil ifTrue:[ |
17185 | 9658 |
^ ignoreCount == -1 or:[ ignoreCount > 0 ] |
12562 | 9659 |
]. |
12941 | 9660 |
ignoredProcesses notNil ifTrue:[ |
17185 | 9661 |
ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]]. |
9662 |
ignoredProcesses isEmpty ifTrue:[ |
|
9663 |
ignoredProcesses := nil. |
|
9664 |
^ false |
|
9665 |
]. |
|
12941 | 9666 |
]. |
12562 | 9667 |
^ true |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9668 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9669 |
"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
|
9670 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9671 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9672 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9673 |
^ false |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9674 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9675 |
"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
|
9676 |
"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
|
9677 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9678 |
|
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9679 |
isForBreakpointWithParameter:paramArg |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9680 |
^ false |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9681 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9682 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9683 |
"Created: / 06-03-2012 / 14:36:28 / cg" |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9684 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9685 |
|
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9686 |
isHaltIgnored |
12941 | 9687 |
"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
|
9688 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9689 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
17185 | 9690 |
^ Screen current shiftDown not |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9691 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9692 |
ignoreCount notNil ifTrue:[ |
17185 | 9693 |
^ ignoreCount > 0 |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9694 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9695 |
ignoreEndTime notNil ifTrue:[ |
17185 | 9696 |
^ ignoreEndTime > Timestamp now |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9697 |
]. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9698 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9699 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9700 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9701 |
"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
|
9702 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9703 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9704 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
11210 | 9705 |
|
8170 | 9706 |
method |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9707 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9708 |
|
9922 | 9709 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
9710 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9711 |
m := weakMethodHolder at:1. |
9796 | 9712 |
"/ wait until really gone (it could still be on the call stack |
9713 |
"/ |
|
9714 |
"/ m notNil ifTrue:[ |
|
9715 |
"/ m mclass isNil ifTrue:[ |
|
9716 |
"/ "/ no longer valid |
|
9717 |
"/ weakMethodHolder at:1 put:nil. |
|
9718 |
"/ ^ nil |
|
9719 |
"/ ]. |
|
9720 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9721 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9722 |
|
9922 | 9723 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 9724 |
! |
9725 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9726 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9727 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9728 |
|
9922 | 9729 |
methodArg == #all ifTrue:[ |
17185 | 9730 |
weakMethodHolder := methodArg |
9922 | 9731 |
] ifFalse:[ |
17185 | 9732 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 9733 |
]. |
8170 | 9734 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9735 |
|
9922 | 9736 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 9737 |
! ! |
9738 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9739 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9740 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9741 |
printOn:aStream |
9922 | 9742 |
|method| |
9743 |
||
9744 |
(method := self method) isNil ifTrue:[ |
|
17185 | 9745 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
9746 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9747 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
9748 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9749 |
aStream nextPutAll:'Ignore '. |
11704 | 9750 |
method isSymbol ifTrue:[ |
17185 | 9751 |
method printOn:aStream. |
11704 | 9752 |
] ifFalse:[ |
17185 | 9753 |
method whoString printOn:aStream. |
11704 | 9754 |
]. |
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9755 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9756 |
|
11704 | 9757 |
"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
|
9758 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
9759 |
|
8170 | 9760 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
9761 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9762 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9763 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9764 |
|
12941 | 9765 |
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
|
9766 |
^ super isActive |
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 |
"Modified: / 06-03-2012 / 12:40:20 / cg" |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9769 |
! |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9770 |
|
8170 | 9771 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9772 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 9773 |
weakMethodHolder == #all ifTrue:[^ true]. |
9774 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9775 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 9776 |
|
9777 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 9778 |
! |
9779 |
||
9780 |
isHaltIgnoredInMethod:aMethod line:line |
|
12937 | 9781 |
^ self isHaltIgnoredInMethod:aMethod line:line context:nil |
9782 |
! |
|
9783 |
||
9784 |
isHaltIgnoredInMethod:aMethod line:line context:context |
|
9095 | 9785 |
"/ 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
|
9786 |
|
13059 | 9787 |
"/ Transcript showCR:'-----------------------------'. |
9788 |
"/ Transcript showCR:aMethod. |
|
9789 |
"/ Transcript showCR:line. |
|
9790 |
"/ Transcript showCR:context. |
|
9791 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
9792 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 9793 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 9794 |
|
12937 | 9795 |
context notNil ifTrue:[ |
17185 | 9796 |
ignoredReceiverClasses notNil ifTrue:[ |
9797 |
^ ignoredReceiverClasses includes:(context receiver class) |
|
9798 |
]. |
|
12941 | 9799 |
]. |
13059 | 9800 |
|
9801 |
"/ Transcript showCR:ignoredProcesses. |
|
9802 |
"/ Transcript showCR:Processor activeProcess. |
|
12941 | 9803 |
ignoredProcesses notNil ifTrue:[ |
17185 | 9804 |
^ ignoredProcesses includes:(Processor activeProcess) |
12937 | 9805 |
]. |
14608 | 9806 |
ignoredSendingClassAndSelectors notNil ifTrue:[ |
17185 | 9807 |
context withAllSendersDo:[:each | |
9808 |
|m className selector cls| |
|
9809 |
||
9810 |
(m := each method) notNil ifTrue:[ |
|
9811 |
cls := m mclass. |
|
9812 |
cls notNil ifTrue:[ |
|
9813 |
className := cls name. |
|
9814 |
selector := m selector. |
|
9815 |
(ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]]) |
|
9816 |
ifTrue:[^ true]. |
|
9817 |
]. |
|
9818 |
] |
|
9819 |
] |
|
14608 | 9820 |
]. |
9821 |
||
9822 |
^ self isHaltIgnored "/ unconditionally |
|
8170 | 9823 |
! ! |
9824 |
||
11366
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9825 |
!DebugView::IgnoredBreakpoint methodsFor:'accessing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9826 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9827 |
parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9828 |
^ parameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9829 |
! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9830 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9831 |
parameter:something |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9832 |
parameter := something. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9833 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9834 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9835 |
!DebugView::IgnoredBreakpoint methodsFor:'printing'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9836 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9837 |
printOn:aStream |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9838 |
aStream nextPutAll:'Ignore breakpoint:#', parameter. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9839 |
self printConditionOn:aStream. |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9840 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9841 |
"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
|
9842 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9843 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9844 |
!DebugView::IgnoredBreakpoint methodsFor:'queries'! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9845 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9846 |
isForBreakpointWithParameter |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9847 |
^ true |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9848 |
|
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9849 |
"Created: / 06-03-2012 / 12:54:35 / cg" |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9850 |
! |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9851 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9852 |
isForBreakpointWithParameter:paramArg |
15730 | 9853 |
Transcript showCR:parameter. |
11367
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9854 |
^ paramArg = parameter |
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9855 |
|
bd0402b6421a
changed: #isBreakpointToBeIgnoredForParameter:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11366
diff
changeset
|
9856 |
"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
|
9857 |
! ! |
d57e42f65841
allow for code breakpoints (breakpoint:#param) to
Claus Gittinger <cg@exept.de>
parents:
11364
diff
changeset
|
9858 |
|
4122 | 9859 |
!DebugView class methodsFor:'documentation'! |
9860 |
||
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9861 |
version |
15730 | 9862 |
^ '$Header$' |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9863 |
! |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
9864 |
|
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
9865 |
version_CVS |
15730 | 9866 |
^ '$Header$' |
10628 | 9867 |
! |
9868 |
||
15950 | 9869 |
version_HG |
9870 |
||
9871 |
^ '$Changeset: <not expanded> $' |
|
9872 |
! |
|
9873 |
||
10628 | 9874 |
version_SVN |
15730 | 9875 |
^ '$Id$' |
4122 | 9876 |
! ! |
9877 |
||
12106 | 9878 |
|
4122 | 9879 |
DebugView initialize! |