author | Claus Gittinger <cg@exept.de> |
Tue, 06 Mar 2012 11:24:07 +0100 | |
changeset 11364 | af95026ebbda |
parent 11305 | f9019302309d |
child 11366 | d57e42f65841 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
11210 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
13 |
|
0 | 14 |
StandardSystemView subclass:#DebugView |
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
15 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
16 |
receiverInspector contextInspector contextArray selectedContext |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
17 |
catchBlock grabber mayProceed traceView tracing bigStep |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
18 |
skipLineNr steppedContextAddress abortButton terminateButton |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
19 |
continueButton stepButton nextButton nextOverButton nextOutButton |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
20 |
sendButton returnButton restartButton exclusive inspecting |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
21 |
nChainShown inspectedProcess updateProcess stopButton |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
22 |
updateButton defineButton monitorToggle stepping |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
23 |
steppedContextLineno stepForReturn actualContext inWrap |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
24 |
stackInspector steppedContext wrapperContext verboseBacktrace |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
25 |
firstContext stepHow cachable currentMethod ignoreBreakpoints |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
26 |
stepUntilEntering lastStepUntilEntering |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
27 |
lastSelectionInReceiverInspector lastSelectionInContextInspector |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
28 |
canShowMore exitAbort reportButton setOfHiddenCallingSelectors |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
29 |
isStoppedAtHaltOrBreakPoint exceptionInfoLabel methodCodeToggle |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
30 |
methodCodeToggleSelectionHolder' |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
31 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
32 |
DebuggingDebugger DefaultDebuggerBackgroundColor |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
33 |
InitialNChainShown IgnoredHalts ShowThreadID LastIgnoreHaltNTimes |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
34 |
LastIgnoreHaltDuration LastExtent LastOrigin' |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
35 |
poolDictionaries:'' |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
36 |
category:'Interface-Debugger' |
0 | 37 |
! |
38 |
||
8170 | 39 |
Object subclass:#IgnoredHalt |
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
40 |
instanceVariableNames:'weakMethodHolder lineNumber ignoreEndTime ignoreCount |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
41 |
ignoreUntilShiftKeyPressed' |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
42 |
classVariableNames:'' |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
43 |
poolDictionaries:'' |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
44 |
privateIn:DebugView |
8170 | 45 |
! |
46 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
47 |
!DebugView class methodsFor:'documentation'! |
29 | 48 |
|
49 |
copyright |
|
50 |
" |
|
51 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
11210 | 52 |
All Rights Reserved |
29 | 53 |
|
54 |
This software is furnished under a license and may be used |
|
55 |
only in accordance with the terms of that license and with the |
|
56 |
inclusion of the above copyright notice. This software may not |
|
57 |
be provided or otherwise made available to, or used by, any |
|
58 |
other person. No title to or ownership of the software is |
|
59 |
hereby transferred. |
|
60 |
" |
|
61 |
! |
|
0 | 62 |
|
29 | 63 |
documentation |
64 |
" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
65 |
This class implements a graphical debugger interface. |
29 | 66 |
The debugger usually sits on top of the faulting process, |
10205 | 67 |
taking over its event processing. |
2358 | 68 |
(this is different from other Smalltalk debuggers, which control |
69 |
the debuggee as a separate process. Consider this an historic |
|
70 |
leftover - the debugger was one of the first applications written for |
|
71 |
ST/X; however, why should we change it without a particular need ...). |
|
72 |
||
73 |
Only the 'stopped' debugged process is affected; |
|
29 | 74 |
other processes continue to respond to events. |
75 |
||
76 |
The one exception is when an error occurs within the dispatcher process |
|
77 |
or in one of the eventhandler processes - in this case, the debugger |
|
78 |
will sit on an exclusive display connection. |
|
79 |
||
80 |
The whole debugging will be changed, once the required process primitives |
|
81 |
are available, which allow control of another processes execution |
|
82 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
83 |
to have the debugger control the debuggee (i.e. two processes) |
|
35 | 84 |
|
85 |
See additional information in 'doc/misc/debugger.doc'. |
|
53 | 86 |
|
10205 | 87 |
Notice: |
11210 | 88 |
the DebugView class caches the last used debugger in a class |
89 |
variable. It may happen, that a malfunctioning debugger (for example, |
|
90 |
a halfway destroyed one) is kept there. You will notice this, if a |
|
91 |
debugger comes up without showing any contents. In this case, close |
|
92 |
(or destroy) the broken debugView, and execute |
|
93 |
Debugger newDebugger |
|
94 |
which removes the cached debugger and forces creation of a new one the |
|
95 |
next time. This is a temporary workaround - the debugger will be fixed to |
|
96 |
avoid this problem. |
|
97 |
You also have to remove the cached debugger, if you change the debugger's |
|
98 |
initialization code (buttons, menu, etc.) and you want the new code to become |
|
99 |
effective. |
|
508 | 100 |
|
101 |
[author:] |
|
11210 | 102 |
Claus Gittinger |
508 | 103 |
|
104 |
[see also:] |
|
11210 | 105 |
Exception Signal |
106 |
Process |
|
29 | 107 |
" |
108 |
! ! |
|
0 | 109 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
110 |
!DebugView class methodsFor:'initialization'! |
243 | 111 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
112 |
initialize |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
113 |
InitialNChainShown := 50. |
8148 | 114 |
"/ DefaultDebuggerBackgroundColor := nil. |
3387 | 115 |
"/ DefaultDebuggerBackgroundColor := Color red lightened. |
116 |
"/ DefaultDebuggerBackgroundColor := Color blue lightened lightened. |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
117 |
|
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
118 |
"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
|
119 |
"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
|
120 |
! |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
121 |
|
243 | 122 |
reinitialize |
7822 | 123 |
"reinitialize after an image-restart" |
124 |
||
243 | 125 |
self newDebugger |
126 |
! ! |
|
127 |
||
10203 | 128 |
!DebugView class methodsFor:'cleanup'! |
129 |
||
10205 | 130 |
lowSpaceCleanup |
10203 | 131 |
"in low memory situations, give up cached debuggers" |
132 |
||
133 |
CachedDebugger := nil. |
|
134 |
CachedExclusive := nil. |
|
135 |
OpenDebuggers := nil. |
|
136 |
||
137 |
" |
|
138 |
DebugView lowSpaceCleanup |
|
139 |
" |
|
140 |
||
141 |
"Modified: 18.4.1996 / 16:48:03 / cg" |
|
142 |
! |
|
143 |
||
144 |
newDebugger |
|
145 |
"force creation of a new debugger (give up cached debuggers)" |
|
146 |
||
147 |
CachedDebugger := nil. |
|
148 |
CachedExclusive := nil. |
|
149 |
OpenDebuggers := nil. |
|
150 |
||
151 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
|
11210 | 152 |
Debugger := self |
10203 | 153 |
]. |
154 |
||
155 |
" |
|
156 |
DebugView newDebugger |
|
157 |
" |
|
158 |
! ! |
|
159 |
||
160 |
!DebugView class methodsFor:'defaults'! |
|
161 |
||
162 |
defaultIcon |
|
163 |
"return the browsers default window icon" |
|
164 |
||
165 |
<resource: #programImage> |
|
166 |
||
10205 | 167 |
^ ToolbarIconLibrary debug22x22Icon |
10203 | 168 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
169 |
||
170 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
171 |
! |
|
172 |
||
173 |
defaultIconForAboutBox |
|
174 |
<resource: #programImage> |
|
175 |
||
10205 | 176 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
10203 | 177 |
! |
178 |
||
179 |
defaultVerboseBacktrace |
|
180 |
<resource: #obsolete> |
|
181 |
self obsoleteMethodWarning. |
|
182 |
^ UserPreferences current verboseBacktraceInDebugger |
|
183 |
||
184 |
"Created: 11.1.1997 / 12:14:35 / cg" |
|
185 |
! |
|
186 |
||
187 |
defaultVerboseBacktrace:aBoolean |
|
188 |
<resource: #obsolete> |
|
189 |
self obsoleteMethodWarning. |
|
190 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
191 |
! |
|
192 |
||
193 |
updateStyleCache |
|
194 |
"extract values from the styleSheet and cache them in class variables" |
|
195 |
||
196 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
197 |
||
198 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
|
199 |
||
200 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
201 |
! ! |
|
202 |
||
203 |
!DebugView class methodsFor:'ignoring halts'! |
|
204 |
||
205 |
haltIgnoreInformationFor:haltingMethod atLineNr:lineNrInHaltingMethod |
|
206 |
"the information (if any) about the ignore-state of a halt" |
|
207 |
||
208 |
IgnoredHalts isNil ifTrue:[^ nil]. |
|
209 |
||
10205 | 210 |
IgnoredHalts do:[:ign | |
11210 | 211 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) ifTrue:[ |
212 |
^ ign |
|
213 |
]. |
|
10203 | 214 |
]. |
215 |
^ nil. |
|
216 |
! |
|
217 |
||
218 |
hasIgnoredHalts |
|
219 |
self removeInactiveIgnores. |
|
220 |
^ IgnoredHalts notEmptyOrNil |
|
221 |
! |
|
222 |
||
11210 | 223 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
10203 | 224 |
"remember to ignore a halt in some method for some number of invocations |
225 |
or until some time has elapsed. |
|
226 |
With nil count and time arguments, such an ignored halt is reactivated" |
|
227 |
||
228 |
|oldEntry ign| |
|
229 |
||
230 |
IgnoredHalts notNil ifTrue:[ |
|
11210 | 231 |
self removeInactiveIgnores. |
232 |
oldEntry := IgnoredHalts |
|
233 |
detect:[:ign | ign isForMethod:haltingMethod line:lineNrOfHalt] |
|
234 |
ifNone:nil. |
|
235 |
oldEntry notNil ifTrue:[ |
|
236 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
237 |
] |
|
238 |
]. |
|
239 |
||
240 |
(countOrNil notNil or:[dTOrNil notNil or:[untilShiftKey == true]]) ifTrue:[ |
|
241 |
IgnoredHalts isNil ifTrue:[ |
|
242 |
IgnoredHalts := OrderedCollection new. |
|
243 |
]. |
|
244 |
ign := IgnoredHalt new method:haltingMethod lineNumber:lineNrOfHalt. |
|
245 |
||
246 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
247 |
ign ignoreCount:countOrNil. |
|
248 |
]. |
|
249 |
(dTOrNil notNil) ifTrue:[ |
|
250 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
251 |
]. |
|
252 |
untilShiftKey == true ifTrue:[ |
|
253 |
ign ignoreUntilShiftKeyPressed:true. |
|
254 |
]. |
|
255 |
IgnoredHalts add:ign. |
|
10203 | 256 |
]. |
257 |
Smalltalk changed:#ignoredHalts. |
|
258 |
||
11210 | 259 |
"Created: / 27-01-2012 / 11:33:38 / cg" |
10203 | 260 |
! |
261 |
||
262 |
isHaltToBeIgnored |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
263 |
|c sender haltingMethod lineNrInHaltingMethod| |
10203 | 264 |
|
265 |
"/ should a halt be ignored ? |
|
266 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
267 |
||
268 |
"/ look for a breakpoint-wrapper's context |
|
269 |
c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil. |
|
270 |
c notNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
271 |
(c receiver isKindOf:NoHandlerError) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
272 |
c := c sender findNextContextWithSelector:#doRaise or:nil or:nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
273 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
274 |
(c receiver isKindOf:BreakPointInterrupt) ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
275 |
c := nil |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
276 |
] ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
277 |
[ ((sender := c sender) receiver isKindOf:BreakPointInterrupt) |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
278 |
or:[ sender receiver == BreakPointInterrupt ]] whileTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
279 |
c := sender |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
280 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
281 |
[ (sender := c sender) isBlockContext ] whileTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
282 |
c := sender |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
283 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
284 |
sender := nil. "/ avoid keeping a reference to this context |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
285 |
]. |
10203 | 286 |
]. |
287 |
||
288 |
c isNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
289 |
"/ look for halts or explicit breakpoints |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
290 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
291 |
c isNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
292 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
293 |
c isNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
294 |
^ false |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
295 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
296 |
]. |
10203 | 297 |
]. |
298 |
||
299 |
c := c sender. |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
300 |
"/ a code-breakpoint ? |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
301 |
(c receiver isKindOf:Breakpoint) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
302 |
c := c sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
303 |
]. |
10203 | 304 |
haltingMethod := c method. |
305 |
||
306 |
haltingMethod isWrapped ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
307 |
lineNrInHaltingMethod := 1. |
10203 | 308 |
] ifFalse:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
309 |
lineNrInHaltingMethod := c lineNumber. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
310 |
"/ Transcript showCR:c. |
10205 | 311 |
]. |
312 |
||
313 |
^ self |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
314 |
isHaltToBeIgnoredIn:haltingMethod |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
315 |
atLineNr:lineNrInHaltingMethod |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
316 |
modifyEntryCount:true. |
10203 | 317 |
|
318 |
"Created: / 22-10-2010 / 12:09:53 / cg" |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
319 |
"Modified: / 27-01-2012 / 11:08:32 / cg" |
10203 | 320 |
! |
321 |
||
322 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod |
|
323 |
^ self |
|
11210 | 324 |
isHaltToBeIgnoredIn:haltingMethod |
325 |
atLineNr:lineNrInHaltingMethod |
|
326 |
modifyEntryCount:false |
|
10203 | 327 |
! |
328 |
||
329 |
isHaltToBeIgnoredIn:haltingMethod atLineNr:lineNrInHaltingMethod modifyEntryCount:modifyCount |
|
330 |
"/ should a halt be ignored ? |
|
331 |
||
332 |
IgnoredHalts isNil ifTrue:[^ false]. |
|
333 |
||
334 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
|
10205 | 335 |
IgnoredHalts do:[:ign | |
11210 | 336 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) ifTrue:[ |
11364
af95026ebbda
changed: #isHaltToBeIgnoredIn:atLineNr:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11305
diff
changeset
|
337 |
Transcript show:'Debugger [info]: halt/break ignored in ', haltingMethod whoString. |
11210 | 338 |
Transcript show:' ('; show:ign; showCR:')'. |
11364
af95026ebbda
changed: #isHaltToBeIgnoredIn:atLineNr:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11305
diff
changeset
|
339 |
|
11210 | 340 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
341 |
ign isHaltIgnored ifFalse:[ |
|
342 |
Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString. |
|
343 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
344 |
]. |
|
345 |
^ true. |
|
346 |
]. |
|
10205 | 347 |
]. |
348 |
||
349 |
IgnoredHalts := IgnoredHalts |
|
11210 | 350 |
select:[:ign | |
351 |
ign isActive and:[ (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) not ] |
|
352 |
]. |
|
10203 | 353 |
IgnoredHalts isEmpty ifTrue:[ |
11210 | 354 |
IgnoredHalts := nil. |
10203 | 355 |
]. |
356 |
||
357 |
^ false. |
|
358 |
||
11364
af95026ebbda
changed: #isHaltToBeIgnoredIn:atLineNr:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11305
diff
changeset
|
359 |
"Modified: / 06-03-2012 / 11:15:01 / cg" |
10203 | 360 |
! |
361 |
||
362 |
removeInactiveIgnores |
|
363 |
IgnoredHalts notNil ifTrue:[ |
|
11210 | 364 |
IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
10203 | 365 |
]. |
366 |
! |
|
367 |
||
368 |
stopIgnoringHalts |
|
369 |
"forget about all ignored halts" |
|
370 |
||
371 |
IgnoredHalts := nil. |
|
372 |
Smalltalk changed:#ignoredHalts. |
|
373 |
! ! |
|
374 |
||
375 |
!DebugView class methodsFor:'instance creation / entering'! |
|
0 | 376 |
|
2421 | 377 |
enter |
378 |
"enter a debugger" |
|
379 |
||
5455 | 380 |
<context: #return> |
381 |
||
10205 | 382 |
^ self |
11210 | 383 |
enter:thisContext sender |
384 |
withMessage:'debugger entered' |
|
385 |
mayProceed:true. |
|
10205 | 386 |
! |
387 |
||
388 |
enter:aContext withMessage:aString |
|
2355 | 389 |
"enter a debugger" |
390 |
||
5455 | 391 |
<context: #return> |
392 |
||
2355 | 393 |
^ self |
11210 | 394 |
enter:aContext |
395 |
withMessage:aString |
|
396 |
mayProceed:true |
|
2355 | 397 |
! |
398 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
399 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 400 |
"enter a debugger; if this is a recursive invocation, enter |
401 |
a MiniDebugger instead. |
|
402 |
This is the standard way of entering the debugger; |
|
403 |
sent from error- and halt messages." |
|
0 | 404 |
|
3447 | 405 |
<context: #return> |
406 |
||
3702 | 407 |
|active| |
93 | 408 |
|
57 | 409 |
StepInterruptPending := nil. |
3998 | 410 |
ControlInterrupt handle:[:ex | |
11210 | 411 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
412 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
413 |
ex proceed |
|
3998 | 414 |
] do:[ |
11210 | 415 |
" |
416 |
well, it could be a stepping or sending debugger up there; |
|
417 |
in this case, return to it. This happens, when a stepping process |
|
418 |
runs into an error (for example, a halt). In this case, we want the |
|
419 |
stepping debugger to come up again instead of a new one. |
|
420 |
" |
|
421 |
OpenDebuggers notNil ifTrue:[ |
|
422 |
active := Processor activeProcess. |
|
423 |
OpenDebuggers do:[:aDebugger | |
|
424 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
|
425 |
(aDebugger inspectedProcess == active) ifTrue:[ |
|
426 |
aDebugger device isOpen ifTrue:[ |
|
427 |
"/ 'entering stepping debugger again' printNL. |
|
428 |
aDebugger unstep. |
|
429 |
aDebugger setLabelFor:aString in:active. |
|
430 |
aDebugger mayProceed:mayProceed. |
|
431 |
^ aDebugger enter:aContext select:nil. |
|
432 |
] |
|
433 |
] |
|
434 |
] |
|
435 |
] |
|
436 |
]. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
437 |
]. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
438 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
526 | 439 |
|
3447 | 440 |
"Modified: / 18.11.2001 / 00:48:03 / cg" |
53 | 441 |
! |
442 |
||
8347 | 443 |
enterException:ex |
444 |
"enter a debugger; if this is a recursive invocation, enter |
|
445 |
a MiniDebugger instead. |
|
446 |
This is the standard way of entering the debugger; |
|
447 |
sent from error- and halt messages." |
|
448 |
||
449 |
^ self |
|
11210 | 450 |
enter:ex returnableSuspendedContext |
451 |
withMessage:ex descriptionForDebugger |
|
452 |
mayProceed:(ex mayProceed). |
|
8347 | 453 |
! |
454 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
455 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 456 |
"enter a debugger - do not check for recursive invocation" |
457 |
||
5455 | 458 |
<context: #return> |
459 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
460 |
|aDebugger| |
266 | 461 |
|
462 |
StepInterruptPending := nil. |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
463 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
464 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
465 |
"/ to avoid recursive debugging ... |
3447 | 466 |
ControlInterrupt handle:[:ex | |
11210 | 467 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
468 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
469 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
470 |
] do:[ |
11210 | 471 |
aDebugger := self new. |
3447 | 472 |
]. |
473 |
||
474 |
aDebugger isNil ifTrue:[ |
|
11210 | 475 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
476 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
477 |
mayProceed ifTrue:[ |
|
478 |
(Dialog confirm:'Error/Breakpoint cought.\\Press Continue or Abort.' withCRs |
|
479 |
yesLabel:'Continue' noLabel:'Abort') |
|
480 |
ifTrue:[ |
|
481 |
^ nil |
|
482 |
]. |
|
483 |
] ifFalse:[ |
|
484 |
self information:'Error cought.\\Press OK to abort the operation.' withCRs. |
|
485 |
]. |
|
486 |
AbortOperationRequest raise. |
|
487 |
"not reached" |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
488 |
]. |
3447 | 489 |
|
490 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
491 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 492 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
493 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
494 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
495 |
" |
11210 | 496 |
nil halt |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
497 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
498 |
|
3447 | 499 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 500 |
! |
501 |
||
6430 | 502 |
enterWithMessage:message |
503 |
"enter a debugger" |
|
504 |
||
505 |
<context: #return> |
|
506 |
||
10205 | 507 |
^ self |
11210 | 508 |
enter:(thisContext sender) |
509 |
withMessage:message |
|
510 |
mayProceed:true. |
|
6430 | 511 |
! |
512 |
||
266 | 513 |
new |
10205 | 514 |
"return a new DebugView. |
2358 | 515 |
- return a cached debugger if it already exists. |
516 |
Also, care for remote displays on which no debugger is wanted |
|
517 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
518 |
||
519 |
|debugger currentScreen debuggerDevice| |
|
520 |
||
521 |
currentScreen := Screen current. |
|
14 | 522 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
523 |
currentScreen notNil ifTrue:[ |
11210 | 524 |
(currentScreen suppressDebugger) ifTrue:[ |
525 |
"/ no debuggers with that device - show an alertBox which aborts... |
|
526 |
^ nil. |
|
527 |
]. |
|
528 |
(currentScreen mayOpenDebugger) ifFalse:[ |
|
529 |
"/ no debugger on that device - but on the main screen |
|
530 |
currentScreen := Screen default. |
|
531 |
]. |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
532 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
533 |
|
266 | 534 |
" |
10205 | 535 |
need a blocking debugger if no processes or |
536 |
or if its a timing/interrupt process |
|
266 | 537 |
(because otherwise we would not get any events here ... |
538 |
" |
|
539 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
11210 | 540 |
((debugger := CachedExclusive) isNil |
541 |
or:[debugger device ~~ currentScreen |
|
542 |
or:[currentScreen isNil |
|
543 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
|
544 |
debugger := self newExclusive |
|
545 |
]. |
|
546 |
CachedExclusive := nil. |
|
266 | 547 |
] ifFalse:[ |
11210 | 548 |
CachedDebugger notNil ifTrue:[ |
549 |
(CachedDebugger device ~~ currentScreen |
|
550 |
or:[currentScreen isNil |
|
551 |
or:[currentScreen isOpen not |
|
552 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
|
553 |
CachedDebugger := nil |
|
554 |
] |
|
555 |
]. |
|
556 |
||
557 |
(debugger := CachedDebugger) notNil ifTrue:[ |
|
558 |
CachedDebugger := nil. |
|
559 |
] ifFalse:[ |
|
560 |
debuggerDevice := currentScreen. |
|
561 |
debuggerDevice isNil ifTrue:[ |
|
562 |
"/ use the default display |
|
563 |
debuggerDevice := Screen default. |
|
564 |
]. |
|
565 |
(debuggerDevice isNil |
|
566 |
or:[debuggerDevice isOpen not |
|
567 |
"/ or:[debuggerDevice mayOpenDebugger not] |
|
568 |
]) ifTrue:[ |
|
569 |
"/ no debugger |
|
570 |
^ nil. |
|
571 |
]. |
|
572 |
||
573 |
Screen currentScreenQuerySignal answer:debuggerDevice |
|
574 |
do:[ |
|
575 |
debugger := super new. |
|
576 |
]. |
|
577 |
debugger label:'Debugger'. |
|
578 |
debugger icon:self defaultIcon. |
|
579 |
] |
|
266 | 580 |
]. |
73 | 581 |
^ debugger |
875 | 582 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
583 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 584 |
! |
0 | 585 |
|
266 | 586 |
newExclusive |
587 |
"return a debugger for exclusive display access" |
|
588 |
||
589 |
|debugger| |
|
105 | 590 |
|
266 | 591 |
debugger := super new. |
592 |
debugger label:'Debugger'. |
|
875 | 593 |
debugger icon:self defaultIcon. |
266 | 594 |
debugger exclusive:true. |
595 |
^ debugger |
|
875 | 596 |
|
597 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 598 |
! |
599 |
||
29 | 600 |
openOn:aProcess |
601 |
"start a debugger on aProcess |
|
602 |
(actually not more than a good-looking inspector)" |
|
15 | 603 |
|
52 | 604 |
|aDebugger label nm| |
15 | 605 |
|
606 |
aDebugger := super new. |
|
875 | 607 |
aDebugger icon:self defaultIcon. |
29 | 608 |
aProcess notNil ifTrue:[ |
11210 | 609 |
nm := aProcess name. |
610 |
nm notNil ifTrue:[ |
|
611 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
612 |
] ifFalse:[ |
|
613 |
nm := aProcess id printString |
|
614 |
]. |
|
615 |
label := 'Debugger [' , nm , ']'. |
|
29 | 616 |
] ifFalse:[ |
11210 | 617 |
label := 'no process' |
29 | 618 |
]. |
1114 | 619 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 620 |
aDebugger openOn:aProcess. |
621 |
^ nil |
|
875 | 622 |
|
1114 | 623 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 624 |
! ! |
625 |
||
3269 | 626 |
!DebugView class methodsFor:'menu specs'! |
627 |
||
628 |
menuSpec |
|
629 |
"This resource specification was automatically generated |
|
630 |
by the MenuEditor of ST/X." |
|
631 |
||
632 |
"Do not manually edit this!! If it is corrupted, |
|
633 |
the MenuEditor may not be able to read the specification." |
|
634 |
||
635 |
" |
|
636 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
637 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
638 |
" |
|
639 |
||
640 |
<resource: #menu> |
|
641 |
||
10205 | 642 |
^ |
5875 | 643 |
#(Menu |
11210 | 644 |
( |
645 |
(MenuItem |
|
646 |
label: 'File' |
|
647 |
translateLabel: true |
|
648 |
submenu: |
|
649 |
(Menu |
|
650 |
( |
|
651 |
(MenuItem |
|
652 |
enabled: canSendEmail |
|
653 |
label: 'Report a Bug via eMail...' |
|
654 |
itemValue: doOpenReportMailApp |
|
655 |
translateLabel: true |
|
656 |
) |
|
657 |
(MenuItem |
|
658 |
label: '-' |
|
659 |
) |
|
660 |
(MenuItem |
|
661 |
label: 'Exit' |
|
662 |
itemValue: closeRequest |
|
663 |
translateLabel: true |
|
664 |
isVisible: isInspecting |
|
665 |
) |
|
666 |
(MenuItem |
|
667 |
label: 'Close Debugger and Abort' |
|
668 |
itemValue: closeRequest |
|
669 |
translateLabel: true |
|
670 |
isVisible: isNotInspecting |
|
671 |
) |
|
672 |
) |
|
673 |
nil |
|
674 |
nil |
|
675 |
) |
|
676 |
) |
|
677 |
(MenuItem |
|
678 |
label: 'View' |
|
679 |
translateLabel: true |
|
680 |
submenu: |
|
681 |
(Menu |
|
682 |
( |
|
683 |
(MenuItem |
|
684 |
enabled: canShowMore |
|
685 |
label: 'Show More WalkBack' |
|
686 |
itemValue: showMore |
|
687 |
translateLabel: true |
|
688 |
) |
|
689 |
(MenuItem |
|
690 |
label: 'Show Verbose WalkBack' |
|
691 |
itemValue: toggleVerboseWalkback |
|
692 |
translateLabel: true |
|
693 |
isVisible: showingDenseWalkback |
|
694 |
) |
|
695 |
(MenuItem |
|
696 |
label: 'Show Dense WalkBack' |
|
697 |
itemValue: toggleVerboseWalkback |
|
698 |
translateLabel: true |
|
699 |
isVisible: showingVerboseWalkback |
|
700 |
) |
|
701 |
(MenuItem |
|
702 |
label: '-' |
|
703 |
) |
|
704 |
(MenuItem |
|
705 |
label: 'Raise Debugger when Entering' |
|
706 |
itemValue: autoRaiseView: |
|
707 |
translateLabel: true |
|
708 |
indication: autoRaiseView |
|
709 |
) |
|
710 |
(MenuItem |
|
711 |
label: '-' |
|
712 |
) |
|
713 |
(MenuItem |
|
714 |
label: 'Settings...' |
|
715 |
itemValue: openSettingsDialog |
|
716 |
translateLabel: true |
|
717 |
) |
|
718 |
) |
|
719 |
nil |
|
720 |
nil |
|
721 |
) |
|
722 |
) |
|
723 |
(MenuItem |
|
724 |
label: 'Process' |
|
725 |
translateLabel: true |
|
726 |
submenu: |
|
727 |
(Menu |
|
728 |
( |
|
729 |
(MenuItem |
|
730 |
label: 'Continue' |
|
731 |
itemValue: doContinue |
|
732 |
translateLabel: true |
|
733 |
) |
|
734 |
(MenuItem |
|
735 |
label: 'Next (Line-Step)' |
|
736 |
itemValue: doNext |
|
737 |
translateLabel: true |
|
738 |
) |
|
739 |
(MenuItem |
|
740 |
label: 'Step' |
|
741 |
itemValue: doStep |
|
742 |
translateLabel: true |
|
743 |
) |
|
744 |
(MenuItem |
|
745 |
label: '-' |
|
746 |
) |
|
747 |
(MenuItem |
|
748 |
label: 'Abort' |
|
749 |
itemValue: doAbort |
|
750 |
translateLabel: true |
|
751 |
) |
|
752 |
(MenuItem |
|
753 |
enabled: abortAllIsHandled |
|
754 |
label: 'Abort All' |
|
755 |
itemValue: doAbortAll |
|
756 |
translateLabel: true |
|
757 |
) |
|
758 |
(MenuItem |
|
759 |
label: '-' |
|
760 |
) |
|
761 |
(MenuItem |
|
762 |
label: 'Terminate' |
|
763 |
itemValue: doTerminate |
|
764 |
translateLabel: true |
|
765 |
) |
|
766 |
) |
|
767 |
nil |
|
768 |
nil |
|
769 |
) |
|
770 |
) |
|
771 |
(MenuItem |
|
772 |
label: 'Context' |
|
773 |
translateLabel: true |
|
774 |
submenu: |
|
775 |
(Menu |
|
776 |
( |
|
777 |
(MenuItem |
|
778 |
enabled: canReturn |
|
779 |
label: 'Return' |
|
780 |
itemValue: doReturn |
|
781 |
translateLabel: true |
|
782 |
) |
|
783 |
(MenuItem |
|
784 |
enabled: canRestart |
|
785 |
label: 'Restart' |
|
786 |
itemValue: doRestart |
|
787 |
translateLabel: true |
|
788 |
) |
|
789 |
(MenuItem |
|
790 |
label: '-' |
|
791 |
) |
|
792 |
(MenuItem |
|
793 |
enabled: hasContextSelected |
|
794 |
label: 'Inspect' |
|
795 |
itemValue: inspectContext |
|
796 |
translateLabel: true |
|
797 |
) |
|
798 |
(MenuItem |
|
799 |
label: 'Copy WalkBack Text' |
|
800 |
itemValue: copyWalkbackText |
|
801 |
translateLabel: true |
|
802 |
) |
|
803 |
(MenuItem |
|
804 |
label: 'Bookmark Method in SystemBrowser' |
|
805 |
itemValue: addBrowserBookmark |
|
806 |
translateLabel: true |
|
807 |
) |
|
808 |
) |
|
809 |
nil |
|
810 |
nil |
|
811 |
) |
|
812 |
) |
|
813 |
(MenuItem |
|
814 |
label: 'Class' |
|
815 |
translateLabel: true |
|
816 |
submenu: |
|
817 |
(Menu |
|
818 |
( |
|
819 |
(MenuItem |
|
820 |
enabled: canBrowseImplementingClass |
|
821 |
label: 'Browse Implementing Class' |
|
822 |
itemValue: browseImplementingClass |
|
823 |
translateLabel: true |
|
824 |
) |
|
825 |
(MenuItem |
|
826 |
enabled: canBrowseReceiversClass |
|
827 |
label: 'Browse Receivers Class' |
|
828 |
itemValue: browseReceiversClass |
|
829 |
translateLabel: true |
|
830 |
) |
|
831 |
(MenuItem |
|
832 |
label: '-' |
|
833 |
) |
|
834 |
(MenuItem |
|
835 |
enabled: canBrowseClassHierarchy |
|
836 |
label: 'Browse Receivers Class Hierarchy' |
|
837 |
itemValue: browseClassHierarchy |
|
838 |
translateLabel: true |
|
839 |
) |
|
840 |
(MenuItem |
|
841 |
enabled: canBrowseFullClassProtocol |
|
842 |
label: 'Browse Receivers Full Protocol' |
|
843 |
itemValue: browseFullClassProtocol |
|
844 |
translateLabel: true |
|
845 |
) |
|
846 |
(MenuItem |
|
847 |
label: '-' |
|
848 |
) |
|
849 |
(MenuItem |
|
850 |
enabled: canBrowseProcessesApplication |
|
851 |
label: 'Browse Application Class' |
|
852 |
itemValue: browseProcessesApplication |
|
853 |
translateLabel: true |
|
854 |
) |
|
855 |
) |
|
856 |
nil |
|
857 |
nil |
|
858 |
) |
|
859 |
) |
|
860 |
(MenuItem |
|
861 |
label: 'Selector' |
|
862 |
translateLabel: true |
|
863 |
submenu: |
|
864 |
(Menu |
|
865 |
( |
|
866 |
(MenuItem |
|
867 |
label: 'Browse Implementors...' |
|
868 |
itemValue: browseImplementorsOf |
|
869 |
translateLabel: true |
|
870 |
) |
|
871 |
(MenuItem |
|
872 |
label: 'Browse Senders...' |
|
873 |
itemValue: browseSendersOf |
|
874 |
translateLabel: true |
|
875 |
) |
|
876 |
(MenuItem |
|
877 |
label: '-' |
|
878 |
) |
|
879 |
(MenuItem |
|
880 |
enabled: canDefineMethod |
|
881 |
label: 'Define Missing Method' |
|
882 |
itemValue: doDefineMethod |
|
883 |
translateLabel: true |
|
884 |
) |
|
885 |
) |
|
886 |
nil |
|
887 |
nil |
|
888 |
) |
|
889 |
) |
|
890 |
(MenuItem |
|
891 |
label: 'Breakpoint' |
|
892 |
translateLabel: true |
|
893 |
submenu: |
|
894 |
(Menu |
|
895 |
( |
|
896 |
(MenuItem |
|
897 |
enabled: canRemoveBreakpoint |
|
898 |
label: 'Remove Breakpoint' |
|
899 |
itemValue: removeBreakpoint |
|
900 |
translateLabel: true |
|
901 |
) |
|
902 |
(MenuItem |
|
903 |
label: 'Remove all Breakpoints' |
|
904 |
itemValue: removeAllBreakpoints |
|
905 |
translateLabel: true |
|
906 |
) |
|
907 |
(MenuItem |
|
908 |
label: '-' |
|
909 |
) |
|
910 |
(MenuItem |
|
911 |
enabled: canAddBreakpoint |
|
912 |
label: 'Add Breakpoint' |
|
913 |
itemValue: addBreakpoint |
|
914 |
translateLabel: true |
|
915 |
) |
|
916 |
(MenuItem |
|
917 |
label: '-' |
|
918 |
) |
|
919 |
(MenuItem |
|
920 |
label: 'Ignore this Halt/BreakPoint' |
|
921 |
translateLabel: true |
|
922 |
submenu: |
|
923 |
(Menu |
|
924 |
( |
|
925 |
(MenuItem |
|
926 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
927 |
label: 'For Some Time...' |
|
928 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
929 |
translateLabel: true |
|
930 |
) |
|
931 |
(MenuItem |
|
932 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
933 |
label: 'For the Next N Times...' |
|
934 |
itemValue: openIgnoreHaltNTimesDialog |
|
935 |
translateLabel: true |
|
936 |
) |
|
937 |
(MenuItem |
|
938 |
label: 'Until Shift-Key is Pressed' |
|
939 |
itemValue: ignoreHaltUntilShiftKeyIsPressed |
|
940 |
translateLabel: true |
|
941 |
) |
|
942 |
(MenuItem |
|
943 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
944 |
label: 'Forever (Until Ignoring is Stopped)' |
|
945 |
itemValue: ignoreHaltForever |
|
946 |
translateLabel: true |
|
947 |
) |
|
948 |
) |
|
949 |
nil |
|
950 |
nil |
|
951 |
) |
|
952 |
) |
|
953 |
(MenuItem |
|
954 |
label: 'Ignore all Halts/BreakPoints' |
|
955 |
translateLabel: true |
|
956 |
submenu: |
|
957 |
(Menu |
|
958 |
( |
|
959 |
(MenuItem |
|
960 |
label: 'For Some Time...' |
|
961 |
itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
|
962 |
translateLabel: true |
|
963 |
) |
|
964 |
(MenuItem |
|
965 |
label: 'Until Shift-Key is Pressed' |
|
966 |
itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
|
967 |
translateLabel: true |
|
968 |
) |
|
969 |
(MenuItem |
|
970 |
label: 'Forever (Until Ignoring is Stopped)' |
|
971 |
itemValue: ignoreAllHaltsForever |
|
972 |
translateLabel: true |
|
973 |
) |
|
974 |
) |
|
975 |
nil |
|
976 |
nil |
|
977 |
) |
|
978 |
) |
|
979 |
(MenuItem |
|
980 |
enabled: hasHaltsToIgnore |
|
981 |
label: 'Stop Ignoring' |
|
982 |
itemValue: stopIgnoringHalts |
|
983 |
translateLabel: true |
|
984 |
) |
|
985 |
(MenuItem |
|
986 |
label: '-' |
|
987 |
) |
|
988 |
(MenuItem |
|
989 |
label: 'Manage Breakpoints' |
|
990 |
itemValue: openBreakPointBrowser |
|
991 |
translateLabel: true |
|
992 |
) |
|
993 |
(MenuItem |
|
994 |
label: 'Allow Breakpoints in Debugger' |
|
995 |
itemValue: allowBreakPointsInDebugger: |
|
996 |
translateLabel: true |
|
997 |
indication: allowBreakPointsInDebugger |
|
998 |
) |
|
999 |
) |
|
1000 |
nil |
|
1001 |
nil |
|
1002 |
) |
|
1003 |
) |
|
1004 |
(MenuItem |
|
1005 |
label: 'Help' |
|
1006 |
translateLabel: true |
|
1007 |
startGroup: right |
|
1008 |
submenu: |
|
1009 |
(Menu |
|
1010 |
( |
|
1011 |
(MenuItem |
|
1012 |
label: 'Debuggers Documentation' |
|
1013 |
itemValue: openHTMLDocument: |
|
1014 |
translateLabel: true |
|
1015 |
argument: 'tools/debugger/TOP.html' |
|
1016 |
) |
|
1017 |
(MenuItem |
|
1018 |
label: '-' |
|
1019 |
) |
|
1020 |
(MenuItem |
|
1021 |
label: 'About DebugView...' |
|
1022 |
itemValue: openAboutThisApplication |
|
1023 |
translateLabel: true |
|
1024 |
) |
|
1025 |
) |
|
1026 |
nil |
|
1027 |
nil |
|
1028 |
) |
|
1029 |
) |
|
1030 |
) |
|
1031 |
nil |
|
1032 |
nil |
|
3269 | 1033 |
) |
11210 | 1034 |
|
1035 |
"Modified: / 27-01-2012 / 11:29:45 / cg" |
|
3269 | 1036 |
! ! |
1037 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1038 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1039 |
|
4121 | 1040 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1041 |
"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
|
1042 |
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
|
1043 |
and Exception contexts, to present the context in which the error |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1044 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1045 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1046 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1047 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1048 |
|
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1049 |
someContexts := Array new:25. |
2042 | 1050 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1051 |
idx := 1. |
10205 | 1052 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
11210 | 1053 |
someContexts at:idx put:con. |
1054 |
con := con sender. |
|
1055 |
idx := idx + 1. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1056 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1057 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1058 |
^ someContexts at:idx. |
3447 | 1059 |
! |
1060 |
||
10205 | 1061 |
interestingContextIndexIn:aContextArray |
3447 | 1062 |
"return an interesting contexts offset, or nil. |
1063 |
This is the context initially shown in the walkback. |
|
1064 |
We move up the calling chain, skipping all intermediate Signal |
|
1065 |
and Exception contexts, to present the context in which the error |
|
1066 |
actually occured. |
|
1067 |
Just for your convenience :-)" |
|
1068 |
||
8152 | 1069 |
|con found offset sel prev ex rcvr nMax idx| |
3447 | 1070 |
|
7713 | 1071 |
"/ Transcript showCR:aContextArray. |
7648 | 1072 |
|
3447 | 1073 |
nMax := aContextArray size. |
1074 |
nMax <= 1 ifTrue:[^ 1]. |
|
1075 |
con := aContextArray at:1. |
|
1076 |
con isBlockContext ifTrue:[^ 1]. |
|
1077 |
||
1078 |
"/ somewhere, at the bottom, there must be a raise ... |
|
1079 |
"/ find the exception |
|
1080 |
||
1081 |
1 to:5 do:[:i | |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1082 |
con := aContextArray at:i ifAbsent:nil. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1083 |
con notNil ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1084 |
sel := con selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1085 |
(sel startsWith:'raise') ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1086 |
rcvr := con receiver. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1087 |
(rcvr isLazyValue not and:[rcvr isException]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1088 |
ex := rcvr. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1089 |
offset := i. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1090 |
found := con |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1091 |
] ifFalse:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1092 |
(rcvr isLazyValue not and:[rcvr isExceptionCreator]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1093 |
offset := i. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1094 |
found := con |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1095 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1096 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1097 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1098 |
]. |
3447 | 1099 |
]. |
1100 |
||
1101 |
" |
|
1102 |
if this is a noHandler exception, skip forward |
|
1103 |
to the erronous context |
|
1104 |
" |
|
1105 |
ex notNil ifTrue:[ |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1106 |
ex signal == Signal noHandlerSignal ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1107 |
found := ex suspendedContext |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1108 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1109 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1110 |
"/ Transcript show:'1 '; showCR:found. |
3447 | 1111 |
found isNil ifTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1112 |
"/ this is a kludge, but convenient. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1113 |
"/ show the place where the error (divisionByZero...) happend, |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1114 |
"/ not where the signal was raised. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1115 |
con := (aContextArray at:1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1116 |
sel := con methodHome selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1117 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1118 |
"/ typically a DivisionByZero - show caller of division |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1119 |
(sel == #// |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1120 |
or:[sel == #/ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1121 |
or:[sel == #\\]]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1122 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1123 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1124 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1125 |
"/ show the place of the bad message; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1126 |
(sel == #doesNotUnderstand:) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1127 |
idx := 3. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1128 |
nMax > 2 ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1129 |
sel := (aContextArray at:idx) selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1130 |
sel == #doesNotUnderstand: ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1131 |
idx := 4 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1132 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1133 |
nMax > idx ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1134 |
sel := (aContextArray at:idx) selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1135 |
"/ show the place of the perfor-send; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1136 |
((sel == #perform:) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1137 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1138 |
idx := idx + 1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1139 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1140 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1141 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1142 |
^ idx min:nMax |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1143 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1144 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1145 |
"/ show the bad method; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1146 |
(sel == #noByteCode) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1147 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1148 |
]. |
3447 | 1149 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1150 |
"/ "/ 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
|
1151 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1152 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1153 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1154 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1155 |
"/ "/ 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
|
1156 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1157 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1158 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1159 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1160 |
"/ "/ 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
|
1161 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1162 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1163 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1164 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1165 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1166 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1167 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1168 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1169 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1170 |
"/ ]. |
7862 | 1171 |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1172 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1173 |
(sel == #signalInterrupt:) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1174 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1175 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1176 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1177 |
"/ "/ 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
|
1178 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1179 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1180 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1181 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1182 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1183 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1184 |
"/ "/ 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
|
1185 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1186 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1187 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
1188 |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1189 |
"/ show the place of the bad index; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1190 |
( #(#notIndexed |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1191 |
#indexNotIntegerOrOutOfBounds: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1192 |
#subscriptBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1193 |
#elementBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1194 |
"/ #subclassResponsibility |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1195 |
) includes:sel) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1196 |
idx := 2. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1197 |
[ idx <= 3 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1198 |
and:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1199 |
sel := (aContextArray at:idx) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1200 |
#(#notIndexed |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1201 |
#indexNotIntegerOrOutOfBounds: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1202 |
#subscriptBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1203 |
#elementBoundsError: ) includes:sel |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1204 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1205 |
] whileTrue:[ idx := idx + 1 ]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1206 |
sel := (aContextArray at:idx) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1207 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1208 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1209 |
sel := (aContextArray at:idx+1) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1210 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1211 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1212 |
sel := (aContextArray at:idx+2) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1213 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1214 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1215 |
^ idx+3 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1216 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1217 |
^ idx+2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1218 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1219 |
^ idx+1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1220 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1221 |
^ idx |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1222 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1223 |
offset := 1. |
8152 | 1224 |
]. |
1225 |
||
1226 |
"/ the above is all too hard-coded; |
|
1227 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1228 |
"/ as more methods get flagged, remove code from above. |
|
1229 |
con := aContextArray at:offset ifAbsent:nil. |
|
1230 |
||
10205 | 1231 |
[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1232 |
con notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1233 |
and:[ con methodHome notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1234 |
and:[ con methodHome method notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1235 |
and:[ con methodHome method shouldBeSkippedInDebuggersWalkBack ]]] |
8152 | 1236 |
] whileTrue:[ |
1237 |
"/ Transcript showCR:con methodHome method. |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1238 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1239 |
con := aContextArray at:offset ifAbsent:nil. |
8152 | 1240 |
]. |
3447 | 1241 |
|
1242 |
" |
|
1243 |
got it; move up, skipping all intermediate Signal and |
|
1244 |
Exception contexts |
|
1245 |
" |
|
1246 |
prev := nil. |
|
1247 |
rcvr := con receiver. |
|
10205 | 1248 |
[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1249 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1250 |
] whileTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1251 |
prev := con. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1252 |
nMax > offset ifFalse:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1253 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1254 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1255 |
con := aContextArray at:offset. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1256 |
rcvr := con receiver. |
3447 | 1257 |
]. |
1258 |
||
1259 |
" |
|
1260 |
now, we are one above the raising context |
|
1261 |
" |
|
1262 |
||
1263 |
" |
|
1264 |
if the sender-method of the raise is one of objects error methods ... |
|
1265 |
" |
|
10205 | 1266 |
( #( halt halt: |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1267 |
error error: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1268 |
doesNotUnderstand: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1269 |
subclassResponsibility |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1270 |
primitiveFailed) includes:con selector) |
3447 | 1271 |
ifTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1272 |
con selector == #doesNotUnderstand: ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1273 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1274 |
one more up, to get to the originating context |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1275 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1276 |
con := aContextArray at:(offset + 1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1277 |
con isNil ifTrue:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1278 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1279 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1280 |
con := aContextArray at:(offset + 1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1281 |
con isNil ifTrue:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1282 |
offset := offset + 1. |
3447 | 1283 |
] ifFalse:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1284 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1285 |
ok, got the raise - if its a BreakPoint, look for the sender |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1286 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1287 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1288 |
offset := offset + 1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1289 |
]. |
3447 | 1290 |
]. |
1291 |
||
1292 |
^ offset |
|
1293 |
||
7713 | 1294 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1295 |
"Modified: / 08-07-2011 / 13:15:49 / cg" |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1296 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1297 |
|
73 | 1298 |
!DebugView methodsFor:'basic'! |
1299 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1300 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1301 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1302 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1303 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1304 |
m notNil ifTrue:[ |
11210 | 1305 |
self updateMenuItems. |
1306 |
||
1307 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
|
1308 |
abortButton enable. |
|
1309 |
m enable:#doAbort. |
|
1310 |
] ifFalse:[ |
|
1311 |
abortButton disable. |
|
1312 |
m disable:#doAbort. |
|
1313 |
]. |
|
1314 |
exclusive ifTrue:[ |
|
1315 |
terminateButton disable. |
|
1316 |
m disable:#doTerminate. |
|
1317 |
] ifFalse:[ |
|
1318 |
terminateButton enable. |
|
1319 |
m enable:#doTerminate. |
|
1320 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1321 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1322 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1323 |
mayProceed == false ifTrue:[ |
11210 | 1324 |
continueButton disable. |
1325 |
m notNil ifTrue:[m disable:#doContinue]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1326 |
] ifFalse:[ |
11210 | 1327 |
continueButton enable. |
1328 |
m notNil ifTrue:[m enable:#doContinue] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1329 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1330 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1331 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1332 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1333 |
|
1364 | 1334 |
enter:aContext select:initialSelectionOrNil |
73 | 1335 |
"enter the debugger - get and display the context, then start an |
1336 |
exclusive event loop on top of eveything else" |
|
1337 |
||
3447 | 1338 |
<context: #return> |
1339 |
||
9076 | 1340 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c| |
3447 | 1341 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1342 |
DebuggingDebugger == true ifTrue:[ |
11210 | 1343 |
'==> enter: (' print. aContext print. |
1344 |
') select: ' print. initialSelectionOrNil printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1345 |
]. |
3447 | 1346 |
thisContext isRecursive ifTrue:[ |
11210 | 1347 |
"/ care for the special case, were the Debugger was autoloaded. |
1348 |
"/ in this case, thisContext IS recursive, but thats no error |
|
1349 |
"/ condition. |
|
1350 |
foundNoByteCodeContext := false. |
|
1351 |
foundExitContext := false. |
|
1352 |
||
1353 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1354 |
[ |
|
1355 |
foundNoByteCodeContext not |
|
1356 |
and:[ foundExitContext not |
|
1357 |
and:[c notNil |
|
1358 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
1359 |
]]]] |
|
1360 |
whileTrue:[ |
|
1361 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
1362 |
foundExitContext := true |
|
1363 |
]. |
|
1364 |
c selector == #noByteCode ifTrue:[ |
|
1365 |
foundNoByteCodeContext := true |
|
1366 |
]. |
|
1367 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1368 |
]. |
|
1369 |
||
1370 |
(foundNoByteCodeContext not |
|
1371 |
and:[ foundExitContext not]) ifFalse:[ |
|
1372 |
('DebugView [warning]: reentered') errorPrintCR. |
|
1373 |
||
1374 |
^ MiniDebugger |
|
1375 |
enter:aContext |
|
1376 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
1377 |
mayProceed:mayProceed. |
|
1378 |
]. |
|
1379 |
foundExitContext ifTrue:[ |
|
1380 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
1381 |
^ self. |
|
1382 |
]. |
|
3447 | 1383 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1384 |
|
10203 | 1385 |
"/'entering: ' print. aContext printCR. |
1386 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 1387 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1388 |
||
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
1389 |
self class isHaltToBeIgnored ifTrue:[ |
11210 | 1390 |
^ self. |
8170 | 1391 |
]. |
1392 |
||
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1393 |
iAmNew := drawableId isNil. |
73 | 1394 |
|
8148 | 1395 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1396 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
1397 |
busy := cachable := true. |
73 | 1398 |
inspecting := false. |
1399 |
inspectedProcess := Processor activeProcess. |
|
1400 |
stepping := false. |
|
1401 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1402 |
stepHow := nil. |
8148 | 1403 |
nChainShown := InitialNChainShown. |
73 | 1404 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1405 |
"/ if debugger is entered while a box has grabbed the |
9076 | 1406 |
"/ 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
|
1407 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1408 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1409 |
"/ 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
|
1410 |
"/ 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
|
1411 |
"/ 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
|
1412 |
Screen allScreens do:[:aScreen | |
11210 | 1413 |
aScreen ungrabPointer. |
1414 |
aScreen ungrabKeyboard. |
|
10205 | 1415 |
]. |
1416 |
||
1417 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1418 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
11210 | 1419 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1420 |
] ifFalse:[ |
11210 | 1421 |
terminateButton enable. |
1422 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1423 |
]. |
73 | 1424 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1425 |
iAmNew ifFalse:[ |
11210 | 1426 |
"/ not the first time - disable buttons & menus |
1427 |
"/ from the previous life |
|
1428 |
self turnOffAllButtons. |
|
1429 |
||
1430 |
m := contextView middleButtonMenu. |
|
1431 |
m notNil ifTrue:[ |
|
1432 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
1433 |
]. |
|
1434 |
verboseBacktrace |
|
1435 |
ifTrue:[self showVerboseWalkback] |
|
1436 |
ifFalse:[self showDenseWalkback]. |
|
132 | 1437 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1438 |
self iconLabel:'Debugger'. |
132 | 1439 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1440 |
windowGroup isNil ifTrue:[ |
11210 | 1441 |
self windowGroup: WindowGroup new. |
1442 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1443 |
]. |
132 | 1444 |
exclusive ifFalse:[ |
11210 | 1445 |
"/ create a (modal) windowGroup for myself |
1446 |
||
1447 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1448 |
] ifTrue:[ |
11210 | 1449 |
"/ create a windowGroup with a synchronous sensor for me |
1450 |
||
1451 |
windowGroup beSynchronous. |
|
73 | 1452 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1453 |
windowGroup setProcess:Processor activeProcess. |
73 | 1454 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1455 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 1456 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1457 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
10203 | 1458 |
"/'after setContext; first is ' print. |
1459 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1460 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
73 | 1461 |
|
10203 | 1462 |
self updateButtonsAndMenuItemsForContext:aContext. |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1463 |
|
73 | 1464 |
" |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1465 |
If this is a new debugger, do a realize. |
528
a5ba1a3d0b45
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
527
diff
changeset
|
1466 |
Otherwise, its probably better to do a map, which shows the |
73 | 1467 |
view at the previous position, without a need for the user to set the |
1468 |
position again |
|
1469 |
" |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1470 |
iAmNew ifFalse:[ |
11210 | 1471 |
self remap. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1472 |
] ifTrue:[ |
11210 | 1473 |
self realize. |
73 | 1474 |
]. |
8193
9a4febdd8202
Raise debugger to the very top when entering
Stefan Vogel <sv@exept.de>
parents:
8181
diff
changeset
|
1475 |
self setForegroundWindow. |
73 | 1476 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1477 |
exclusive ifTrue:[ |
11210 | 1478 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1479 |
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
|
1480 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1481 |
This is a modal debugger - all event processing is stopped.. |
10205 | 1482 |
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
|
1483 |
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
|
1484 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1485 |
Also, there is no event processing (redraw) for other views.' |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1486 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1487 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1488 |
self autoRaiseView ifTrue:[ |
11210 | 1489 |
"/ self raise. |
1490 |
self raiseDeiconified. |
|
1491 |
self topView activate; setForegroundWindow; activate. |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1492 |
]. |
1486
6ae442626f20
wait until visible before starting to draw
Claus Gittinger <cg@exept.de>
parents:
1484
diff
changeset
|
1493 |
|
73 | 1494 |
canContinue := true. |
1495 |
exitAction := nil. |
|
1496 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1497 |
"/ enter private event handling loop. This is left (and we come back here again) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1498 |
"/ when any button was pressed which requires continuation of the debuggee or |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1499 |
"/ closedown of the debugger. |
3701
ef73aac8e8d5
Use #ifCurtailed: instead of #valueOnUnwindDo:
Stefan Vogel <sv@exept.de>
parents:
3694
diff
changeset
|
1500 |
[self controlLoop] ifCurtailed:[ |
11210 | 1501 |
windowGroup notNil ifTrue:[ |
1502 |
windowGroup setProcess:nil. |
|
1503 |
]. |
|
1504 |
self destroy |
|
132 | 1505 |
]. |
73 | 1506 |
|
10203 | 1507 |
"/ here after my own control loop is finished. |
1508 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1509 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1510 |
"/ 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
|
1511 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 1512 |
contextView contents:nil. |
1513 |
||
73 | 1514 |
codeView acceptAction:nil. |
942 | 1515 |
codeView doItAction:nil. |
73 | 1516 |
|
4892 | 1517 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
11210 | 1518 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 1519 |
]. |
1520 |
||
73 | 1521 |
(exitAction ~~ #step) ifTrue:[ |
11210 | 1522 |
"/ not stepping - close window |
1523 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
|
1524 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
1525 |
receiverInspector release. |
|
1526 |
contextInspector release. |
|
1527 |
||
1528 |
self unmap. |
|
1529 |
device flush. |
|
1530 |
||
1531 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
1532 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
1533 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
1534 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
1535 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
1536 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
1537 |
exitAction isBlock ifTrue:[ |
|
1538 |
self exit_unwindThenDo:exitAction. |
|
1539 |
"does not return" |
|
1540 |
]. |
|
1541 |
"not reached" |
|
1542 |
^ self |
|
73 | 1543 |
]. |
1544 |
||
3447 | 1545 |
"/ stepping - window stays open |
940 | 1546 |
selectedContext := actualContext := firstContext := nil. |
73 | 1547 |
|
2472 | 1548 |
"/ restore the previous pointer grab |
73 | 1549 |
grabber notNil ifTrue:[ |
11210 | 1550 |
device grabPointerInView:grabber. |
1551 |
grabber := nil. |
|
61 | 1552 |
]. |
73 | 1553 |
|
1554 |
(exitAction == #step) ifTrue:[ |
|
11210 | 1555 |
" |
1556 |
schedule another stepInterrupt |
|
1557 |
- must enter myself into the collection of open debuggers, |
|
1558 |
in case the stepping process comes back again via a halt or signal |
|
1559 |
before the step is finished. In this case, the stepping debugger should |
|
1560 |
come up (instead of a new one) |
|
1561 |
- must flush caches since optimized methods not always |
|
1562 |
look for pending interrupts |
|
1563 |
" |
|
1564 |
||
1565 |
"/ |
|
1566 |
"/ also must care for stepping into a return |
|
1567 |
"/ |
|
1568 |
steppedContext notNil ifTrue:[ |
|
1569 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
1570 |
]. |
|
1571 |
||
1572 |
OpenDebuggers isNil ifTrue:[ |
|
1573 |
OpenDebuggers := WeakIdentitySet new. |
|
1574 |
]. |
|
1575 |
OpenDebuggers add:self. |
|
1576 |
||
1577 |
self label:'single stepping - please wait ...'. |
|
1578 |
stepping := true. |
|
1579 |
||
1580 |
ObjectMemory stepInterruptHandler:self. |
|
1581 |
Processor activeProcess stepInterruptHandler:self. |
|
1582 |
ObjectMemory flushCaches. |
|
1583 |
||
1584 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
1585 |
Context singleStepInterruptRequest |
|
1586 |
raiseWith: |
|
1587 |
(("bigStep" steppedContextLineno notNil) |
|
1588 |
ifTrue:[#next] |
|
1589 |
ifFalse:[#step]) |
|
1590 |
] ifFalse:[ |
|
1591 |
"/ see if we came here through an interrupt-action |
|
1592 |
"/ (i.e. aProcess interruptWith:...) |
|
1593 |
||
1594 |
enteredByInterrupt := false. |
|
1595 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
1596 |
[enteredByInterrupt not |
|
1597 |
and:[con notNil |
|
1598 |
and:[con ~~ aContext]]] whileTrue:[ |
|
1599 |
((sel := con selector) == #timerInterrupt |
|
1600 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
1601 |
enteredByInterrupt := true. |
|
1602 |
] ifFalse:[ |
|
1603 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
1604 |
]. |
|
1605 |
]. |
|
1606 |
||
1607 |
ObjectMemory flushInlineCaches. |
|
1608 |
||
1609 |
DebuggingDebugger == true ifTrue:[ |
|
1610 |
enteredByInterrupt printCR. |
|
1611 |
]. |
|
1612 |
enteredByInterrupt ifTrue:[ |
|
1613 |
"/ dont want to step through all intermediate |
|
1614 |
"/ (scheduler-) contexts; place a return-trap on the |
|
1615 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1616 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1617 |
"/ 'special unwind return' printCR. |
11210 | 1618 |
con unwindThenDo:[ |
1619 |
Processor activeProcess stepInterruptHandler:self. |
|
1620 |
ObjectMemory stepInterruptHandler:self. |
|
1621 |
InStepInterrupt := nil. |
|
1622 |
StepInterruptPending := 1. |
|
1623 |
InterruptPending := 1]. |
|
1624 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1625 |
"/ 'normal step return' printCR. |
11210 | 1626 |
skipLineNr ~~ #return ifTrue:[ |
1627 |
StepInterruptPending := 1. |
|
1628 |
InterruptPending := 1. |
|
1629 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1630 |
"/ 'step for return' printCR. |
11210 | 1631 |
] |
1632 |
]. |
|
1633 |
InStepInterrupt := nil |
|
1634 |
] |
|
73 | 1635 |
] ifFalse:[ |
11210 | 1636 |
OpenDebuggers notNil ifTrue:[ |
1637 |
OpenDebuggers remove:self ifAbsent:[]. |
|
1638 |
]. |
|
1639 |
self cacheMyself. |
|
73 | 1640 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1641 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1642 |
"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
|
1643 |
"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
|
1644 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
10203 | 1645 |
"Modified (comment): / 06-07-2011 / 12:29:28 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1646 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1647 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1648 |
exit_abort |
5455 | 1649 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
1650 |
"/ that one would run on top of this context. |
|
1651 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1652 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1653 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1654 |
"/ done in the #enter:select method. |
5455 | 1655 |
"/ You are not expected to understand this. |
1656 |
||
6487 | 1657 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
1658 |
! |
|
1659 |
||
1660 |
exit_abortAll |
|
1661 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1662 |
"/ that one would run on top of this context. |
|
1663 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1664 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1665 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1666 |
"/ done in the #enter:select method. |
6487 | 1667 |
"/ You are not expected to understand this. |
1668 |
||
1669 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1670 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1671 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1672 |
exit_quickTerminate |
3447 | 1673 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1674 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1675 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1676 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 1677 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1678 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1679 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1680 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1681 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1682 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1683 |
selectedContext notNil ifTrue:[ |
11210 | 1684 |
con := selectedContext. |
1685 |
self cacheMyself. |
|
1686 |
" |
|
1687 |
have to catch errors occuring in unwind-blocks |
|
1688 |
" |
|
1689 |
Error handle:[:ex | |
|
1690 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1691 |
ex description infoPrintCR. |
|
1692 |
ex proceed |
|
1693 |
] do:[ |
|
1694 |
con unwindAndRestart. |
|
1695 |
]. |
|
1696 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1697 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1698 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1699 |
"Created: / 16.11.2001 / 17:23:17 / cg" |
3447 | 1700 |
"Modified: / 17.11.2001 / 23:37:09 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1701 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1702 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1703 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1704 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1705 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1706 |
selectedContext notNil ifTrue:[ |
11210 | 1707 |
" |
1708 |
if there is a selection in the codeView, |
|
1709 |
evaluate it and use the result as return value |
|
1710 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1711 |
"/ 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
|
1712 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1713 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1714 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1715 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1716 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1717 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1718 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1719 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1720 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1721 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1722 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1723 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1724 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1725 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1726 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1727 |
|
11210 | 1728 |
con := selectedContext. |
1729 |
self cacheMyself. |
|
1730 |
" |
|
1731 |
have to catch errors occuring in unwind-blocks |
|
1732 |
" |
|
1733 |
Error handle:[:ex | |
|
1734 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1735 |
ex description infoPrintCR. |
|
1736 |
ex proceed |
|
1737 |
] do:[ |
|
1738 |
con unwind:retVal. |
|
1739 |
]. |
|
1740 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1741 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1742 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1743 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 1744 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1745 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1746 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1747 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1748 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1749 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1750 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1751 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1752 |
Error handle:[:ex | |
11210 | 1753 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
1754 |
ex description infoPrintCR. |
|
1755 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1756 |
] do:[ |
11210 | 1757 |
self cacheMyself. |
1758 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1759 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1760 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1761 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1762 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 1763 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
1764 |
! |
|
1765 |
||
6487 | 1766 |
exit_unwindThenDo:aBlock |
1767 |
|con| |
|
1768 |
||
1769 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1770 |
"/ that one would run on top of this context. |
|
1771 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1772 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1773 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1774 |
"/ done in the #enter:select method. |
6487 | 1775 |
"/ You are not expected to understand this. |
1776 |
||
1777 |
" |
|
1778 |
have to catch errors occuring in unwind-blocks |
|
1779 |
" |
|
1780 |
self cacheMyself. |
|
1781 |
||
1782 |
Error handle:[:ex | |
|
11210 | 1783 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
1784 |
ex description infoPrintCR. |
|
1785 |
||
1786 |
ex proceed |
|
6487 | 1787 |
] do:[ |
11210 | 1788 |
"/ find the enter:select context. |
1789 |
con := thisContext sender. |
|
1790 |
[ |
|
1791 |
(con selector == #enter:select:) |
|
1792 |
and:[con receiver == self] |
|
1793 |
] |
|
1794 |
whileFalse:[ con := con sender ]. |
|
1795 |
||
1796 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
1797 |
con sender receiver == self class ifTrue:[ |
|
1798 |
con := con sender. |
|
1799 |
con sender receiver == self class ifTrue:[ |
|
1800 |
con := con sender. |
|
1801 |
con isBlockContext ifTrue:[ |
|
1802 |
con := con methodHome. |
|
1803 |
] |
|
1804 |
]. |
|
1805 |
]. |
|
1806 |
||
1807 |
con unwindThenDo:aBlock. |
|
6487 | 1808 |
]. |
1809 |
'DebugView [warning]: abort failed' errorPrintCR |
|
1810 |
||
1811 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
1812 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
1813 |
! |
|
1814 |
||
3447 | 1815 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
1816 |
|selection con1 con2 h| |
|
1817 |
||
1818 |
initialSelectionOrNil notNil ifTrue:[ |
|
11210 | 1819 |
^ initialSelectionOrNil |
3447 | 1820 |
]. |
1821 |
||
1822 |
" |
|
1823 |
and find the one context to show initially |
|
1824 |
- if we came here by a send (single step), its the top context; |
|
1825 |
- if we came here by a step (i.e. bigStep), its the top context |
|
1826 |
(for ifs and whiles) or the sender (for regular sends). |
|
1827 |
- otherwise, we came here by some signal raise, and we are interested |
|
1828 |
in the context where the raise actually occured. |
|
1829 |
" |
|
1830 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
1831 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
1832 |
||
1833 |
exitAction == #step ifTrue:[ |
|
11210 | 1834 |
selection := 1. |
1835 |
steppedContext notNil ifTrue:[ |
|
1836 |
||
1837 |
" |
|
1838 |
if we came here by a big-step, show the method where we are |
|
1839 |
" |
|
1840 |
con1 == steppedContext ifTrue:[ |
|
1841 |
selection := 1 |
|
1842 |
] ifFalse:[ |
|
1843 |
con2 == steppedContext ifTrue:[ |
|
1844 |
selection := 2 |
|
1845 |
] |
|
1846 |
]. |
|
1847 |
" |
|
1848 |
for bigStep, we could also be in a block below the actual method ... |
|
1849 |
" |
|
1850 |
((h := con1 home) notNil |
|
1851 |
and:[h == steppedContext]) ifTrue:[ |
|
1852 |
selection := 1 |
|
1853 |
] ifFalse:[ |
|
1854 |
(con2 notNil |
|
1855 |
and:[(h := con2 home) notNil |
|
1856 |
and:[h == steppedContext]]) ifTrue:[ |
|
1857 |
selection := 2 |
|
1858 |
] |
|
1859 |
]. |
|
1860 |
h := nil. |
|
1861 |
] |
|
3447 | 1862 |
] ifFalse:[ |
11210 | 1863 |
steppedContext isNil ifTrue:[ |
1864 |
" |
|
1865 |
preselect a more interesting context, (where halt/raise was ...) |
|
1866 |
" |
|
1867 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
1868 |
selection := self class interestingContextIndexIn:contextArray. |
|
1869 |
selection := selection min:(contextArray size). |
|
1870 |
] ifFalse:[ |
|
1871 |
" |
|
1872 |
if we came here by a big-step, show the method where we are |
|
1873 |
" |
|
1874 |
con1 == steppedContext ifTrue:[ |
|
1875 |
selection := 1 |
|
1876 |
] ifFalse:[ |
|
1877 |
con2 == steppedContext ifTrue:[ |
|
1878 |
selection := 2. |
|
1879 |
] |
|
1880 |
] |
|
1881 |
] |
|
3447 | 1882 |
]. |
1883 |
^ selection |
|
1884 |
||
1885 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
1886 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 1887 |
! |
1888 |
||
5110 | 1889 |
isInspecting |
1890 |
^ inspecting |
|
1891 |
! |
|
1892 |
||
1893 |
isNotInspecting |
|
1894 |
^ inspecting not |
|
1895 |
! |
|
1896 |
||
73 | 1897 |
openOn:aProcess |
10205 | 1898 |
"enter the debugger on a process - |
73 | 1899 |
in this case, we are just inspecting the context chain of the process, |
1900 |
not running on top of the debugged process, but as a separate |
|
1901 |
one. (think of it as an inspector showing more detail, and offering |
|
1902 |
some more control operations)" |
|
1903 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1904 |
|bpanel dummy w| |
73 | 1905 |
|
8148 | 1906 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1907 |
|
73 | 1908 |
busy := true. |
1909 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1910 |
stepHow := nil. |
73 | 1911 |
inspecting := true. |
1912 |
inspectedProcess := aProcess. |
|
8148 | 1913 |
nChainShown := InitialNChainShown. |
73 | 1914 |
|
1915 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1916 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1917 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1918 |
"/ get the max size & freeze button |
6647 | 1919 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1920 |
w := continueButton preferredWidth. |
6647 | 1921 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1922 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1923 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1924 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1925 |
aProcess state == #run ifTrue:[ |
11210 | 1926 |
device hasColors ifTrue:[ |
1927 |
continueButton foregroundColor:Color red darkened. |
|
1928 |
]. |
|
1929 |
continueButton label:(resources string:'Stop'). |
|
1930 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1931 |
] ifFalse:[ |
11210 | 1932 |
device hasColors ifTrue:[ |
1933 |
continueButton foregroundColor:Color green darkened darkened. |
|
1934 |
]. |
|
1935 |
continueButton label:(resources string:'Continue'). |
|
1936 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1937 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1938 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 1939 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1940 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1941 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1942 |
|
92 | 1943 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 1944 |
dummy borderWidth:0; level:0. |
61 | 1945 |
|
73 | 1946 |
"/ stepButton destroy. |
1947 |
"/ sendButton destroy. |
|
1948 |
||
1949 |
updateButton := Button |
|
11210 | 1950 |
label:(resources string:'Update') |
1951 |
action:[self updateContext] |
|
1952 |
in:bpanel. |
|
73 | 1953 |
monitorToggle := Toggle in:bpanel. |
6647 | 1954 |
monitorToggle label:(resources string:'Monitor'). |
73 | 1955 |
monitorToggle pressAction:[self autoUpdateOn]. |
1956 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
1957 |
||
1958 |
"can only look into process - context chain is not active" |
|
1959 |
canContinue := true. |
|
1960 |
||
1961 |
terminateButton enable. |
|
1962 |
abortButton enable. |
|
1963 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1964 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1965 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1966 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1967 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1968 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 1969 |
|
1970 |
aProcess isNil ifTrue:[ |
|
11210 | 1971 |
terminateButton disable. |
1972 |
abortButton disable. |
|
1973 |
continueButton disable. |
|
1974 |
returnButton disable. |
|
1975 |
restartButton disable. |
|
73 | 1976 |
] ifFalse:[ |
11210 | 1977 |
(aProcess suspendedContext isNil |
1978 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
1979 |
terminateButton disable. |
|
1980 |
]. |
|
1981 |
||
1982 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
1983 |
||
1984 |
catchBlock := [ |
|
1985 |
catchBlock := nil. |
|
1986 |
contextArray := nil. |
|
1987 |
selectedContext := actualContext := firstContext := nil. |
|
1988 |
steppedContext := wrapperContext := nil. |
|
1989 |
||
1990 |
(exitAction == #terminate) ifTrue:[ |
|
1991 |
aProcess terminate. |
|
1992 |
]. |
|
1993 |
(exitAction == #quickTerminate) ifTrue:[ |
|
1994 |
aProcess terminateNoSignal. |
|
1995 |
]. |
|
1996 |
super destroy |
|
1997 |
]. |
|
73 | 1998 |
]. |
1999 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
2000 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2001 |
"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
|
2002 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2003 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2004 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2005 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 2006 |
|selection| |
2007 |
||
2008 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2009 |
selection notNil ifTrue:[ |
11210 | 2010 |
self showSelection:selection. |
2011 |
contextView setSelection:selection. |
|
2012 |
selection > 1 ifTrue:[ |
|
2013 |
contextView scrollToLine:(selection - 1) |
|
2014 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2015 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2016 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2017 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 2018 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2019 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2020 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2021 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2022 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2023 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2024 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2025 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2026 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2027 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2028 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2029 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2030 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2031 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2032 |
! ! |
2033 |
||
2034 |
!DebugView methodsFor:'help'! |
|
2035 |
||
8212 | 2036 |
flyByHelpDependsOnPositionIn:aView |
2037 |
"subclasses where the help-text depends upon the pointer position might |
|
2038 |
want to redefine this" |
|
2039 |
||
2040 |
^ aView == codeView |
|
2041 |
! |
|
2042 |
||
3510 | 2043 |
flyByHelpTextFor:aComponent |
2044 |
|s| |
|
2045 |
||
2046 |
aComponent == abortButton ifTrue:[ |
|
11210 | 2047 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2048 |
]. |
2049 |
aComponent == terminateButton ifTrue:[ |
|
11210 | 2050 |
s := 'Terminate process (close view)' |
3510 | 2051 |
]. |
2052 |
aComponent == continueButton ifTrue:[ |
|
11210 | 2053 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2054 |
s := 'Stop' |
|
2055 |
] ifFalse:[ |
|
2056 |
s := 'Continue execution' |
|
2057 |
] |
|
3510 | 2058 |
]. |
2059 |
aComponent == stepButton ifTrue:[ |
|
11210 | 2060 |
s := 'Step to next send (don''t enter into called methods)' |
3510 | 2061 |
]. |
2062 |
aComponent == nextButton ifTrue:[ |
|
11210 | 2063 |
s := 'Step to next line (don''t enter into called methods)' |
3510 | 2064 |
]. |
2065 |
aComponent == nextOverButton ifTrue:[ |
|
11210 | 2066 |
s := 'Step over to cursor-line' |
3510 | 2067 |
]. |
2068 |
aComponent == nextOutButton ifTrue:[ |
|
11210 | 2069 |
s := 'Step out to caller' |
3510 | 2070 |
]. |
2071 |
aComponent == sendButton ifTrue:[ |
|
11210 | 2072 |
s := 'Send next message (enter into called methods)' |
3510 | 2073 |
]. |
2074 |
aComponent == returnButton ifTrue:[ |
|
11210 | 2075 |
s := 'Return from selected method' |
3510 | 2076 |
]. |
2077 |
aComponent == restartButton ifTrue:[ |
|
11210 | 2078 |
s := 'Restart selected method' |
3510 | 2079 |
]. |
2080 |
aComponent == monitorToggle ifTrue:[ |
|
11210 | 2081 |
s := 'Toggle monitoring' |
3510 | 2082 |
]. |
2083 |
aComponent == updateButton ifTrue:[ |
|
11210 | 2084 |
s := 'Update' |
3510 | 2085 |
]. |
8656 | 2086 |
aComponent == reportButton ifTrue:[ |
11210 | 2087 |
s := 'Send a defect report via eMail' |
8656 | 2088 |
]. |
3510 | 2089 |
s notNil ifTrue:[ |
11210 | 2090 |
^ resources string:s |
3510 | 2091 |
]. |
2092 |
^ nil |
|
2093 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2094 |
"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
|
2095 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2096 |
! |
2097 |
||
8212 | 2098 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2099 |
|s vline line col pos interval| |
8212 | 2100 |
|
2101 |
aComponent == codeView ifFalse:[^ nil]. |
|
2102 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2103 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2104 |
|
8396 | 2105 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2106 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2107 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2108 |
|
2109 |
pos := codeView characterPositionOfLine:line col:col. |
|
2110 |
interval := pos to:pos. |
|
2111 |
||
10205 | 2112 |
self |
11210 | 2113 |
withNodeValueAtInterval:interval |
2114 |
do:[:value :description | |
|
2115 |
|valueClassOrSizeString valueString| |
|
2116 |
||
2117 |
valueClassOrSizeString := valueString := ''. |
|
2118 |
||
2119 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2120 |
value isString ifTrue:[ |
|
2121 |
value isText ifTrue:[ |
|
2122 |
valueString := '"',(value contractTo:80),'"'. |
|
2123 |
] ifFalse:[ |
|
2124 |
valueString := value storeString contractTo:80. |
|
2125 |
]. |
|
2126 |
] ifFalse:[ |
|
2127 |
(value isBoolean |
|
2128 |
or:[ value isInteger |
|
2129 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2130 |
valueString := value printString. |
|
2131 |
] ifFalse:[ |
|
2132 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2133 |
||
2134 |
(value isArray |
|
2135 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2136 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2137 |
]. |
|
2138 |
||
2139 |
Error handle:[:ex | |
|
2140 |
valueString := '??? (',ex description,')' |
|
2141 |
] do:[ |
|
2142 |
[ |
|
2143 |
valueString := value printString contractTo:80. |
|
2144 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
|
2145 |
] |
|
2146 |
] |
|
2147 |
]. |
|
2148 |
description isEmptyOrNil ifTrue:[ |
|
2149 |
s := valueString , valueClassOrSizeString |
|
2150 |
] ifFalse:[ |
|
2151 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2152 |
]. |
|
2153 |
]. |
|
8592 | 2154 |
"/ Transcript showCR:s. |
2155 |
^ s |
|
9446 | 2156 |
|
2157 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2158 |
! |
2159 |
||
266 | 2160 |
helpTextFor:aComponent |
2161 |
|s| |
|
2162 |
||
2163 |
aComponent == abortButton ifTrue:[ |
|
11210 | 2164 |
s := 'HELP_ABORT' |
266 | 2165 |
]. |
2166 |
aComponent == terminateButton ifTrue:[ |
|
11210 | 2167 |
s := 'HELP_TERMINATE' |
266 | 2168 |
]. |
2169 |
aComponent == continueButton ifTrue:[ |
|
11210 | 2170 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2171 |
s := 'HELP_STOP' |
|
2172 |
] ifFalse:[ |
|
2173 |
s := 'HELP_CONTINUE' |
|
2174 |
] |
|
266 | 2175 |
]. |
2176 |
aComponent == stepButton ifTrue:[ |
|
11210 | 2177 |
s := 'HELP_STEP' |
266 | 2178 |
]. |
2179 |
aComponent == nextButton ifTrue:[ |
|
11210 | 2180 |
s := 'HELP_NEXT' |
266 | 2181 |
]. |
1065 | 2182 |
aComponent == nextOverButton ifTrue:[ |
11210 | 2183 |
s := 'HELP_NEXTOVER' |
1065 | 2184 |
]. |
2185 |
aComponent == nextOutButton ifTrue:[ |
|
11210 | 2186 |
s := 'HELP_NEXTOUT' |
1065 | 2187 |
]. |
266 | 2188 |
aComponent == stepButton ifTrue:[ |
11210 | 2189 |
s := 'HELP_STEP' |
266 | 2190 |
]. |
2191 |
aComponent == sendButton ifTrue:[ |
|
11210 | 2192 |
s := 'HELP_SEND' |
266 | 2193 |
]. |
2194 |
aComponent == returnButton ifTrue:[ |
|
11210 | 2195 |
s := 'HELP_RETURN' |
266 | 2196 |
]. |
2197 |
aComponent == restartButton ifTrue:[ |
|
11210 | 2198 |
s := 'HELP_RESTART' |
266 | 2199 |
]. |
2200 |
aComponent == contextView ifTrue:[ |
|
11210 | 2201 |
s := 'HELP_WALKBACK' |
266 | 2202 |
]. |
2203 |
aComponent == codeView ifTrue:[ |
|
11210 | 2204 |
s := 'HELP_CODEVIEW' |
266 | 2205 |
]. |
2206 |
aComponent == monitorToggle ifTrue:[ |
|
11210 | 2207 |
s := 'HELP_MONITOR' |
266 | 2208 |
]. |
2209 |
aComponent == updateButton ifTrue:[ |
|
11210 | 2210 |
s := 'HELP_UPDATE' |
266 | 2211 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2212 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2213 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2214 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2215 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
11210 | 2216 |
s := 'HELP_REC_INSP' |
266 | 2217 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2218 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
11210 | 2219 |
s := 'HELP_CON_INSP' |
266 | 2220 |
]. |
2221 |
||
2222 |
s notNil ifTrue:[ |
|
11210 | 2223 |
^ resources string:s |
266 | 2224 |
]. |
2225 |
^ nil |
|
2226 |
||
2227 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 2228 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 2229 |
! ! |
2230 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2231 |
!DebugView methodsFor:'initialization & release'! |
266 | 2232 |
|
2233 |
addToCurrentProject |
|
2234 |
"ignored here" |
|
2235 |
||
2236 |
^ self |
|
2237 |
! |
|
2238 |
||
2115 | 2239 |
destroy |
2240 |
"closing the debugger implies an abort or continue" |
|
2241 |
||
2404 | 2242 |
|m| |
2243 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
2244 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 2245 |
(self confirm:('Code modified - exit anyway ?')) |
2246 |
ifFalse:[ |
|
2247 |
^ self |
|
2248 |
] |
|
2115 | 2249 |
]. |
2250 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2251 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2252 |
|
2404 | 2253 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 2254 |
inspecting ifFalse:[ |
11210 | 2255 |
"I am running on top of a process, abort or continue it" |
2256 |
||
2257 |
windowGroup notNil ifTrue:[ |
|
2258 |
windowGroup setProcess:nil. |
|
2259 |
]. |
|
2260 |
self uncacheMyself. |
|
2261 |
||
2262 |
"/ |
|
2263 |
"/ catch invalid return; |
|
2264 |
"/ this happens, when my process has somehow died (quickterminate) |
|
2265 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
2266 |
"/ #destroy-window function. |
|
2267 |
"/ |
|
2268 |
Context cannotReturnSignal handle:[:ex | |
|
2269 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
2270 |
self uncacheMyself. |
|
2271 |
Debugger newDebugger. |
|
2272 |
ex return. |
|
2273 |
] do:[ |
|
2274 |
AbortOperationRequest isHandled ifTrue:[ |
|
2275 |
self doAbort. |
|
2276 |
] ifFalse:[ |
|
2277 |
self doContinue |
|
2278 |
] |
|
2279 |
]. |
|
2280 |
"/ We don't reach this point normally |
|
2281 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2282 |
Debugger newDebugger. |
|
2283 |
self uncacheMyself. |
|
2115 | 2284 |
]. |
2285 |
||
2299 | 2286 |
Debugger newDebugger. |
2115 | 2287 |
"/ since I am going to be destroyed, remove me from the cache |
2288 |
self uncacheMyself. |
|
2289 |
super destroy. |
|
2290 |
||
2291 |
"Modified: / 10.7.1997 / 17:15:41 / stefan" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2292 |
"Modified: / 16.11.2001 / 17:38:15 / cg" |
2115 | 2293 |
! |
2294 |
||
266 | 2295 |
initialize |
10205 | 2296 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
11305 | 2297 |
newLayout v exceptionAndTogglePanel codeToggleLabels| |
266 | 2298 |
|
2299 |
super initialize. |
|
2300 |
||
2340 | 2301 |
font := font onDevice:device. |
266 | 2302 |
|
8148 | 2303 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2304 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
11210 | 2305 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2306 |
|
266 | 2307 |
busy := false. |
2308 |
exclusive := false. |
|
2309 |
inspecting := false. |
|
2310 |
exitAction := nil. |
|
2311 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2312 |
stepHow := nil. |
266 | 2313 |
canContinue := false. |
2314 |
||
3269 | 2315 |
mH := 0. |
2316 |
||
3447 | 2317 |
menuPanel := MenuPanel in:self. |
8131 | 2318 |
menuPanel receiver:self. |
3447 | 2319 |
menuPanel verticalLayout:false. |
8131 | 2320 |
menu := self class menuSpec decodeAsLiteralArray. |
2321 |
menu findGuiResourcesIn:self. |
|
2322 |
menuPanel menu:menu. |
|
3447 | 2323 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2324 |
mH := menuPanel preferredHeight. |
3447 | 2325 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2326 |
||
8148 | 2327 |
newLayout := UserPreferences current useNewLayoutInDebugger. |
2328 |
newLayout ifFalse:[ |
|
11210 | 2329 |
bpanel := HorizontalPanelView in:self. |
2330 |
||
2331 |
self initializeButtonsIn:bpanel. |
|
2332 |
||
2333 |
bH := bpanel preferredHeight + 5. |
|
2334 |
bpanel origin:(0.0 @ mH) |
|
2335 |
extent:(1.0 @ bH). |
|
2336 |
panel := VariableVerticalPanel |
|
2337 |
origin:(0.0 @ (mH + bH)) |
|
2338 |
corner:(1.0 @ 1.0) |
|
2339 |
in:self. |
|
2340 |
||
2341 |
v := self initializeContextListViewIn:panel. |
|
2342 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2343 |
||
2344 |
codePanel := View in:panel. |
|
2345 |
v := self initializeCodeViewIn:codePanel. |
|
2346 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
2347 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2348 |
||
2349 |
v := self initializeInspectorViewsIn:panel. |
|
2350 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2351 |
|
8148 | 2352 |
] ifTrue:[ |
11210 | 2353 |
bpanel1 := HorizontalPanelView in:self. |
2354 |
self initializeButtons1In:bpanel1. |
|
2355 |
||
2356 |
bH1 := bpanel1 preferredHeight + 5. |
|
2357 |
bpanel1 origin:(0.0 @ mH) |
|
2358 |
extent:(1.0 @ bH1). |
|
2359 |
panel := VariableVerticalPanel |
|
2360 |
origin:(0.0 @ (mH + bH1)) |
|
2361 |
corner:(1.0 @ 1.0) |
|
2362 |
in:self. |
|
2363 |
"/ panel showHandle:true. |
|
2364 |
"/ panel handlePosition:#left. |
|
2365 |
||
2366 |
v := self initializeContextListViewIn:panel. |
|
2367 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2368 |
||
2369 |
codePanel := View in:panel. |
|
2370 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
2371 |
self initializeButtons2In:bpanel2. |
|
2372 |
||
2373 |
bH2 := bpanel2 preferredHeight + 5. |
|
2374 |
bpanel2 origin:(0.0 @ 0.0) |
|
2375 |
extent:(1.0 @ bH2). |
|
2376 |
||
2377 |
exceptionInfoLabel := Label label:''. |
|
2378 |
exceptionInfoLabel adjust:#left. |
|
2379 |
||
2380 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
2381 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
2382 |
exceptionAndTogglePanel |
|
2383 |
geometryLayout: |
|
2384 |
((LayoutFrame |
|
2385 |
origin:(0.0 @ 0.0) |
|
2386 |
corner:(1.0 @ 0.0)) |
|
2387 |
topOffset:bH2; |
|
2388 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
2389 |
rightOffset:-2). |
|
2390 |
||
2391 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
2392 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
11305 | 2393 |
codeToggleLabels := resources array:{ |
2394 |
'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . |
|
2395 |
'Showing Current Code' asText backgroundColorizeAllWith:Color green lightened . |
|
2396 |
}. |
|
2397 |
methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel. |
|
2398 |
methodCodeToggle list:codeToggleLabels. |
|
11210 | 2399 |
methodCodeToggle useIndex:true. |
2400 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
2401 |
methodCodeToggle beInvisible. |
|
2402 |
||
2403 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
2404 |
||
2405 |
v := self initializeCodeViewIn:codePanel. |
|
2406 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
2407 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2408 |
||
2409 |
v := self initializeInspectorViewsIn:panel. |
|
2410 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2411 |
]. |
2412 |
||
3387 | 2413 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
11210 | 2414 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2415 |
]. |
9626 | 2416 |
LastExtent notNil ifTrue:[ |
11210 | 2417 |
self extent:LastExtent. |
9626 | 2418 |
]. |
2419 |
LastOrigin notNil ifTrue:[ |
|
11210 | 2420 |
self origin:LastOrigin. |
9626 | 2421 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2422 |
|
3269 | 2423 |
" |
2424 |
Debugger newDebugger |
|
2425 |
" |
|
3447 | 2426 |
|
11305 | 2427 |
"Modified: / 01-03-2012 / 14:28:38 / cg" |
3269 | 2428 |
! |
2429 |
||
10205 | 2430 |
initializeAbortButtonIn:bpanel |
2431 |
abortButton := Button |
|
11210 | 2432 |
label:(resources string:'Abort') |
2433 |
action:[ |
|
2434 |
abortButton turnOffWithoutRedraw. |
|
2435 |
self doAbort |
|
2436 |
] |
|
2437 |
in:bpanel. |
|
3447 | 2438 |
|
2439 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
2440 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
2441 |
! |
|
2442 |
||
10205 | 2443 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2444 |
"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
|
2445 |
|
3447 | 2446 |
|separator| |
2447 |
||
10205 | 2448 |
bpanel horizontalLayout:#left. |
3447 | 2449 |
bpanel verticalLayout:#centerMax. |
2450 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2451 |
||
8194 | 2452 |
self initializeContinueButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2453 |
continueButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2454 |
|
9131 | 2455 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
2456 |
"/ separator borderWidth:0; level:0. |
|
3447 | 2457 |
self initializeAbortButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2458 |
abortButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2459 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2460 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2461 |
separator borderWidth:0; level:0. |
3269 | 2462 |
|
3447 | 2463 |
self initializeTerminateButtonIn:bpanel. |
2464 |
||
9131 | 2465 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 2466 |
separator borderWidth:0; level:0. |
2467 |
||
2468 |
self initializeDefineButtonIn:bpanel. |
|
4356 | 2469 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
11210 | 2470 |
separator := View extent:(10 @ 5) in:bpanel. |
2471 |
separator borderWidth:0; level:0. |
|
2472 |
self initializeReportButtonIn:bpanel. |
|
4356 | 2473 |
]. |
3447 | 2474 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 2475 |
! |
2476 |
||
10205 | 2477 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2478 |
"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
|
2479 |
|
3269 | 2480 |
|separator| |
2481 |
||
9131 | 2482 |
bpanel horizontalLayout:#left. |
3269 | 2483 |
bpanel verticalLayout:#centerMax. |
2484 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2485 |
||
3447 | 2486 |
self initializeNextButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2487 |
nextButton width:100. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2488 |
|
3447 | 2489 |
self initializeStepButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2490 |
stepButton width:100. |
3447 | 2491 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2492 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2493 |
"/ 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
|
2494 |
"/ 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
|
2495 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2496 |
|
3269 | 2497 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2498 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2499 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2500 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2501 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2502 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2503 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2504 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2505 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2506 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2507 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2508 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2509 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2510 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2511 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2512 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2513 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2514 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2515 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2516 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2517 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2518 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2519 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2520 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2521 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2522 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2523 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2524 |
|
3447 | 2525 |
self initializeSendButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2526 |
sendButton width:100. |
3447 | 2527 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2528 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2529 |
separator borderWidth:0; level:0. |
3269 | 2530 |
|
3447 | 2531 |
self initializeReturnButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2532 |
returnButton width:100. |
3447 | 2533 |
self initializeRestartButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2534 |
restartButton width:100. |
3447 | 2535 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2536 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 2537 |
! |
2538 |
||
10205 | 2539 |
initializeButtonsIn:bpanel |
3269 | 2540 |
|separator| |
2541 |
||
2542 |
bpanel horizontalLayout:#left. |
|
2543 |
bpanel verticalLayout:#centerMax. |
|
2544 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2545 |
||
3447 | 2546 |
self initializeAbortButtonIn:bpanel. |
2547 |
||
3269 | 2548 |
separator := View extent:(10 @ 5) in:bpanel. |
2549 |
separator borderWidth:0; level:0. |
|
2550 |
||
3447 | 2551 |
self initializeContinueButtonIn:bpanel. |
3269 | 2552 |
|
2553 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2554 |
separator borderWidth:0; level:0. |
|
2555 |
||
10205 | 2556 |
self initializeReturnButtonIn:bpanel. |
2557 |
self initializeRestartButtonIn:bpanel. |
|
3269 | 2558 |
|
2559 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2560 |
separator borderWidth:0; level:0. |
|
2561 |
||
3447 | 2562 |
self initializeNextButtonIn:bpanel. |
2563 |
self initializeStepButtonIn:bpanel. |
|
2564 |
||
3269 | 2565 |
"/ cg: |
2566 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
2567 |
"/ they do not work relyable with inlined blocks yet. |
|
2568 |
"/ |
|
2569 |
||
2570 |
||
2571 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
2572 |
"/ img isNil ifTrue:[ |
|
2573 |
"/ img := (resources at:'next') |
|
2574 |
"/ ]. |
|
2575 |
"/ nextButton := Button |
|
2576 |
"/ label:img |
|
2577 |
"/ action:[stepButton turnOff. self doNext] |
|
2578 |
"/ in:bpanel. |
|
2579 |
"/ |
|
2580 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
2581 |
"/ img isNil ifTrue:[ |
|
2582 |
"/ img := (resources at:'over') |
|
2583 |
"/ ]. |
|
2584 |
"/ nextOverButton := Button |
|
2585 |
"/ label:img |
|
2586 |
"/ action:[stepButton turnOff. self doNextOver] |
|
2587 |
"/ in:bpanel. |
|
2588 |
"/ |
|
2589 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
2590 |
"/ img isNil ifTrue:[ |
|
2591 |
"/ img := (resources at:'out') |
|
2592 |
"/ ]. |
|
2593 |
"/ nextOutButton := Button |
|
2594 |
"/ label:img |
|
2595 |
"/ action:[stepButton turnOff. self doNextOut] |
|
2596 |
"/ in:bpanel. |
|
2597 |
||
3447 | 2598 |
self initializeSendButtonIn:bpanel. |
2599 |
||
3187 | 2600 |
separator := View extent:(30 @ 5) in:bpanel. |
2601 |
separator borderWidth:0; level:0. |
|
3269 | 2602 |
|
3447 | 2603 |
self initializeTerminateButtonIn:bpanel. |
2604 |
||
3269 | 2605 |
separator := View extent:(30 @ 5) in:bpanel. |
2606 |
separator borderWidth:0; level:0. |
|
2607 |
||
3447 | 2608 |
self initializeDefineButtonIn:bpanel. |
4356 | 2609 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
11210 | 2610 |
self initializeReportButtonIn:bpanel. |
4356 | 2611 |
]. |
2612 |
||
3447 | 2613 |
|
2614 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
2615 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 2616 |
! |
2617 |
||
2618 |
initializeCodeViewIn:panel |
|
2619 |
|v| |
|
2620 |
||
10628 | 2621 |
(UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
2622 |
v := codeView := Tools::CodeView2 in: panel. |
|
2623 |
codeView model: ValueHolder new. |
|
2624 |
codeView methodHolder: ValueHolder new. |
|
2625 |
codeView classHolder: ValueHolder new. |
|
2626 |
] ifFalse:[ |
|
2627 |
v := HVScrollableView |
|
2628 |
for:CodeView |
|
2629 |
miniScrollerH:true |
|
2630 |
miniScrollerV:false |
|
2631 |
in:panel. |
|
2632 |
||
2633 |
"/ v autoHideScrollBars:true. |
|
2634 |
codeView := v scrolledView. |
|
2635 |
codeView enableMotionEvents. "/ for active help |
|
2636 |
]. |
|
3269 | 2637 |
|
2638 |
^ v |
|
10628 | 2639 |
|
2640 |
"Modified: / 27-07-2011 / 13:15:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3269 | 2641 |
! |
2642 |
||
2643 |
initializeContextListViewIn:panel |
|
2644 |
|v| |
|
266 | 2645 |
|
10205 | 2646 |
v := HVScrollableView |
11210 | 2647 |
for:SelectionInListView |
2648 |
miniScrollerH:true |
|
2649 |
miniScrollerV:false |
|
2650 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2651 |
v autoHideHorizontalScrollBar:true. |
266 | 2652 |
|
2653 |
contextView := v scrolledView. |
|
2654 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 2655 |
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
|
2656 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 2657 |
|
10205 | 2658 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 2659 |
|
3269 | 2660 |
^ v |
2661 |
! |
|
2662 |
||
5453 | 2663 |
initializeContextViewsMiddleButtonMenu |
2664 |
<resource: #programMenu > |
|
2665 |
||
10205 | 2666 |
contextView middleButtonMenu:(self middleButtonMenu). |
2667 |
! |
|
2668 |
||
2669 |
initializeContinueButtonIn:bpanel |
|
2670 |
continueButton := Button |
|
11210 | 2671 |
label:(resources string:'Continue') |
2672 |
action:[ |
|
2673 |
continueButton turnOffWithoutRedraw. |
|
2674 |
self doContinue |
|
2675 |
] |
|
2676 |
in:bpanel. |
|
3447 | 2677 |
|
2678 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
2679 |
! |
|
2680 |
||
10205 | 2681 |
initializeDefineButtonIn:bpanel |
2682 |
defineButton := Button |
|
11210 | 2683 |
label:(resources string:'Define') |
2684 |
action:[ |
|
2685 |
defineButton turnOffWithoutRedraw. |
|
2686 |
self doDefine |
|
2687 |
] |
|
2688 |
in:bpanel. |
|
3447 | 2689 |
defineButton beInvisible |
2690 |
||
2691 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
2692 |
! |
|
2693 |
||
3269 | 2694 |
initializeInspectorViewsIn:panel |
2695 |
|hpanel| |
|
266 | 2696 |
|
2697 |
hpanel := VariableHorizontalPanel in:panel. |
|
2698 |
||
2699 |
receiverInspector := InspectorView |
|
11210 | 2700 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
2701 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2702 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 2703 |
|
2704 |
contextInspector := ContextInspectorView |
|
11210 | 2705 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
2706 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2707 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2708 |
|
3269 | 2709 |
^ hpanel |
266 | 2710 |
! |
2711 |
||
10205 | 2712 |
initializeNextButtonIn:bpanel |
2713 |
nextButton := Button |
|
11210 | 2714 |
label:(resources string:'Debug_Next') |
2715 |
action:[ |
|
2716 |
stepButton turnOff. |
|
2717 |
self doNext |
|
2718 |
] |
|
2719 |
in:bpanel. |
|
3447 | 2720 |
|
2721 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
2722 |
! |
|
2723 |
||
10205 | 2724 |
initializeReportButtonIn:bpanel |
2725 |
reportButton := Button |
|
11210 | 2726 |
label:(resources string:'Report by Mail...') |
2727 |
action:[ |
|
2728 |
reportButton turnOffWithoutRedraw. |
|
2729 |
self doOpenReportMailApp. |
|
2730 |
] |
|
2731 |
in:bpanel. |
|
4356 | 2732 |
|
2733 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
2734 |
! |
|
2735 |
||
10205 | 2736 |
initializeRestartButtonIn:bpanel |
2737 |
restartButton := Button |
|
11210 | 2738 |
label:(resources string:'Restart') |
2739 |
action:[ |
|
2740 |
restartButton turnOff. |
|
2741 |
self doRestart |
|
2742 |
] |
|
2743 |
in:bpanel. |
|
3447 | 2744 |
|
2745 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
|
2746 |
! |
|
2747 |
||
10205 | 2748 |
initializeReturnButtonIn:bpanel |
2749 |
returnButton := Button |
|
11210 | 2750 |
label:(resources string:'Return') |
2751 |
action:[ |
|
2752 |
returnButton turnOff. |
|
2753 |
self doReturn |
|
2754 |
] |
|
2755 |
in:bpanel. |
|
3447 | 2756 |
|
2757 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
2758 |
! |
|
2759 |
||
10205 | 2760 |
initializeSendButtonIn:bpanel |
2761 |
sendButton := Button |
|
11210 | 2762 |
label:(resources string:'Send') |
2763 |
action:[ |
|
2764 |
sendButton turnOff. |
|
2765 |
self doSend |
|
2766 |
] |
|
2767 |
in:bpanel. |
|
3447 | 2768 |
|
2769 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
2770 |
! |
|
2771 |
||
10205 | 2772 |
initializeStepButtonIn:bpanel |
2773 |
stepButton := Button |
|
11210 | 2774 |
label:(resources string:'Debug_Step') |
2775 |
action:[ |
|
2776 |
stepButton turnOff. |
|
2777 |
self doStep |
|
2778 |
] |
|
2779 |
in:bpanel. |
|
3447 | 2780 |
|
2781 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
2782 |
! |
|
2783 |
||
10205 | 2784 |
initializeTerminateButtonIn:bpanel |
2785 |
terminateButton := Button |
|
11210 | 2786 |
label:(resources string:'Debug_Terminate') |
2787 |
action:[ |
|
2788 |
terminateButton turnOffWithoutRedraw. |
|
2789 |
self doTerminate |
|
2790 |
] |
|
2791 |
in:bpanel. |
|
3447 | 2792 |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2793 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2794 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2795 |
|
3447 | 2796 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 2797 |
! |
2798 |
||
1249 | 2799 |
postRealize |
2800 |
super postRealize. |
|
266 | 2801 |
|
2802 |
inspecting ifTrue:[ |
|
11210 | 2803 |
inspectedProcess notNil ifTrue:[ |
2804 |
" |
|
2805 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
2806 |
to run between mine and the debugged processes prio) |
|
2807 |
" |
|
2808 |
Processor activeProcess |
|
2809 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
2810 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2811 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2812 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2813 |
self sensor addEventListener:self. |
1249 | 2814 |
|
2815 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 2816 |
! |
2817 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2818 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2819 |
"/ 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
|
2820 |
"/ 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
|
2821 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2822 |
drawableId notNil ifTrue:[ |
11210 | 2823 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2824 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2825 |
"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
|
2826 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2827 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2828 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2829 |
|
266 | 2830 |
setLabelFor:aMessage in:aProcess |
9403 | 2831 |
|l lines processNameOrNil pidOrNil osPidString| |
6821 | 2832 |
|
2833 |
lines := aMessage asStringCollection. |
|
2834 |
lines size > 1 ifTrue:[ |
|
11210 | 2835 |
l := lines first |
6821 | 2836 |
] ifFalse:[ |
11210 | 2837 |
l := aMessage. |
6821 | 2838 |
]. |
2839 |
||
2840 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2841 |
Error handle:[:ex | |
11210 | 2842 |
l := l , '???' |
1030 | 2843 |
] do:[ |
11210 | 2844 |
processNameOrNil := aProcess name. |
2845 |
processNameOrNil notNil ifTrue:[ |
|
2846 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
2847 |
]. |
|
2848 |
pidOrNil := aProcess id printString. |
|
2849 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 2850 |
]. |
1030 | 2851 |
l := l , ')'. |
266 | 2852 |
self label:l. |
6821 | 2853 |
|
10205 | 2854 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
11210 | 2855 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
9403 | 2856 |
]. |
2857 |
||
8305 | 2858 |
exceptionInfoLabel notNil ifTrue:[ |
11210 | 2859 |
exceptionInfoLabel |
2860 |
label:(resources |
|
2861 |
string:'Exception: %1 in process %2 [%3]%4' |
|
2862 |
with:(lines first colorizeAllWith:Color red) |
|
2863 |
with:(processNameOrNil ? '') |
|
2864 |
with:(pidOrNil ? '') |
|
2865 |
with:(osPidString ? '')) |
|
8305 | 2866 |
]. |
2867 |
||
6821 | 2868 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 2869 |
! ! |
2870 |
||
2871 |
!DebugView methodsFor:'interrupt handling'! |
|
2872 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2873 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2874 |
DebuggingDebugger == true ifTrue:[ |
11210 | 2875 |
'contextIRQ' printCR. |
2876 |
thisContext sender fullPrint. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2877 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2878 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2879 |
|
1364 | 2880 |
"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
|
2881 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2882 |
|
0 | 2883 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2884 |
DebuggingDebugger == true ifTrue:[ |
11210 | 2885 |
'stepIRQ' printCR. |
2886 |
thisContext sender fullPrint. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2887 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2888 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2889 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2890 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2891 |
"Modified: / 13.1.1998 / 21:14:11 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2892 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2893 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2894 |
stepOrNext |
10205 | 2895 |
|where here con s isWrap method wrappedMethod |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2896 |
inBlock left ignore contextBelow lastWrappedContext |
10205 | 2897 |
leftWrap enteredWrap anyStepBlocks |
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2898 |
oneMore initiallyShown inBlockBelow receiver processName| |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2899 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2900 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
2901 |
"/ DebuggingDebugger := false |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2902 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2903 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2904 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2905 |
skipLineNr == #return ifTrue:[ |
11210 | 2906 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
2907 |
here := thisContext sender sender. |
|
2908 |
here setLineNumber:nil. |
|
2909 |
here := nil. |
|
2910 |
con := thisContext sender sender sender. |
|
2911 |
||
2912 |
HaltInterrupt handle:[:ex | |
|
2913 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
2914 |
ex proceed |
|
2915 |
] do:[ |
|
2916 |
self enter:con select:nil. |
|
2917 |
]. |
|
2918 |
con := nil. |
|
2919 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2920 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2921 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2922 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2923 |
"/ "/ 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
|
2924 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2925 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2926 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2927 |
"/ 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
|
2928 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2929 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2930 |
|
52 | 2931 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
11210 | 2932 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
2933 |
^ self |
|
52 | 2934 |
]. |
2935 |
||
29 | 2936 |
here := thisContext. "stepInterrupt" |
10205 | 2937 |
here := here sender. "the caller; step- or contextIRQ" |
2938 |
here := here sender. "the interrupted context" |
|
29 | 2939 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2940 |
DebuggingDebugger == true ifTrue:[ |
11210 | 2941 |
'*******' printCR. |
2942 |
'here in ' print. |
|
2943 |
inWrap ifTrue:['(wrap) ' print.]. |
|
2944 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
2945 |
here selector printCR. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2946 |
]. |
10 | 2947 |
|
2581 | 2948 |
"/ kludge an bug-workaround; |
2949 |
"/ I should not see those ... |
|
2950 |
||
2951 |
here selector == #ioInterrupt ifTrue:[ |
|
11210 | 2952 |
DebuggingDebugger == true ifTrue:[ |
2953 |
'oops - should not get that one' printCR. |
|
2954 |
]. |
|
2955 |
Processor ioInterrupt. |
|
2956 |
StepInterruptPending := 1. |
|
2957 |
InterruptPending := 1. |
|
2958 |
where := nil. here := nil. |
|
2959 |
InStepInterrupt := nil. |
|
2960 |
^ self |
|
2581 | 2961 |
]. |
2962 |
||
2963 |
stepUntilEntering notNil ifTrue:[ |
|
11210 | 2964 |
DebuggingDebugger == true ifTrue:[ |
2965 |
'check if entering ' print. stepUntilEntering printCR. |
|
2966 |
]. |
|
2967 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
2968 |
DebuggingDebugger == true ifTrue:[ |
|
2969 |
'entering...' printCR. |
|
2970 |
]. |
|
2971 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
2972 |
||
2973 |
lastStepUntilEntering := stepUntilEntering. |
|
2974 |
stepUntilEntering := nil. |
|
2975 |
self enter:here select:nil. |
|
2976 |
con := nil. |
|
2977 |
^ self |
|
2978 |
]. |
|
2979 |
"/ see if stepping context is still active ... |
|
2980 |
||
2981 |
con := here. |
|
2982 |
||
2983 |
DebuggingDebugger == true ifTrue:[ |
|
2984 |
'start searching at: ' print. |
|
2985 |
con fullPrint. |
|
2986 |
]. |
|
2987 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
2988 |
con := con sender |
|
2989 |
]. |
|
2990 |
con notNil ifTrue:[ |
|
2991 |
DebuggingDebugger == true ifTrue:[ |
|
2992 |
'steppingContext still active - continue stepping' printCR. |
|
2993 |
]. |
|
2994 |
con := nil. |
|
2995 |
where := nil. here := nil. |
|
2996 |
StepInterruptPending := 1. |
|
2997 |
InterruptPending := 1. |
|
2998 |
InStepInterrupt := nil. |
|
2999 |
^ self |
|
3000 |
]. |
|
3001 |
stepUntilEntering := nil. |
|
2581 | 3002 |
]. |
3003 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
3004 |
" |
10205 | 3005 |
kludge to hide breakpoint wrappers in the context list: |
11210 | 3006 |
check if we are in a wrapper methods hidden setup-sequence |
3007 |
if so, ignore the interrupt and continue single sending |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
3008 |
" |
29 | 3009 |
isWrap := false. |
57 | 3010 |
left := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3011 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3012 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3013 |
where := here. |
57 | 3014 |
inWrap ifTrue:[ |
11210 | 3015 |
wrappedMethod := nil. |
3016 |
5 timesRepeat:[ |
|
3017 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
|
3018 |
method := where method. |
|
3019 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
3020 |
" |
|
3021 |
in a wrapper method |
|
3022 |
" |
|
3023 |
wrappedMethod ~~ method ifTrue:[ |
|
3024 |
wrappedMethod := method. |
|
3025 |
lastWrappedContext := where. |
|
3026 |
where sender receiver == method originalMethod ifFalse:[ |
|
3027 |
isWrap := true. |
|
3028 |
] |
|
3029 |
] ifFalse:[ |
|
3030 |
where == steppedContext ifTrue:[ |
|
3031 |
||
3032 |
DebuggingDebugger == true ifTrue:[ |
|
3033 |
'change stepCon from: ' print. |
|
3034 |
steppedContext print. |
|
3035 |
' to lastWrapped: ' print. |
|
3036 |
lastWrappedContext printCR. |
|
3037 |
]. |
|
3038 |
||
3039 |
inWrap := false. |
|
3040 |
leftWrap := true. |
|
3041 |
wrapperContext := steppedContext. |
|
3042 |
steppedContext := lastWrappedContext |
|
3043 |
] |
|
3044 |
] |
|
3045 |
]. |
|
3046 |
where := where sender |
|
3047 |
] |
|
3048 |
]. |
|
29 | 3049 |
]. |
3050 |
||
3051 |
isWrap ifTrue:[ |
|
11210 | 3052 |
DebuggingDebugger == true ifTrue:[ |
3053 |
'ignore wrap' printCR. |
|
3054 |
]. |
|
3055 |
||
3056 |
"/ |
|
3057 |
"/ ignore, while in wrappers hidden setup |
|
3058 |
"/ |
|
3059 |
where := nil. here := nil. |
|
3060 |
ObjectMemory flushInlineCaches. |
|
3061 |
||
3062 |
skipLineNr == #return ifTrue:[ |
|
3063 |
DebuggingDebugger == true ifTrue:[ |
|
3064 |
'skipRet in wrap' printCR. |
|
3065 |
] |
|
3066 |
]. |
|
3067 |
||
3068 |
StepInterruptPending := 1. |
|
3069 |
InterruptPending := 1. |
|
3070 |
InStepInterrupt := nil. |
|
3071 |
^ self |
|
29 | 3072 |
]. |
3073 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3074 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 3075 |
|
2581 | 3076 |
DebuggingDebugger == true ifTrue:[ |
11210 | 3077 |
'bigStep is: ' print. bigStep printCR. |
3078 |
'steppedContext is: ' print. steppedContext printCR. |
|
2581 | 3079 |
]. |
3080 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3081 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3082 |
"/ 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
|
3083 |
"/ |
10205 | 3084 |
(bigStep |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
3085 |
and:[steppedContext notNil]) ifTrue:[ |
11210 | 3086 |
" |
3087 |
a step or next - ignore all contexts below the interesting one |
|
3088 |
" |
|
3089 |
where := here. "the interrupted context" |
|
3090 |
contextBelow := nil. |
|
3091 |
||
3092 |
where home notNil ifTrue:[ |
|
3093 |
"/ |
|
3094 |
"/ in a block called by 'our' context ? |
|
3095 |
"/ |
|
3096 |
where home == steppedContext ifTrue:[ |
|
3055 | 3097 |
"/ '*block*' printCR. |
11210 | 3098 |
inBlock := true |
3099 |
] |
|
3100 |
]. |
|
3101 |
||
3102 |
where == steppedContext ifFalse:[ |
|
3103 |
where := where sender. |
|
3104 |
||
3105 |
where notNil ifTrue:[ |
|
3106 |
where home == steppedContext ifTrue:[ |
|
3055 | 3107 |
"/ '*block*' printCR. |
11210 | 3108 |
inBlock := true. |
3109 |
] |
|
3110 |
]. |
|
57 | 3111 |
|
3112 |
"/ 'looking for ' print. |
|
3055 | 3113 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 3114 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3115 |
"/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
|
3116 |
"/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
|
3117 |
|
11210 | 3118 |
where == steppedContext ifFalse:[ |
3119 |
||
3120 |
"/ check if we are in a context below steppedContext |
|
3121 |
"/ (i.e. if steppedContext can be reached from |
|
3122 |
"/ interrupted context. Not using context-ref but its |
|
3123 |
"/ address to avoid creation of many useless contexts.) |
|
3124 |
||
3125 |
inBlock ifFalse:[ |
|
3126 |
[where notNil] whileTrue:[ |
|
3127 |
||
3128 |
"/ if either the receiver or any arg of this context |
|
3129 |
"/ is a block of the steppedContext, we must really |
|
3130 |
"/ do a single step. Otherwise, stepping through a |
|
3131 |
"/ do:-loop would be very difficult. |
|
3132 |
receiver := where receiver. |
|
3133 |
(receiver isBlock |
|
3134 |
and:[(receiver isKindOf:Block) |
|
3135 |
and:[receiver home == steppedContext]]) |
|
3136 |
ifTrue:[ |
|
3137 |
anyStepBlocks := true. |
|
3138 |
] ifFalse:[ |
|
3139 |
where args do:[:arg | |
|
3140 |
(arg isBlock |
|
3141 |
and:[(arg isKindOf:Block) |
|
3142 |
and:[arg home == steppedContext]]) |
|
3143 |
ifTrue:[ |
|
3144 |
anyStepBlocks := true. |
|
3145 |
] |
|
3146 |
] |
|
3147 |
]. |
|
3148 |
||
3149 |
DebuggingDebugger == true ifTrue:[ |
|
3150 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
3151 |
where selector printCR. |
|
3152 |
]. |
|
3153 |
||
3154 |
where == steppedContext ifTrue:[ |
|
3055 | 3155 |
"/ 'found it - below; ignore' printCR. |
11210 | 3156 |
" |
3157 |
found the interesting context somwehere up in the |
|
3158 |
chain. We seem to be still below the interesting one ... |
|
3159 |
" |
|
3160 |
tracing == true ifTrue:[ |
|
3161 |
here printString printCR |
|
3162 |
]. |
|
3163 |
" |
|
3164 |
yes, a context below |
|
3165 |
- continue and schedule another stepInterrupt. |
|
3166 |
Must flush caches since optimized methods not always |
|
3167 |
look for pending interrupts |
|
3168 |
" |
|
3169 |
||
3170 |
contextBelow notNil ifTrue:[ |
|
3055 | 3171 |
"/ '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
|
3172 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3173 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3174 |
"/ 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
|
3175 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3176 |
|
11210 | 3177 |
DebuggingDebugger == true ifTrue:[ |
3178 |
'below stepCon; continue until unwind of: ' print. |
|
3179 |
contextBelow printCR. |
|
3180 |
]. |
|
3181 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
3182 |
StepInterruptPending := nil. |
|
3183 |
] ifFalse:[ |
|
3184 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3185 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3186 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3187 |
"/ 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
|
3188 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3189 |
|
11210 | 3190 |
DebuggingDebugger == true ifTrue:[ |
3191 |
'in stepCon; continue single stepping' printCR. |
|
3192 |
]. |
|
3193 |
StepInterruptPending := 1. |
|
3194 |
InterruptPending := 1. |
|
3195 |
]. |
|
3196 |
where := nil. here := nil. |
|
3197 |
InStepInterrupt := nil. |
|
3198 |
||
3199 |
^ self |
|
3200 |
]. |
|
3201 |
||
3202 |
(steppedContext notNil and:[ |
|
3203 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
3204 |
inBlockBelow := true. |
|
3205 |
]. |
|
3206 |
||
3207 |
anyStepBlocks ifFalse:[ |
|
3208 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3209 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3210 |
"/ 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
|
3211 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3212 |
where isBlockContext ifFalse:[ |
11210 | 3213 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3214 |
]. |
11210 | 3215 |
] |
3216 |
]. |
|
3217 |
where := where sender |
|
3218 |
]. |
|
3219 |
s := 'context returned'. |
|
3220 |
left := true. |
|
3221 |
]. |
|
3222 |
] ifTrue:[ |
|
3055 | 3223 |
"/ 'found it right in sender' printCR. |
11210 | 3224 |
s := 'after step' |
3225 |
]. |
|
3226 |
] ifTrue:[ |
|
3055 | 3227 |
"/ 'found it right away' printCR. |
11210 | 3228 |
s := 'after step' |
3229 |
]. |
|
0 | 3230 |
] ifFalse:[ |
3055 | 3231 |
"/ ' send' printCR. |
11210 | 3232 |
" |
3233 |
a send |
|
3234 |
" |
|
3235 |
DebuggingDebugger == true ifTrue:[ |
|
3236 |
'clear steppedContext' printCR. |
|
3237 |
]. |
|
3238 |
steppedContext := nil. |
|
3239 |
s := 'after send' |
|
0 | 3240 |
]. |
7 | 3241 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3242 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3243 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
11210 | 3244 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3245 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3246 |
|
790 | 3247 |
"/ handle the case, when a subBlock leaves; |
3248 |
"/ continue stepping in the home context. |
|
3249 |
||
3250 |
left ifTrue:[ |
|
11210 | 3251 |
steppedContext home notNil ifTrue:[ |
3252 |
steppedContext := steppedContext home. |
|
3253 |
s := 'after step'. |
|
3254 |
left := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3255 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3256 |
|
11210 | 3257 |
] |
790 | 3258 |
]. |
3259 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3260 |
" |
10205 | 3261 |
kludge to hide breakpoint wrappers in the context list: |
11210 | 3262 |
check if we are in a wrapper methods hidden exit-sequence |
3263 |
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
|
3264 |
" |
10205 | 3265 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3266 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3267 |
ifTrue:[ |
11210 | 3268 |
"/ did not find our steppedContext along the chain; |
3269 |
"/ could be in a wrappedMethods exitBlock ... |
|
3270 |
||
3271 |
leftWrap ifFalse:[ |
|
3272 |
where := here. |
|
3273 |
wrappedMethod := nil. |
|
3274 |
5 timesRepeat:[ |
|
3275 |
where notNil ifTrue:[ |
|
3276 |
where isBlockContext ifFalse:[ |
|
3277 |
method := where method. |
|
3278 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
3279 |
where == wrapperContext ifTrue:[ |
|
3280 |
DebuggingDebugger == true ifTrue:[ |
|
3281 |
'change stepCon fromWrapped: ' print. |
|
3282 |
steppedContext print. |
|
3283 |
' to: ' print. |
|
3284 |
wrapperContext printCR. |
|
3285 |
]. |
|
3286 |
||
3287 |
inWrap := true. |
|
3288 |
enteredWrap := true. |
|
3289 |
steppedContext := wrapperContext. |
|
3290 |
wrapperContext := nil. |
|
3291 |
] |
|
3292 |
]. |
|
3293 |
]. |
|
3294 |
where := where sender |
|
3295 |
] |
|
3296 |
]. |
|
3297 |
]. |
|
3298 |
enteredWrap ifTrue:[ |
|
3299 |
ignore := true |
|
3300 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3301 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3302 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3303 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3304 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3305 |
left ifTrue:[ |
11210 | 3306 |
"/ special care for stepInterrupt in send, |
3307 |
"/ when created a dummy context (lineNr == 1) |
|
3308 |
||
3309 |
steppedContext lineNumber isNil ifTrue:[ |
|
3310 |
steppedContext selector == here sender selector ifTrue:[ |
|
3311 |
left := false. |
|
3312 |
s := 'after step'. |
|
3313 |
steppedContext := here sender. |
|
3314 |
]. |
|
3315 |
]. |
|
3316 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3317 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3318 |
|
57 | 3319 |
inBlock ifTrue:[ |
3055 | 3320 |
"/ 'inBlock' printCR. |
11210 | 3321 |
s := 'in block'. |
57 | 3322 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3323 |
inBlockBelow ifTrue:[ |
11210 | 3324 |
ignore := true |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3325 |
]. |
57 | 3326 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3327 |
DebuggingDebugger == true ifTrue:[ |
11210 | 3328 |
where notNil ifTrue:[ |
3329 |
'(' print. steppedContextLineno print. ') ' print. |
|
3330 |
where printCR. |
|
3331 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
3332 |
]. |
57 | 3333 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3334 |
ignore ifFalse:[ |
11210 | 3335 |
(bigStep |
3336 |
and:[steppedContextLineno notNil |
|
3337 |
and:[where notNil |
|
3338 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
3339 |
(here isBlockContext |
|
3340 |
and:[(here methodHome == steppedContext) |
|
3341 |
or:[here home == steppedContext]]) ifTrue:[ |
|
3342 |
DebuggingDebugger == true ifTrue:[ |
|
3343 |
'same line but in block' printCR. |
|
3344 |
]. |
|
3345 |
||
3346 |
steppedContext := actualContext := here. |
|
3347 |
steppedContextLineno := here lineNumber. |
|
3348 |
] ifFalse:[ |
|
3349 |
"/ kludge - I only have the info for up to 255 lines |
|
3350 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
3351 |
DebuggingDebugger == true ifTrue:[ |
|
3352 |
'same line - ignored' printCR. |
|
3353 |
]. |
|
3354 |
ignore := true |
|
3355 |
]. |
|
3356 |
]. |
|
3357 |
]. |
|
3358 |
||
3359 |
(left not |
|
3360 |
and:[skipLineNr notNil |
|
3361 |
and:[where notNil |
|
3362 |
and:[where lineNumber notNil |
|
3363 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
3364 |
DebuggingDebugger == true ifTrue:[ |
|
3365 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
3366 |
]. |
|
3367 |
ignore := true |
|
3368 |
]. |
|
3369 |
||
3370 |
(steppedContextLineno isNil |
|
3371 |
and:[skipLineNr isNil |
|
3372 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
3373 |
DebuggingDebugger == true ifTrue:[ |
|
3374 |
'same line2 (after conIRQ) - ignored' printCR. |
|
3375 |
]. |
|
3376 |
ignore := true |
|
3377 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3378 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3379 |
|
57 | 3380 |
ignore ifTrue:[ |
3055 | 3381 |
"/' ' printCR. |
11210 | 3382 |
where := nil. here := nil. |
3383 |
" |
|
3384 |
yes, a context below |
|
3385 |
- continue and schedule another stepInterrupt. |
|
3386 |
Must flush caches since optimized methods not always |
|
3387 |
look for pending interrupts |
|
3388 |
" |
|
3389 |
ObjectMemory flushInlineCaches. |
|
3390 |
StepInterruptPending := 1. |
|
3391 |
InterruptPending := 1. |
|
3392 |
InStepInterrupt := nil. |
|
3393 |
^ self |
|
57 | 3394 |
]. |
3395 |
||
3055 | 3396 |
"/ ' ' printCR. |
57 | 3397 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3398 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 3399 |
|
57 | 3400 |
tracing := false. |
3401 |
bigStep := false. |
|
3402 |
||
0 | 3403 |
"release refs to context" |
3404 |
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
|
3405 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3406 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3407 |
DebuggingDebugger == true ifTrue:[ |
11210 | 3408 |
'==> 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
|
3409 |
]. |
1364 | 3410 |
|
3411 |
initiallyShown := nil. |
|
3412 |
(oneMore == true) ifTrue:[ |
|
11210 | 3413 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
3414 |
initiallyShown := 2 |
|
3415 |
] ifFalse:[ |
|
3416 |
initiallyShown := 1 |
|
3417 |
] |
|
1364 | 3418 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3419 |
con := thisContext sender sender. |
3435 | 3420 |
|
9235 | 3421 |
HaltInterrupt handle:[:ex | |
11210 | 3422 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
3423 |
ex proceed |
|
3435 | 3424 |
] do:[ |
11210 | 3425 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3426 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3427 |
con := nil |
1364 | 3428 |
|
3429 |
"Created: / 14.10.1996 / 12:53:39 / cg" |
|
3447 | 3430 |
"Modified: / 18.11.2001 / 01:00:55 / cg" |
0 | 3431 |
! ! |
3432 |
||
4867 | 3433 |
!DebugView methodsFor:'menu & button actions'! |
266 | 3434 |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3435 |
addBreakpoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3436 |
"add a breakpoint on the selected contexts method - if any" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3437 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3438 |
|implementorClass method| |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3439 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3440 |
selectedContext isNil ifTrue:[ |
11210 | 3441 |
^ self showError:'** select a context first **' |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3442 |
]. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3443 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
11210 | 3444 |
^ self |
10205 | 3445 |
]. |
3446 |
||
3447 |
implementorClass := selectedContext methodClass. |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3448 |
implementorClass notNil ifTrue:[ |
11210 | 3449 |
method := implementorClass compiledMethodAt:selectedContext selector. |
3450 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
3451 |
method setBreakPoint |
|
3452 |
] |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3453 |
]. |
3511 | 3454 |
contextView middleButtonMenu disable:#addBreakpoint. |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3455 |
contextView middleButtonMenu enable:#removeBreakpoint. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3456 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3457 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3458 |
! |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3459 |
|
5875 | 3460 |
addBrowserBookmark |
3461 |
"add a browser-bookmark for the selected contexts method" |
|
3462 |
||
3463 |
|cls sel| |
|
3464 |
||
3465 |
selectedContext isNil ifTrue:[^ self]. |
|
3466 |
||
3467 |
cls := selectedContext receiver class. |
|
3468 |
sel := selectedContext selector. |
|
3469 |
(cls includesSelector:sel) ifFalse:[ |
|
11210 | 3470 |
sel := nil |
5875 | 3471 |
]. |
3472 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
3473 |
! |
|
3474 |
||
3511 | 3475 |
allowBreakPointsInDebugger |
3476 |
^ ignoreBreakpoints not |
|
3477 |
! |
|
3478 |
||
3479 |
allowBreakPointsInDebugger:aBoolean |
|
3480 |
ignoreBreakpoints := aBoolean not. |
|
5798 | 3481 |
self initializeMiddleButtonMenu. |
3482 |
self initializeContextViewsMiddleButtonMenu. |
|
3511 | 3483 |
! |
3484 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3485 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3486 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3487 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3488 |
"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
|
3489 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3490 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3491 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3492 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3493 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3494 |
"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
|
3495 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3496 |
|
266 | 3497 |
autoUpdateOff |
3498 |
"stop the update process" |
|
3499 |
||
3500 |
updateProcess notNil ifTrue:[ |
|
11210 | 3501 |
monitorToggle lampColor:(Color yellow). |
3502 |
updateProcess terminate. |
|
3503 |
updateProcess := nil |
|
266 | 3504 |
] |
3505 |
! |
|
3506 |
||
3507 |
autoUpdateOn |
|
3508 |
"fork a subprocess which updates the contextList in regular intervals" |
|
3509 |
||
3510 |
updateProcess isNil ifTrue:[ |
|
11210 | 3511 |
updateProcess := |
3512 |
[ |
|
3513 |
[true] whileTrue:[ |
|
3514 |
monitorToggle showLamp ifTrue:[ |
|
3515 |
monitorToggle lampColor:(Color yellow). |
|
3516 |
] ifFalse:[ |
|
3517 |
monitorToggle activeForegroundColor:Color black. |
|
3518 |
]. |
|
3519 |
(Delay forSeconds:0.25) wait. |
|
3520 |
self updateContext. |
|
3521 |
monitorToggle showLamp ifTrue:[ |
|
3522 |
monitorToggle lampColor:(Color red). |
|
3523 |
] ifFalse:[ |
|
3524 |
monitorToggle activeForegroundColor:Color red. |
|
3525 |
]. |
|
3526 |
(Delay forSeconds:0.25) wait. |
|
3527 |
self updateContext. |
|
3528 |
] |
|
3529 |
] forkAt:(Processor activePriority - 1) |
|
266 | 3530 |
] |
3531 |
||
3532 |
! |
|
3533 |
||
3269 | 3534 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3535 |
"browse the receiver's class (of the selected context's message)" |
3269 | 3536 |
|
3537 |
|cls sel| |
|
3538 |
||
3539 |
selectedContext isNil ifTrue:[^ self]. |
|
3540 |
||
3541 |
cls := selectedContext receiver class. |
|
3542 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3543 |
(cls includesSelector:sel) ifFalse:[ |
11210 | 3544 |
sel := nil |
3269 | 3545 |
]. |
3546 |
cls browserClass openInClass:cls selector:sel. |
|
3547 |
||
3548 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3549 |
! |
|
3550 |
||
3551 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3552 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 3553 |
|
3554 |
|cls mthd| |
|
3555 |
||
3556 |
selectedContext isNil ifTrue:[^ self]. |
|
3557 |
||
3558 |
mthd := selectedContext method. |
|
3447 | 3559 |
mthd notNil ifTrue:[ |
11210 | 3560 |
cls := mthd containingClass. |
3561 |
"/ still nil if unbound - then use receivers class |
|
3447 | 3562 |
]. |
3563 |
cls isNil ifTrue:[ |
|
11210 | 3564 |
cls := selectedContext receiver class |
3269 | 3565 |
]. |
3566 |
cls browserClass browseClassHierarchy:cls. |
|
3567 |
||
3447 | 3568 |
"Modified: / 17.11.2001 / 19:43:06 / cg" |
3269 | 3569 |
! |
3570 |
||
3571 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3572 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 3573 |
|
3574 |
|cls mthd| |
|
3575 |
||
3576 |
selectedContext isNil ifTrue:[^ self]. |
|
3577 |
||
3578 |
mthd := selectedContext method. |
|
3447 | 3579 |
mthd notNil ifTrue:[ |
11210 | 3580 |
cls := mthd containingClass. |
3581 |
"/ still nil if unbound - then use receivers class |
|
3447 | 3582 |
]. |
3583 |
cls isNil ifTrue:[ |
|
11210 | 3584 |
cls := selectedContext receiver class |
3269 | 3585 |
]. |
3586 |
cls browserClass browseFullClassProtocol:cls. |
|
3587 |
||
3447 | 3588 |
"Modified: / 17.11.2001 / 19:43:43 / cg" |
3269 | 3589 |
! |
3590 |
||
3591 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3592 |
"browse the implementing class (of the selected context's message)" |
3269 | 3593 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3594 |
|mthd who sel cls home| |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3595 |
|
1452 | 3596 |
selectedContext isNil ifTrue:[^ self]. |
3597 |
||
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3598 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3599 |
mthd notNil ifTrue:[ |
11210 | 3600 |
who := selectedContext method who. |
3601 |
who notNil ifTrue:[ |
|
3602 |
cls := who methodClass. |
|
3603 |
sel := who methodSelector. |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3604 |
] ifFalse:[ |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3605 |
"might have been re-accepted" |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3606 |
(home := selectedContext methodHome) notNil ifTrue:[ |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3607 |
(sel := home selector) notNil ifTrue:[ |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3608 |
cls := home receiver class |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3609 |
whichClassImplements:selectedContext selector. |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3610 |
cls notNil ifTrue:[ |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3611 |
Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs. |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3612 |
]. |
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3613 |
] |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3614 |
]. |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3615 |
]. |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3616 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3617 |
cls isNil ifTrue:[ |
11210 | 3618 |
"/ class not found - try receiver |
3619 |
cls := selectedContext receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3620 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3621 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3622 |
cls browserClass openInClass:cls selector:sel. |
266 | 3623 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3624 |
"Created: / 22-11-1995 / 21:27:01 / cg" |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3625 |
"Modified: / 01-03-2012 / 14:21:11 / cg" |
266 | 3626 |
! |
3627 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3628 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3629 |
"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
|
3630 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3631 |
selectedContext isNil ifTrue:[ |
11210 | 3632 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3633 |
]. |
4153 | 3634 |
"/ selectedContext receiver class browserClass |
3635 |
UserPreferences systemBrowserClass |
|
11210 | 3636 |
browseImplementorsOf:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3637 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3638 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3639 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3640 |
"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
|
3641 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3642 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3643 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3644 |
(sel := codeView selection) notNil ifTrue:[ |
11210 | 3645 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3646 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3647 |
initial isNil ifTrue:[ |
11210 | 3648 |
initial := selectedContext isNil |
3649 |
ifTrue:[nil] |
|
3650 |
ifFalse:[selectedContext selector]. |
|
10205 | 3651 |
]. |
3652 |
selector := Dialog |
|
11210 | 3653 |
requestSelector:'Selector to browse implementors of:' |
3654 |
initialAnswer:initial. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3655 |
selector size == 0 ifFalse:[ |
11210 | 3656 |
UserPreferences systemBrowserClass |
3657 |
browseImplementorsMatching:selector. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3658 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3659 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3660 |
"Modified: / 6.2.2000 / 01:05:14 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3661 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3662 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3663 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3664 |
"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
|
3665 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3666 |
|p appClass| |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3667 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3668 |
p := inspectedProcess ? Processor activeProcess. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3669 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
11210 | 3670 |
WindowGroup scheduledWindowGroups do:[:wg | |
3671 |
wg process == p ifTrue:[ |
|
3672 |
appClass := wg application class. |
|
3673 |
appClass browserClass openInClass:appClass selector:nil. |
|
3674 |
^ self |
|
3675 |
] |
|
3676 |
] |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3677 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3678 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3679 |
|
3269 | 3680 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3681 |
"browse the receiver's class (of the selected context's message)" |
3269 | 3682 |
|
3683 |
|cls sel| |
|
3684 |
||
3685 |
selectedContext isNil ifTrue:[^ self]. |
|
3686 |
||
3687 |
cls := selectedContext receiver class. |
|
3688 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3689 |
(cls includesSelector:sel) ifFalse:[ |
11210 | 3690 |
sel := nil |
3269 | 3691 |
]. |
3692 |
cls browserClass openInClass:cls selector:sel. |
|
3693 |
||
3694 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3695 |
! |
|
3696 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3697 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3698 |
"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
|
3699 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3700 |
selectedContext isNil ifTrue:[ |
11210 | 3701 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3702 |
]. |
3140 | 3703 |
UserPreferences systemBrowserClass |
11210 | 3704 |
browseAllCallsOn:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3705 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3706 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3707 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3708 |
"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
|
3709 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3710 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3711 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3712 |
(sel := codeView selection) notNil ifTrue:[ |
11210 | 3713 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3714 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3715 |
initial isNil ifTrue:[ |
11210 | 3716 |
initial := selectedContext isNil |
3717 |
ifTrue:[nil] |
|
3718 |
ifFalse:[selectedContext selector]. |
|
10205 | 3719 |
]. |
3720 |
selector := Dialog |
|
11210 | 3721 |
requestSelector:'Selector to browse senders of:' |
3722 |
initialAnswer:initial. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3723 |
selector size == 0 ifFalse:[ |
11210 | 3724 |
UserPreferences systemBrowserClass |
3725 |
browseAllCallsOn:selector asSymbol. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3726 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3727 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3728 |
"Modified: / 6.2.2000 / 01:05:29 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3729 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3730 |
|
9626 | 3731 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 3732 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 3733 |
LastExtent := self extent. |
3734 |
LastOrigin := self origin. |
|
3735 |
||
3736 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
3737 |
! |
|
3738 |
||
266 | 3739 |
copyWalkbackText |
3740 |
"place the contents of the walkback view into the copy-paste buffer. |
|
3741 |
This allows pasting it into some other view for printing ..." |
|
3742 |
||
10760 | 3743 |
|infoText| |
3744 |
||
3745 |
contextArray isEmptyOrNil ifTrue:[ |
|
3746 |
infoText := 'No context, no walkback'. |
|
3747 |
] ifFalse:[ |
|
3748 |
infoText := (contextArray collect:[:con | con fullPrintString]) asStringCollection. |
|
3749 |
]. |
|
3750 |
||
3751 |
self setClipboardText:infoText |
|
266 | 3752 |
|
3753 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
3754 |
! |
|
3755 |
||
3756 |
doAbort |
|
1187 | 3757 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 3758 |
at save places (for example: in the event loop) and returns back |
3759 |
from whatever the process is doing, but does not terminate it." |
|
3760 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3761 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 3762 |
(self confirm:('Code modified - abort anyway ?')) |
3763 |
ifFalse:[ |
|
3764 |
^ self |
|
3765 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3766 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3767 |
|
266 | 3768 |
inspecting ifTrue:[ |
11210 | 3769 |
inspectedProcess isDead ifTrue:[ |
3770 |
self showTerminated. |
|
3771 |
^ self |
|
3772 |
]. |
|
3773 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3774 |
self showError:'** the process does not handle the abort signal **' |
|
3775 |
] ifTrue:[ |
|
3776 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
3777 |
]. |
|
3778 |
^ self |
|
266 | 3779 |
]. |
3780 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3781 |
steppedContext := wrapperContext := nil. |
266 | 3782 |
haveControl := false. |
3783 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3784 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3785 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3786 |
catchBlock notNil ifTrue:[ |
11210 | 3787 |
abortButton turnOff. |
3788 |
catchBlock value. |
|
3789 |
||
3790 |
"/ not reached |
|
3791 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
266 | 3792 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3793 |
|
266 | 3794 |
^ self. |
3795 |
||
3447 | 3796 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 3797 |
! |
3798 |
||
6487 | 3799 |
doAbortAll |
3800 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
3801 |
at save places (for example: in the event loop) and returns back |
|
3802 |
from whatever the process is doing, but does not terminate it." |
|
3803 |
||
3804 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
11210 | 3805 |
(self confirm:('Code modified - abort anyway ?')) |
3806 |
ifFalse:[ |
|
3807 |
^ self |
|
3808 |
] |
|
6487 | 3809 |
]. |
3810 |
||
3811 |
inspecting ifTrue:[ |
|
11210 | 3812 |
inspectedProcess isDead ifTrue:[ |
3813 |
self showTerminated. |
|
3814 |
^ self |
|
3815 |
]. |
|
3816 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3817 |
self showError:'** the process does not handle the abort signal **' |
|
3818 |
] ifTrue:[ |
|
3819 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
3820 |
]. |
|
3821 |
^ self |
|
6487 | 3822 |
]. |
3823 |
||
3824 |
steppedContext := wrapperContext := nil. |
|
3825 |
haveControl := false. |
|
3826 |
exitAction := #abortAll. |
|
3827 |
||
3828 |
"exit private event-loop" |
|
3829 |
catchBlock notNil ifTrue:[ |
|
11210 | 3830 |
abortButton turnOff. |
3831 |
catchBlock value. |
|
3832 |
||
3833 |
"/ not reached |
|
3834 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 3835 |
]. |
3836 |
||
3837 |
^ self. |
|
3838 |
||
3839 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
3840 |
! |
|
3841 |
||
266 | 3842 |
doContinue |
3843 |
"continue from menu" |
|
3844 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3845 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3846 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3847 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 3848 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
3849 |
^ self |
|
3850 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3851 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3852 |
|
266 | 3853 |
inspecting ifTrue:[ |
11210 | 3854 |
device hasColors ifTrue:[ |
3855 |
continueButton foregroundColor:Color red darkened. |
|
3856 |
]. |
|
3857 |
continueButton label:(resources string:'Stop'). |
|
3858 |
continueButton action:[self doStop]. |
|
3859 |
||
3860 |
self processPerform:#resume. |
|
3861 |
||
3862 |
^ self |
|
266 | 3863 |
]. |
3864 |
canContinue ifTrue:[ |
|
11210 | 3865 |
exContext := thisContext findSpecialHandle:false raise:true. |
3866 |
||
3867 |
(exContext notNil |
|
3868 |
and:[ (ex := exContext receiver) isLazyValue not |
|
3869 |
and:[ ex isException |
|
3870 |
and:[ ex signal == NoHandlerError |
|
3871 |
and:[ ex parameter signal == RecursionError]]]]) |
|
3872 |
ifTrue:[ |
|
3873 |
"/ debug due to unhandled recursionInterrupt. |
|
3874 |
"/ ask if we should proceed with more stack. |
|
3875 |
||
3876 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
3877 |
answer == true ifTrue:[ |
|
3878 |
proc := Processor activeProcess. |
|
3879 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
3880 |
]. |
|
3881 |
]. |
|
3882 |
||
3883 |
steppedContext := wrapperContext := nil. |
|
3884 |
tracing := false. |
|
3885 |
haveControl := false. |
|
3886 |
exitAction := #continue. |
|
3887 |
||
3888 |
"exit private event-loop" |
|
3889 |
catchBlock value. |
|
3890 |
||
3891 |
"/ not reached. |
|
3892 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
3893 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3894 |
|
266 | 3895 |
] ifFalse:[ |
11210 | 3896 |
inspecting ifFalse:[ |
3897 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
3898 |
self showSelection:1. |
|
3899 |
self doReturn |
|
3900 |
] |
|
266 | 3901 |
] |
477 | 3902 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3903 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 3904 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 3905 |
! |
3906 |
||
3187 | 3907 |
doDefine |
5955 | 3908 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3909 |
bagOfClassNames bagOfUsedClassNames implClass idx callee restart| |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3910 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3911 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3912 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3913 |
|
3283 | 3914 |
selector := actualContext selector. |
8963 | 3915 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3916 |
implClass notNil ifTrue:[ |
11210 | 3917 |
"/ must be a subclassResponsibility |
3918 |
||
3919 |
idx := contextArray identityIndexOf:actualContext. |
|
3920 |
idx > 1 ifTrue:[ |
|
3921 |
callee := contextArray at:idx-1. |
|
3922 |
||
3923 |
callee selector == #subclassResponsibility ifTrue:[ |
|
3924 |
restart := false. |
|
3925 |
] |
|
3926 |
]. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3927 |
]. |
5955 | 3928 |
|
3929 |
"generate nice argument names" |
|
3930 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
3931 |
bagOfUsedClassNames := Bag new. |
|
10205 | 3932 |
argNames := actualContext args |
11210 | 3933 |
collect: |
3934 |
[:eachArg | |
|
3935 |
|nm| |
|
3936 |
||
3937 |
nm := eachArg class name. |
|
3938 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
3939 |
nm article , nm |
|
3940 |
] ifFalse:[ |
|
3941 |
bagOfUsedClassNames add:nm. |
|
3942 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
3943 |
]. |
|
3944 |
]. |
|
5955 | 3945 |
|
3946 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 3947 |
|
3447 | 3948 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
3949 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
3950 |
||
3951 |
actualContext receiver isNil ifTrue:[ |
|
11210 | 3952 |
(self confirm:'Are you sure you want to add this method (to UndefinedObject) ?') |
3953 |
ifFalse:[ |
|
3954 |
^ self |
|
3955 |
] |
|
3447 | 3956 |
]. |
3957 |
||
3958 |
receiversClass := actualContext receiver class. |
|
3959 |
||
3960 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
|
11210 | 3961 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
3962 |
cat := 'accessing'. |
|
3447 | 3963 |
]. |
3964 |
(selector numArgs == 1 |
|
3965 |
and:[(selector endsWith:':') |
|
10205 | 3966 |
and:[receiversClass instVarNames includes:(selector copyWithoutLast:1)]]) |
3447 | 3967 |
ifTrue:[ |
11210 | 3968 |
code := '%1\' , haltStmtFix , '\ %2 := arg.'. |
3969 |
cat := 'accessing'. |
|
3447 | 3970 |
]. |
3971 |
||
3972 |
"/ actualContext receiver isClass ifTrue:[ |
|
3973 |
"/ selector == #new ifTrue:[ |
|
3974 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
3975 |
"/ ]. |
|
3976 |
"/ selector == #'new:' ifTrue:[ |
|
3977 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
3978 |
"/ ]. |
|
3979 |
"/ ]. |
|
3980 |
code isNil ifTrue:[ |
|
11210 | 3981 |
code := '%1\' , haltStmtDef |
10205 | 3982 |
]. |
3983 |
||
3984 |
self |
|
11210 | 3985 |
codeAccept:(code bindWith:proto with:selector) withCRs |
3986 |
inClass:receiversClass |
|
3987 |
unwind:false |
|
3988 |
category:cat |
|
3989 |
onCancel:[^ self]. |
|
3269 | 3990 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3991 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3992 |
restart ifTrue:[ |
11210 | 3993 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3994 |
] |
3427 | 3995 |
|
3447 | 3996 |
"Modified: / 17.11.2001 / 23:43:54 / cg" |
3187 | 3997 |
! |
3998 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3999 |
doIgnoreBreakpoints |
3511 | 4000 |
self allowBreakPointsInDebugger:false |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4001 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4002 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4003 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4004 |
"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
|
4005 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4006 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4007 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4008 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4009 |
(self confirm:('Code modified - step anyway ?')) |
4010 |
ifFalse:[ |
|
4011 |
^ self |
|
4012 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4013 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4014 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4015 |
canContinue ifTrue:[ |
11210 | 4016 |
steppedContext := wrapperContext := nil. |
4017 |
haveControl := false. |
|
4018 |
exitAction := #step. |
|
4019 |
||
4020 |
"exit private event-loop" |
|
4021 |
catchBlock value. |
|
4022 |
||
4023 |
"/ not reached |
|
4024 |
'DebugView [warning]: send failed' errorPrintCR. |
|
4025 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4026 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4027 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4028 |
"Created: / 6.3.1997 / 21:09:36 / cg" |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4029 |
"Modified: / 29.7.1998 / 21:49:29 / cg" |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4030 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4031 |
|
266 | 4032 |
doNext |
1072 | 4033 |
"skip for next source-code line; entering blocks" |
266 | 4034 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4035 |
stepHow := #nextIn. |
266 | 4036 |
self doStep:nil |
790 | 4037 |
|
1072 | 4038 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4039 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4040 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4041 |
doNextOut |
1072 | 4042 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4043 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4044 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4045 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4046 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4047 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 4048 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4049 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4050 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4051 |
doNextOver |
1072 | 4052 |
"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
|
4053 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4054 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4055 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4056 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4057 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 4058 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 4059 |
! |
4060 |
||
4061 |
doNoTrace |
|
4062 |
traceView notNil ifTrue:[ |
|
11210 | 4063 |
traceView topView destroy. |
4064 |
traceView := nil. |
|
266 | 4065 |
]. |
4066 |
tracing := false |
|
4067 |
! |
|
4068 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4069 |
doNotIgnoreBreakpoints |
3511 | 4070 |
self allowBreakPointsInDebugger:true |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4071 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4072 |
|
4356 | 4073 |
doOpenReportMailApp |
4074 |
"open a mail report tool" |
|
4075 |
||
4076 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4077 |
|
4356 | 4078 |
str := '' writeStream. |
4079 |
||
4080 |
str nextPutLine:('Error notification from ' |
|
11210 | 4081 |
, OperatingSystem getLoginName |
4082 |
, '@' |
|
4083 |
, OperatingSystem getHostName). |
|
4356 | 4084 |
str cr. |
4085 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
4086 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 4087 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
4088 |
str nextPutLine:('Description: ' , self label). |
|
4089 |
"/ str nextPutLine:('Error: ', printedException description). |
|
4090 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
4091 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
4092 |
str nextPutLine:'Backtrace:'. |
|
4093 |
str cr. |
|
4094 |
||
4095 |
firstContext notNil ifTrue:[ |
|
11210 | 4096 |
firstContext fullPrintAllOn:str. |
4356 | 4097 |
]. |
4098 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4099 |
|
10205 | 4100 |
SendMailTool |
11210 | 4101 |
openForMessage:(str contents) |
4102 |
withSubject:('STX Error:[', self label, ']') |
|
4103 |
preOpenBlock:[:inst| |
|
4104 |
inst recipientEntryField value:'error@exept.de' |
|
4105 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4106 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4107 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 4108 |
! |
4109 |
||
266 | 4110 |
doRestart |
4111 |
"restart - the selected context will be restarted" |
|
10205 | 4112 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4113 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4114 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
4115 |
^ self |
|
4116 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4117 |
]. |
266 | 4118 |
inspecting ifTrue:[ |
11210 | 4119 |
selectedContext isNil ifTrue:[ |
4120 |
^ self showError:'** select a context first **' |
|
4121 |
]. |
|
4122 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
4123 |
^ self |
|
266 | 4124 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4125 |
steppedContext := wrapperContext := nil. |
266 | 4126 |
haveControl := false. |
6365 | 4127 |
exitAction := #restart. "exit private event-loop" |
4128 |
||
4129 |
catchBlock value. |
|
4130 |
||
4131 |
"/ normally not reached |
|
10205 | 4132 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4133 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4134 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4135 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4136 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 4137 |
! |
4138 |
||
4139 |
doReturn |
|
4140 |
"return - the selected context will do a ^nil" |
|
4141 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4142 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4143 |
(self confirm:('Code modified - return anyway ?')) |
4144 |
ifFalse:[ |
|
4145 |
^ self |
|
4146 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4147 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4148 |
|
266 | 4149 |
inspecting ifTrue:[ |
11210 | 4150 |
selectedContext isNil ifTrue:[ |
4151 |
^ self showError:'** select a context first **' |
|
4152 |
]. |
|
4153 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
4154 |
^ self |
|
266 | 4155 |
]. |
4156 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4157 |
steppedContext := wrapperContext := nil. |
266 | 4158 |
haveControl := false. |
4159 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4160 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4161 |
"exit private event-loop" |
6365 | 4162 |
catchBlock value. |
477 | 4163 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4164 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4165 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4166 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4167 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4168 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 4169 |
! |
4170 |
||
4171 |
doSend |
|
4172 |
"single send; reenter with next message send" |
|
4173 |
||
1072 | 4174 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4175 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4176 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4177 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4178 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4179 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4180 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4181 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4182 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4183 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4184 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4185 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4186 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4187 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4188 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4189 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4190 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4191 |
|
1072 | 4192 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 4193 |
! |
4194 |
||
4195 |
doStep |
|
4196 |
"skip for next send in selected method" |
|
4197 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4198 |
stepHow := #step. |
790 | 4199 |
self doStep:-1 |
4200 |
||
1072 | 4201 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 4202 |
! |
4203 |
||
4204 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4205 |
"common helper for step, skip & next. |
10205 | 4206 |
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
|
4207 |
or to next line (if nil) or to next send (if -1)" |
266 | 4208 |
|
4209 |
|con method| |
|
4210 |
||
4211 |
inspecting ifTrue:[^ self]. |
|
4212 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4213 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4214 |
(self confirm:('Code modified - step anyway ?')) |
4215 |
ifFalse:[ |
|
4216 |
^ self |
|
4217 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4218 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4219 |
|
266 | 4220 |
canContinue ifTrue:[ |
11210 | 4221 |
selectedContext notNil ifTrue:[ |
4222 |
con := actualContext. "/ selectedContext. |
|
4223 |
steppedContextLineno := actualContext lineNumber. |
|
4224 |
] ifFalse:[ |
|
4225 |
con := contextArray at:2. |
|
4226 |
steppedContextLineno := con lineNumber. |
|
4227 |
]. |
|
4228 |
||
4229 |
skipLineNr := lineNr. |
|
4230 |
||
4231 |
lineNr == -1 ifTrue:[ |
|
4232 |
steppedContextLineno := skipLineNr := nil. |
|
4233 |
]. |
|
4234 |
||
4235 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
4236 |
steppedContext := contextArray at:1. |
|
4237 |
stepHow := #nextIn. |
|
4238 |
] ifFalse:[ |
|
4239 |
stepHow == #nextOut ifTrue:[ |
|
4240 |
steppedContext := con home. |
|
4241 |
] ifFalse:[ |
|
4242 |
steppedContext := con. |
|
4243 |
]. |
|
4244 |
]. |
|
4245 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4246 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
4247 |
"/ ' 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
|
4248 |
|
11210 | 4249 |
" |
4250 |
if we step in a wrapped method, |
|
4251 |
prepare to skip the prolog ... |
|
4252 |
" |
|
4253 |
||
4254 |
inWrap := false. |
|
4255 |
method := con method. |
|
4256 |
(method notNil |
|
4257 |
and:[method isWrapped |
|
4258 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
4259 |
inWrap := true |
|
4260 |
]. |
|
4261 |
||
4262 |
lineNr == #return ifTrue:[ |
|
4263 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
4264 |
]. |
|
4265 |
||
4266 |
con := nil. |
|
4267 |
bigStep := true. |
|
4268 |
haveControl := false. |
|
4269 |
exitAction := #step. |
|
4270 |
||
4271 |
"exit private event-loop" |
|
4272 |
catchBlock value. |
|
4273 |
||
4274 |
"/ not reached |
|
4275 |
'DebugView [warning]: step failed' errorPrintCR. |
|
4276 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 4277 |
] |
477 | 4278 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4279 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 4280 |
! |
4281 |
||
4282 |
doStop |
|
4283 |
"stop the process (if its running, otherwise this is a no-op)" |
|
4284 |
||
4285 |
inspecting ifTrue:[ |
|
11210 | 4286 |
device hasColors ifTrue:[ |
4287 |
continueButton foregroundColor:Color green darkened darkened. |
|
4288 |
]. |
|
4289 |
continueButton label:(resources string:'Continue'). |
|
4290 |
continueButton action:[self doContinue]. |
|
4291 |
||
4292 |
self processPerform:#stop. |
|
4293 |
||
4294 |
^ self |
|
266 | 4295 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4296 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4297 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 4298 |
! |
4299 |
||
4300 |
doTerminate |
|
4301 |
"terminate - the process has a chance for cleanup" |
|
4302 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4303 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4304 |
(self confirm:('Code modified - terminate anyway ?')) |
4305 |
ifFalse:[ |
|
4306 |
^ self |
|
4307 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4308 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4309 |
|
266 | 4310 |
inspecting ifTrue:[ |
11210 | 4311 |
self processPerform:#terminate. |
4312 |
^ self |
|
266 | 4313 |
]. |
4314 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4315 |
steppedContext := wrapperContext := nil. |
266 | 4316 |
haveControl := false. |
10205 | 4317 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4318 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4319 |
"exit private event-loop" |
6365 | 4320 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4321 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4322 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4323 |
inspecting ifFalse:[ |
11210 | 4324 |
'DebugView [warning]: terminate failed' errorPrintCR. |
4325 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
4326 |
Debugger newDebugger. |
|
4327 |
Processor activeProcess terminate. |
|
4328 |
] |
|
266 | 4329 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4330 |
terminateButton turnOff. |
477 | 4331 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4332 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 4333 |
! |
4334 |
||
4335 |
doTrace |
|
4336 |
"tracing - not really implemented ..." |
|
4337 |
||
4338 |
self warn:'this function is not yet implemented'. |
|
4339 |
||
4340 |
"/ |v b| |
|
4341 |
"/ |
|
4342 |
"/ traceView isNil ifTrue:[ |
|
4343 |
"/ v := StandardSystemView on:Display. |
|
4344 |
"/ v label:'Debugger-Trace'. |
|
4345 |
"/ v icon:icon. |
|
4346 |
"/ |
|
4347 |
"/ b := Button label:'untrace' in:v. |
|
4348 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
4349 |
"/ b action:[ |
|
4350 |
"/ StepInterruptPending := nil. |
|
4351 |
"/ tracing := false. |
|
4352 |
"/ v unrealize. |
|
4353 |
"/ traceView := nil |
|
4354 |
"/ ]. |
|
4355 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
4356 |
"/ traceView origin:(0 @ (b height)) |
|
4357 |
"/ extent:[v width @ (v height - b height)] |
|
4358 |
"/ ]. |
|
4359 |
"/ v realize. |
|
4360 |
"/ |
|
4361 |
"/ tracing := true. |
|
4362 |
! |
|
4363 |
||
4364 |
doTraceStep |
|
4365 |
"tracestep - not implemented yet" |
|
4366 |
||
4367 |
canContinue ifTrue:[ |
|
11210 | 4368 |
tracing := true. |
4369 |
self doStep |
|
266 | 4370 |
] |
4371 |
! |
|
4372 |
||
4373 |
exit |
|
4374 |
"exit from menu: immediate exit from smalltalk" |
|
4375 |
||
4376 |
OperatingSystem exit |
|
4377 |
! |
|
4378 |
||
8170 | 4379 |
hasHaltsToIgnore |
4380 |
^ IgnoredHalts notEmptyOrNil |
|
4381 |
! |
|
4382 |
||
9922 | 4383 |
ignoreAllHaltsForever |
11210 | 4384 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:true. |
9922 | 4385 |
|
4386 |
"Created: / 08-05-2011 / 10:19:56 / cg" |
|
4387 |
! |
|
4388 |
||
11210 | 4389 |
ignoreAllHaltsUntilShiftKeyIsPressed |
4390 |
self addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true forAll:true. |
|
4391 |
||
4392 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
4393 |
! |
|
4394 |
||
8179 | 4395 |
ignoreHaltForever |
11210 | 4396 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:false. |
4397 |
||
4398 |
"Modified: / 27-01-2012 / 11:31:37 / cg" |
|
4399 |
! |
|
4400 |
||
4401 |
ignoreHaltUntilShiftKeyIsPressed |
|
4402 |
self addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true forAll:false. |
|
4403 |
||
4404 |
"Created: / 27-01-2012 / 11:36:54 / cg" |
|
8179 | 4405 |
! |
4406 |
||
266 | 4407 |
inspectContext |
4408 |
"launch an inspector on the currently selected context" |
|
4409 |
||
4410 |
contextView selection notNil ifTrue:[ |
|
11210 | 4411 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
4412 |
(contextArray at:(contextView selection)) inspect. |
|
4413 |
] |
|
266 | 4414 |
] |
4415 |
! |
|
4416 |
||
8170 | 4417 |
isStoppedAtHaltOrBreakPoint |
4418 |
^ isStoppedAtHaltOrBreakPoint |
|
4419 |
! |
|
4420 |
||
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4421 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4422 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4423 |
! |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4424 |
|
8142 | 4425 |
middleButtonMenu |
4426 |
<resource: #programMenu > |
|
4427 |
||
9488 | 4428 |
|items m nameOfExecutable| |
8142 | 4429 |
|
4430 |
exclusive ifTrue:[ |
|
11210 | 4431 |
items := #( |
4432 |
('Show More WalkBack' showMore ) |
|
4433 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4434 |
('-' ) |
|
4435 |
('Add Breakpoint' addBreakpoint ) |
|
4436 |
('Remove Breakpoint' removeBreakpoint ) |
|
4437 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4438 |
('-' ) |
|
4439 |
). |
|
8142 | 4440 |
] ifFalse:[ |
11210 | 4441 |
items := #( |
4442 |
('Show More WalkBack' showMore ) |
|
4443 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4444 |
('-' ) |
|
4445 |
('Skip' skip ) |
|
4446 |
('Step Out' skipForReturn ) |
|
4447 |
('Skip until Entering...' skipUntilEntering ) |
|
4448 |
('-' ) |
|
8142 | 4449 |
" |
11210 | 4450 |
('Continue' doContinue ) |
4451 |
('Terminate' doTerminate ) |
|
4452 |
('Abort' doAbort ) |
|
4453 |
('-' ) |
|
4454 |
('Step' doStep ) |
|
4455 |
('Send' doSend ) |
|
4456 |
('-' ) |
|
4457 |
('Return' doReturn ) |
|
4458 |
('Restart' doRestart ) |
|
4459 |
('-' ) |
|
8142 | 4460 |
" |
11210 | 4461 |
('Add Breakpoint' addBreakpoint ) |
4462 |
('Remove Breakpoint' removeBreakpoint ) |
|
4463 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4464 |
). |
|
4465 |
||
4466 |
self allowBreakPointsInDebugger ifFalse:[ |
|
4467 |
items := items , #( |
|
4468 |
('Allow Breakpoints && halt in Debugger' doNotIgnoreBreakpoints ) |
|
4469 |
). |
|
4470 |
] ifTrue:[ |
|
4471 |
items := items , #( |
|
4472 |
('Ignore Breakpoints && halt in Debugger' doIgnoreBreakpoints ) |
|
4473 |
). |
|
4474 |
]. |
|
4475 |
||
4476 |
items := items , #( |
|
4477 |
('-' ) |
|
4478 |
('Browse Implementing Class' browseImplementingClass ) |
|
4479 |
('Browse Receivers Class' browseReceiversClass ) |
|
4480 |
('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
|
4481 |
('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
4482 |
('Implementors' browseImplementors ) |
|
4483 |
('Implementors Of...' browseImplementorsOf ) |
|
4484 |
('Senders' browseSenders ) |
|
4485 |
('Senders Of...' browseSendersOf ) |
|
4486 |
('-' ) |
|
4487 |
('Inspect Context' inspectContext ) |
|
4488 |
). |
|
8142 | 4489 |
]. |
4490 |
||
9488 | 4491 |
items := items , #( |
11210 | 4492 |
('Copy WalkBack Text' copyWalkbackText ) |
4493 |
('-' ) |
|
4494 |
('QuickTerminate' quickTerminate ) |
|
4495 |
('=' )). |
|
9488 | 4496 |
|
4497 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
4498 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
4499 |
||
4500 |
items := items , { |
|
11210 | 4501 |
{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
10205 | 4502 |
|
4503 |
m := PopUpMenu |
|
11210 | 4504 |
itemList:items |
4505 |
resources:resources |
|
4506 |
receiver:self |
|
4507 |
for:contextView. |
|
8142 | 4508 |
|
4509 |
verboseBacktrace ifTrue:[ |
|
11210 | 4510 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
4511 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback |
|
8142 | 4512 |
]. |
4513 |
||
4514 |
inspecting ifTrue:[ |
|
11210 | 4515 |
m notNil ifTrue:[ |
4516 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
4517 |
browseClassHierarchy browseFullClassProtocol |
|
4518 |
browseImplementors browseSenders inspectContext skip doStepOut). |
|
4519 |
]. |
|
8142 | 4520 |
]. |
4521 |
self updateMenuItems. |
|
4522 |
||
4523 |
^ m. |
|
9488 | 4524 |
|
4525 |
"Modified: / 19-05-2010 / 11:49:56 / cg" |
|
8142 | 4526 |
! |
4527 |
||
3447 | 4528 |
openAboutThisApplication |
4529 |
"opens an about box for this application." |
|
4530 |
||
7112 | 4531 |
Dialog aboutClass:self class. |
4532 |
||
4533 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 4534 |
! |
4535 |
||
9612
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4536 |
openBreakPointBrowser |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4537 |
Tools::BreakpointBrowser open |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4538 |
|
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4539 |
"Created: / 27-10-2010 / 12:52:49 / cg" |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4540 |
! |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4541 |
|
9922 | 4542 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
4543 |
|answer dT| |
|
4544 |
||
4545 |
[ |
|
11210 | 4546 |
answer := Dialog |
4547 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
4548 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
4549 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4550 |
||
4551 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
4552 |
dT notNil ifTrue:[ |
|
4553 |
LastIgnoreHaltDuration := dT. |
|
4554 |
self addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false forAll:true. |
|
4555 |
^ self. |
|
4556 |
]. |
|
9922 | 4557 |
] loop |
4558 |
||
4559 |
"Created: / 08-05-2011 / 10:19:20 / cg" |
|
4560 |
! |
|
4561 |
||
8170 | 4562 |
openIgnoreHaltNTimesDialog |
8179 | 4563 |
|answer n| |
4564 |
||
4565 |
[ |
|
11210 | 4566 |
answer := Dialog |
4567 |
request:(resources string:'How often should this halt be ignored ?') |
|
4568 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
4569 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4570 |
||
4571 |
n := Integer readFrom:answer onError:nil. |
|
4572 |
n notNil ifTrue:[ |
|
4573 |
LastIgnoreHaltNTimes := n. |
|
4574 |
self addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false forAll:false. |
|
4575 |
^ self. |
|
4576 |
]. |
|
8179 | 4577 |
] loop. |
9922 | 4578 |
|
11210 | 4579 |
"Modified: / 27-01-2012 / 11:31:44 / cg" |
8179 | 4580 |
! |
4581 |
||
4582 |
openIgnoreHaltUntilTimeElapsedDialog |
|
4583 |
|answer dT| |
|
4584 |
||
4585 |
[ |
|
11210 | 4586 |
answer := Dialog |
4587 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
4588 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
4589 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4590 |
||
4591 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
4592 |
dT notNil ifTrue:[ |
|
4593 |
LastIgnoreHaltDuration := dT. |
|
4594 |
self addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false forAll:false. |
|
4595 |
^ self. |
|
4596 |
]. |
|
8179 | 4597 |
] loop |
9613
380816519281
changed: #openIgnoreHaltUntilTimeElapsedDialog
Claus Gittinger <cg@exept.de>
parents:
9612
diff
changeset
|
4598 |
|
11210 | 4599 |
"Modified: / 27-01-2012 / 11:31:47 / cg" |
8170 | 4600 |
! |
4601 |
||
8620 | 4602 |
openSettingsDialog |
4603 |
|settingsList settingsApp| |
|
4604 |
||
10205 | 4605 |
settingsList := |
11210 | 4606 |
#( |
4607 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
4608 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
4609 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
4610 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
4611 |
). |
|
8620 | 4612 |
|
4613 |
settingsApp := SettingsDialog new. |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4614 |
"/ settingsApp requestor:self. |
8620 | 4615 |
settingsApp installSettingsEntries:settingsList. |
4616 |
settingsApp allButOpen. |
|
4617 |
settingsApp window label:('Debugger Settings'). |
|
4618 |
settingsApp openWindow. |
|
4619 |
! |
|
4620 |
||
266 | 4621 |
quickTerminate |
4622 |
"quick terminate - the process will get no chance for cleanup actions" |
|
4623 |
||
4624 |
inspecting ifTrue:[ |
|
11210 | 4625 |
self processPerform:#terminateNoSignal. |
4626 |
^ self |
|
266 | 4627 |
]. |
4628 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4629 |
steppedContext := wrapperContext := nil. |
266 | 4630 |
haveControl := false. |
4631 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4632 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4633 |
"exit private event-loop" |
6365 | 4634 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4635 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4636 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4637 |
inspecting ifFalse:[ |
11210 | 4638 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
4639 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
4640 |
Debugger newDebugger. |
|
4641 |
Processor activeProcess terminateNoSignal. |
|
4642 |
] |
|
266 | 4643 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4644 |
terminateButton turnOff. |
477 | 4645 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4646 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 4647 |
! |
4648 |
||
4649 |
removeAllBreakpoints |
|
4650 |
"remove all trace & breakpoints - if any" |
|
4651 |
||
1327 | 4652 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
11210 | 4653 |
self withExecuteCursorDo:[ |
4654 |
MessageTracer unwrapAllMethods |
|
4655 |
] |
|
1319 | 4656 |
] |
1327 | 4657 |
|
1661 | 4658 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
266 | 4659 |
! |
4660 |
||
4661 |
removeBreakpoint |
|
4662 |
"remove breakpoint on the selected contexts method - if any" |
|
4663 |
||
4664 |
|implementorClass method| |
|
4665 |
||
4666 |
selectedContext isNil ifTrue:[ |
|
11210 | 4667 |
^ self showError:'** select a context first **' |
266 | 4668 |
]. |
1327 | 4669 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
11210 | 4670 |
^ self |
10205 | 4671 |
]. |
4672 |
||
4673 |
implementorClass := selectedContext methodClass. |
|
266 | 4674 |
implementorClass notNil ifTrue:[ |
11210 | 4675 |
method := implementorClass compiledMethodAt:selectedContext selector. |
4676 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
4677 |
method clearBreakPoint |
|
4678 |
] |
|
266 | 4679 |
]. |
4680 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
3511 | 4681 |
contextView middleButtonMenu enable:#addBreakpoint. |
1327 | 4682 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4683 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
266 | 4684 |
! |
4685 |
||
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4686 |
selectedContextIsWrapped |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4687 |
|con mthd| |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4688 |
|
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4689 |
contextView selection notNil ifTrue:[ |
11210 | 4690 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
4691 |
con := contextArray at:(contextView selection). |
|
4692 |
mthd := con methodHome method. |
|
4693 |
^ mthd notNil and:[mthd isWrapped] |
|
4694 |
] |
|
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4695 |
]. |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4696 |
^ false. |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4697 |
! |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4698 |
|
3447 | 4699 |
showDenseWalkback |
3427 | 4700 |
|m| |
4701 |
||
4702 |
m := contextView middleButtonMenu. |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4703 |
verboseBacktrace := false. |
3694 | 4704 |
m labelAt:#showDenseWalkback put:(resources string:'Show Verbose WalkBack'). |
3447 | 4705 |
m selectorAt:#showDenseWalkback put:#showVerboseWalkback. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4706 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4707 |
|
3447 | 4708 |
"Created: / 17.11.2001 / 20:08:08 / cg" |
4709 |
"Modified: / 17.11.2001 / 22:39:48 / cg" |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4710 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4711 |
|
266 | 4712 |
showMore |
3447 | 4713 |
"double the number of contexts shown" |
266 | 4714 |
|
4715 |
contextArray notNil ifTrue:[ |
|
11210 | 4716 |
nChainShown := nChainShown * 2. |
4717 |
self redisplayBacktrace. |
|
266 | 4718 |
] |
563 | 4719 |
|
3447 | 4720 |
"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
|
4721 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4722 |
|
3447 | 4723 |
showVerboseWalkback |
4724 |
|m| |
|
4725 |
||
4726 |
verboseBacktrace := true. |
|
4727 |
m := contextView middleButtonMenu. |
|
3694 | 4728 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
3447 | 4729 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback. |
4730 |
||
4731 |
self redisplayBacktrace. |
|
4732 |
||
4733 |
"Created: / 17.11.2001 / 20:07:57 / cg" |
|
4734 |
"Modified: / 17.11.2001 / 22:39:41 / cg" |
|
4735 |
! |
|
4736 |
||
4737 |
showingDenseWalkback |
|
4738 |
^ verboseBacktrace == false. |
|
4739 |
||
4740 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
4741 |
! |
|
4742 |
||
4743 |
showingVerboseWalkback |
|
4744 |
^ verboseBacktrace == true. |
|
4745 |
||
4746 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
4747 |
! |
|
4748 |
||
9626 | 4749 |
sizeChanged:how |
10205 | 4750 |
super sizeChanged:how. |
9626 | 4751 |
LastExtent := self extent. |
4752 |
||
4753 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
4754 |
! |
|
4755 |
||
266 | 4756 |
skip |
4757 |
"skip for cursor line in selected method" |
|
4758 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4759 |
stepHow := #skip. |
266 | 4760 |
self doStep:codeView cursorLine. |
790 | 4761 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4762 |
"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
|
4763 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4764 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4765 |
skipForReturn |
2581 | 4766 |
"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
|
4767 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4768 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4769 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4770 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4771 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 4772 |
! |
4773 |
||
4774 |
skipUntilEntering |
|
4775 |
"skip until some particular method is invoked." |
|
4776 |
||
4777 |
|selector| |
|
4778 |
||
10205 | 4779 |
selector := Dialog |
11210 | 4780 |
request:'Skip until entering what (matchpattern):' |
4781 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 4782 |
selector size == 0 ifTrue:[^ self]. |
4783 |
||
4784 |
stepUntilEntering := selector asSymbol. |
|
4785 |
stepHow := #send. |
|
4786 |
self doStep:-1. |
|
4787 |
||
4788 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 4789 |
! |
4790 |
||
8170 | 4791 |
stopIgnoringHalts |
8179 | 4792 |
self class stopIgnoringHalts |
8170 | 4793 |
! |
4794 |
||
3447 | 4795 |
toggleVerboseWalkback |
4796 |
verboseBacktrace ifFalse:[ |
|
11210 | 4797 |
self showVerboseWalkback |
3447 | 4798 |
] ifTrue:[ |
11210 | 4799 |
self showDenseWalkback |
3447 | 4800 |
]. |
4801 |
||
4802 |
"Modified: / 17.11.2001 / 20:07:45 / cg" |
|
266 | 4803 |
! ! |
4804 |
||
4805 |
!DebugView methodsFor:'private'! |
|
4806 |
||
6487 | 4807 |
abortAllIsHandled |
9750 | 4808 |
^ AbortAllOperationWantedQuery query |
4809 |
||
4810 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 4811 |
! |
4812 |
||
266 | 4813 |
busy |
4814 |
^ busy |
|
4815 |
! |
|
4816 |
||
3269 | 4817 |
canBrowseClassHierarchy |
4818 |
|m| |
|
4819 |
||
4820 |
m := contextView middleButtonMenu. |
|
4821 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
|
4822 |
! |
|
4823 |
||
4824 |
canBrowseFullClassProtocol |
|
4825 |
|m| |
|
4826 |
||
4827 |
m := contextView middleButtonMenu. |
|
4828 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
|
4829 |
! |
|
4830 |
||
4831 |
canBrowseImplementingClass |
|
4832 |
|m| |
|
4833 |
||
4834 |
m := contextView middleButtonMenu. |
|
4835 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
|
4836 |
! |
|
4837 |
||
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4838 |
canBrowseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4839 |
|p| |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4840 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4841 |
p := inspectedProcess ? Processor activeProcess. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4842 |
p isNil ifTrue:[^ false]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4843 |
^ p isGUIProcess |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4844 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4845 |
|
3269 | 4846 |
canBrowseReceiversClass |
4847 |
|m| |
|
4848 |
||
4849 |
m := contextView middleButtonMenu. |
|
4850 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
|
4851 |
! |
|
4852 |
||
4853 |
canDefineMethod |
|
4854 |
^ defineButton isVisible |
|
4855 |
! |
|
4856 |
||
3447 | 4857 |
canRestart |
4858 |
^ restartButton isEnabled |
|
4859 |
||
4860 |
"Modified: / 17.11.2001 / 19:59:49 / cg" |
|
4861 |
! |
|
4862 |
||
4863 |
canReturn |
|
4864 |
^ returnButton isEnabled |
|
4865 |
||
4866 |
"Modified: / 17.11.2001 / 19:59:18 / cg" |
|
4867 |
! |
|
4868 |
||
9583 | 4869 |
canSendEmail |
4870 |
^ SendMailTool notNil |
|
4871 |
||
4872 |
"Created: / 15-10-2010 / 11:51:23 / cg" |
|
4873 |
! |
|
4874 |
||
3269 | 4875 |
canShowMore |
4876 |
^ canShowMore |
|
4877 |
! |
|
4878 |
||
7797 | 4879 |
contextListEntryFor:aContext |
4880 |
|s| |
|
4881 |
||
4882 |
aContext selector == #doIt ifTrue:[ |
|
11210 | 4883 |
aContext receiver isNil ifTrue:[ |
4884 |
^ 'doIt' allBold |
|
4885 |
] |
|
7797 | 4886 |
]. |
4887 |
||
4888 |
s := Text new writeStream. |
|
4889 |
aContext printOn:s. |
|
4890 |
^ s contents |
|
4891 |
||
4892 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
4893 |
! |
|
4894 |
||
266 | 4895 |
exclusive:aBoolean |
4896 |
exclusive := aBoolean |
|
4897 |
! |
|
4898 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4899 |
explainSelection |
8212 | 4900 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4901 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4902 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4903 |
interval isEmpty ifTrue:[ |
11210 | 4904 |
crsrPos := codeView characterPositionOfCursor. |
4905 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
4906 |
crsrPos := (crsrPos - 1) max:1 |
|
4907 |
]. |
|
4908 |
interval := crsrPos to:crsrPos. |
|
10205 | 4909 |
]. |
4910 |
self |
|
11210 | 4911 |
withNodeValueAtInterval:interval |
4912 |
do:[:value :description | |
|
4913 |
self showValue:value |
|
4914 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4915 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4916 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4917 |
findNodeForInterval:interval |
8212 | 4918 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4919 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4920 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4921 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
4922 |
source := codeView contentsAsString string. |
10205 | 4923 |
"/ source := currentMethod notNil |
4924 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 4925 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
4926 |
source isNil ifTrue:[^ nil]. |
8214 | 4927 |
|
8212 | 4928 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
4929 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4930 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4931 |
|
7912 | 4932 |
findNodeIn:tree forInterval:interval |
4933 |
<resource: #obsolete> |
|
10205 | 4934 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4935 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4936 |
|
7912 | 4937 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4938 |
node := nil. |
10205 | 4939 |
tree nodesDo:[:each | |
11210 | 4940 |
(each intersectsInterval:interval) ifTrue:[ |
4941 |
(node isNil or:[node == each parent]) ifTrue:[ |
|
4942 |
node := each |
|
4943 |
] ifFalse:[ |
|
4944 |
(node parent notNil |
|
4945 |
and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
4946 |
] |
|
4947 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4948 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4949 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4950 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4951 |
|
2581 | 4952 |
goodSkipUntilSelector |
4953 |
|current| |
|
4954 |
||
4955 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
4956 |
selectedContext isNil ifTrue:[^ nil]. |
|
4957 |
current := selectedContext selector. |
|
4958 |
current isNil ifTrue:[^ nil]. |
|
4959 |
('change:*' match:current) ifTrue:[ |
|
11210 | 4960 |
^ 'update:*' |
2581 | 4961 |
]. |
4962 |
^ nil |
|
4963 |
! |
|
4964 |
||
8179 | 4965 |
haltSelectors |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
4966 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break'). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
4967 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
4968 |
"Modified (format): / 27-01-2012 / 11:10:00 / cg" |
8179 | 4969 |
! |
4970 |
||
3447 | 4971 |
hasContextSelected |
4972 |
^ contextView hasSelection |
|
4973 |
||
4974 |
"Created: / 17.11.2001 / 19:57:03 / cg" |
|
4975 |
! |
|
4976 |
||
10205 | 4977 |
inspectedProcess |
4978 |
^ inspectedProcess |
|
266 | 4979 |
! |
4980 |
||
4981 |
interruptProcessWith:aBlock |
|
4982 |
"let inspected process do something, then update the context list" |
|
4983 |
||
4984 |
inspectedProcess isDead ifTrue:[ |
|
11210 | 4985 |
self showTerminated. |
4986 |
^ self |
|
266 | 4987 |
]. |
4988 |
inspectedProcess interruptWith:aBlock. |
|
4989 |
" |
|
4990 |
give the process a chance to run, then update |
|
4991 |
" |
|
4992 |
(Delay forSeconds:0.2) wait. |
|
4993 |
self setContext:(inspectedProcess suspendedContext). |
|
4994 |
! |
|
4995 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4996 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4997 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4998 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4999 |
|
8194 | 5000 |
openHTMLDocument: anHTMLFilename |
5001 |
"open a HTMLDocumentView on anHTMLFilename" |
|
5002 |
||
5003 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
5004 |
! |
|
5005 |
||
266 | 5006 |
processPerform:aMessage |
5007 |
"do something, then update the context list" |
|
5008 |
||
5009 |
inspectedProcess isDead ifTrue:[ |
|
11210 | 5010 |
self showTerminated. |
5011 |
^ self |
|
266 | 5012 |
]. |
5013 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
5014 |
|
266 | 5015 |
" |
5016 |
give the process a chance to run, then update |
|
5017 |
" |
|
5018 |
(Delay forSeconds:0.2) wait. |
|
5019 |
self setContext:(inspectedProcess suspendedContext). |
|
5020 |
! |
|
5021 |
||
939 | 5022 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5023 |
"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
|
5024 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5025 |
|
939 | 5026 |
|oldSelection oldContext con idx| |
5027 |
||
5028 |
contextArray notNil ifTrue:[ |
|
11210 | 5029 |
self withExecuteCursorDo:[ |
5030 |
oldSelection := contextView selection. |
|
5031 |
oldSelection notNil ifTrue:[ |
|
5032 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
5033 |
]. |
|
5034 |
||
5035 |
con := firstContext. |
|
950 | 5036 |
"/ con := contextArray at:1. |
11210 | 5037 |
"/ force redeisplay, even if same by changing the first entry |
5038 |
contextArray size > 0 ifTrue:[ |
|
5039 |
contextArray at:1 put:nil. |
|
5040 |
]. |
|
5041 |
self setContext:con. |
|
5042 |
||
5043 |
oldContext isNil ifTrue:[ |
|
5044 |
idx := oldSelection |
|
5045 |
] ifFalse:[ |
|
5046 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
5047 |
]. |
|
5048 |
contextView setSelection:idx. |
|
5049 |
idx notNil ifTrue:[ |
|
5050 |
self showSelection:idx |
|
5051 |
] |
|
5052 |
] |
|
939 | 5053 |
] |
5054 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5055 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 5056 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 5057 |
! |
5058 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5059 |
selectedInterval |
7912 | 5060 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5061 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5062 |
|
7823 | 5063 |
showError:message |
5064 |
codeView contents:(resources string:message). |
|
5065 |
shown ifTrue:[ |
|
11210 | 5066 |
exclusive ifTrue:[ |
5067 |
"/ consider this a kludge: |
|
5068 |
"/ if exclusive, cannot use flash, since it suspends |
|
5069 |
"/ (but we cannot suspend here ...) |
|
5070 |
codeView redrawInverted. device flush. |
|
5071 |
OperatingSystem millisecondDelay:200. |
|
5072 |
codeView redraw |
|
5073 |
] ifFalse:[ |
|
5074 |
codeView flash |
|
5075 |
] |
|
7823 | 5076 |
] |
5077 |
||
5078 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
5079 |
! |
|
5080 |
||
5081 |
showTerminated |
|
5082 |
self showError:'** the process has terminated **' |
|
5083 |
! |
|
5084 |
||
5085 |
showValue:aValue |
|
5086 |
"/ TODO: show value in info field |
|
5087 |
"/ Transcript showCR:aValue printString |
|
5088 |
! |
|
5089 |
||
10205 | 5090 |
stepping |
5091 |
^ stepping |
|
5092 |
! |
|
5093 |
||
5094 |
unstep |
|
7823 | 5095 |
stepping := false. |
5096 |
bigStep := false. |
|
5097 |
steppedContext := wrapperContext := nil. |
|
5098 |
exitAction := nil |
|
5099 |
||
5100 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
5101 |
! |
|
5102 |
||
10203 | 5103 |
updateButtonsAndMenuItemsForContext:aContext |
5104 |
|m| |
|
5105 |
||
5106 |
m := contextView middleButtonMenu. |
|
5107 |
m notNil ifTrue:[ |
|
11210 | 5108 |
self updateMenuItems. |
5109 |
||
5110 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
5111 |
abortButton enable. |
|
5112 |
m enable:#doAbort. |
|
5113 |
] ifFalse:[ |
|
5114 |
abortButton disable. |
|
5115 |
m disable:#doAbort. |
|
5116 |
]. |
|
5117 |
exclusive ifTrue:[ |
|
5118 |
terminateButton disable. |
|
5119 |
m disable:#doTerminate. |
|
5120 |
] ifFalse:[ |
|
5121 |
terminateButton enable. |
|
5122 |
m enable:#doTerminate. |
|
5123 |
]. |
|
10203 | 5124 |
]. |
5125 |
||
5126 |
mayProceed == false ifTrue:[ |
|
11210 | 5127 |
continueButton disable. |
5128 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 5129 |
] ifFalse:[ |
11210 | 5130 |
continueButton enable. |
5131 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 5132 |
]. |
5133 |
||
5134 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
|
5135 |
! |
|
5136 |
||
7823 | 5137 |
updateContext |
5138 |
|oldContext idx| |
|
5139 |
||
5140 |
inspectedProcess state == #dead ifTrue:[ |
|
11210 | 5141 |
self showTerminated. |
5142 |
^ self |
|
7823 | 5143 |
]. |
5144 |
||
5145 |
oldContext := selectedContext. |
|
5146 |
[ |
|
11210 | 5147 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
5148 |
oldContext notNil ifTrue:[ |
|
5149 |
contextArray notNil ifTrue:[ |
|
5150 |
idx := contextArray identityIndexOf:oldContext. |
|
5151 |
idx ~~ 0 ifTrue:[ |
|
5152 |
self showSelection:idx |
|
5153 |
] ifFalse:[ |
|
5154 |
codeView contents:('** context returned **') |
|
5155 |
] |
|
5156 |
] |
|
5157 |
] |
|
5158 |
]. |
|
7823 | 5159 |
] valueUninterruptably. |
5160 |
||
5161 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 5162 |
! |
5163 |
||
10203 | 5164 |
updateMenuItems |
5165 |
|m mthd cls mCls rCls| |
|
5166 |
||
5167 |
" |
|
5168 |
enable/disable some menu items |
|
5169 |
" |
|
5170 |
m := contextView middleButtonMenu. |
|
5171 |
m notNil ifTrue:[ |
|
11210 | 5172 |
m disable:#removeBreakpoint. |
5173 |
m disable:#addBreakpoint. |
|
5174 |
canShowMore ifFalse:[ |
|
5175 |
m disable:#showMore |
|
5176 |
]. |
|
5177 |
||
5178 |
selectedContext notNil ifTrue:[ |
|
5179 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
5180 |
||
5181 |
mthd := selectedContext method. |
|
5182 |
mthd notNil ifTrue:[ |
|
5183 |
cls := mCls := mthd containingClass. |
|
5184 |
mthd isBreakpointed ifTrue:[ |
|
5185 |
m enable:#removeBreakpoint. |
|
5186 |
] ifFalse:[ |
|
5187 |
m enable:#addBreakpoint. |
|
5188 |
] |
|
5189 |
]. |
|
5190 |
rCls := selectedContext receiver class. |
|
5191 |
cls isNil ifTrue:[ |
|
5192 |
cls := rCls |
|
5193 |
]. |
|
5194 |
cls notNil ifTrue:[ |
|
5195 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5196 |
rCls == mCls ifTrue:[ |
|
5197 |
m disable:#browseReceiversClass |
|
5198 |
]. |
|
5199 |
mCls isNil ifTrue:[ |
|
5200 |
m disable:#browseImplementingClass |
|
5201 |
] |
|
5202 |
||
5203 |
] ifFalse:[ |
|
5204 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5205 |
]. |
|
5206 |
] ifFalse:[ |
|
5207 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5208 |
] |
|
10203 | 5209 |
] |
5210 |
! |
|
5211 |
||
8212 | 5212 |
withNodeValueAtInterval:interval do:aBlock |
9294
e19553d7e864
changed: #withNodeValueAtInterval:do:
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
5213 |
|node definingNode nm nmBold varIdx parentNode receiver con receiversNonMetaClass| |
8212 | 5214 |
|
5215 |
"/interval printCR. |
|
10205 | 5216 |
Error |
11210 | 5217 |
handle:[:ex | ] |
5218 |
do:[ |
|
5219 |
[ |
|
5220 |
node := self findNodeForInterval:interval |
|
5221 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
5222 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
5223 |
|
8212 | 5224 |
node isNil ifTrue:[ ^ self ]. |
10205 | 5225 |
node isVariable ifFalse:[ |
11210 | 5226 |
"/ Transcript showCR:node. |
5227 |
^ self |
|
8592 | 5228 |
]. |
8212 | 5229 |
|
5230 |
nm := node name. |
|
8214 | 5231 |
nmBold := nm allBold. |
8600 | 5232 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 5233 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 5234 |
receiver := actualContext methodHome receiver. |
8212 | 5235 |
|
5236 |
(nm = 'self') ifTrue:[ |
|
11210 | 5237 |
aBlock value:receiver value:'receiver' allBold. |
5238 |
^ self |
|
8212 | 5239 |
]. |
5240 |
(nm = 'super') ifTrue:[ |
|
11210 | 5241 |
aBlock value:receiver value:'receiver' allBold. |
5242 |
^ self |
|
8212 | 5243 |
]. |
5244 |
(nm = 'thisContext') ifTrue:[ |
|
11210 | 5245 |
aBlock value:actualContext value:'context' allBold. |
5246 |
^ self |
|
8212 | 5247 |
]. |
5248 |
||
5249 |
definingNode := node whoDefines:nm. |
|
5250 |
definingNode isNil ifTrue:[ |
|
11210 | 5251 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 5252 |
"/aBlock value:'xIII' value:'instVar'. |
11210 | 5253 |
receiver class isMetaclass ifTrue:[ |
5254 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
5255 |
] ifFalse:[ |
|
5256 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
5257 |
]. |
|
5258 |
^ self |
|
5259 |
]. |
|
5260 |
||
5261 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
5262 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
5263 |
aBlock value:'' value:'private class ',nmBold. |
|
5264 |
^ self |
|
5265 |
]. |
|
5266 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
5267 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
5268 |
^ self |
|
5269 |
]. |
|
5270 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
5271 |
|pool| |
|
5272 |
||
5273 |
pool := Smalltalk at:eachPoolName. |
|
5274 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
5275 |
(pool classVarNames includes:nm) ifTrue:[ |
|
5276 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
5277 |
^ self |
|
5278 |
]. |
|
5279 |
]. |
|
5280 |
(Smalltalk includesKey:nm asSymbol) ifTrue:[ |
|
5281 |
(Smalltalk at:nm asSymbol) isClass ifTrue:[ |
|
5282 |
aBlock value:'class: ',nmBold value:nil. |
|
5283 |
] ifFalse:[ |
|
5284 |
aBlock value:(Smalltalk at:nm asSymbol) value:'global ',nmBold. |
|
5285 |
]. |
|
5286 |
^ self |
|
5287 |
]. |
|
5288 |
aBlock value:'' value:'unknown'. |
|
5289 |
^ self |
|
8212 | 5290 |
]. |
5291 |
"/definingNode printCR. |
|
5292 |
||
5293 |
definingNode isMethod ifTrue:[ |
|
11210 | 5294 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
5295 |
varIdx ~~ 0 ifTrue:[ |
|
5296 |
Error |
|
5297 |
handle:[:ex | ] |
|
5298 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
5299 |
^ self |
|
5300 |
]. |
|
5301 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
5302 |
varIdx ~~ 0 ifTrue:[ |
|
5303 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
5304 |
Error |
|
5305 |
handle:[:ex | ] |
|
5306 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
5307 |
^ self |
|
5308 |
] |
|
5309 |
]. |
|
8212 | 5310 |
]. |
5311 |
||
5312 |
definingNode isBlock ifTrue:[ |
|
11210 | 5313 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
5314 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
5315 |
varIdx ~~ 0 ifTrue:[ |
|
5316 |
"/ am I in this block ? |
|
5317 |
(actualContext lineNumber notNil |
|
5318 |
and:[ definingNode lastLineNumber notNil |
|
5319 |
and:[ (actualContext lineNumber |
|
5320 |
between:definingNode firstLineNumber |
|
5321 |
and:definingNode lastLineNumber) |
|
5322 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
5323 |
ifTrue:[ |
|
5324 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
5325 |
^ self |
|
5326 |
]. |
|
8214 | 5327 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
11210 | 5328 |
^ self |
5329 |
] |
|
5330 |
]. |
|
8212 | 5331 |
]. |
5332 |
||
5333 |
parentNode := definingNode parent. |
|
5334 |
||
5335 |
[parentNode notNil] whileTrue:[ |
|
5336 |
"/'isMethod ' print. parentNode isMethod printCR. |
|
11210 | 5337 |
parentNode isMethod ifTrue:[ |
5338 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
5339 |
varIdx ~~ 0 ifTrue:[ |
|
5340 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
5341 |
Error |
|
5342 |
handle:[:ex | ] |
|
5343 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
5344 |
^ self |
|
5345 |
] |
|
5346 |
]. |
|
5347 |
]. |
|
8212 | 5348 |
"/'isBlock ' print. parentNode isBlock printCR. |
11210 | 5349 |
parentNode isBlock ifTrue:[ |
5350 |
"/ we dont have any information on the inlineability |
|
5351 |
"/ of this block here (RBParser does not know what |
|
5352 |
"/ the compiler does. |
|
5353 |
"/ therefore, it is questionable if we can use the |
|
5354 |
"/ contexts home context here. |
|
5355 |
"/ am I in this block ? |
|
5356 |
con := actualContext. |
|
5357 |
[con notNil |
|
5358 |
and:[ parentNode lastLineNumber notNil |
|
5359 |
and:[ con lineNumber notNil |
|
5360 |
and:[ con lineNumber |
|
5361 |
between:parentNode firstLineNumber |
|
5362 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
5363 |
con := con sender. |
|
5364 |
]. |
|
5365 |
con notNil ifTrue:[ |
|
5366 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
5367 |
varIdx ~~ 0 ifTrue:[ |
|
5368 |
Error |
|
5369 |
handle:[:ex | ] |
|
5370 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
5371 |
^ self |
|
5372 |
]. |
|
5373 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
5374 |
varIdx ~~ 0 ifTrue:[ |
|
5375 |
Error |
|
5376 |
handle:[:ex | ] |
|
5377 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
5378 |
^ self |
|
5379 |
]. |
|
5380 |
]. |
|
5381 |
]. |
|
5382 |
parentNode := parentNode parent. |
|
8212 | 5383 |
]. |
8214 | 5384 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 5385 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
5386 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 5387 |
! ! |
5388 |
||
5389 |
!DebugView methodsFor:'private queries'! |
|
5390 |
||
5391 |
isAborting |
|
5392 |
^ exitAction == #abort |
|
5393 |
! |
|
5394 |
||
5395 |
setOfHiddenCallingSelectors |
|
5396 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
5397 |
! |
|
5398 |
||
5399 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
5400 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
5401 |
! ! |
|
5402 |
||
9922 | 5403 |
!DebugView methodsFor:'private-breakpoints'! |
5404 |
||
11210 | 5405 |
addIgnoredHaltForCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey forAll:aBoolean |
9922 | 5406 |
|haltingContext haltingMethod lineNrOfHalt| |
5407 |
||
5408 |
aBoolean ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5409 |
haltingMethod := #all |
9922 | 5410 |
] ifFalse:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5411 |
haltingContext := self findHaltingContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5412 |
haltingContext isNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5413 |
Transcript showCR:'no halting context found'. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5414 |
^ self |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5415 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5416 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5417 |
haltingMethod := haltingContext method. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5418 |
lineNrOfHalt := haltingContext lineNumber. |
9922 | 5419 |
]. |
5420 |
||
5421 |
self class |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5422 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
11210 | 5423 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
5424 |
||
5425 |
"Created: / 27-01-2012 / 11:31:12 / cg" |
|
9922 | 5426 |
! |
5427 |
||
5428 |
canAddBreakpoint |
|
5429 |
|m| |
|
5430 |
||
5431 |
m := contextView middleButtonMenu. |
|
5432 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
5433 |
! |
|
5434 |
||
5435 |
canRemoveBreakpoint |
|
5436 |
|m| |
|
5437 |
||
5438 |
m := contextView middleButtonMenu. |
|
5439 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
5440 |
! |
|
5441 |
||
5442 |
findHaltingContext |
|
5443 |
|haltSelectors| |
|
5444 |
||
5445 |
haltSelectors := self haltSelectors. |
|
5446 |
||
10205 | 5447 |
contextArray keysAndValuesDo:[:idx :con | |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5448 |
|sel con2 sel2 method| |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5449 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5450 |
sel := con selector. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5451 |
(haltSelectors includes:sel) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5452 |
(method := con method) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5453 |
method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5454 |
con2 := contextArray at:idx+1. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5455 |
sel2 := con2 selector. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5456 |
(haltSelectors includes:sel2) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5457 |
con2 method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5458 |
^ contextArray at:idx+2. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5459 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5460 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5461 |
^ contextArray at:idx+1 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5462 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5463 |
method mclass == Breakpoint ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5464 |
(contextArray at:idx+1) infoPrintCR. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5465 |
^ contextArray at:idx+1 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5466 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5467 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5468 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5469 |
con method isWrapped ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5470 |
^ con |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5471 |
]. |
9922 | 5472 |
]. |
5473 |
^ nil |
|
5474 |
||
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5475 |
"Modified: / 27-01-2012 / 11:06:02 / cg" |
9922 | 5476 |
! |
5477 |
||
5478 |
ignoreBreakpoints |
|
5479 |
^ ignoreBreakpoints |
|
5480 |
||
5481 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
5482 |
! ! |
|
5483 |
||
7823 | 5484 |
!DebugView methodsFor:'private-cache handling'! |
5485 |
||
5486 |
cacheMyself |
|
5487 |
"remember myself for next debug session" |
|
5488 |
||
5489 |
"caching the last debugger will make the next debugger appear |
|
5490 |
faster, since no resources have to be allocated in the display. |
|
5491 |
We have to be careful to release all refs to the debuggee, though. |
|
5492 |
Otherwise, the GC will not be able to release it." |
|
5493 |
||
5494 |
windowGroup notNil ifTrue:[ |
|
11210 | 5495 |
windowGroup setProcess:nil. |
7823 | 5496 |
]. |
5497 |
||
5498 |
self releaseDebuggee. |
|
5499 |
||
5500 |
cachable ~~ true ifTrue:[^ self]. |
|
5501 |
||
5502 |
"/ |
|
5503 |
"/ only cache if I am on the Display |
|
5504 |
"/ |
|
5505 |
device == Display ifTrue:[ |
|
11210 | 5506 |
exclusive ifTrue:[ |
5507 |
CachedExclusive := self |
|
5508 |
] ifFalse:[ |
|
5509 |
CachedDebugger := self |
|
5510 |
]. |
|
7823 | 5511 |
]. |
5512 |
||
5513 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
11210 | 5514 |
ObjectMemory stepInterruptHandler:nil |
7823 | 5515 |
]. |
5516 |
||
5517 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
5518 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
5519 |
! |
|
5520 |
||
5521 |
isCached |
|
5522 |
"tell wether we are a cached debugger" |
|
5523 |
||
5524 |
CachedExclusive == self ifTrue:[ |
|
11210 | 5525 |
^ true. |
7823 | 5526 |
]. |
5527 |
CachedDebugger == self ifTrue:[ |
|
11210 | 5528 |
^ true. |
7823 | 5529 |
]. |
5530 |
||
5531 |
^ false. |
|
5532 |
||
5533 |
"Created: 10.7.1997 / 15:22:43 / stefan" |
|
5534 |
! |
|
5535 |
||
5536 |
releaseDebuggee |
|
5537 |
"We have to be careful to release all refs to the debuggee, |
|
5538 |
because we may be in the cache. |
|
5539 |
Otherwise, the GC will not be able to release it" |
|
5540 |
||
5541 |
busy := false. |
|
5542 |
||
5543 |
codeView acceptAction:nil. |
|
5544 |
codeView doItAction:nil. |
|
5545 |
codeView contents:nil. |
|
5546 |
||
5547 |
receiverInspector release. |
|
5548 |
contextInspector release. |
|
5549 |
inspectedProcess := nil. |
|
5550 |
contextArray := nil. |
|
5551 |
selectedContext := actualContext := firstContext := nil. |
|
5552 |
steppedContext := wrapperContext := nil. |
|
5553 |
catchBlock := nil. |
|
5554 |
grabber := nil. |
|
5555 |
self autoUpdateOff. |
|
5556 |
||
5557 |
"Created: / 10.7.1997 / 14:57:51 / stefan" |
|
5558 |
"Modified: / 10.7.1997 / 15:50:38 / stefan" |
|
5559 |
"Modified: / 17.11.2001 / 22:58:17 / cg" |
|
5560 |
! |
|
5561 |
||
5562 |
uncacheMyself |
|
5563 |
"do not remember myself any longer for next debug session" |
|
5564 |
||
5565 |
cachable := false. |
|
5566 |
||
5567 |
CachedExclusive == self ifTrue:[ |
|
11210 | 5568 |
CachedExclusive := nil. |
7823 | 5569 |
]. |
5570 |
CachedDebugger == self ifTrue:[ |
|
11210 | 5571 |
CachedDebugger := nil. |
7823 | 5572 |
]. |
5573 |
OpenDebuggers notNil ifTrue:[ |
|
11210 | 5574 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 5575 |
]. |
5576 |
||
5577 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
5578 |
! ! |
|
5579 |
||
10628 | 5580 |
!DebugView methodsFor:'private-code view'! |
5581 |
||
5582 |
codeAspect |
|
5583 |
||
5584 |
^#method |
|
5585 |
||
5586 |
"Created: / 27-07-2011 / 13:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5587 |
! ! |
|
5588 |
||
7823 | 5589 |
!DebugView methodsFor:'private-context handling'! |
5590 |
||
266 | 5591 |
setContext:aContext |
5592 |
"show calling chain from aContext in the walk-back listview" |
|
5593 |
||
641 | 5594 |
^ 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
|
5595 |
|
641 | 5596 |
"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
|
5597 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5598 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5599 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5600 |
"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
|
5601 |
Most complications here arise from filtering less-interesting contexts |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5602 |
if not in verbose-context mode." |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5603 |
|
3702 | 5604 |
|con text method caller caller2 called called2 m count c cc |
3447 | 5605 |
suspendContext calledBySuspendContext nm h calledContext| |
266 | 5606 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5607 |
(contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5608 |
"no change" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5609 |
^ false |
266 | 5610 |
]. |
5611 |
||
8170 | 5612 |
isStoppedAtHaltOrBreakPoint := false. |
939 | 5613 |
firstContext := aContext. |
5614 |
||
266 | 5615 |
m := contextView middleButtonMenu. |
5616 |
m notNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5617 |
m disable:#showMore. |
266 | 5618 |
]. |
3269 | 5619 |
canShowMore := false. |
266 | 5620 |
|
5621 |
aContext isNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5622 |
text := Array with:'** no context **'. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5623 |
contextArray := nil. |
266 | 5624 |
] ifFalse:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5625 |
text := OrderedCollection new:nChainShown. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5626 |
contextArray := OrderedCollection new:nChainShown. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5627 |
con := aContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5628 |
calledContext := nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5629 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5630 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5631 |
"/ with dense backtrace, hide the ProcessorScheduler |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5632 |
"/ contexts at the top; look for a Process>>suspend* |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5633 |
"/ context within the first 10 contexts |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5634 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5635 |
suspendContext := nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5636 |
c := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5637 |
1 to:10 do:[:i | |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5638 |
|sel| |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5639 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5640 |
c notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5641 |
(sel := c selector) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5642 |
((sel isSymbol and:[sel startsWith:'suspend']) |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5643 |
and:[c receiver isMemberOf:Process]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5644 |
suspendContext := c. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5645 |
calledBySuspendContext := cc. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5646 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5647 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5648 |
cc := c. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5649 |
c := c sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5650 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5651 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5652 |
suspendContext notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5653 |
con := suspendContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5654 |
calledContext := calledBySuspendContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5655 |
suspendContext := nil |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5656 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5657 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5658 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5659 |
con notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5660 |
"/ hide the halt implementation |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5661 |
(self haltSelectors includes:con selector) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5662 |
(method := con method) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5663 |
method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5664 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5665 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5666 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5667 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5668 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5669 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5670 |
method mclass == Breakpoint ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5671 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5672 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5673 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5674 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5675 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5676 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5677 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5678 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5679 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5680 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5681 |
" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5682 |
get them all |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5683 |
" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5684 |
count := 0. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5685 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5686 |
(self haltSelectors includes:con selector) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5687 |
(method := con method) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5688 |
method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5689 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5690 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5691 |
method mclass == Breakpoint ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5692 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5693 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5694 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5695 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5696 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5697 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5698 |
[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5699 |
DebuggingDebugger == true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5700 |
'showingContext1: (' print. con print. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5701 |
') --> ' print. (self showingContext1:con calling:calledContext) printCR. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5702 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5703 |
self showingContext1:con calling:calledContext |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5704 |
] whileFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5705 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5706 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5707 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5708 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5709 |
DebuggingDebugger == true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5710 |
'showingContext2: (' print. con print. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5711 |
') --> ' print. (self showingContext2:con nesting:count) printCR. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5712 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5713 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5714 |
(self showingContext2:con nesting:count) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5715 |
"/ ignore it, if its in the same |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5716 |
"/ method as the previous context |
3447 | 5717 |
"/ (verboseBacktrace ~~ true |
10205 | 5718 |
"/ and:[count > 0 |
3447 | 5719 |
"/ and:[contextArray last method == con method |
10205 | 5720 |
"/ and:[(contextArray last isBlockContext not |
3447 | 5721 |
"/ & con isBlockContext not) not ]]]) ifTrue:[ |
5722 |
"/ "/ skip it, if its in the same method |
|
5723 |
"/ "/ as the called context. |
|
5724 |
"/ ] ifFalse:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5725 |
contextArray add:con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5726 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5727 |
(MoreDebuggingDetail == true) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5728 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5729 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5730 |
Error |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5731 |
handle:[:ex | nm := '???' ] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5732 |
do:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5733 |
nm := self contextListEntryFor:con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5734 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5735 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5736 |
text add:nm. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5737 |
count := count + 1. |
3447 | 5738 |
"/ ]. |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5739 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5740 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5741 |
"/ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5742 |
"/ kludge: if its a wrapped method, then hide the wrap-call |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5743 |
"/ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5744 |
method := con method. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5745 |
(method notNil and:[method isWrapped]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5746 |
called := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5747 |
caller := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5748 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5749 |
called2 := caller. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5750 |
caller2 := caller sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5751 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5752 |
calledContext := called2. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5753 |
con := caller2 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5754 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5755 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5756 |
caller := caller2 := nil |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5757 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5758 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5759 |
"/ with dense backtrace, skip the doIt methods context |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5760 |
"/ (its dummy anyway) and fake that contexts name |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5761 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5762 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5763 |
(con isBlockContext |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5764 |
and:[(h := con home) == con sender |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5765 |
and:[h notNil |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5766 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5767 |
and:[h method who isNil]]]]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5768 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5769 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5770 |
text removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5771 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5772 |
text add:(self contextListEntryFor:con methodHome). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5773 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5774 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5775 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5776 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5777 |
"/ with dense backtrace, dont show below the doIt |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5778 |
( verboseBacktrace ~~ true |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5779 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5780 |
con := nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5781 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5782 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5783 |
con := con sender |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5784 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5785 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5786 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5787 |
" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5788 |
did we reach the end ? |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5789 |
" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5790 |
(con isNil or:[con sender isNil]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5791 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5792 |
"/ the very last one is the startup context |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5793 |
"/ (in main) - it has nil as receiver and nil as selector |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5794 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5795 |
(contextArray notEmpty |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5796 |
and:[contextArray last selector isNil]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5797 |
contextArray removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5798 |
text removeLast |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5799 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5800 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5801 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5802 |
"/ in dense mode, remove the process startup |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5803 |
"/ contexts (if any) |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5804 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5805 |
(contextArray size > 0 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5806 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5807 |
con selector == #start ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5808 |
contextArray removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5809 |
text removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5810 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5811 |
[contextArray size > 0 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5812 |
and:[contextArray last methodHome == con]] whileTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5813 |
contextArray removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5814 |
text removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5815 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5816 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5817 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5818 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5819 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5820 |
m notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5821 |
m enable:#showMore. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5822 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5823 |
canShowMore := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5824 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5825 |
]. |
266 | 5826 |
]. |
5827 |
||
5828 |
contextView setList:text. |
|
944 | 5829 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5830 |
releaseInspectors ifTrue:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5831 |
receiverInspector release. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5832 |
contextInspector release. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5833 |
]. |
266 | 5834 |
|
5835 |
m notNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5836 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 5837 |
]. |
3511 | 5838 |
self updateMenuItems. |
266 | 5839 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5840 |
|
7797 | 5841 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5842 |
"Modified: / 27-01-2012 / 11:13:21 / cg" |
266 | 5843 |
! |
5844 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5845 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5846 |
"show calling chain from aContext in the walk-back listview. |
1213 | 5847 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5848 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5849 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5850 |
|
8152 | 5851 |
con := aContext. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5852 |
verboseBacktrace ifFalse:[ |
11210 | 5853 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
5854 |
con := con sender. |
|
5855 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
5856 |
con := con sender. |
|
5857 |
]. |
|
5858 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5859 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5860 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5861 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5862 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5863 |
"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
|
5864 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5865 |
|
3447 | 5866 |
showingContext1:aContext calling:calledContext |
7823 | 5867 |
"return false, if this (top) context is to be skipped. |
10205 | 5868 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 5869 |
the set of methods which are suppressed is my (claus's) own choice." |
5870 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5871 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 5872 |
|
5873 |
verboseBacktrace == true ifTrue:[ ^true ]. |
|
5874 |
aContext isNil ifTrue:[ ^true ]. |
|
5875 |
||
5876 |
sel := aContext selector. |
|
5877 |
rec := aContext receiver. |
|
5878 |
mthd := aContext method. |
|
5879 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
5880 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5881 |
"/ to avoid firing/waiting the lazy or future |
10205 | 5882 |
recIsException := (rec isLazyValue not) and:[rec isException]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5883 |
aContext sender notNil ifTrue:[ |
11210 | 5884 |
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
|
5885 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5886 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5887 |
DebuggingDebugger == true ifTrue:[ |
11210 | 5888 |
'showingContext1: (' print. aContext print. |
5889 |
') calling: (' print. calledContext print. |
|
5890 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5891 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5892 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5893 |
(#(doCallHandler: doRaise |
3447 | 5894 |
) includes:sel) |
11210 | 5895 |
ifTrue:[ |
5896 |
recIsException ifTrue:[ ^ false]. |
|
5897 |
]. |
|
3447 | 5898 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5899 |
(#(raise raiseRequest |
3447 | 5900 |
) includes:sel) |
11210 | 5901 |
ifTrue:[ |
5902 |
recIsException ifTrue:[ |
|
5903 |
(senderRec isLazyValue not |
|
5904 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
5905 |
]. |
|
5906 |
]. |
|
3447 | 5907 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5908 |
(#(doWhile: |
3447 | 5909 |
) includes:sel) |
11210 | 5910 |
ifTrue:[ |
5911 |
rec isBlock ifTrue:[ |
|
5912 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
5913 |
]. |
|
5914 |
]. |
|
3447 | 5915 |
|
8620 | 5916 |
calledContext notNil ifTrue:[ |
11210 | 5917 |
calledSel := calledContext selector. |
5918 |
calledRec := calledContext receiver. |
|
5919 |
||
5920 |
calledRec isBlock ifTrue:[ |
|
5921 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
5922 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
5923 |
]. |
|
5924 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
5925 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8620 | 5926 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5927 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5928 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5929 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5930 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5931 |
"/ |
10205 | 5932 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5933 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5934 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5935 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5936 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5937 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5938 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5939 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5940 |
"/ ]. |
8620 | 5941 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5942 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5943 |
(#(handleDo:) includes:sel) |
11210 | 5944 |
ifTrue:[ |
5945 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
5946 |
]. |
|
10205 | 5947 |
(#( |
11210 | 5948 |
withCursor:do: |
5949 |
withWaitCursorDo: |
|
3447 | 5950 |
) includes:sel) |
11210 | 5951 |
ifTrue:[ |
5952 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
5953 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
5954 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
5955 |
]. |
|
10205 | 5956 |
|
5957 |
(#( |
|
11210 | 5958 |
wait |
5959 |
waitWithTimeout: |
|
5960 |
waitWithTimeoutMs: |
|
3447 | 5961 |
) includes:sel) |
11210 | 5962 |
ifTrue:[ |
5963 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
5964 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
5965 |
]. |
|
3447 | 5966 |
|
5967 |
^ true |
|
5968 |
||
9662 | 5969 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
5970 |
"Modified: / 08-12-2010 / 18:21:02 / cg" |
|
3447 | 5971 |
! |
5972 |
||
5973 |
showingContext2:aContext nesting:nesting |
|
7823 | 5974 |
"return false, if this (intermediate) context is to be skipped. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5975 |
Here, we hide some well known methods, which are usually |
10205 | 5976 |
not too interesting; |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5977 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 5978 |
|
10205 | 5979 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5980 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5981 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5982 |
verboseBacktrace ifTrue:[^ true]. |
3447 | 5983 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5984 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5985 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5986 |
sel := aContext selector. |
939 | 5987 |
mClass := aContext methodClass. |
5988 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5989 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5990 |
sender notNil ifTrue:[ |
11210 | 5991 |
senderSelector := sender selector. |
5992 |
senderReceiver := sender receiver. |
|
5993 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5994 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5995 |
|
939 | 5996 |
sel == #withCursor:do: ifTrue:[ |
11210 | 5997 |
(mClass == WindowGroup) ifTrue:[^ false]. |
5998 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 5999 |
]. |
6000 |
(sel == #withExecuteCursorDo: |
|
6001 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
11210 | 6002 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 6003 |
]. |
6004 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
6005 |
(sel == #do: |
6600 | 6006 |
or:[sel == #from:to:do: |
6601 | 6007 |
or:[sel == #keysAndValuesDo: |
6008 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
11210 | 6009 |
mClass == Array ifTrue:[^ false]. |
6010 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
6011 |
mClass == Set ifTrue:[^ false]. |
|
6012 |
mClass == Dictionary ifTrue:[^ false]. |
|
6013 |
mClass == Interval ifTrue:[^ false]. |
|
10205 | 6014 |
]. |
6015 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6016 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6017 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6018 |
or:[sel == #perform:with:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6019 |
or:[sel == #perform:with:with:with:with:]]]]) |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6020 |
ifTrue:[ |
11210 | 6021 |
nesting == 0 ifTrue:[^ true]. |
6022 |
mClass == Array ifTrue:[^ false]. |
|
6023 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6024 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6025 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6026 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6027 |
|
939 | 6028 |
(mClass == Object) ifTrue:[ |
11210 | 6029 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 6030 |
]. |
6031 |
||
6032 |
(mClass == Method) ifTrue:[ |
|
11210 | 6033 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 6034 |
]. |
6035 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
6036 |
(mClass == SmallInteger) ifTrue:[ |
11210 | 6037 |
(sel == #to:do:) ifTrue:[^ false]. |
6038 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
6039 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
6040 |
|
939 | 6041 |
(mClass == Block) ifTrue:[ |
11210 | 6042 |
sel == #ensure: ifTrue:[^ false]. |
6043 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
6044 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
6045 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
6046 |
sel == #on:do: ifTrue:[^ false]. |
|
6047 |
||
6048 |
sel == #value ifTrue:[^ false]. |
|
6049 |
sel == #value: ifTrue:[^ false]. |
|
6050 |
sel == #value:value: ifTrue:[^ false]. |
|
6051 |
sel == #value:value:value: ifTrue:[^ false]. |
|
6052 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
6053 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
6054 |
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
|
6055 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6056 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6057 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6058 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6059 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6060 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6061 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6062 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6063 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6064 |
"/ 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
|
6065 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6066 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6067 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6068 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6069 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6070 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6071 |
|
11210 | 6072 |
aContext home notNil ifTrue:[ |
6073 |
aContext home receiver isLazyValue ifFalse:[ |
|
6074 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
|
6075 |
(aContext home selector == #wait) ifTrue:[^ false]. |
|
6076 |
(aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
6077 |
] |
|
6078 |
] |
|
6079 |
] |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6080 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6081 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
6082 |
(rec isExceptionHandler) ifTrue:[ |
11210 | 6083 |
sel == #handle:do: ifTrue:[^ false]. |
6084 |
sel == #handleDo: ifTrue:[^ false]. |
|
6085 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
6086 |
sel == #answer:do: ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6087 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
6088 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
11210 | 6089 |
sel == #doRaise ifTrue:[^ false]. |
6090 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
6091 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
6092 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
6093 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6094 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6095 |
(mClass == Context) ifTrue:[ |
11210 | 6096 |
sel == #unwind ifTrue:[^ false]. |
6097 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6098 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6099 |
(mClass == ProcessorScheduler) ifTrue:[ |
11210 | 6100 |
sel == #interruptActive ifTrue:[^ false]. |
6101 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
6102 |
sel == #suspend: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6103 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6104 |
mClass == Process ifTrue:[ |
11210 | 6105 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6106 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6107 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6108 |
|
9662 | 6109 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
6110 |
"Modified: / 08-12-2010 / 18:21:45 / cg" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
6111 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
6112 |
|
4859 | 6113 |
!DebugView methodsFor:'private-control loop'! |
266 | 6114 |
|
6115 |
controlLoop |
|
6116 |
"this is a kludge: |
|
11210 | 6117 |
start a dispatchloop which exits when |
6118 |
either continue, return or step is pressed |
|
266 | 6119 |
" |
6120 |
||
6121 |
haveControl := true. |
|
664 | 6122 |
[ |
11210 | 6123 |
[haveControl] whileTrue:[ |
6124 |
self controlLoopCatchingErrors |
|
6125 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
6126 |
] ensure:[ |
11210 | 6127 |
catchBlock := nil. |
6128 |
haveControl := false |
|
266 | 6129 |
]. |
664 | 6130 |
|
6131 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 6132 |
! |
6133 |
||
6134 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
6135 |
"this is the debuggers own private event handling loop; |
1187 | 6136 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
6137 |
|
266 | 6138 |
"setup a self removing catch-block" |
6139 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
6140 |
||
6141 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
11210 | 6142 |
"if we do not have multiple processes or its a system process |
6143 |
we start another dispatch loop, which exits when |
|
6144 |
either continue, return or step is pressed |
|
6145 |
or (via the catchBlock) if an error occurs. |
|
6146 |
Since our display is an extra exclusive one, |
|
6147 |
all processing for normal views stops here ... |
|
6148 |
" |
|
6149 |
||
6150 |
WindowGroup setActiveGroup:windowGroup. |
|
6151 |
SignalSet anySignal handle:[:ex | |
|
6152 |
|signal| |
|
6153 |
||
6154 |
signal := ex signal. |
|
6155 |
||
6156 |
self showError:'*** Error in modal debugger: |
|
266 | 6157 |
|
334 | 6158 |
>>>> Signal: ' , signal printString , ' |
266 | 6159 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 6160 |
>>>> From: ' , ex suspendedContext sender printString , ' |
6161 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
6162 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
6163 |
>>>> : ' , 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
|
6164 |
>>>> : ' , 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
|
6165 |
>>>> : ' , 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
|
6166 |
>>>> : ' , 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
|
6167 |
>>>> : ' , 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
|
6168 |
>>>> : ' , 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
|
6169 |
>>>> : ' , 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
|
6170 |
>>>> : ' , 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
|
6171 |
>>>> : ' , 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
|
6172 |
>>>> : ' , 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
|
6173 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 6174 |
>>>> Message: ' , ex description , ' |
266 | 6175 |
|
1187 | 6176 |
caught & ignored.'. |
11210 | 6177 |
ex return. |
6178 |
] do:[ |
|
6179 |
UserNotification handle:[:ex | |
|
6180 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
|
6181 |
ex proceed |
|
6182 |
]. |
|
6183 |
self showError:ex description. |
|
6184 |
ex proceed. |
|
6185 |
] do:[ |
|
6186 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
|
6187 |
haveControl]. |
|
6188 |
] |
|
6189 |
]. |
|
6190 |
WindowGroup setActiveGroup:nil. |
|
266 | 6191 |
] ifFalse:[ |
11210 | 6192 |
"we do have multiple processes - |
6193 |
simply enter the DebugViews-Windowgroup event loop. |
|
6194 |
effectively suspending event processing for the currently |
|
6195 |
active group. |
|
6196 |
" |
|
6197 |
SignalSet anySignal handle:[:ex | |
|
6198 |
|answer signal eMsg| |
|
6199 |
||
6200 |
signal := ex signal. |
|
6201 |
||
6202 |
DebuggingDebugger ~~ true ifTrue:[ |
|
6203 |
(signal == ActivityNotification) ifTrue:[ |
|
6204 |
ex proceed |
|
6205 |
]. |
|
6206 |
"/ |
|
6207 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
6208 |
"/ |
|
6209 |
ex catchInDebugger ifTrue:[ |
|
6210 |
'DebugView [info]: ',signal printString,'-signal in debugger cought for close' infoPrintCR. |
|
6211 |
self destroy. |
|
6212 |
ex reject |
|
6213 |
]. |
|
6214 |
||
6215 |
"/ |
|
6216 |
"/ ignore recursive breakpoints |
|
6217 |
"/ |
|
6218 |
(signal isControlInterrupt) ifTrue:[ |
|
6219 |
ignoreBreakpoints == true ifTrue:[ |
|
6220 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
6221 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
6222 |
ex proceed |
|
6223 |
]. |
|
6224 |
]. |
|
6225 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
6226 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
6227 |
answer := Dialog |
|
6228 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
6229 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
6230 |
values:#( #proceed #close ) |
|
6231 |
default:#close. |
|
6232 |
answer == #close ifTrue:[ |
|
6233 |
self destroy. |
|
6234 |
ex reject |
|
6235 |
]. |
|
6236 |
ex return. |
|
6237 |
]. |
|
6238 |
signal == RecursiveExceptionError ifTrue:[ |
|
6239 |
(ex parameter signal == BreakPointInterrupt) |
|
6240 |
ifTrue:[ |
|
6241 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
6242 |
ex proceed. |
|
6243 |
]. |
|
6244 |
||
6245 |
self showError:'*** Recursive error in debugger: |
|
266 | 6246 |
|
6247 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 6248 |
>>>> ' , ex parameter signal printString , ' |
266 | 6249 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 6250 |
>>>> From: ' , ex suspendedContext sender printString , ' |
6251 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
6252 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
6253 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 6254 |
>>>> Message: ' , ex description , ' |
266 | 6255 |
|
1187 | 6256 |
caught & ignored.'. |
11210 | 6257 |
ex return |
6258 |
]. |
|
6259 |
]. |
|
6260 |
||
6261 |
self topView raiseDeiconified. |
|
6262 |
||
6263 |
eMsg := ex description. |
|
6264 |
(ex signal isControlInterrupt) ifTrue:[ |
|
6265 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
6266 |
]. |
|
6267 |
Dialog aboutToOpenBoxNotificationSignal |
|
6268 |
handle:[:ex | ex proceed ] |
|
6269 |
do:[ |
|
6270 |
answer := Dialog |
|
6271 |
choose:('Error in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
|
6272 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
6273 |
values:#( #proceed #cancel #debug ) |
|
6274 |
default:#cancel. |
|
6275 |
]. |
|
6276 |
answer == #debug ifTrue:[ |
|
6277 |
'DebugView [info]: cought exception - debugging' infoPrintCR. |
|
6278 |
Debugger |
|
6279 |
enterUnconditional:(ex suspendedContext) |
|
6280 |
withMessage:'Error in debugger: ' , eMsg |
|
6281 |
mayProceed:true. |
|
6282 |
ex proceed. |
|
6283 |
]. |
|
6284 |
answer == #proceed ifTrue:[ |
|
6285 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
6286 |
ex proceed. |
|
6287 |
]. |
|
6288 |
'DebugView [info]: cought exception - returning' infoPrintCR. |
|
6289 |
ex return. |
|
6290 |
] do:[ |
|
6291 |
"/ make certain that sub-debuggers, inspectors etc. |
|
6292 |
"/ come up on my device. |
|
6293 |
Screen currentScreenQuerySignal answer:device |
|
6294 |
do:[ |
|
6295 |
windowGroup |
|
6296 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
6297 |
true] |
|
6298 |
onLeave:[] |
|
6299 |
] |
|
6300 |
]. |
|
266 | 6301 |
]. |
6302 |
catchBlock := nil. |
|
6303 |
||
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
6304 |
"Created: / 24.11.1995 / 20:33:45 / cg" |
3447 | 6305 |
"Modified: / 18.11.2001 / 01:04:17 / cg" |
266 | 6306 |
! ! |
6307 |
||
0 | 6308 |
!DebugView methodsFor:'user interaction'! |
6309 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6310 |
checkIfCodeIsReallyModified |
6616 | 6311 |
|source| |
6312 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6313 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6314 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6315 |
currentMethod isNil ifTrue:[ |
11210 | 6316 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6317 |
]. |
6616 | 6318 |
source := currentMethod source. |
6319 |
source notNil ifTrue:[ |
|
11210 | 6320 |
source string = codeView contents string ifTrue:[ |
6321 |
^ false |
|
6322 |
]. |
|
6323 |
(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
|
6324 |
^ false |
|
6325 |
]. |
|
6616 | 6326 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6327 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6328 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6329 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6330 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6331 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6332 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6333 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6334 |
checkSelectionChangeAllowed:newSelection |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6335 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6336 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6337 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6338 |
and:[newSelection = contextView selection]) ifTrue:[ |
11210 | 6339 |
^ true |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6340 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6341 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6342 |
(self confirm:('Code modified - change selection anyway ?')) ifFalse:[ |
11210 | 6343 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6344 |
]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6345 |
codeView modified:false. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6346 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6347 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6348 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6349 |
|
266 | 6350 |
codeAccept:someCode |
6351 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
6352 |
and including selected method cannot be continued." |
|
6353 |
||
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6354 |
^ self codeAccept:someCode unwind:false "true" category:nil onCancel:nil |
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6355 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6356 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 6357 |
! |
6358 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6359 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
3427 | 6360 |
"user wants some code to be recompiled - must unwind stack since everything above |
6361 |
and including selected method cannot be continued." |
|
6362 |
||
6363 |
" |
|
6364 |
actually, this is not true, since the active methods will still be |
|
6365 |
executed correctly - however, the code shown in the debugger is no |
|
6366 |
longer in sync (showing the new code) with the executed code. |
|
6367 |
Therefore, we hide those contexts to avoid confusion .... |
|
6368 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
6369 |
||
6370 |
"walk up context chain and find highest context which is either the selected context, |
|
6371 |
or - if its a block-context - whose home is the selected context" |
|
6372 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6373 |
|con top newMethod| |
3427 | 6374 |
|
6375 |
codeView withWaitCursorDo:[ |
|
11210 | 6376 |
" |
6377 |
find the method-home context for this one |
|
6378 |
" |
|
6379 |
doUnwind ifTrue:[ |
|
6380 |
con := selectedContext. |
|
6381 |
top := con. |
|
6382 |
[con notNil] whileTrue:[ |
|
6383 |
(con methodHome == selectedContext) ifTrue:[ |
|
6384 |
top := con |
|
6385 |
]. |
|
6386 |
con := con sender |
|
6387 |
]. |
|
6388 |
]. |
|
6389 |
||
6390 |
"/ |
|
6391 |
"/ provide the classes nameSpace on a query; |
|
6392 |
"/ in case we accept while in another nameSpace context, |
|
6393 |
"/ (but for a class which is somewhere else) |
|
6394 |
"/ |
|
6395 |
(Class updateChangeFileQuerySignal, |
|
6396 |
Class updateChangeListQuerySignal, |
|
6397 |
Class updateHistoryLineQuerySignal) answer:true |
|
6398 |
do:[ |
|
6399 |
Class nameSpaceQuerySignal |
|
6400 |
answer:(aClass nameSpace) |
|
6401 |
do:[ |
|
6402 |
Class packageQuerySignal |
|
6403 |
answer:(aClass package ? PackageId noProjectID) |
|
6404 |
do:[ |
|
6405 |
codeView contents:someCode. |
|
6406 |
newMethod := aClass compilerClass |
|
6407 |
compile:someCode |
|
6408 |
forClass:aClass |
|
6409 |
inCategory:category |
|
6410 |
notifying:codeView. |
|
6411 |
]. |
|
6412 |
]. |
|
6413 |
]. |
|
6414 |
||
6415 |
inspecting ifFalse:[ |
|
6416 |
" |
|
6417 |
if it worked, remove everything up to and including top |
|
6418 |
from context chain |
|
6419 |
" |
|
6420 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
6421 |
codeView modified:false. |
|
6422 |
||
6423 |
doUnwind ifTrue:[ |
|
6424 |
selectedContext canReturn ifTrue:[ |
|
6425 |
self setContext:(top "sender"). |
|
6426 |
exitAction := #restart. |
|
6427 |
selectedContext setLineNumber:1. |
|
6428 |
self doRestart. |
|
6429 |
] ifFalse:[ |
|
6430 |
self setContext:(top sender). |
|
6431 |
exitAction := #return. |
|
6432 |
]. |
|
6433 |
||
6434 |
" |
|
6435 |
continue/step is no longer possible |
|
6436 |
" |
|
6437 |
"/ continueButton disable. |
|
6438 |
"/ canContinue := false. |
|
6439 |
]. |
|
6440 |
||
6441 |
contextView selection:1. |
|
6442 |
"/ self showSelection:1. |
|
6443 |
"/ contextView makeSelectionVisible. "/ scrollToLine:(selection - 1) |
|
6444 |
] ifFalse:[ |
|
6445 |
^ cancelAction value |
|
6446 |
] |
|
6447 |
]. |
|
3427 | 6448 |
]. |
6449 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
6450 |
"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
|
6451 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
3427 | 6452 |
! |
6453 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6454 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6455 |
"user wants some code to be recompiled - must unwind stack since everything above |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6456 |
and including selected method cannot be continued." |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6457 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6458 |
" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6459 |
actually, this is not true, since the active methods will still be |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6460 |
executed correctly - however, the code shown in the debugger is no |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6461 |
longer in sync (showing the new code) with the executed code. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6462 |
Therefore, we hide those contexts to avoid confusion .... |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6463 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6464 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6465 |
"walk up context chain and find highest context which is either the selected context, |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6466 |
or - if its a block-context - whose home is the selected context" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6467 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6468 |
|sel implementorClass method category| |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6469 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6470 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6471 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6472 |
"/ 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
|
6473 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6474 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6475 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6476 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6477 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6478 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6479 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6480 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6481 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6482 |
|
10628 | 6483 |
" |
6484 |
use class&selector to find the method for the compilation |
|
6485 |
and compile. |
|
6486 |
" |
|
6487 |
category := givenCategoryOrNil. |
|
6488 |
sel := selectedContext selector. |
|
6489 |
implementorClass := selectedContext methodClass. |
|
6490 |
implementorClass notNil ifTrue:[ |
|
6491 |
category isNil ifTrue:[ |
|
6492 |
method := selectedContext method. |
|
6493 |
method isNil ifTrue:[ |
|
6494 |
method := implementorClass compiledMethodAt:sel. |
|
6495 |
]. |
|
6496 |
category := method category |
|
6497 |
] |
|
6498 |
] ifFalse:[ |
|
6499 |
implementorClass := selectedContext receiver class. |
|
6500 |
implementorClass ~~ Object ifTrue:[ |
|
6501 |
implementorClass := Dialog |
|
6502 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
6503 |
initialAnswer:implementorClass name |
|
6504 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
6505 |
implementorClass size == 0 ifTrue:[ |
|
6506 |
^ cancelAction value "/ cancelled |
|
6507 |
]. |
|
6508 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
6509 |
implementorClass isNil ifTrue:[ |
|
6510 |
Dialog warn:'No such class'. |
|
6511 |
^ cancelAction value "/ cancelled |
|
6512 |
]. |
|
6513 |
]. |
|
6514 |
]. |
|
6515 |
||
6516 |
self |
|
6517 |
codeAccept:someCode |
|
6518 |
inClass:implementorClass |
|
6519 |
unwind:doUnwind |
|
6520 |
category:category |
|
6521 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6522 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6523 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6524 |
"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
|
6525 |
"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
|
6526 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6527 |
|
7912 | 6528 |
codeCompletion |
6529 |
|cls| |
|
6530 |
||
8212 | 6531 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 6532 |
|
7912 | 6533 |
cls := currentMethod mclass. |
8212 | 6534 |
cls isNil ifTrue:[ ^ self ]. |
6535 |
||
7912 | 6536 |
UserInformation handle:[:ex | |
11210 | 6537 |
ex proceed. |
7912 | 6538 |
] do:[ |
11210 | 6539 |
DoWhatIMeanSupport codeCompletionForClass:cls context:selectedContext codeView:codeView. |
7912 | 6540 |
]. |
6541 |
! |
|
6542 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6543 |
confirm:aString |
6971 | 6544 |
"open a modal yes-no dialog. |
6545 |
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
|
6546 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6547 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
11210 | 6548 |
^ true |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6549 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6550 |
^ super confirm:aString. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6551 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6552 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
6553 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
6554 |
"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
|
6555 |
Also sent to autoselect an interesting context on entry." |
0 | 6556 |
|
9235 | 6557 |
HaltInterrupt handle:[:ex | |
11210 | 6558 |
ignoreBreakpoints ifFalse:[ex reject]. |
6559 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
6560 |
ex proceed |
|
3447 | 6561 |
] do:[ |
11210 | 6562 |
self updateForContext:lineNr |
3269 | 6563 |
]. |
6564 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSĂgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
6565 |
|
3447 | 6566 |
"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
|
6567 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6568 |
|
10205 | 6569 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6570 |
stackInspector notNil ifTrue:[ |
11210 | 6571 |
stackInspector destroy. |
6572 |
stackInspector := nil. |
|
6573 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
6574 |
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
|
6575 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6576 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6577 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6578 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6579 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6580 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6581 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6582 |
sel notNil ifTrue:[ |
11210 | 6583 |
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
|
6584 |
] |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6585 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6586 |
"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
|
6587 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6588 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6589 |
processEvent:anEvent |
6129 | 6590 |
"filter keyboard events for popUp variable value display. |
6591 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6592 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6593 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6594 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6595 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6596 |
evView notNil ifTrue:[ |
11210 | 6597 |
focusView := evView windowGroup focusView. |
6598 |
focusView isNil ifTrue:[ |
|
6599 |
focusView := evView. |
|
6600 |
]. |
|
6601 |
||
6602 |
anEvent isKeyPressEvent ifTrue:[ |
|
6603 |
key := anEvent key. |
|
6604 |
rawKey := anEvent rawKey. |
|
6605 |
||
6606 |
inCodeView := (focusView == codeView |
|
6607 |
or:[focusView isComponentOf:codeView]). |
|
6608 |
inCodeView ifTrue:[ |
|
6609 |
key == #CodeCompletion ifTrue:[ |
|
6610 |
"/ complete the word before/under the cursor. |
|
6611 |
self sensor |
|
6612 |
pushUserEvent:#codeCompletion |
|
6613 |
for:self |
|
6614 |
withArguments:#(). |
|
6615 |
^ true |
|
6616 |
]. |
|
6617 |
]. |
|
6618 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6619 |
|
3602 | 6620 |
false ifTrue:[ |
11210 | 6621 |
anEvent isButtonReleaseEvent ifTrue:[ |
6622 |
anEvent view == codeView ifTrue:[ |
|
6623 |
(RBParser notNil and:[RBParser isLoaded]) |
|
6624 |
ifTrue:[ |
|
6625 |
self sensor |
|
6626 |
pushEvent:anEvent. "/ must be first in queue |
|
6627 |
||
6628 |
self sensor |
|
6629 |
pushUserEvent:#explainSelection |
|
6630 |
for:self |
|
6631 |
withArguments:nil. |
|
6632 |
^ true "/ eaten |
|
6633 |
] |
|
6634 |
] |
|
6635 |
]. |
|
3602 | 6636 |
]. |
6637 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6638 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6639 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6640 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6641 |
|
8212 | 6642 |
setCurrentMethod:aMethodOrNil |
6643 |
currentMethod := aMethodOrNil. |
|
6644 |
! |
|
6645 |
||
1327 | 6646 |
showSelection:lineNr |
6647 |
"user clicked on a header line - show selected code in textView. |
|
6648 |
Also sent to autoselect an interesting context on entry." |
|
6649 |
||
10205 | 6650 |
Notification |
11210 | 6651 |
handle: |
6652 |
[:ex | |
|
6653 |
"/ ex suspendedContext fullPrintAll. |
|
6654 |
Transcript showCR:ex description. |
|
6655 |
"/ Transcript showCR:ex parameter. |
|
6656 |
ex proceed |
|
6657 |
] |
|
6658 |
do: |
|
6659 |
[ |
|
6660 |
Error |
|
6661 |
handle: |
|
6662 |
[:ex | |
|
6663 |
|s con| |
|
6664 |
||
6665 |
ex signal isControlInterrupt |
|
6666 |
ifTrue:[ |
|
6667 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' infoPrintCR. |
|
6668 |
ex proceed |
|
6669 |
]. |
|
6670 |
||
6671 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' bindWith:ex suspendedContext) infoPrintCR. |
|
6672 |
||
6673 |
s := '' writeStream. |
|
6674 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
6675 |
s nextPutLine:'****'. |
|
6676 |
s nextPutAll: '**** '; nextPutLine:(ex description "withCRs"). |
|
6677 |
s nextPutLine:'****'. |
|
6678 |
con := ex suspendedContext. |
|
6679 |
s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6680 |
con := con sender. |
|
6681 |
HaltInterrupt ignoreIn:[ |
|
6682 |
con fullPrintAllOn:s. |
|
6683 |
]. |
|
5842 | 6684 |
"/ [con notNil] whileTrue:[ |
6685 |
"/ Error catch:[:ex | |
|
6686 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6687 |
"/ ]. |
|
4947 | 6688 |
"/ |
5842 | 6689 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
6690 |
"/ con := nil |
|
6691 |
"/ ] ifFalse:[ |
|
6692 |
"/ con := con sender. |
|
6693 |
"/ ] |
|
6694 |
"/ ]. |
|
11210 | 6695 |
codeView contents:(s contents). |
6696 |
ex return. |
|
6697 |
] |
|
6698 |
do: |
|
6699 |
[ |
|
6700 |
self doShowSelection:lineNr |
|
6701 |
] |
|
6702 |
] |
|
1327 | 6703 |
|
6815 | 6704 |
"Modified: / 04-07-2006 / 14:50:06 / cg" |
1327 | 6705 |
! |
6706 |
||
10205 | 6707 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6708 |
stackInspector isNil ifTrue:[ |
11210 | 6709 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
6710 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
6711 |
stackInspector := InspectorView |
|
6712 |
origin:(0.6 @ 0.0) |
|
6713 |
corner:(1.0 @ 1.0) |
|
6714 |
in:contextInspector superView. |
|
6715 |
stackInspector realize. |
|
6716 |
stackInspector fieldListLabel:'Stack'. |
|
6717 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6718 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6719 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6720 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6721 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6722 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6723 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6724 |
"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
|
6725 |
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
|
6726 |
|
56 | 6727 |
|con homeContext sel method code canAccept |
105 | 6728 |
implementorClass lineNrInMethod rec m line |
10205 | 6729 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 6730 |
codeSet highlighter evaluatorClass |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6731 |
canDefine callee searchClass originalMethod| |
3187 | 6732 |
|
6733 |
canDefine := false. |
|
8212 | 6734 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
6735 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6736 |
contextArray notNil ifTrue:[ |
10628 | 6737 |
lineNr <= contextArray size ifTrue:[ |
6738 |
con := contextArray at:lineNr. |
|
6739 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
6740 |
]. |
|
6741 |
" |
|
6742 |
clicking on the '** ...'-line shows more ... |
|
6743 |
" |
|
6744 |
con isNil ifTrue:[ |
|
6745 |
line := contextView list at:lineNr. |
|
6746 |
(line startsWith:'**') ifTrue:[ |
|
6747 |
self showMore. |
|
6748 |
lineNr >= contextArray size ifTrue:[ |
|
6749 |
contextView setSelection:lineNr. |
|
6750 |
con := contextArray at:lineNr ifAbsent:nil |
|
6751 |
] |
|
6752 |
]. |
|
6753 |
con isNil ifTrue:[ |
|
6754 |
codeView contents:nil. |
|
6755 |
^ self |
|
6756 |
]. |
|
6757 |
]. |
|
6758 |
||
6759 |
selectedContext := con. |
|
6760 |
m := contextView middleButtonMenu. |
|
6761 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
6762 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
6763 |
]. |
|
6764 |
||
6765 |
self withExecuteCursorDo:[ |
|
6766 |
codeSet := false. |
|
6767 |
||
6768 |
" |
|
6769 |
give it to the (lower right) inspector |
|
6770 |
" |
|
6771 |
Error handle:[:ex | |
|
6772 |
'DebugView [warning]: error while accessing context' errorPrintCR. |
|
6773 |
contextInspector inspect:nil. |
|
9479 | 6774 |
"/ ex reject. |
10628 | 6775 |
] do:[ |
6776 |
contextInspector inspect:con. |
|
6777 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
6778 |
]. |
|
6779 |
||
6780 |
"/ show a stack inspector sometimes |
|
6781 |
||
6782 |
con hasStackToShow ifTrue:[ |
|
6783 |
self showStackInspectorFor:con |
|
6784 |
] ifFalse:[ |
|
6785 |
self hideStackInspector |
|
6786 |
]. |
|
6787 |
||
6788 |
homeContext := con methodHome. |
|
6789 |
con canReturn ifTrue:[ |
|
6790 |
returnButton enable. restartButton enable. |
|
6791 |
] ifFalse:[ |
|
6792 |
returnButton disable. restartButton disable. |
|
6793 |
]. |
|
6794 |
||
6795 |
lineNrInMethod := con lineNumber. |
|
6796 |
||
6797 |
canAccept := false. |
|
6798 |
||
6799 |
homeContext isNil ifTrue:[ |
|
6800 |
" |
|
6801 |
mhmh - an optimized block |
|
6802 |
should get the block here, and get the method from |
|
6803 |
that one ... |
|
6804 |
But in the current version, there is no easy way to get to the block |
|
6805 |
since that one is not in the context. |
|
6806 |
A future new block calling scheme will fix this |
|
6807 |
(passing the block instead of the home as block argument). |
|
6808 |
" |
|
6809 |
||
6810 |
"temporary kludge - peek into the sender context. |
|
6811 |
If its a do-like method and there is a single block variable |
|
6812 |
in the args or temporaries, that must be the one. |
|
6813 |
This helps in some cases. |
|
6814 |
" |
|
6815 |
(sender := con sender) notNil ifTrue:[ |
|
6816 |
tryVars := false. |
|
6817 |
(selSender := sender selector) notNil ifTrue:[ |
|
6818 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
6819 |
tryVars := true. |
|
6820 |
] |
|
6821 |
]. |
|
6822 |
tryVars ifTrue:[ |
|
6823 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
6824 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
6825 |
possibleBlocks size == 1 ifTrue:[ |
|
6826 |
method := possibleBlocks first method. |
|
6827 |
]. |
|
6828 |
] |
|
6829 |
]. |
|
6830 |
] ifFalse:[ |
|
6831 |
"fetch rec here - so we won't need context in doItAction" |
|
6832 |
rec := homeContext receiver. |
|
6833 |
sel := homeContext selector. |
|
6834 |
sel notNil ifTrue:[ |
|
6835 |
canAccept := true. |
|
6836 |
||
6837 |
implementorClass := homeContext methodClass. |
|
6838 |
implementorClass isNil ifTrue:[ |
|
6839 |
Error handle:[:ex | |
|
6840 |
ex signal == BreakPointInterrupt ifTrue:[ |
|
6841 |
ex proceed. |
|
6842 |
]. |
|
6843 |
code := 'error while asking method for its source'. |
|
6844 |
code := code , Character cr , ex signal printString. |
|
6845 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6846 |
||
6847 |
canAccept := false. |
|
6848 |
ex return. |
|
6849 |
] do:[ |
|
6850 |
" |
|
6851 |
special: look if this context was created by |
|
6852 |
valueWithReceiver kind of method invocation; |
|
6853 |
if so, grab the method from the sender and show it |
|
6854 |
" |
|
6855 |
((sender := homeContext sender) notNil |
|
6856 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
6857 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
6858 |
method := sender receiver. |
|
6859 |
canAccept := false. |
|
6860 |
] ifFalse:[ |
|
6861 |
(method := con method) notNil ifTrue:[ |
|
6862 |
canAccept := false. |
|
6863 |
] |
|
6864 |
]. |
|
6865 |
] |
|
6866 |
] ifFalse:[ |
|
6867 |
method := implementorClass compiledMethodAt:sel. |
|
6868 |
]. |
|
6869 |
] |
|
6870 |
]. |
|
6871 |
||
6872 |
homeContext notNil ifTrue:[ |
|
6873 |
searchClass := homeContext searchClass ? rec class. |
|
6874 |
currentMethod := searchClass lookupMethodFor:sel. |
|
6875 |
]. |
|
6876 |
originalMethod := currentMethod. |
|
6877 |
(currentMethod notNil and:[currentMethod ~~ method]) ifTrue:[ |
|
6878 |
originalMethod := method. |
|
6879 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
6880 |
method := originalMethod. |
|
6881 |
] ifFalse:[ |
|
6882 |
method := currentMethod. |
|
6883 |
lineNrInMethod := nil. |
|
6884 |
canAccept := true. |
|
6885 |
]. |
|
6886 |
methodCodeToggle beVisible. |
|
6887 |
] ifFalse:[ |
|
6888 |
methodCodeToggle beInvisible. |
|
6889 |
]. |
|
6890 |
||
6891 |
code isNil ifTrue:[ |
|
6892 |
errMsg := nil. |
|
6893 |
method isNil ifTrue:[ |
|
6894 |
"/ fall back heuristics |
|
6895 |
con isBlockContext ifTrue:[ |
|
6896 |
((sender := con sender) notNil |
|
6897 |
and:[((sender selector ? '') startsWith:'value') |
|
6898 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
6899 |
code := sender receiver source. |
|
6900 |
] |
|
6901 |
] ifFalse:[ |
|
6902 |
((sender := con sender) notNil |
|
6903 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
6904 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
6905 |
method := sender receiver. |
|
6906 |
] |
|
6907 |
] |
|
6908 |
]. |
|
6909 |
method notNil ifTrue:[ |
|
6910 |
Error handle:[:ex | |
|
6911 |
ex signal isControlInterrupt ifTrue:[ |
|
6912 |
ex proceed. |
|
6913 |
]. |
|
6914 |
code := 'error while asking method for its source'. |
|
6915 |
code := code , Character cr , ex signal printString. |
|
6916 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6917 |
||
6918 |
canAccept := false. |
|
6919 |
ex return. |
|
6920 |
] do:[ |
|
6921 |
self sensor shiftDown ifTrue:[ |
|
6922 |
code := method decompiledSource |
|
6923 |
] ifFalse:[ |
|
6924 |
code := method source. |
|
6925 |
]. |
|
6926 |
]. |
|
6927 |
code isNil ifTrue:[ |
|
6928 |
method sourceFilename notNil ifTrue:[ |
|
6929 |
codeView contents:(resources |
|
6930 |
string:'** no sourcefile: %1 **' |
|
6931 |
with:method sourceFilename). |
|
6932 |
codeView flash. |
|
6933 |
codeSet := true. |
|
6934 |
] ifFalse:[ |
|
6935 |
[ |
|
6936 |
|src| |
|
6937 |
||
6938 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
6939 |
codeView contents:src. |
|
6940 |
codeSet := true. |
|
6941 |
] on: Error do:[ |
|
6942 |
errMsg := '** no source **' |
|
6943 |
]. |
|
6944 |
] |
|
6945 |
]. |
|
6946 |
] ifFalse:[ |
|
6947 |
homeContext isNil ifTrue:[ |
|
6948 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
6949 |
] ifFalse:[ |
|
6950 |
errMsg := '** no method - no source **'. |
|
6951 |
canDefine := true. |
|
6952 |
] |
|
6953 |
]. |
|
6954 |
errMsg notNil ifTrue:[ |
|
6955 |
self showError:errMsg. |
|
6956 |
codeSet := true. |
|
6957 |
] |
|
6958 |
]. |
|
6959 |
||
6960 |
code isNil ifTrue:[ |
|
6961 |
"/ canAccept := false. |
|
6962 |
codeSet ifFalse:[ |
|
6963 |
codeView contents:nil. |
|
6964 |
] |
|
6965 |
] ifFalse:[ |
|
6966 |
lineNrInMethod notNil ifTrue:[ |
|
6967 |
lineNrInMethod == 0 ifTrue:[ |
|
6968 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
6969 |
lineNrInMethod := method lineNumber |
|
6970 |
]. |
|
6971 |
"/ guess lineNumber from sent-messages selector |
|
6972 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
6973 |
lineNrInMethod == 0 ifTrue:[ |
|
6974 |
|conIdx sentContext messages| |
|
6975 |
||
6976 |
conIdx := contextArray identityIndexOf:con. |
|
6977 |
conIdx > 1 ifTrue:[ |
|
6978 |
sentContext := contextArray at:conIdx-1. |
|
6979 |
sentContext isBlockContext ifFalse:[ |
|
6980 |
(method notNil and:[code notNil]) ifTrue:[ |
|
6981 |
messages := method messagesSent. |
|
6982 |
messages size == 1 ifTrue:[ |
|
6983 |
sentContext selector == messages first ifTrue:[ |
|
6984 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
6985 |
] |
|
6986 |
] |
|
6987 |
]. |
|
6988 |
]. |
|
6989 |
]. |
|
6990 |
]. |
|
6991 |
]. |
|
6992 |
]. |
|
6993 |
codeView isCodeView2 ifTrue:[ |
|
10649
3f480fd28a48
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
10628
diff
changeset
|
6994 |
codeView model setValue: code. |
3f480fd28a48
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
10628
diff
changeset
|
6995 |
codeView model changed. |
10628 | 6996 |
codeView methodHolder value: method. |
10752 | 6997 |
codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
10628 | 6998 |
] ifFalse:[ |
6999 |
||
7000 |
UserPreferences current syntaxColoring ifTrue:[ |
|
7001 |
implementorClass isNil ifTrue:[ |
|
7002 |
(con isBlockContext |
|
7003 |
and:[con home isNil |
|
7004 |
and:[con guessedHome notNil]]) |
|
7005 |
ifTrue:[ |
|
7006 |
implementorClass := con guessedHome mclass |
|
7007 |
] |
|
7008 |
]. |
|
7009 |
implementorClass notNil ifTrue:[ |
|
7010 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
7011 |
code size < 100000 ifTrue:[ |
|
7012 |
Error handle:[:ex | |
|
7013 |
] do:[ |
|
7014 |
code := highlighter formatMethod:code in:implementorClass. |
|
7015 |
] |
|
7016 |
] |
|
7017 |
] |
|
7018 |
] |
|
7019 |
]. |
|
1555 | 7020 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
7021 |
"/ code ~= (codeView contents) ifTrue:[ |
10628 | 7022 |
codeView setContents:code. |
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
7023 |
"/ ]. |
10628 | 7024 |
]. |
7025 |
(lineNrInMethod notNil |
|
7026 |
and:[lineNrInMethod ~~ 0 |
|
7027 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 7028 |
lineNrInMethod == 255 ifFalse:[ |
10628 | 7029 |
(lineNrInMethod == 255 |
7030 |
and:[method notNil |
|
7031 |
and:[method hasCode not]]) ifTrue:[ |
|
7032 |
"/ means: do not really know in interpreted methods |
|
7033 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
7034 |
] ifFalse:[ |
|
7035 |
codeView selectLine:lineNrInMethod. |
|
7036 |
]. |
|
7037 |
codeView makeSelectionVisible |
|
7000 | 7038 |
]. |
10628 | 7039 |
] ifFalse:[ |
7040 |
codeView unselect. |
|
7041 |
codeView scrollToTop |
|
7042 |
] |
|
7043 |
]. |
|
7044 |
||
7045 |
codeView acceptEnabled:canAccept. |
|
7046 |
canAccept ifTrue:[ |
|
7047 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
7048 |
] ifFalse:[ |
|
7049 |
codeView acceptAction:[:code | self beep] |
|
7050 |
]. |
|
7051 |
||
7052 |
receiverInspector inspect:rec. |
|
7053 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
|
7054 |
||
7055 |
" |
|
7056 |
the one below is wrong: currently, the |
|
7057 |
evaluator cannot handle passed contexts. |
|
7058 |
Once it does, pass con as in:-arg |
|
7059 |
" |
|
7060 |
(rec isJavaObject |
|
7061 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
7062 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
7063 |
evaluatorClass := Parser |
|
7064 |
] ifFalse:[ |
|
7065 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
7066 |
evaluatorClass := method mclass evaluatorClass. |
|
7067 |
] ifFalse:[ |
|
7068 |
evaluatorClass := rec class evaluatorClass. |
|
7069 |
]. |
|
7070 |
]. |
|
7071 |
||
7072 |
codeView doItAction:[:theCode | |
|
7073 |
evaluatorClass |
|
7074 |
evaluate:theCode |
|
7075 |
in:actualContext |
|
7076 |
receiver:rec |
|
7077 |
notifying:codeView |
|
7078 |
logged:true |
|
7079 |
ifFail:nil |
|
7080 |
]. |
|
7081 |
self setCurrentMethod:method. |
|
7082 |
||
7083 |
selectedContext := homeContext. |
|
7084 |
actualContext := con |
|
7085 |
]. |
|
4122 | 7086 |
] ifFalse:[ |
10628 | 7087 |
codeView contents:nil. |
4122 | 7088 |
]. |
7089 |
codeView modified:false. |
|
7090 |
||
7091 |
con isContext ifFalse:[ |
|
10628 | 7092 |
sendButton disable. |
4122 | 7093 |
] ifTrue:[ |
10628 | 7094 |
sendButton enable. |
10205 | 7095 |
]. |
7096 |
||
7097 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 7098 |
(due to the block held in codeView). |
7099 |
(not really needed, since stuff gets collected away sooner or later ... |
|
7100 |
... but this makes it a bit sooner) |
|
7101 |
" |
|
7102 |
con := nil. |
|
7103 |
homeContext := nil. |
|
7104 |
||
10205 | 7105 |
(callee notNil |
7106 |
and:[callee method notNil |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7107 |
and:[callee method selector == #subclassResponsibility]] |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7108 |
) ifTrue:[ |
10628 | 7109 |
canDefine := true. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7110 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7111 |
|
4122 | 7112 |
canDefine ifTrue:[ |
10628 | 7113 |
defineButton beVisible. |
4122 | 7114 |
] ifFalse:[ |
10628 | 7115 |
defineButton beInvisible. |
4122 | 7116 |
]. |
7117 |
||
7118 |
" |
|
7119 |
enable/disable some menu items |
|
7120 |
" |
|
7121 |
self updateMenuItems |
|
7122 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
7123 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
10649
3f480fd28a48
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
10628
diff
changeset
|
7124 |
"Modified: / 22-08-2011 / 13:49:39 / cg" |
10752 | 7125 |
"Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4122 | 7126 |
! ! |
7127 |
||
8170 | 7128 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
7129 |
||
7130 |
ignoreCount:something |
|
7131 |
ignoreCount := something. |
|
7132 |
! |
|
7133 |
||
7134 |
ignoreEndTime:something |
|
7135 |
ignoreEndTime := something. |
|
7136 |
! |
|
7137 |
||
11210 | 7138 |
ignoreUntilShiftKeyPressed:aBoolean |
7139 |
ignoreUntilShiftKeyPressed := aBoolean. |
|
7140 |
||
7141 |
"Created: / 27-01-2012 / 11:35:23 / cg" |
|
7142 |
! |
|
7143 |
||
8170 | 7144 |
method |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7145 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7146 |
|
9922 | 7147 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
7148 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7149 |
m := weakMethodHolder at:1. |
9796 | 7150 |
"/ wait until really gone (it could still be on the call stack |
7151 |
"/ |
|
7152 |
"/ m notNil ifTrue:[ |
|
7153 |
"/ m mclass isNil ifTrue:[ |
|
7154 |
"/ "/ no longer valid |
|
7155 |
"/ weakMethodHolder at:1 put:nil. |
|
7156 |
"/ ^ nil |
|
7157 |
"/ ]. |
|
7158 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7159 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7160 |
|
9922 | 7161 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 7162 |
! |
7163 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7164 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7165 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7166 |
|
9922 | 7167 |
methodArg == #all ifTrue:[ |
11210 | 7168 |
weakMethodHolder := methodArg |
9922 | 7169 |
] ifFalse:[ |
11210 | 7170 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 7171 |
]. |
8170 | 7172 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7173 |
|
9922 | 7174 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 7175 |
! ! |
7176 |
||
7177 |
!DebugView::IgnoredHalt methodsFor:'misc'! |
|
7178 |
||
7179 |
decrementIgnoreCount |
|
7180 |
ignoreCount notNil ifTrue:[ |
|
11210 | 7181 |
ignoreCount > 0 ifTrue:[ |
7182 |
ignoreCount := ignoreCount - 1 |
|
7183 |
] |
|
8170 | 7184 |
] |
7185 |
! ! |
|
7186 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7187 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7188 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7189 |
printOn:aStream |
9922 | 7190 |
|method| |
7191 |
||
7192 |
(method := self method) isNil ifTrue:[ |
|
11210 | 7193 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
7194 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7195 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7196 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7197 |
aStream nextPutAll:'Ignore '. |
11210 | 7198 |
method whoString printOn:aStream. |
7199 |
||
7200 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
7201 |
aStream nextPutAll:' until shiftKey pressed'. |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7202 |
] ifFalse:[ |
11210 | 7203 |
ignoreEndTime notNil ifTrue:[ |
7204 |
aStream nextPutAll:' until '. |
|
7205 |
ignoreEndTime printOn:aStream. |
|
7206 |
] ifFalse:[ |
|
7207 |
(ignoreCount > 0) ifTrue:[ |
|
7208 |
aStream nextPutAll:' for '. |
|
7209 |
ignoreCount printOn:aStream. |
|
7210 |
] ifFalse:[ |
|
7211 |
(ignoreCount < 0) ifTrue:[ |
|
7212 |
aStream nextPutAll:' forEver'. |
|
7213 |
] ifFalse:[ |
|
7214 |
aStream nextPutAll:' no longer'. |
|
7215 |
]. |
|
7216 |
]. |
|
7217 |
]. |
|
7218 |
]. |
|
7219 |
||
7220 |
"Modified: / 27-01-2012 / 11:43:10 / cg" |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7221 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7222 |
|
8170 | 7223 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
7224 |
||
9078 | 7225 |
haltIgnoredInfoString |
7226 |
"some string describing why and how this halt is ignored; |
|
7227 |
nil if not ignored" |
|
7228 |
||
7229 |
ignoreCount notNil ifTrue:[ |
|
11210 | 7230 |
ignoreCount > 0 ifTrue:[ |
7231 |
^ '%1 more calls ignored' bindWith:ignoreCount |
|
7232 |
]. |
|
7233 |
^ nil |
|
9078 | 7234 |
]. |
7235 |
ignoreEndTime notNil ifTrue:[ |
|
11210 | 7236 |
(ignoreEndTime > Timestamp now) ifTrue:[ |
7237 |
^ 'ignored until %1' bindWith:ignoreEndTime |
|
7238 |
]. |
|
7239 |
^ nil |
|
7240 |
]. |
|
7241 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
7242 |
Display shiftDown ifFalse:[ |
|
7243 |
^ 'ignored until shiftKey is pressed' |
|
7244 |
]. |
|
7245 |
^ nil |
|
9078 | 7246 |
]. |
7247 |
||
7248 |
^ 'ignored until reenabled' |
|
11210 | 7249 |
|
7250 |
"Modified: / 27-01-2012 / 11:35:48 / cg" |
|
9078 | 7251 |
! |
7252 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7253 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7254 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7255 |
|
9796 | 7256 |
self method isNil ifTrue:[self halt. ^ false ]. "/ method no longer valid |
11210 | 7257 |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7258 |
ignoreEndTime notNil ifTrue:[ |
11210 | 7259 |
^ ignoreEndTime > Timestamp now |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7260 |
]. |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7261 |
ignoreCount notNil ifTrue:[ |
11210 | 7262 |
^ ignoreCount > 0 |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7263 |
]. |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7264 |
^ false |
9796 | 7265 |
|
7266 |
"Modified: / 23-03-2011 / 15:21:02 / cg" |
|
11210 | 7267 |
"Modified (format): / 27-01-2012 / 11:25:30 / cg" |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7268 |
! |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7269 |
|
8170 | 7270 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7271 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 7272 |
weakMethodHolder == #all ifTrue:[^ true]. |
7273 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7274 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 7275 |
|
7276 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 7277 |
! |
7278 |
||
7279 |
isHaltIgnored |
|
9078 | 7280 |
"true if this halt should be ignored" |
7281 |
||
11210 | 7282 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
7283 |
^ Display shiftDown not |
|
7284 |
]. |
|
8170 | 7285 |
ignoreCount notNil ifTrue:[ |
11210 | 7286 |
^ ignoreCount > 0 |
8170 | 7287 |
]. |
7288 |
ignoreEndTime notNil ifTrue:[ |
|
11210 | 7289 |
^ ignoreEndTime > Timestamp now |
8170 | 7290 |
]. |
7291 |
||
7292 |
^ true |
|
11210 | 7293 |
|
7294 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
|
8170 | 7295 |
! |
7296 |
||
7297 |
isHaltIgnoredInMethod:aMethod line:line |
|
9095 | 7298 |
"/ 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
|
7299 |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7300 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 7301 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 7302 |
|
7303 |
^ self isHaltIgnored |
|
7304 |
! ! |
|
7305 |
||
4122 | 7306 |
!DebugView class methodsFor:'documentation'! |
7307 |
||
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7308 |
version |
11364
af95026ebbda
changed: #isHaltToBeIgnoredIn:atLineNr:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11305
diff
changeset
|
7309 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.531 2012-03-06 10:24:07 cg Exp $' |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7310 |
! |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7311 |
|
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
7312 |
version_CVS |
11364
af95026ebbda
changed: #isHaltToBeIgnoredIn:atLineNr:modifyEntryCount:
Claus Gittinger <cg@exept.de>
parents:
11305
diff
changeset
|
7313 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.531 2012-03-06 10:24:07 cg Exp $' |
10628 | 7314 |
! |
7315 |
||
7316 |
version_SVN |
|
7317 |
^ '§Id: DebugView.st 7818 2011-08-18 11:42:39Z vranyj1 §' |
|
4122 | 7318 |
! ! |
7319 |
||
7320 |
DebugView initialize! |