author | Claus Gittinger <cg@exept.de> |
Thu, 01 Mar 2012 14:21:31 +0100 | |
changeset 11304 | d142697b6c1e |
parent 11303 | 28e758994349 |
child 11305 | f9019302309d |
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:[ |
337 |
Transcript show:'Debugger [info]: halt ignored in ', haltingMethod whoString. |
|
338 |
Transcript show:' ('; show:ign; showCR:')'. |
|
339 |
modifyCount ifTrue:[ ign decrementIgnoreCount ]. |
|
340 |
ign isHaltIgnored ifFalse:[ |
|
341 |
Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString. |
|
342 |
IgnoredHalts remove:ign ifAbsent:[]. |
|
343 |
]. |
|
344 |
^ true. |
|
345 |
]. |
|
10205 | 346 |
]. |
347 |
||
348 |
IgnoredHalts := IgnoredHalts |
|
11210 | 349 |
select:[:ign | |
350 |
ign isActive and:[ (ign isForMethod:haltingMethod line:lineNrInHaltingMethod) not ] |
|
351 |
]. |
|
10203 | 352 |
IgnoredHalts isEmpty ifTrue:[ |
11210 | 353 |
IgnoredHalts := nil. |
10203 | 354 |
]. |
355 |
||
356 |
^ false. |
|
357 |
||
11210 | 358 |
"Modified: / 27-01-2012 / 11:41:19 / cg" |
10203 | 359 |
! |
360 |
||
361 |
removeInactiveIgnores |
|
362 |
IgnoredHalts notNil ifTrue:[ |
|
11210 | 363 |
IgnoredHalts := IgnoredHalts select:[:i | i isActive]. |
10203 | 364 |
]. |
365 |
! |
|
366 |
||
367 |
stopIgnoringHalts |
|
368 |
"forget about all ignored halts" |
|
369 |
||
370 |
IgnoredHalts := nil. |
|
371 |
Smalltalk changed:#ignoredHalts. |
|
372 |
! ! |
|
373 |
||
374 |
!DebugView class methodsFor:'instance creation / entering'! |
|
0 | 375 |
|
2421 | 376 |
enter |
377 |
"enter a debugger" |
|
378 |
||
5455 | 379 |
<context: #return> |
380 |
||
10205 | 381 |
^ self |
11210 | 382 |
enter:thisContext sender |
383 |
withMessage:'debugger entered' |
|
384 |
mayProceed:true. |
|
10205 | 385 |
! |
386 |
||
387 |
enter:aContext withMessage:aString |
|
2355 | 388 |
"enter a debugger" |
389 |
||
5455 | 390 |
<context: #return> |
391 |
||
2355 | 392 |
^ self |
11210 | 393 |
enter:aContext |
394 |
withMessage:aString |
|
395 |
mayProceed:true |
|
2355 | 396 |
! |
397 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
398 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 399 |
"enter a debugger; if this is a recursive invocation, enter |
400 |
a MiniDebugger instead. |
|
401 |
This is the standard way of entering the debugger; |
|
402 |
sent from error- and halt messages." |
|
0 | 403 |
|
3447 | 404 |
<context: #return> |
405 |
||
3702 | 406 |
|active| |
93 | 407 |
|
57 | 408 |
StepInterruptPending := nil. |
3998 | 409 |
ControlInterrupt handle:[:ex | |
11210 | 410 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
411 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
412 |
ex proceed |
|
3998 | 413 |
] do:[ |
11210 | 414 |
" |
415 |
well, it could be a stepping or sending debugger up there; |
|
416 |
in this case, return to it. This happens, when a stepping process |
|
417 |
runs into an error (for example, a halt). In this case, we want the |
|
418 |
stepping debugger to come up again instead of a new one. |
|
419 |
" |
|
420 |
OpenDebuggers notNil ifTrue:[ |
|
421 |
active := Processor activeProcess. |
|
422 |
OpenDebuggers do:[:aDebugger | |
|
423 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
|
424 |
(aDebugger inspectedProcess == active) ifTrue:[ |
|
425 |
aDebugger device isOpen ifTrue:[ |
|
426 |
"/ 'entering stepping debugger again' printNL. |
|
427 |
aDebugger unstep. |
|
428 |
aDebugger setLabelFor:aString in:active. |
|
429 |
aDebugger mayProceed:mayProceed. |
|
430 |
^ aDebugger enter:aContext select:nil. |
|
431 |
] |
|
432 |
] |
|
433 |
] |
|
434 |
] |
|
435 |
]. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
436 |
]. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
437 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
526 | 438 |
|
3447 | 439 |
"Modified: / 18.11.2001 / 00:48:03 / cg" |
53 | 440 |
! |
441 |
||
8347 | 442 |
enterException:ex |
443 |
"enter a debugger; if this is a recursive invocation, enter |
|
444 |
a MiniDebugger instead. |
|
445 |
This is the standard way of entering the debugger; |
|
446 |
sent from error- and halt messages." |
|
447 |
||
448 |
^ self |
|
11210 | 449 |
enter:ex returnableSuspendedContext |
450 |
withMessage:ex descriptionForDebugger |
|
451 |
mayProceed:(ex mayProceed). |
|
8347 | 452 |
! |
453 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
454 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 455 |
"enter a debugger - do not check for recursive invocation" |
456 |
||
5455 | 457 |
<context: #return> |
458 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
459 |
|aDebugger| |
266 | 460 |
|
461 |
StepInterruptPending := nil. |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
462 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
463 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
464 |
"/ to avoid recursive debugging ... |
3447 | 465 |
ControlInterrupt handle:[:ex | |
11210 | 466 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
467 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
|
468 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
469 |
] do:[ |
11210 | 470 |
aDebugger := self new. |
3447 | 471 |
]. |
472 |
||
473 |
aDebugger isNil ifTrue:[ |
|
11210 | 474 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
475 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
476 |
mayProceed ifTrue:[ |
|
477 |
(Dialog confirm:'Error/Breakpoint cought.\\Press Continue or Abort.' withCRs |
|
478 |
yesLabel:'Continue' noLabel:'Abort') |
|
479 |
ifTrue:[ |
|
480 |
^ nil |
|
481 |
]. |
|
482 |
] ifFalse:[ |
|
483 |
self information:'Error cought.\\Press OK to abort the operation.' withCRs. |
|
484 |
]. |
|
485 |
AbortOperationRequest raise. |
|
486 |
"not reached" |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
487 |
]. |
3447 | 488 |
|
489 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
490 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 491 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
492 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
493 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
494 |
" |
11210 | 495 |
nil halt |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
496 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
497 |
|
3447 | 498 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 499 |
! |
500 |
||
6430 | 501 |
enterWithMessage:message |
502 |
"enter a debugger" |
|
503 |
||
504 |
<context: #return> |
|
505 |
||
10205 | 506 |
^ self |
11210 | 507 |
enter:(thisContext sender) |
508 |
withMessage:message |
|
509 |
mayProceed:true. |
|
6430 | 510 |
! |
511 |
||
266 | 512 |
new |
10205 | 513 |
"return a new DebugView. |
2358 | 514 |
- return a cached debugger if it already exists. |
515 |
Also, care for remote displays on which no debugger is wanted |
|
516 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
517 |
||
518 |
|debugger currentScreen debuggerDevice| |
|
519 |
||
520 |
currentScreen := Screen current. |
|
14 | 521 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
522 |
currentScreen notNil ifTrue:[ |
11210 | 523 |
(currentScreen suppressDebugger) ifTrue:[ |
524 |
"/ no debuggers with that device - show an alertBox which aborts... |
|
525 |
^ nil. |
|
526 |
]. |
|
527 |
(currentScreen mayOpenDebugger) ifFalse:[ |
|
528 |
"/ no debugger on that device - but on the main screen |
|
529 |
currentScreen := Screen default. |
|
530 |
]. |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
531 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
532 |
|
266 | 533 |
" |
10205 | 534 |
need a blocking debugger if no processes or |
535 |
or if its a timing/interrupt process |
|
266 | 536 |
(because otherwise we would not get any events here ... |
537 |
" |
|
538 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
11210 | 539 |
((debugger := CachedExclusive) isNil |
540 |
or:[debugger device ~~ currentScreen |
|
541 |
or:[currentScreen isNil |
|
542 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
|
543 |
debugger := self newExclusive |
|
544 |
]. |
|
545 |
CachedExclusive := nil. |
|
266 | 546 |
] ifFalse:[ |
11210 | 547 |
CachedDebugger notNil ifTrue:[ |
548 |
(CachedDebugger device ~~ currentScreen |
|
549 |
or:[currentScreen isNil |
|
550 |
or:[currentScreen isOpen not |
|
551 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
|
552 |
CachedDebugger := nil |
|
553 |
] |
|
554 |
]. |
|
555 |
||
556 |
(debugger := CachedDebugger) notNil ifTrue:[ |
|
557 |
CachedDebugger := nil. |
|
558 |
] ifFalse:[ |
|
559 |
debuggerDevice := currentScreen. |
|
560 |
debuggerDevice isNil ifTrue:[ |
|
561 |
"/ use the default display |
|
562 |
debuggerDevice := Screen default. |
|
563 |
]. |
|
564 |
(debuggerDevice isNil |
|
565 |
or:[debuggerDevice isOpen not |
|
566 |
"/ or:[debuggerDevice mayOpenDebugger not] |
|
567 |
]) ifTrue:[ |
|
568 |
"/ no debugger |
|
569 |
^ nil. |
|
570 |
]. |
|
571 |
||
572 |
Screen currentScreenQuerySignal answer:debuggerDevice |
|
573 |
do:[ |
|
574 |
debugger := super new. |
|
575 |
]. |
|
576 |
debugger label:'Debugger'. |
|
577 |
debugger icon:self defaultIcon. |
|
578 |
] |
|
266 | 579 |
]. |
73 | 580 |
^ debugger |
875 | 581 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
582 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 583 |
! |
0 | 584 |
|
266 | 585 |
newExclusive |
586 |
"return a debugger for exclusive display access" |
|
587 |
||
588 |
|debugger| |
|
105 | 589 |
|
266 | 590 |
debugger := super new. |
591 |
debugger label:'Debugger'. |
|
875 | 592 |
debugger icon:self defaultIcon. |
266 | 593 |
debugger exclusive:true. |
594 |
^ debugger |
|
875 | 595 |
|
596 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 597 |
! |
598 |
||
29 | 599 |
openOn:aProcess |
600 |
"start a debugger on aProcess |
|
601 |
(actually not more than a good-looking inspector)" |
|
15 | 602 |
|
52 | 603 |
|aDebugger label nm| |
15 | 604 |
|
605 |
aDebugger := super new. |
|
875 | 606 |
aDebugger icon:self defaultIcon. |
29 | 607 |
aProcess notNil ifTrue:[ |
11210 | 608 |
nm := aProcess name. |
609 |
nm notNil ifTrue:[ |
|
610 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
611 |
] ifFalse:[ |
|
612 |
nm := aProcess id printString |
|
613 |
]. |
|
614 |
label := 'Debugger [' , nm , ']'. |
|
29 | 615 |
] ifFalse:[ |
11210 | 616 |
label := 'no process' |
29 | 617 |
]. |
1114 | 618 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 619 |
aDebugger openOn:aProcess. |
620 |
^ nil |
|
875 | 621 |
|
1114 | 622 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 623 |
! ! |
624 |
||
3269 | 625 |
!DebugView class methodsFor:'menu specs'! |
626 |
||
627 |
menuSpec |
|
628 |
"This resource specification was automatically generated |
|
629 |
by the MenuEditor of ST/X." |
|
630 |
||
631 |
"Do not manually edit this!! If it is corrupted, |
|
632 |
the MenuEditor may not be able to read the specification." |
|
633 |
||
634 |
" |
|
635 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
636 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
637 |
" |
|
638 |
||
639 |
<resource: #menu> |
|
640 |
||
10205 | 641 |
^ |
5875 | 642 |
#(Menu |
11210 | 643 |
( |
644 |
(MenuItem |
|
645 |
label: 'File' |
|
646 |
translateLabel: true |
|
647 |
submenu: |
|
648 |
(Menu |
|
649 |
( |
|
650 |
(MenuItem |
|
651 |
enabled: canSendEmail |
|
652 |
label: 'Report a Bug via eMail...' |
|
653 |
itemValue: doOpenReportMailApp |
|
654 |
translateLabel: true |
|
655 |
) |
|
656 |
(MenuItem |
|
657 |
label: '-' |
|
658 |
) |
|
659 |
(MenuItem |
|
660 |
label: 'Exit' |
|
661 |
itemValue: closeRequest |
|
662 |
translateLabel: true |
|
663 |
isVisible: isInspecting |
|
664 |
) |
|
665 |
(MenuItem |
|
666 |
label: 'Close Debugger and Abort' |
|
667 |
itemValue: closeRequest |
|
668 |
translateLabel: true |
|
669 |
isVisible: isNotInspecting |
|
670 |
) |
|
671 |
) |
|
672 |
nil |
|
673 |
nil |
|
674 |
) |
|
675 |
) |
|
676 |
(MenuItem |
|
677 |
label: 'View' |
|
678 |
translateLabel: true |
|
679 |
submenu: |
|
680 |
(Menu |
|
681 |
( |
|
682 |
(MenuItem |
|
683 |
enabled: canShowMore |
|
684 |
label: 'Show More WalkBack' |
|
685 |
itemValue: showMore |
|
686 |
translateLabel: true |
|
687 |
) |
|
688 |
(MenuItem |
|
689 |
label: 'Show Verbose WalkBack' |
|
690 |
itemValue: toggleVerboseWalkback |
|
691 |
translateLabel: true |
|
692 |
isVisible: showingDenseWalkback |
|
693 |
) |
|
694 |
(MenuItem |
|
695 |
label: 'Show Dense WalkBack' |
|
696 |
itemValue: toggleVerboseWalkback |
|
697 |
translateLabel: true |
|
698 |
isVisible: showingVerboseWalkback |
|
699 |
) |
|
700 |
(MenuItem |
|
701 |
label: '-' |
|
702 |
) |
|
703 |
(MenuItem |
|
704 |
label: 'Raise Debugger when Entering' |
|
705 |
itemValue: autoRaiseView: |
|
706 |
translateLabel: true |
|
707 |
indication: autoRaiseView |
|
708 |
) |
|
709 |
(MenuItem |
|
710 |
label: '-' |
|
711 |
) |
|
712 |
(MenuItem |
|
713 |
label: 'Settings...' |
|
714 |
itemValue: openSettingsDialog |
|
715 |
translateLabel: true |
|
716 |
) |
|
717 |
) |
|
718 |
nil |
|
719 |
nil |
|
720 |
) |
|
721 |
) |
|
722 |
(MenuItem |
|
723 |
label: 'Process' |
|
724 |
translateLabel: true |
|
725 |
submenu: |
|
726 |
(Menu |
|
727 |
( |
|
728 |
(MenuItem |
|
729 |
label: 'Continue' |
|
730 |
itemValue: doContinue |
|
731 |
translateLabel: true |
|
732 |
) |
|
733 |
(MenuItem |
|
734 |
label: 'Next (Line-Step)' |
|
735 |
itemValue: doNext |
|
736 |
translateLabel: true |
|
737 |
) |
|
738 |
(MenuItem |
|
739 |
label: 'Step' |
|
740 |
itemValue: doStep |
|
741 |
translateLabel: true |
|
742 |
) |
|
743 |
(MenuItem |
|
744 |
label: '-' |
|
745 |
) |
|
746 |
(MenuItem |
|
747 |
label: 'Abort' |
|
748 |
itemValue: doAbort |
|
749 |
translateLabel: true |
|
750 |
) |
|
751 |
(MenuItem |
|
752 |
enabled: abortAllIsHandled |
|
753 |
label: 'Abort All' |
|
754 |
itemValue: doAbortAll |
|
755 |
translateLabel: true |
|
756 |
) |
|
757 |
(MenuItem |
|
758 |
label: '-' |
|
759 |
) |
|
760 |
(MenuItem |
|
761 |
label: 'Terminate' |
|
762 |
itemValue: doTerminate |
|
763 |
translateLabel: true |
|
764 |
) |
|
765 |
) |
|
766 |
nil |
|
767 |
nil |
|
768 |
) |
|
769 |
) |
|
770 |
(MenuItem |
|
771 |
label: 'Context' |
|
772 |
translateLabel: true |
|
773 |
submenu: |
|
774 |
(Menu |
|
775 |
( |
|
776 |
(MenuItem |
|
777 |
enabled: canReturn |
|
778 |
label: 'Return' |
|
779 |
itemValue: doReturn |
|
780 |
translateLabel: true |
|
781 |
) |
|
782 |
(MenuItem |
|
783 |
enabled: canRestart |
|
784 |
label: 'Restart' |
|
785 |
itemValue: doRestart |
|
786 |
translateLabel: true |
|
787 |
) |
|
788 |
(MenuItem |
|
789 |
label: '-' |
|
790 |
) |
|
791 |
(MenuItem |
|
792 |
enabled: hasContextSelected |
|
793 |
label: 'Inspect' |
|
794 |
itemValue: inspectContext |
|
795 |
translateLabel: true |
|
796 |
) |
|
797 |
(MenuItem |
|
798 |
label: 'Copy WalkBack Text' |
|
799 |
itemValue: copyWalkbackText |
|
800 |
translateLabel: true |
|
801 |
) |
|
802 |
(MenuItem |
|
803 |
label: 'Bookmark Method in SystemBrowser' |
|
804 |
itemValue: addBrowserBookmark |
|
805 |
translateLabel: true |
|
806 |
) |
|
807 |
) |
|
808 |
nil |
|
809 |
nil |
|
810 |
) |
|
811 |
) |
|
812 |
(MenuItem |
|
813 |
label: 'Class' |
|
814 |
translateLabel: true |
|
815 |
submenu: |
|
816 |
(Menu |
|
817 |
( |
|
818 |
(MenuItem |
|
819 |
enabled: canBrowseImplementingClass |
|
820 |
label: 'Browse Implementing Class' |
|
821 |
itemValue: browseImplementingClass |
|
822 |
translateLabel: true |
|
823 |
) |
|
824 |
(MenuItem |
|
825 |
enabled: canBrowseReceiversClass |
|
826 |
label: 'Browse Receivers Class' |
|
827 |
itemValue: browseReceiversClass |
|
828 |
translateLabel: true |
|
829 |
) |
|
830 |
(MenuItem |
|
831 |
label: '-' |
|
832 |
) |
|
833 |
(MenuItem |
|
834 |
enabled: canBrowseClassHierarchy |
|
835 |
label: 'Browse Receivers Class Hierarchy' |
|
836 |
itemValue: browseClassHierarchy |
|
837 |
translateLabel: true |
|
838 |
) |
|
839 |
(MenuItem |
|
840 |
enabled: canBrowseFullClassProtocol |
|
841 |
label: 'Browse Receivers Full Protocol' |
|
842 |
itemValue: browseFullClassProtocol |
|
843 |
translateLabel: true |
|
844 |
) |
|
845 |
(MenuItem |
|
846 |
label: '-' |
|
847 |
) |
|
848 |
(MenuItem |
|
849 |
enabled: canBrowseProcessesApplication |
|
850 |
label: 'Browse Application Class' |
|
851 |
itemValue: browseProcessesApplication |
|
852 |
translateLabel: true |
|
853 |
) |
|
854 |
) |
|
855 |
nil |
|
856 |
nil |
|
857 |
) |
|
858 |
) |
|
859 |
(MenuItem |
|
860 |
label: 'Selector' |
|
861 |
translateLabel: true |
|
862 |
submenu: |
|
863 |
(Menu |
|
864 |
( |
|
865 |
(MenuItem |
|
866 |
label: 'Browse Implementors...' |
|
867 |
itemValue: browseImplementorsOf |
|
868 |
translateLabel: true |
|
869 |
) |
|
870 |
(MenuItem |
|
871 |
label: 'Browse Senders...' |
|
872 |
itemValue: browseSendersOf |
|
873 |
translateLabel: true |
|
874 |
) |
|
875 |
(MenuItem |
|
876 |
label: '-' |
|
877 |
) |
|
878 |
(MenuItem |
|
879 |
enabled: canDefineMethod |
|
880 |
label: 'Define Missing Method' |
|
881 |
itemValue: doDefineMethod |
|
882 |
translateLabel: true |
|
883 |
) |
|
884 |
) |
|
885 |
nil |
|
886 |
nil |
|
887 |
) |
|
888 |
) |
|
889 |
(MenuItem |
|
890 |
label: 'Breakpoint' |
|
891 |
translateLabel: true |
|
892 |
submenu: |
|
893 |
(Menu |
|
894 |
( |
|
895 |
(MenuItem |
|
896 |
enabled: canRemoveBreakpoint |
|
897 |
label: 'Remove Breakpoint' |
|
898 |
itemValue: removeBreakpoint |
|
899 |
translateLabel: true |
|
900 |
) |
|
901 |
(MenuItem |
|
902 |
label: 'Remove all Breakpoints' |
|
903 |
itemValue: removeAllBreakpoints |
|
904 |
translateLabel: true |
|
905 |
) |
|
906 |
(MenuItem |
|
907 |
label: '-' |
|
908 |
) |
|
909 |
(MenuItem |
|
910 |
enabled: canAddBreakpoint |
|
911 |
label: 'Add Breakpoint' |
|
912 |
itemValue: addBreakpoint |
|
913 |
translateLabel: true |
|
914 |
) |
|
915 |
(MenuItem |
|
916 |
label: '-' |
|
917 |
) |
|
918 |
(MenuItem |
|
919 |
label: 'Ignore this Halt/BreakPoint' |
|
920 |
translateLabel: true |
|
921 |
submenu: |
|
922 |
(Menu |
|
923 |
( |
|
924 |
(MenuItem |
|
925 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
926 |
label: 'For Some Time...' |
|
927 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
928 |
translateLabel: true |
|
929 |
) |
|
930 |
(MenuItem |
|
931 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
932 |
label: 'For the Next N Times...' |
|
933 |
itemValue: openIgnoreHaltNTimesDialog |
|
934 |
translateLabel: true |
|
935 |
) |
|
936 |
(MenuItem |
|
937 |
label: 'Until Shift-Key is Pressed' |
|
938 |
itemValue: ignoreHaltUntilShiftKeyIsPressed |
|
939 |
translateLabel: true |
|
940 |
) |
|
941 |
(MenuItem |
|
942 |
enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
|
943 |
label: 'Forever (Until Ignoring is Stopped)' |
|
944 |
itemValue: ignoreHaltForever |
|
945 |
translateLabel: true |
|
946 |
) |
|
947 |
) |
|
948 |
nil |
|
949 |
nil |
|
950 |
) |
|
951 |
) |
|
952 |
(MenuItem |
|
953 |
label: 'Ignore all Halts/BreakPoints' |
|
954 |
translateLabel: true |
|
955 |
submenu: |
|
956 |
(Menu |
|
957 |
( |
|
958 |
(MenuItem |
|
959 |
label: 'For Some Time...' |
|
960 |
itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog |
|
961 |
translateLabel: true |
|
962 |
) |
|
963 |
(MenuItem |
|
964 |
label: 'Until Shift-Key is Pressed' |
|
965 |
itemValue: ignoreAllHaltsUntilShiftKeyIsPressed |
|
966 |
translateLabel: true |
|
967 |
) |
|
968 |
(MenuItem |
|
969 |
label: 'Forever (Until Ignoring is Stopped)' |
|
970 |
itemValue: ignoreAllHaltsForever |
|
971 |
translateLabel: true |
|
972 |
) |
|
973 |
) |
|
974 |
nil |
|
975 |
nil |
|
976 |
) |
|
977 |
) |
|
978 |
(MenuItem |
|
979 |
enabled: hasHaltsToIgnore |
|
980 |
label: 'Stop Ignoring' |
|
981 |
itemValue: stopIgnoringHalts |
|
982 |
translateLabel: true |
|
983 |
) |
|
984 |
(MenuItem |
|
985 |
label: '-' |
|
986 |
) |
|
987 |
(MenuItem |
|
988 |
label: 'Manage Breakpoints' |
|
989 |
itemValue: openBreakPointBrowser |
|
990 |
translateLabel: true |
|
991 |
) |
|
992 |
(MenuItem |
|
993 |
label: 'Allow Breakpoints in Debugger' |
|
994 |
itemValue: allowBreakPointsInDebugger: |
|
995 |
translateLabel: true |
|
996 |
indication: allowBreakPointsInDebugger |
|
997 |
) |
|
998 |
) |
|
999 |
nil |
|
1000 |
nil |
|
1001 |
) |
|
1002 |
) |
|
1003 |
(MenuItem |
|
1004 |
label: 'Help' |
|
1005 |
translateLabel: true |
|
1006 |
startGroup: right |
|
1007 |
submenu: |
|
1008 |
(Menu |
|
1009 |
( |
|
1010 |
(MenuItem |
|
1011 |
label: 'Debuggers Documentation' |
|
1012 |
itemValue: openHTMLDocument: |
|
1013 |
translateLabel: true |
|
1014 |
argument: 'tools/debugger/TOP.html' |
|
1015 |
) |
|
1016 |
(MenuItem |
|
1017 |
label: '-' |
|
1018 |
) |
|
1019 |
(MenuItem |
|
1020 |
label: 'About DebugView...' |
|
1021 |
itemValue: openAboutThisApplication |
|
1022 |
translateLabel: true |
|
1023 |
) |
|
1024 |
) |
|
1025 |
nil |
|
1026 |
nil |
|
1027 |
) |
|
1028 |
) |
|
1029 |
) |
|
1030 |
nil |
|
1031 |
nil |
|
3269 | 1032 |
) |
11210 | 1033 |
|
1034 |
"Modified: / 27-01-2012 / 11:29:45 / cg" |
|
3269 | 1035 |
! ! |
1036 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1037 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1038 |
|
4121 | 1039 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1040 |
"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
|
1041 |
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
|
1042 |
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
|
1043 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1044 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1045 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1046 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1047 |
|
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1048 |
someContexts := Array new:25. |
2042 | 1049 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1050 |
idx := 1. |
10205 | 1051 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
11210 | 1052 |
someContexts at:idx put:con. |
1053 |
con := con sender. |
|
1054 |
idx := idx + 1. |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1055 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1056 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1057 |
^ someContexts at:idx. |
3447 | 1058 |
! |
1059 |
||
10205 | 1060 |
interestingContextIndexIn:aContextArray |
3447 | 1061 |
"return an interesting contexts offset, or nil. |
1062 |
This is the context initially shown in the walkback. |
|
1063 |
We move up the calling chain, skipping all intermediate Signal |
|
1064 |
and Exception contexts, to present the context in which the error |
|
1065 |
actually occured. |
|
1066 |
Just for your convenience :-)" |
|
1067 |
||
8152 | 1068 |
|con found offset sel prev ex rcvr nMax idx| |
3447 | 1069 |
|
7713 | 1070 |
"/ Transcript showCR:aContextArray. |
7648 | 1071 |
|
3447 | 1072 |
nMax := aContextArray size. |
1073 |
nMax <= 1 ifTrue:[^ 1]. |
|
1074 |
con := aContextArray at:1. |
|
1075 |
con isBlockContext ifTrue:[^ 1]. |
|
1076 |
||
1077 |
"/ somewhere, at the bottom, there must be a raise ... |
|
1078 |
"/ find the exception |
|
1079 |
||
1080 |
1 to:5 do:[:i | |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1081 |
con := aContextArray at:i ifAbsent:nil. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1082 |
con notNil ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1083 |
sel := con selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1084 |
(sel startsWith:'raise') ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1085 |
rcvr := con receiver. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1086 |
(rcvr isLazyValue not and:[rcvr isException]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1087 |
ex := rcvr. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1088 |
offset := i. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1089 |
found := con |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1090 |
] ifFalse:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1091 |
(rcvr isLazyValue not and:[rcvr isExceptionCreator]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1092 |
offset := i. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1093 |
found := con |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1094 |
] |
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 |
]. |
3447 | 1098 |
]. |
1099 |
||
1100 |
" |
|
1101 |
if this is a noHandler exception, skip forward |
|
1102 |
to the erronous context |
|
1103 |
" |
|
1104 |
ex notNil ifTrue:[ |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1105 |
ex signal == Signal noHandlerSignal ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1106 |
found := ex suspendedContext |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1107 |
] |
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 |
"/ Transcript show:'1 '; showCR:found. |
3447 | 1110 |
found isNil ifTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1111 |
"/ this is a kludge, but convenient. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1112 |
"/ show the place where the error (divisionByZero...) happend, |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1113 |
"/ not where the signal was raised. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1114 |
con := (aContextArray at:1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1115 |
sel := con methodHome selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1116 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1117 |
"/ typically a DivisionByZero - show caller of division |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1118 |
(sel == #// |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1119 |
or:[sel == #/ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1120 |
or:[sel == #\\]]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1121 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1122 |
]. |
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 |
"/ 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
|
1125 |
(sel == #doesNotUnderstand:) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1126 |
idx := 3. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1127 |
nMax > 2 ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1128 |
sel := (aContextArray at:idx) selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1129 |
sel == #doesNotUnderstand: ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1130 |
idx := 4 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1131 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1132 |
nMax > idx ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1133 |
sel := (aContextArray at:idx) selector ? ''. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1134 |
"/ 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
|
1135 |
((sel == #perform:) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1136 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1137 |
idx := idx + 1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1138 |
]. |
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 |
^ idx min:nMax |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1142 |
]. |
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 |
"/ show the bad method; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1145 |
(sel == #noByteCode) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1146 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1147 |
]. |
3447 | 1148 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1149 |
"/ "/ 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
|
1150 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1151 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1152 |
"/ ]. |
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 |
"/ "/ 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
|
1155 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1156 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1157 |
"/ ]. |
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 |
"/ "/ 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
|
1160 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1161 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1162 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1163 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1164 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1165 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1166 |
"/ ]. |
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 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1169 |
"/ ]. |
7862 | 1170 |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1171 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1172 |
(sel == #signalInterrupt:) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1173 |
^ 2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1174 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
1175 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1176 |
"/ "/ 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
|
1177 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1178 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1179 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1180 |
"/ ] |
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 |
"/ "/ 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
|
1184 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1185 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1186 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
1187 |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1188 |
"/ 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
|
1189 |
( #(#notIndexed |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1190 |
#indexNotIntegerOrOutOfBounds: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1191 |
#subscriptBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1192 |
#elementBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1193 |
"/ #subclassResponsibility |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1194 |
) includes:sel) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1195 |
idx := 2. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1196 |
[ idx <= 3 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1197 |
and:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1198 |
sel := (aContextArray at:idx) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1199 |
#(#notIndexed |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1200 |
#indexNotIntegerOrOutOfBounds: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1201 |
#subscriptBoundsError: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1202 |
#elementBoundsError: ) includes:sel |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1203 |
] |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1204 |
] whileTrue:[ idx := idx + 1 ]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1205 |
sel := (aContextArray at:idx) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1206 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1207 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1208 |
sel := (aContextArray at:idx+1) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1209 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1210 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1211 |
sel := (aContextArray at:idx+2) selector. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1212 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1213 |
ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1214 |
^ idx+3 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1215 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1216 |
^ idx+2 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1217 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1218 |
^ idx+1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1219 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1220 |
^ idx |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1221 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1222 |
offset := 1. |
8152 | 1223 |
]. |
1224 |
||
1225 |
"/ the above is all too hard-coded; |
|
1226 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1227 |
"/ as more methods get flagged, remove code from above. |
|
1228 |
con := aContextArray at:offset ifAbsent:nil. |
|
1229 |
||
10205 | 1230 |
[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1231 |
con notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1232 |
and:[ con methodHome notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1233 |
and:[ con methodHome method notNil |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1234 |
and:[ con methodHome method shouldBeSkippedInDebuggersWalkBack ]]] |
8152 | 1235 |
] whileTrue:[ |
1236 |
"/ Transcript showCR:con methodHome method. |
|
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1237 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1238 |
con := aContextArray at:offset ifAbsent:nil. |
8152 | 1239 |
]. |
3447 | 1240 |
|
1241 |
" |
|
1242 |
got it; move up, skipping all intermediate Signal and |
|
1243 |
Exception contexts |
|
1244 |
" |
|
1245 |
prev := nil. |
|
1246 |
rcvr := con receiver. |
|
10205 | 1247 |
[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1248 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1249 |
] whileTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1250 |
prev := con. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1251 |
nMax > offset ifFalse:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1252 |
|
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1253 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1254 |
con := aContextArray at:offset. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1255 |
rcvr := con receiver. |
3447 | 1256 |
]. |
1257 |
||
1258 |
" |
|
1259 |
now, we are one above the raising context |
|
1260 |
" |
|
1261 |
||
1262 |
" |
|
1263 |
if the sender-method of the raise is one of objects error methods ... |
|
1264 |
" |
|
10205 | 1265 |
( #( halt halt: |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1266 |
error error: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1267 |
doesNotUnderstand: |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1268 |
subclassResponsibility |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1269 |
primitiveFailed) includes:con selector) |
3447 | 1270 |
ifTrue:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1271 |
con selector == #doesNotUnderstand: ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1272 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1273 |
one more up, to get to the originating context |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1274 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1275 |
con := aContextArray at:(offset + 1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1276 |
con isNil ifTrue:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1277 |
offset := offset + 1. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1278 |
]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1279 |
con := aContextArray at:(offset + 1). |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1280 |
con isNil ifTrue:[^ offset]. |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1281 |
offset := offset + 1. |
3447 | 1282 |
] ifFalse:[ |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1283 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1284 |
ok, got the raise - if its a BreakPoint, look for the sender |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1285 |
" |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1286 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1287 |
offset := offset + 1 |
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1288 |
]. |
3447 | 1289 |
]. |
1290 |
||
1291 |
^ offset |
|
1292 |
||
7713 | 1293 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
10289
cb1f8bda978e
changed: #interestingContextIndexIn:
Claus Gittinger <cg@exept.de>
parents:
10205
diff
changeset
|
1294 |
"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
|
1295 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1296 |
|
73 | 1297 |
!DebugView methodsFor:'basic'! |
1298 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1299 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1300 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1301 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1302 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1303 |
m notNil ifTrue:[ |
11210 | 1304 |
self updateMenuItems. |
1305 |
||
1306 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
|
1307 |
abortButton enable. |
|
1308 |
m enable:#doAbort. |
|
1309 |
] ifFalse:[ |
|
1310 |
abortButton disable. |
|
1311 |
m disable:#doAbort. |
|
1312 |
]. |
|
1313 |
exclusive ifTrue:[ |
|
1314 |
terminateButton disable. |
|
1315 |
m disable:#doTerminate. |
|
1316 |
] ifFalse:[ |
|
1317 |
terminateButton enable. |
|
1318 |
m enable:#doTerminate. |
|
1319 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1320 |
]. |
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 |
mayProceed == false ifTrue:[ |
11210 | 1323 |
continueButton disable. |
1324 |
m notNil ifTrue:[m disable:#doContinue]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1325 |
] ifFalse:[ |
11210 | 1326 |
continueButton enable. |
1327 |
m notNil ifTrue:[m enable:#doContinue] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1328 |
]. |
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 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1331 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1332 |
|
1364 | 1333 |
enter:aContext select:initialSelectionOrNil |
73 | 1334 |
"enter the debugger - get and display the context, then start an |
1335 |
exclusive event loop on top of eveything else" |
|
1336 |
||
3447 | 1337 |
<context: #return> |
1338 |
||
9076 | 1339 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c| |
3447 | 1340 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1341 |
DebuggingDebugger == true ifTrue:[ |
11210 | 1342 |
'==> enter: (' print. aContext print. |
1343 |
') select: ' print. initialSelectionOrNil printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1344 |
]. |
3447 | 1345 |
thisContext isRecursive ifTrue:[ |
11210 | 1346 |
"/ care for the special case, were the Debugger was autoloaded. |
1347 |
"/ in this case, thisContext IS recursive, but thats no error |
|
1348 |
"/ condition. |
|
1349 |
foundNoByteCodeContext := false. |
|
1350 |
foundExitContext := false. |
|
1351 |
||
1352 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1353 |
[ |
|
1354 |
foundNoByteCodeContext not |
|
1355 |
and:[ foundExitContext not |
|
1356 |
and:[c notNil |
|
1357 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
|
1358 |
]]]] |
|
1359 |
whileTrue:[ |
|
1360 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
1361 |
foundExitContext := true |
|
1362 |
]. |
|
1363 |
c selector == #noByteCode ifTrue:[ |
|
1364 |
foundNoByteCodeContext := true |
|
1365 |
]. |
|
1366 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1367 |
]. |
|
1368 |
||
1369 |
(foundNoByteCodeContext not |
|
1370 |
and:[ foundExitContext not]) ifFalse:[ |
|
1371 |
('DebugView [warning]: reentered') errorPrintCR. |
|
1372 |
||
1373 |
^ MiniDebugger |
|
1374 |
enter:aContext |
|
1375 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
1376 |
mayProceed:mayProceed. |
|
1377 |
]. |
|
1378 |
foundExitContext ifTrue:[ |
|
1379 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
1380 |
^ self. |
|
1381 |
]. |
|
3447 | 1382 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1383 |
|
10203 | 1384 |
"/'entering: ' print. aContext printCR. |
1385 |
"/'initial: ' print. initialSelectionOrNil printCR. |
|
8170 | 1386 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1387 |
||
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
1388 |
self class isHaltToBeIgnored ifTrue:[ |
11210 | 1389 |
^ self. |
8170 | 1390 |
]. |
1391 |
||
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1392 |
iAmNew := drawableId isNil. |
73 | 1393 |
|
8148 | 1394 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1395 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
1396 |
busy := cachable := true. |
73 | 1397 |
inspecting := false. |
1398 |
inspectedProcess := Processor activeProcess. |
|
1399 |
stepping := false. |
|
1400 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1401 |
stepHow := nil. |
8148 | 1402 |
nChainShown := InitialNChainShown. |
73 | 1403 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1404 |
"/ if debugger is entered while a box has grabbed the |
9076 | 1405 |
"/ 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
|
1406 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1407 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1408 |
"/ 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
|
1409 |
"/ 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
|
1410 |
"/ 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
|
1411 |
Screen allScreens do:[:aScreen | |
11210 | 1412 |
aScreen ungrabPointer. |
1413 |
aScreen ungrabKeyboard. |
|
10205 | 1414 |
]. |
1415 |
||
1416 |
("inspectedProcess suspendedContext isNil |
|
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1417 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
11210 | 1418 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1419 |
] ifFalse:[ |
11210 | 1420 |
terminateButton enable. |
1421 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1422 |
]. |
73 | 1423 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1424 |
iAmNew ifFalse:[ |
11210 | 1425 |
"/ not the first time - disable buttons & menus |
1426 |
"/ from the previous life |
|
1427 |
self turnOffAllButtons. |
|
1428 |
||
1429 |
m := contextView middleButtonMenu. |
|
1430 |
m notNil ifTrue:[ |
|
1431 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
|
1432 |
]. |
|
1433 |
verboseBacktrace |
|
1434 |
ifTrue:[self showVerboseWalkback] |
|
1435 |
ifFalse:[self showDenseWalkback]. |
|
132 | 1436 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1437 |
self iconLabel:'Debugger'. |
132 | 1438 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1439 |
windowGroup isNil ifTrue:[ |
11210 | 1440 |
self windowGroup: WindowGroup new. |
1441 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1442 |
]. |
132 | 1443 |
exclusive ifFalse:[ |
11210 | 1444 |
"/ create a (modal) windowGroup for myself |
1445 |
||
1446 |
windowGroup setModal:true. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1447 |
] ifTrue:[ |
11210 | 1448 |
"/ create a windowGroup with a synchronous sensor for me |
1449 |
||
1450 |
windowGroup beSynchronous. |
|
73 | 1451 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1452 |
windowGroup setProcess:Processor activeProcess. |
73 | 1453 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1454 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 1455 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1456 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
10203 | 1457 |
"/'after setContext; first is ' print. |
1458 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1459 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
73 | 1460 |
|
10203 | 1461 |
self updateButtonsAndMenuItemsForContext:aContext. |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1462 |
|
73 | 1463 |
" |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1464 |
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
|
1465 |
Otherwise, its probably better to do a map, which shows the |
73 | 1466 |
view at the previous position, without a need for the user to set the |
1467 |
position again |
|
1468 |
" |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1469 |
iAmNew ifFalse:[ |
11210 | 1470 |
self remap. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1471 |
] ifTrue:[ |
11210 | 1472 |
self realize. |
73 | 1473 |
]. |
8193
9a4febdd8202
Raise debugger to the very top when entering
Stefan Vogel <sv@exept.de>
parents:
8181
diff
changeset
|
1474 |
self setForegroundWindow. |
73 | 1475 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1476 |
exclusive ifTrue:[ |
11210 | 1477 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1478 |
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
|
1479 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1480 |
This is a modal debugger - all event processing is stopped.. |
10205 | 1481 |
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
|
1482 |
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
|
1483 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1484 |
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
|
1485 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1486 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1487 |
self autoRaiseView ifTrue:[ |
11210 | 1488 |
"/ self raise. |
1489 |
self raiseDeiconified. |
|
1490 |
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
|
1491 |
]. |
1486
6ae442626f20
wait until visible before starting to draw
Claus Gittinger <cg@exept.de>
parents:
1484
diff
changeset
|
1492 |
|
73 | 1493 |
canContinue := true. |
1494 |
exitAction := nil. |
|
1495 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1496 |
"/ 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
|
1497 |
"/ 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
|
1498 |
"/ closedown of the debugger. |
3701
ef73aac8e8d5
Use #ifCurtailed: instead of #valueOnUnwindDo:
Stefan Vogel <sv@exept.de>
parents:
3694
diff
changeset
|
1499 |
[self controlLoop] ifCurtailed:[ |
11210 | 1500 |
windowGroup notNil ifTrue:[ |
1501 |
windowGroup setProcess:nil. |
|
1502 |
]. |
|
1503 |
self destroy |
|
132 | 1504 |
]. |
73 | 1505 |
|
10203 | 1506 |
"/ here after my own control loop is finished. |
1507 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1508 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1509 |
"/ 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
|
1510 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 1511 |
contextView contents:nil. |
1512 |
||
73 | 1513 |
codeView acceptAction:nil. |
942 | 1514 |
codeView doItAction:nil. |
73 | 1515 |
|
4892 | 1516 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
11210 | 1517 |
ObjectMemory stepInterruptHandler:nil. |
4892 | 1518 |
]. |
1519 |
||
73 | 1520 |
(exitAction ~~ #step) ifTrue:[ |
11210 | 1521 |
"/ not stepping - close window |
1522 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
|
1523 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
|
1524 |
receiverInspector release. |
|
1525 |
contextInspector release. |
|
1526 |
||
1527 |
self unmap. |
|
1528 |
device flush. |
|
1529 |
||
1530 |
(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ]. |
|
1531 |
(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ]. |
|
1532 |
(exitAction == #return) ifTrue:[ self exit_return. "does not return" ]. |
|
1533 |
(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ]. |
|
1534 |
(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ]. |
|
1535 |
(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ]. |
|
1536 |
exitAction isBlock ifTrue:[ |
|
1537 |
self exit_unwindThenDo:exitAction. |
|
1538 |
"does not return" |
|
1539 |
]. |
|
1540 |
"not reached" |
|
1541 |
^ self |
|
73 | 1542 |
]. |
1543 |
||
3447 | 1544 |
"/ stepping - window stays open |
940 | 1545 |
selectedContext := actualContext := firstContext := nil. |
73 | 1546 |
|
2472 | 1547 |
"/ restore the previous pointer grab |
73 | 1548 |
grabber notNil ifTrue:[ |
11210 | 1549 |
device grabPointerInView:grabber. |
1550 |
grabber := nil. |
|
61 | 1551 |
]. |
73 | 1552 |
|
1553 |
(exitAction == #step) ifTrue:[ |
|
11210 | 1554 |
" |
1555 |
schedule another stepInterrupt |
|
1556 |
- must enter myself into the collection of open debuggers, |
|
1557 |
in case the stepping process comes back again via a halt or signal |
|
1558 |
before the step is finished. In this case, the stepping debugger should |
|
1559 |
come up (instead of a new one) |
|
1560 |
- must flush caches since optimized methods not always |
|
1561 |
look for pending interrupts |
|
1562 |
" |
|
1563 |
||
1564 |
"/ |
|
1565 |
"/ also must care for stepping into a return |
|
1566 |
"/ |
|
1567 |
steppedContext notNil ifTrue:[ |
|
1568 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
|
1569 |
]. |
|
1570 |
||
1571 |
OpenDebuggers isNil ifTrue:[ |
|
1572 |
OpenDebuggers := WeakIdentitySet new. |
|
1573 |
]. |
|
1574 |
OpenDebuggers add:self. |
|
1575 |
||
1576 |
self label:'single stepping - please wait ...'. |
|
1577 |
stepping := true. |
|
1578 |
||
1579 |
ObjectMemory stepInterruptHandler:self. |
|
1580 |
Processor activeProcess stepInterruptHandler:self. |
|
1581 |
ObjectMemory flushCaches. |
|
1582 |
||
1583 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
|
1584 |
Context singleStepInterruptRequest |
|
1585 |
raiseWith: |
|
1586 |
(("bigStep" steppedContextLineno notNil) |
|
1587 |
ifTrue:[#next] |
|
1588 |
ifFalse:[#step]) |
|
1589 |
] ifFalse:[ |
|
1590 |
"/ see if we came here through an interrupt-action |
|
1591 |
"/ (i.e. aProcess interruptWith:...) |
|
1592 |
||
1593 |
enteredByInterrupt := false. |
|
1594 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
1595 |
[enteredByInterrupt not |
|
1596 |
and:[con notNil |
|
1597 |
and:[con ~~ aContext]]] whileTrue:[ |
|
1598 |
((sel := con selector) == #timerInterrupt |
|
1599 |
or:[sel == #ioInterrupt]) ifTrue:[ |
|
1600 |
enteredByInterrupt := true. |
|
1601 |
] ifFalse:[ |
|
1602 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
|
1603 |
]. |
|
1604 |
]. |
|
1605 |
||
1606 |
ObjectMemory flushInlineCaches. |
|
1607 |
||
1608 |
DebuggingDebugger == true ifTrue:[ |
|
1609 |
enteredByInterrupt printCR. |
|
1610 |
]. |
|
1611 |
enteredByInterrupt ifTrue:[ |
|
1612 |
"/ dont want to step through all intermediate |
|
1613 |
"/ (scheduler-) contexts; place a return-trap on the |
|
1614 |
"/ one right below the interesting one |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1615 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1616 |
"/ 'special unwind return' printCR. |
11210 | 1617 |
con unwindThenDo:[ |
1618 |
Processor activeProcess stepInterruptHandler:self. |
|
1619 |
ObjectMemory stepInterruptHandler:self. |
|
1620 |
InStepInterrupt := nil. |
|
1621 |
StepInterruptPending := 1. |
|
1622 |
InterruptPending := 1]. |
|
1623 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1624 |
"/ 'normal step return' printCR. |
11210 | 1625 |
skipLineNr ~~ #return ifTrue:[ |
1626 |
StepInterruptPending := 1. |
|
1627 |
InterruptPending := 1. |
|
1628 |
] ifFalse:[ |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1629 |
"/ 'step for return' printCR. |
11210 | 1630 |
] |
1631 |
]. |
|
1632 |
InStepInterrupt := nil |
|
1633 |
] |
|
73 | 1634 |
] ifFalse:[ |
11210 | 1635 |
OpenDebuggers notNil ifTrue:[ |
1636 |
OpenDebuggers remove:self ifAbsent:[]. |
|
1637 |
]. |
|
1638 |
self cacheMyself. |
|
73 | 1639 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1640 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1641 |
"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
|
1642 |
"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
|
1643 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
10203 | 1644 |
"Modified (comment): / 06-07-2011 / 12:29:28 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1645 |
! |
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 |
exit_abort |
5455 | 1648 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
1649 |
"/ that one would run on top of this context. |
|
1650 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1651 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1652 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1653 |
"/ done in the #enter:select method. |
5455 | 1654 |
"/ You are not expected to understand this. |
1655 |
||
6487 | 1656 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
1657 |
! |
|
1658 |
||
1659 |
exit_abortAll |
|
1660 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1661 |
"/ that one would run on top of this context. |
|
1662 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1663 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1664 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1665 |
"/ done in the #enter:select method. |
6487 | 1666 |
"/ You are not expected to understand this. |
1667 |
||
1668 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1669 |
! |
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 |
exit_quickTerminate |
3447 | 1672 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1673 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1674 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1675 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 1676 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1677 |
! |
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 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1680 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1681 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1682 |
selectedContext notNil ifTrue:[ |
11210 | 1683 |
con := selectedContext. |
1684 |
self cacheMyself. |
|
1685 |
" |
|
1686 |
have to catch errors occuring in unwind-blocks |
|
1687 |
" |
|
1688 |
Error handle:[:ex | |
|
1689 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1690 |
ex description infoPrintCR. |
|
1691 |
ex proceed |
|
1692 |
] do:[ |
|
1693 |
con unwindAndRestart. |
|
1694 |
]. |
|
1695 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1696 |
] |
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 |
"Created: / 16.11.2001 / 17:23:17 / cg" |
3447 | 1699 |
"Modified: / 17.11.2001 / 23:37:09 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1700 |
! |
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 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1703 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1704 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1705 |
selectedContext notNil ifTrue:[ |
11210 | 1706 |
" |
1707 |
if there is a selection in the codeView, |
|
1708 |
evaluate it and use the result as return value |
|
1709 |
" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1710 |
"/ 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
|
1711 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1712 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1713 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1714 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1715 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1716 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1717 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1718 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1719 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1720 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1721 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1722 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1723 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1724 |
"/ ]. |
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 |
|
11210 | 1727 |
con := selectedContext. |
1728 |
self cacheMyself. |
|
1729 |
" |
|
1730 |
have to catch errors occuring in unwind-blocks |
|
1731 |
" |
|
1732 |
Error handle:[:ex | |
|
1733 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1734 |
ex description infoPrintCR. |
|
1735 |
ex proceed |
|
1736 |
] do:[ |
|
1737 |
con unwind:retVal. |
|
1738 |
]. |
|
1739 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1740 |
] |
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 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 1743 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1744 |
! |
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 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1747 |
|
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 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1750 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1751 |
Error handle:[:ex | |
11210 | 1752 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
1753 |
ex description infoPrintCR. |
|
1754 |
ex proceed |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1755 |
] do:[ |
11210 | 1756 |
self cacheMyself. |
1757 |
Processor activeProcess terminate. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1758 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1759 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1760 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1761 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 1762 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
1763 |
! |
|
1764 |
||
6487 | 1765 |
exit_unwindThenDo:aBlock |
1766 |
|con| |
|
1767 |
||
1768 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1769 |
"/ that one would run on top of this context. |
|
1770 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1771 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1772 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
10205 | 1773 |
"/ done in the #enter:select method. |
6487 | 1774 |
"/ You are not expected to understand this. |
1775 |
||
1776 |
" |
|
1777 |
have to catch errors occuring in unwind-blocks |
|
1778 |
" |
|
1779 |
self cacheMyself. |
|
1780 |
||
1781 |
Error handle:[:ex | |
|
11210 | 1782 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
1783 |
ex description infoPrintCR. |
|
1784 |
||
1785 |
ex proceed |
|
6487 | 1786 |
] do:[ |
11210 | 1787 |
"/ find the enter:select context. |
1788 |
con := thisContext sender. |
|
1789 |
[ |
|
1790 |
(con selector == #enter:select:) |
|
1791 |
and:[con receiver == self] |
|
1792 |
] |
|
1793 |
whileFalse:[ con := con sender ]. |
|
1794 |
||
1795 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
1796 |
con sender receiver == self class ifTrue:[ |
|
1797 |
con := con sender. |
|
1798 |
con sender receiver == self class ifTrue:[ |
|
1799 |
con := con sender. |
|
1800 |
con isBlockContext ifTrue:[ |
|
1801 |
con := con methodHome. |
|
1802 |
] |
|
1803 |
]. |
|
1804 |
]. |
|
1805 |
||
1806 |
con unwindThenDo:aBlock. |
|
6487 | 1807 |
]. |
1808 |
'DebugView [warning]: abort failed' errorPrintCR |
|
1809 |
||
1810 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
1811 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
1812 |
! |
|
1813 |
||
3447 | 1814 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
1815 |
|selection con1 con2 h| |
|
1816 |
||
1817 |
initialSelectionOrNil notNil ifTrue:[ |
|
11210 | 1818 |
^ initialSelectionOrNil |
3447 | 1819 |
]. |
1820 |
||
1821 |
" |
|
1822 |
and find the one context to show initially |
|
1823 |
- if we came here by a send (single step), its the top context; |
|
1824 |
- if we came here by a step (i.e. bigStep), its the top context |
|
1825 |
(for ifs and whiles) or the sender (for regular sends). |
|
1826 |
- otherwise, we came here by some signal raise, and we are interested |
|
1827 |
in the context where the raise actually occured. |
|
1828 |
" |
|
1829 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
1830 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
1831 |
||
1832 |
exitAction == #step ifTrue:[ |
|
11210 | 1833 |
selection := 1. |
1834 |
steppedContext notNil ifTrue:[ |
|
1835 |
||
1836 |
" |
|
1837 |
if we came here by a big-step, show the method where we are |
|
1838 |
" |
|
1839 |
con1 == steppedContext ifTrue:[ |
|
1840 |
selection := 1 |
|
1841 |
] ifFalse:[ |
|
1842 |
con2 == steppedContext ifTrue:[ |
|
1843 |
selection := 2 |
|
1844 |
] |
|
1845 |
]. |
|
1846 |
" |
|
1847 |
for bigStep, we could also be in a block below the actual method ... |
|
1848 |
" |
|
1849 |
((h := con1 home) notNil |
|
1850 |
and:[h == steppedContext]) ifTrue:[ |
|
1851 |
selection := 1 |
|
1852 |
] ifFalse:[ |
|
1853 |
(con2 notNil |
|
1854 |
and:[(h := con2 home) notNil |
|
1855 |
and:[h == steppedContext]]) ifTrue:[ |
|
1856 |
selection := 2 |
|
1857 |
] |
|
1858 |
]. |
|
1859 |
h := nil. |
|
1860 |
] |
|
3447 | 1861 |
] ifFalse:[ |
11210 | 1862 |
steppedContext isNil ifTrue:[ |
1863 |
" |
|
1864 |
preselect a more interesting context, (where halt/raise was ...) |
|
1865 |
" |
|
1866 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
1867 |
selection := self class interestingContextIndexIn:contextArray. |
|
1868 |
selection := selection min:(contextArray size). |
|
1869 |
] ifFalse:[ |
|
1870 |
" |
|
1871 |
if we came here by a big-step, show the method where we are |
|
1872 |
" |
|
1873 |
con1 == steppedContext ifTrue:[ |
|
1874 |
selection := 1 |
|
1875 |
] ifFalse:[ |
|
1876 |
con2 == steppedContext ifTrue:[ |
|
1877 |
selection := 2. |
|
1878 |
] |
|
1879 |
] |
|
1880 |
] |
|
3447 | 1881 |
]. |
1882 |
^ selection |
|
1883 |
||
1884 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
1885 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 1886 |
! |
1887 |
||
5110 | 1888 |
isInspecting |
1889 |
^ inspecting |
|
1890 |
! |
|
1891 |
||
1892 |
isNotInspecting |
|
1893 |
^ inspecting not |
|
1894 |
! |
|
1895 |
||
73 | 1896 |
openOn:aProcess |
10205 | 1897 |
"enter the debugger on a process - |
73 | 1898 |
in this case, we are just inspecting the context chain of the process, |
1899 |
not running on top of the debugged process, but as a separate |
|
1900 |
one. (think of it as an inspector showing more detail, and offering |
|
1901 |
some more control operations)" |
|
1902 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1903 |
|bpanel dummy w| |
73 | 1904 |
|
8148 | 1905 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1906 |
|
73 | 1907 |
busy := true. |
1908 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1909 |
stepHow := nil. |
73 | 1910 |
inspecting := true. |
1911 |
inspectedProcess := aProcess. |
|
8148 | 1912 |
nChainShown := InitialNChainShown. |
73 | 1913 |
|
1914 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1915 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1916 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1917 |
"/ get the max size & freeze button |
6647 | 1918 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1919 |
w := continueButton preferredWidth. |
6647 | 1920 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1921 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1922 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1923 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1924 |
aProcess state == #run ifTrue:[ |
11210 | 1925 |
device hasColors ifTrue:[ |
1926 |
continueButton foregroundColor:Color red darkened. |
|
1927 |
]. |
|
1928 |
continueButton label:(resources string:'Stop'). |
|
1929 |
continueButton action:[self doStop]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1930 |
] ifFalse:[ |
11210 | 1931 |
device hasColors ifTrue:[ |
1932 |
continueButton foregroundColor:Color green darkened darkened. |
|
1933 |
]. |
|
1934 |
continueButton label:(resources string:'Continue'). |
|
1935 |
continueButton action:[self doContinue]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1936 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1937 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 1938 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1939 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1940 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1941 |
|
92 | 1942 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 1943 |
dummy borderWidth:0; level:0. |
61 | 1944 |
|
73 | 1945 |
"/ stepButton destroy. |
1946 |
"/ sendButton destroy. |
|
1947 |
||
1948 |
updateButton := Button |
|
11210 | 1949 |
label:(resources string:'Update') |
1950 |
action:[self updateContext] |
|
1951 |
in:bpanel. |
|
73 | 1952 |
monitorToggle := Toggle in:bpanel. |
6647 | 1953 |
monitorToggle label:(resources string:'Monitor'). |
73 | 1954 |
monitorToggle pressAction:[self autoUpdateOn]. |
1955 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
1956 |
||
1957 |
"can only look into process - context chain is not active" |
|
1958 |
canContinue := true. |
|
1959 |
||
1960 |
terminateButton enable. |
|
1961 |
abortButton enable. |
|
1962 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1963 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1964 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1965 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1966 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1967 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 1968 |
|
1969 |
aProcess isNil ifTrue:[ |
|
11210 | 1970 |
terminateButton disable. |
1971 |
abortButton disable. |
|
1972 |
continueButton disable. |
|
1973 |
returnButton disable. |
|
1974 |
restartButton disable. |
|
73 | 1975 |
] ifFalse:[ |
11210 | 1976 |
(aProcess suspendedContext isNil |
1977 |
or:[aProcess isSystemProcess]) ifTrue:[ |
|
1978 |
terminateButton disable. |
|
1979 |
]. |
|
1980 |
||
1981 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
|
1982 |
||
1983 |
catchBlock := [ |
|
1984 |
catchBlock := nil. |
|
1985 |
contextArray := nil. |
|
1986 |
selectedContext := actualContext := firstContext := nil. |
|
1987 |
steppedContext := wrapperContext := nil. |
|
1988 |
||
1989 |
(exitAction == #terminate) ifTrue:[ |
|
1990 |
aProcess terminate. |
|
1991 |
]. |
|
1992 |
(exitAction == #quickTerminate) ifTrue:[ |
|
1993 |
aProcess terminateNoSignal. |
|
1994 |
]. |
|
1995 |
super destroy |
|
1996 |
]. |
|
73 | 1997 |
]. |
1998 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1999 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2000 |
"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
|
2001 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2002 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2003 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2004 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 2005 |
|selection| |
2006 |
||
2007 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2008 |
selection notNil ifTrue:[ |
11210 | 2009 |
self showSelection:selection. |
2010 |
contextView setSelection:selection. |
|
2011 |
selection > 1 ifTrue:[ |
|
2012 |
contextView scrollToLine:(selection - 1) |
|
2013 |
] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2014 |
]. |
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 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 2017 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2018 |
! |
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 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2021 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2022 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2023 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2024 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2025 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2026 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2027 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2028 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2029 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2030 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 2031 |
! ! |
2032 |
||
2033 |
!DebugView methodsFor:'help'! |
|
2034 |
||
8212 | 2035 |
flyByHelpDependsOnPositionIn:aView |
2036 |
"subclasses where the help-text depends upon the pointer position might |
|
2037 |
want to redefine this" |
|
2038 |
||
2039 |
^ aView == codeView |
|
2040 |
! |
|
2041 |
||
3510 | 2042 |
flyByHelpTextFor:aComponent |
2043 |
|s| |
|
2044 |
||
2045 |
aComponent == abortButton ifTrue:[ |
|
11210 | 2046 |
s := 'Abort (unwind to eventLoop)' |
3510 | 2047 |
]. |
2048 |
aComponent == terminateButton ifTrue:[ |
|
11210 | 2049 |
s := 'Terminate process (close view)' |
3510 | 2050 |
]. |
2051 |
aComponent == continueButton ifTrue:[ |
|
11210 | 2052 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2053 |
s := 'Stop' |
|
2054 |
] ifFalse:[ |
|
2055 |
s := 'Continue execution' |
|
2056 |
] |
|
3510 | 2057 |
]. |
2058 |
aComponent == stepButton ifTrue:[ |
|
11210 | 2059 |
s := 'Step to next send (don''t enter into called methods)' |
3510 | 2060 |
]. |
2061 |
aComponent == nextButton ifTrue:[ |
|
11210 | 2062 |
s := 'Step to next line (don''t enter into called methods)' |
3510 | 2063 |
]. |
2064 |
aComponent == nextOverButton ifTrue:[ |
|
11210 | 2065 |
s := 'Step over to cursor-line' |
3510 | 2066 |
]. |
2067 |
aComponent == nextOutButton ifTrue:[ |
|
11210 | 2068 |
s := 'Step out to caller' |
3510 | 2069 |
]. |
2070 |
aComponent == sendButton ifTrue:[ |
|
11210 | 2071 |
s := 'Send next message (enter into called methods)' |
3510 | 2072 |
]. |
2073 |
aComponent == returnButton ifTrue:[ |
|
11210 | 2074 |
s := 'Return from selected method' |
3510 | 2075 |
]. |
2076 |
aComponent == restartButton ifTrue:[ |
|
11210 | 2077 |
s := 'Restart selected method' |
3510 | 2078 |
]. |
2079 |
aComponent == monitorToggle ifTrue:[ |
|
11210 | 2080 |
s := 'Toggle monitoring' |
3510 | 2081 |
]. |
2082 |
aComponent == updateButton ifTrue:[ |
|
11210 | 2083 |
s := 'Update' |
3510 | 2084 |
]. |
8656 | 2085 |
aComponent == reportButton ifTrue:[ |
11210 | 2086 |
s := 'Send a defect report via eMail' |
8656 | 2087 |
]. |
3510 | 2088 |
s notNil ifTrue:[ |
11210 | 2089 |
^ resources string:s |
3510 | 2090 |
]. |
2091 |
^ nil |
|
2092 |
||
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2093 |
"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
|
2094 |
"Modified: / 18-06-2010 / 11:34:51 / cg" |
3510 | 2095 |
! |
2096 |
||
8212 | 2097 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 2098 |
|s vline line col pos interval| |
8212 | 2099 |
|
2100 |
aComponent == codeView ifFalse:[^ nil]. |
|
2101 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
9446 | 2102 |
self sensor motionEventPending ifTrue:[^ nil]. |
8212 | 2103 |
|
8396 | 2104 |
vline := codeView visibleLineOfY:aPointOrNil y. |
2105 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
2106 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 2107 |
|
2108 |
pos := codeView characterPositionOfLine:line col:col. |
|
2109 |
interval := pos to:pos. |
|
2110 |
||
10205 | 2111 |
self |
11210 | 2112 |
withNodeValueAtInterval:interval |
2113 |
do:[:value :description | |
|
2114 |
|valueClassOrSizeString valueString| |
|
2115 |
||
2116 |
valueClassOrSizeString := valueString := ''. |
|
2117 |
||
2118 |
"/ some heuristics as when to show the class name (a purely subjective preference) |
|
2119 |
value isString ifTrue:[ |
|
2120 |
value isText ifTrue:[ |
|
2121 |
valueString := '"',(value contractTo:80),'"'. |
|
2122 |
] ifFalse:[ |
|
2123 |
valueString := value storeString contractTo:80. |
|
2124 |
]. |
|
2125 |
] ifFalse:[ |
|
2126 |
(value isBoolean |
|
2127 |
or:[ value isInteger |
|
2128 |
or:[ value isSymbol ]]) ifTrue:[ |
|
2129 |
valueString := value printString. |
|
2130 |
] ifFalse:[ |
|
2131 |
valueClassOrSizeString := ' (',value class name,')'. |
|
2132 |
||
2133 |
(value isArray |
|
2134 |
or:[ value isOrderedCollection ]) ifTrue:[ |
|
2135 |
valueClassOrSizeString := ' (size=',value size printString,')'. |
|
2136 |
]. |
|
2137 |
||
2138 |
Error handle:[:ex | |
|
2139 |
valueString := '??? (',ex description,')' |
|
2140 |
] do:[ |
|
2141 |
[ |
|
2142 |
valueString := value printString contractTo:80. |
|
2143 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
|
2144 |
] |
|
2145 |
] |
|
2146 |
]. |
|
2147 |
description isEmptyOrNil ifTrue:[ |
|
2148 |
s := valueString , valueClassOrSizeString |
|
2149 |
] ifFalse:[ |
|
2150 |
s := description , ': ', valueString, valueClassOrSizeString |
|
2151 |
]. |
|
2152 |
]. |
|
8592 | 2153 |
"/ Transcript showCR:s. |
2154 |
^ s |
|
9446 | 2155 |
|
2156 |
"Modified: / 27-04-2010 / 17:51:53 / cg" |
|
8212 | 2157 |
! |
2158 |
||
266 | 2159 |
helpTextFor:aComponent |
2160 |
|s| |
|
2161 |
||
2162 |
aComponent == abortButton ifTrue:[ |
|
11210 | 2163 |
s := 'HELP_ABORT' |
266 | 2164 |
]. |
2165 |
aComponent == terminateButton ifTrue:[ |
|
11210 | 2166 |
s := 'HELP_TERMINATE' |
266 | 2167 |
]. |
2168 |
aComponent == continueButton ifTrue:[ |
|
11210 | 2169 |
continueButton label = (resources string:'Stop') ifTrue:[ |
2170 |
s := 'HELP_STOP' |
|
2171 |
] ifFalse:[ |
|
2172 |
s := 'HELP_CONTINUE' |
|
2173 |
] |
|
266 | 2174 |
]. |
2175 |
aComponent == stepButton ifTrue:[ |
|
11210 | 2176 |
s := 'HELP_STEP' |
266 | 2177 |
]. |
2178 |
aComponent == nextButton ifTrue:[ |
|
11210 | 2179 |
s := 'HELP_NEXT' |
266 | 2180 |
]. |
1065 | 2181 |
aComponent == nextOverButton ifTrue:[ |
11210 | 2182 |
s := 'HELP_NEXTOVER' |
1065 | 2183 |
]. |
2184 |
aComponent == nextOutButton ifTrue:[ |
|
11210 | 2185 |
s := 'HELP_NEXTOUT' |
1065 | 2186 |
]. |
266 | 2187 |
aComponent == stepButton ifTrue:[ |
11210 | 2188 |
s := 'HELP_STEP' |
266 | 2189 |
]. |
2190 |
aComponent == sendButton ifTrue:[ |
|
11210 | 2191 |
s := 'HELP_SEND' |
266 | 2192 |
]. |
2193 |
aComponent == returnButton ifTrue:[ |
|
11210 | 2194 |
s := 'HELP_RETURN' |
266 | 2195 |
]. |
2196 |
aComponent == restartButton ifTrue:[ |
|
11210 | 2197 |
s := 'HELP_RESTART' |
266 | 2198 |
]. |
2199 |
aComponent == contextView ifTrue:[ |
|
11210 | 2200 |
s := 'HELP_WALKBACK' |
266 | 2201 |
]. |
2202 |
aComponent == codeView ifTrue:[ |
|
11210 | 2203 |
s := 'HELP_CODEVIEW' |
266 | 2204 |
]. |
2205 |
aComponent == monitorToggle ifTrue:[ |
|
11210 | 2206 |
s := 'HELP_MONITOR' |
266 | 2207 |
]. |
2208 |
aComponent == updateButton ifTrue:[ |
|
11210 | 2209 |
s := 'HELP_UPDATE' |
266 | 2210 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2211 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2212 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2213 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2214 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
11210 | 2215 |
s := 'HELP_REC_INSP' |
266 | 2216 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2217 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
11210 | 2218 |
s := 'HELP_CON_INSP' |
266 | 2219 |
]. |
2220 |
||
2221 |
s notNil ifTrue:[ |
|
11210 | 2222 |
^ resources string:s |
266 | 2223 |
]. |
2224 |
^ nil |
|
2225 |
||
2226 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 2227 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 2228 |
! ! |
2229 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2230 |
!DebugView methodsFor:'initialization & release'! |
266 | 2231 |
|
2232 |
addToCurrentProject |
|
2233 |
"ignored here" |
|
2234 |
||
2235 |
^ self |
|
2236 |
! |
|
2237 |
||
2115 | 2238 |
destroy |
2239 |
"closing the debugger implies an abort or continue" |
|
2240 |
||
2404 | 2241 |
|m| |
2242 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
2243 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 2244 |
(self confirm:('Code modified - exit anyway ?')) |
2245 |
ifFalse:[ |
|
2246 |
^ self |
|
2247 |
] |
|
2115 | 2248 |
]. |
2249 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2250 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2251 |
|
2404 | 2252 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 2253 |
inspecting ifFalse:[ |
11210 | 2254 |
"I am running on top of a process, abort or continue it" |
2255 |
||
2256 |
windowGroup notNil ifTrue:[ |
|
2257 |
windowGroup setProcess:nil. |
|
2258 |
]. |
|
2259 |
self uncacheMyself. |
|
2260 |
||
2261 |
"/ |
|
2262 |
"/ catch invalid return; |
|
2263 |
"/ this happens, when my process has somehow died (quickterminate) |
|
2264 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
2265 |
"/ #destroy-window function. |
|
2266 |
"/ |
|
2267 |
Context cannotReturnSignal handle:[:ex | |
|
2268 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
|
2269 |
self uncacheMyself. |
|
2270 |
Debugger newDebugger. |
|
2271 |
ex return. |
|
2272 |
] do:[ |
|
2273 |
AbortOperationRequest isHandled ifTrue:[ |
|
2274 |
self doAbort. |
|
2275 |
] ifFalse:[ |
|
2276 |
self doContinue |
|
2277 |
] |
|
2278 |
]. |
|
2279 |
"/ We don't reach this point normally |
|
2280 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2281 |
Debugger newDebugger. |
|
2282 |
self uncacheMyself. |
|
2115 | 2283 |
]. |
2284 |
||
2299 | 2285 |
Debugger newDebugger. |
2115 | 2286 |
"/ since I am going to be destroyed, remove me from the cache |
2287 |
self uncacheMyself. |
|
2288 |
super destroy. |
|
2289 |
||
2290 |
"Modified: / 10.7.1997 / 17:15:41 / stefan" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2291 |
"Modified: / 16.11.2001 / 17:38:15 / cg" |
2115 | 2292 |
! |
2293 |
||
266 | 2294 |
initialize |
10205 | 2295 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2296 |
newLayout v exceptionAndTogglePanel| |
266 | 2297 |
|
2298 |
super initialize. |
|
2299 |
||
2340 | 2300 |
font := font onDevice:device. |
266 | 2301 |
|
8148 | 2302 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2303 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
11210 | 2304 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2305 |
|
266 | 2306 |
busy := false. |
2307 |
exclusive := false. |
|
2308 |
inspecting := false. |
|
2309 |
exitAction := nil. |
|
2310 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2311 |
stepHow := nil. |
266 | 2312 |
canContinue := false. |
2313 |
||
3269 | 2314 |
mH := 0. |
2315 |
||
3447 | 2316 |
menuPanel := MenuPanel in:self. |
8131 | 2317 |
menuPanel receiver:self. |
3447 | 2318 |
menuPanel verticalLayout:false. |
8131 | 2319 |
menu := self class menuSpec decodeAsLiteralArray. |
2320 |
menu findGuiResourcesIn:self. |
|
2321 |
menuPanel menu:menu. |
|
3447 | 2322 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2323 |
mH := menuPanel preferredHeight. |
3447 | 2324 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2325 |
||
8148 | 2326 |
newLayout := UserPreferences current useNewLayoutInDebugger. |
2327 |
newLayout ifFalse:[ |
|
11210 | 2328 |
bpanel := HorizontalPanelView in:self. |
2329 |
||
2330 |
self initializeButtonsIn:bpanel. |
|
2331 |
||
2332 |
bH := bpanel preferredHeight + 5. |
|
2333 |
bpanel origin:(0.0 @ mH) |
|
2334 |
extent:(1.0 @ bH). |
|
2335 |
panel := VariableVerticalPanel |
|
2336 |
origin:(0.0 @ (mH + bH)) |
|
2337 |
corner:(1.0 @ 1.0) |
|
2338 |
in:self. |
|
2339 |
||
2340 |
v := self initializeContextListViewIn:panel. |
|
2341 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2342 |
||
2343 |
codePanel := View in:panel. |
|
2344 |
v := self initializeCodeViewIn:codePanel. |
|
2345 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
2346 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2347 |
||
2348 |
v := self initializeInspectorViewsIn:panel. |
|
2349 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2350 |
|
8148 | 2351 |
] ifTrue:[ |
11210 | 2352 |
bpanel1 := HorizontalPanelView in:self. |
2353 |
self initializeButtons1In:bpanel1. |
|
2354 |
||
2355 |
bH1 := bpanel1 preferredHeight + 5. |
|
2356 |
bpanel1 origin:(0.0 @ mH) |
|
2357 |
extent:(1.0 @ bH1). |
|
2358 |
panel := VariableVerticalPanel |
|
2359 |
origin:(0.0 @ (mH + bH1)) |
|
2360 |
corner:(1.0 @ 1.0) |
|
2361 |
in:self. |
|
2362 |
"/ panel showHandle:true. |
|
2363 |
"/ panel handlePosition:#left. |
|
2364 |
||
2365 |
v := self initializeContextListViewIn:panel. |
|
2366 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2367 |
||
2368 |
codePanel := View in:panel. |
|
2369 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
2370 |
self initializeButtons2In:bpanel2. |
|
2371 |
||
2372 |
bH2 := bpanel2 preferredHeight + 5. |
|
2373 |
bpanel2 origin:(0.0 @ 0.0) |
|
2374 |
extent:(1.0 @ bH2). |
|
2375 |
||
2376 |
exceptionInfoLabel := Label label:''. |
|
2377 |
exceptionInfoLabel adjust:#left. |
|
2378 |
||
2379 |
exceptionAndTogglePanel := HorizontalPanelView in:codePanel. |
|
2380 |
exceptionAndTogglePanel horizontalLayout:#left. |
|
2381 |
exceptionAndTogglePanel |
|
2382 |
geometryLayout: |
|
2383 |
((LayoutFrame |
|
2384 |
origin:(0.0 @ 0.0) |
|
2385 |
corner:(1.0 @ 0.0)) |
|
2386 |
topOffset:bH2; |
|
2387 |
bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6); |
|
2388 |
rightOffset:-2). |
|
2389 |
||
2390 |
methodCodeToggleSelectionHolder := 1 asValue. |
|
2391 |
methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self. |
|
2392 |
methodCodeToggle := PopUpList label:(resources string:'Original Code (Executed)') in:exceptionAndTogglePanel. |
|
2393 |
methodCodeToggle list:(resources array:#( 'Original Code (Executed)' 'Current Code')). |
|
2394 |
methodCodeToggle useIndex:true. |
|
2395 |
methodCodeToggle model:methodCodeToggleSelectionHolder. |
|
2396 |
methodCodeToggle beInvisible. |
|
2397 |
||
2398 |
exceptionAndTogglePanel add:exceptionInfoLabel. |
|
2399 |
||
2400 |
v := self initializeCodeViewIn:codePanel. |
|
2401 |
v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0). |
|
2402 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2403 |
||
2404 |
v := self initializeInspectorViewsIn:panel. |
|
2405 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
3269 | 2406 |
]. |
2407 |
||
3387 | 2408 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
11210 | 2409 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2410 |
]. |
9626 | 2411 |
LastExtent notNil ifTrue:[ |
11210 | 2412 |
self extent:LastExtent. |
9626 | 2413 |
]. |
2414 |
LastOrigin notNil ifTrue:[ |
|
11210 | 2415 |
self origin:LastOrigin. |
9626 | 2416 |
]. |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2417 |
|
3269 | 2418 |
" |
2419 |
Debugger newDebugger |
|
2420 |
" |
|
3447 | 2421 |
|
9626 | 2422 |
"Modified: / 10-11-2010 / 10:09:34 / cg" |
3269 | 2423 |
! |
2424 |
||
10205 | 2425 |
initializeAbortButtonIn:bpanel |
2426 |
abortButton := Button |
|
11210 | 2427 |
label:(resources string:'Abort') |
2428 |
action:[ |
|
2429 |
abortButton turnOffWithoutRedraw. |
|
2430 |
self doAbort |
|
2431 |
] |
|
2432 |
in:bpanel. |
|
3447 | 2433 |
|
2434 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
2435 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
2436 |
! |
|
2437 |
||
10205 | 2438 |
initializeButtons1In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2439 |
"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
|
2440 |
|
3447 | 2441 |
|separator| |
2442 |
||
10205 | 2443 |
bpanel horizontalLayout:#left. |
3447 | 2444 |
bpanel verticalLayout:#centerMax. |
2445 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2446 |
||
8194 | 2447 |
self initializeContinueButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2448 |
continueButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2449 |
|
9131 | 2450 |
"/ separator := View extent:(10 @ 5) in:bpanel. |
2451 |
"/ separator borderWidth:0; level:0. |
|
3447 | 2452 |
self initializeAbortButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2453 |
abortButton width:150. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2454 |
|
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2455 |
separator := View extent:(100 @ 5) in:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2456 |
separator borderWidth:0; level:0. |
3269 | 2457 |
|
3447 | 2458 |
self initializeTerminateButtonIn:bpanel. |
2459 |
||
9131 | 2460 |
separator := View extent:(50 @ 5) in:bpanel. |
3447 | 2461 |
separator borderWidth:0; level:0. |
2462 |
||
2463 |
self initializeDefineButtonIn:bpanel. |
|
4356 | 2464 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
11210 | 2465 |
separator := View extent:(10 @ 5) in:bpanel. |
2466 |
separator borderWidth:0; level:0. |
|
2467 |
self initializeReportButtonIn:bpanel. |
|
4356 | 2468 |
]. |
3447 | 2469 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 2470 |
! |
2471 |
||
10205 | 2472 |
initializeButtons2In:bpanel |
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
2473 |
"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
|
2474 |
|
3269 | 2475 |
|separator| |
2476 |
||
9131 | 2477 |
bpanel horizontalLayout:#left. |
3269 | 2478 |
bpanel verticalLayout:#centerMax. |
2479 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2480 |
||
3447 | 2481 |
self initializeNextButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2482 |
nextButton width:100. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2483 |
|
3447 | 2484 |
self initializeStepButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2485 |
stepButton width:100. |
3447 | 2486 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2487 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2488 |
"/ 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
|
2489 |
"/ 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
|
2490 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2491 |
|
3269 | 2492 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2493 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2494 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2495 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2496 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2497 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2498 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2499 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2500 |
"/ in:bpanel. |
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 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2503 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2504 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2505 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2506 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2507 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2508 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2509 |
"/ in:bpanel. |
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 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2512 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2513 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2514 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2515 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2516 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2517 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2518 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2519 |
|
3447 | 2520 |
self initializeSendButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2521 |
sendButton width:100. |
3447 | 2522 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2523 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2524 |
separator borderWidth:0; level:0. |
3269 | 2525 |
|
3447 | 2526 |
self initializeReturnButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2527 |
returnButton width:100. |
3447 | 2528 |
self initializeRestartButtonIn:bpanel. |
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2529 |
restartButton width:100. |
3447 | 2530 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
2531 |
"Modified: / 18-06-2010 / 08:32:05 / cg" |
3269 | 2532 |
! |
2533 |
||
10205 | 2534 |
initializeButtonsIn:bpanel |
3269 | 2535 |
|separator| |
2536 |
||
2537 |
bpanel horizontalLayout:#left. |
|
2538 |
bpanel verticalLayout:#centerMax. |
|
2539 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2540 |
||
3447 | 2541 |
self initializeAbortButtonIn:bpanel. |
2542 |
||
3269 | 2543 |
separator := View extent:(10 @ 5) in:bpanel. |
2544 |
separator borderWidth:0; level:0. |
|
2545 |
||
3447 | 2546 |
self initializeContinueButtonIn:bpanel. |
3269 | 2547 |
|
2548 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2549 |
separator borderWidth:0; level:0. |
|
2550 |
||
10205 | 2551 |
self initializeReturnButtonIn:bpanel. |
2552 |
self initializeRestartButtonIn:bpanel. |
|
3269 | 2553 |
|
2554 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2555 |
separator borderWidth:0; level:0. |
|
2556 |
||
3447 | 2557 |
self initializeNextButtonIn:bpanel. |
2558 |
self initializeStepButtonIn:bpanel. |
|
2559 |
||
3269 | 2560 |
"/ cg: |
2561 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
2562 |
"/ they do not work relyable with inlined blocks yet. |
|
2563 |
"/ |
|
2564 |
||
2565 |
||
2566 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
2567 |
"/ img isNil ifTrue:[ |
|
2568 |
"/ img := (resources at:'next') |
|
2569 |
"/ ]. |
|
2570 |
"/ nextButton := Button |
|
2571 |
"/ label:img |
|
2572 |
"/ action:[stepButton turnOff. self doNext] |
|
2573 |
"/ in:bpanel. |
|
2574 |
"/ |
|
2575 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
2576 |
"/ img isNil ifTrue:[ |
|
2577 |
"/ img := (resources at:'over') |
|
2578 |
"/ ]. |
|
2579 |
"/ nextOverButton := Button |
|
2580 |
"/ label:img |
|
2581 |
"/ action:[stepButton turnOff. self doNextOver] |
|
2582 |
"/ in:bpanel. |
|
2583 |
"/ |
|
2584 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
2585 |
"/ img isNil ifTrue:[ |
|
2586 |
"/ img := (resources at:'out') |
|
2587 |
"/ ]. |
|
2588 |
"/ nextOutButton := Button |
|
2589 |
"/ label:img |
|
2590 |
"/ action:[stepButton turnOff. self doNextOut] |
|
2591 |
"/ in:bpanel. |
|
2592 |
||
3447 | 2593 |
self initializeSendButtonIn:bpanel. |
2594 |
||
3187 | 2595 |
separator := View extent:(30 @ 5) in:bpanel. |
2596 |
separator borderWidth:0; level:0. |
|
3269 | 2597 |
|
3447 | 2598 |
self initializeTerminateButtonIn:bpanel. |
2599 |
||
3269 | 2600 |
separator := View extent:(30 @ 5) in:bpanel. |
2601 |
separator borderWidth:0; level:0. |
|
2602 |
||
3447 | 2603 |
self initializeDefineButtonIn:bpanel. |
4356 | 2604 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
11210 | 2605 |
self initializeReportButtonIn:bpanel. |
4356 | 2606 |
]. |
2607 |
||
3447 | 2608 |
|
2609 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
2610 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 2611 |
! |
2612 |
||
2613 |
initializeCodeViewIn:panel |
|
2614 |
|v| |
|
2615 |
||
10628 | 2616 |
(UserPreferences current useCodeView2In: #Debugger) ifTrue:[ |
2617 |
v := codeView := Tools::CodeView2 in: panel. |
|
2618 |
codeView model: ValueHolder new. |
|
2619 |
codeView methodHolder: ValueHolder new. |
|
2620 |
codeView classHolder: ValueHolder new. |
|
2621 |
] ifFalse:[ |
|
2622 |
v := HVScrollableView |
|
2623 |
for:CodeView |
|
2624 |
miniScrollerH:true |
|
2625 |
miniScrollerV:false |
|
2626 |
in:panel. |
|
2627 |
||
2628 |
"/ v autoHideScrollBars:true. |
|
2629 |
codeView := v scrolledView. |
|
2630 |
codeView enableMotionEvents. "/ for active help |
|
2631 |
]. |
|
3269 | 2632 |
|
2633 |
^ v |
|
10628 | 2634 |
|
2635 |
"Modified: / 27-07-2011 / 13:15:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3269 | 2636 |
! |
2637 |
||
2638 |
initializeContextListViewIn:panel |
|
2639 |
|v| |
|
266 | 2640 |
|
10205 | 2641 |
v := HVScrollableView |
11210 | 2642 |
for:SelectionInListView |
2643 |
miniScrollerH:true |
|
2644 |
miniScrollerV:false |
|
2645 |
in:panel. |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2646 |
v autoHideHorizontalScrollBar:true. |
266 | 2647 |
|
2648 |
contextView := v scrolledView. |
|
2649 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 2650 |
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
|
2651 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 2652 |
|
10205 | 2653 |
contextView middleButtonMenu:(self middleButtonMenu). |
5453 | 2654 |
|
3269 | 2655 |
^ v |
2656 |
! |
|
2657 |
||
5453 | 2658 |
initializeContextViewsMiddleButtonMenu |
2659 |
<resource: #programMenu > |
|
2660 |
||
10205 | 2661 |
contextView middleButtonMenu:(self middleButtonMenu). |
2662 |
! |
|
2663 |
||
2664 |
initializeContinueButtonIn:bpanel |
|
2665 |
continueButton := Button |
|
11210 | 2666 |
label:(resources string:'Continue') |
2667 |
action:[ |
|
2668 |
continueButton turnOffWithoutRedraw. |
|
2669 |
self doContinue |
|
2670 |
] |
|
2671 |
in:bpanel. |
|
3447 | 2672 |
|
2673 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
2674 |
! |
|
2675 |
||
10205 | 2676 |
initializeDefineButtonIn:bpanel |
2677 |
defineButton := Button |
|
11210 | 2678 |
label:(resources string:'Define') |
2679 |
action:[ |
|
2680 |
defineButton turnOffWithoutRedraw. |
|
2681 |
self doDefine |
|
2682 |
] |
|
2683 |
in:bpanel. |
|
3447 | 2684 |
defineButton beInvisible |
2685 |
||
2686 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
2687 |
! |
|
2688 |
||
3269 | 2689 |
initializeInspectorViewsIn:panel |
2690 |
|hpanel| |
|
266 | 2691 |
|
2692 |
hpanel := VariableHorizontalPanel in:panel. |
|
2693 |
||
2694 |
receiverInspector := InspectorView |
|
11210 | 2695 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
2696 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2697 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 2698 |
|
2699 |
contextInspector := ContextInspectorView |
|
11210 | 2700 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
2701 |
in:hpanel. |
|
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2702 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2703 |
|
3269 | 2704 |
^ hpanel |
266 | 2705 |
! |
2706 |
||
10205 | 2707 |
initializeNextButtonIn:bpanel |
2708 |
nextButton := Button |
|
11210 | 2709 |
label:(resources string:'Debug_Next') |
2710 |
action:[ |
|
2711 |
stepButton turnOff. |
|
2712 |
self doNext |
|
2713 |
] |
|
2714 |
in:bpanel. |
|
3447 | 2715 |
|
2716 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
2717 |
! |
|
2718 |
||
10205 | 2719 |
initializeReportButtonIn:bpanel |
2720 |
reportButton := Button |
|
11210 | 2721 |
label:(resources string:'Report by Mail...') |
2722 |
action:[ |
|
2723 |
reportButton turnOffWithoutRedraw. |
|
2724 |
self doOpenReportMailApp. |
|
2725 |
] |
|
2726 |
in:bpanel. |
|
4356 | 2727 |
|
2728 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
2729 |
! |
|
2730 |
||
10205 | 2731 |
initializeRestartButtonIn:bpanel |
2732 |
restartButton := Button |
|
11210 | 2733 |
label:(resources string:'Restart') |
2734 |
action:[ |
|
2735 |
restartButton turnOff. |
|
2736 |
self doRestart |
|
2737 |
] |
|
2738 |
in:bpanel. |
|
3447 | 2739 |
|
2740 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
|
2741 |
! |
|
2742 |
||
10205 | 2743 |
initializeReturnButtonIn:bpanel |
2744 |
returnButton := Button |
|
11210 | 2745 |
label:(resources string:'Return') |
2746 |
action:[ |
|
2747 |
returnButton turnOff. |
|
2748 |
self doReturn |
|
2749 |
] |
|
2750 |
in:bpanel. |
|
3447 | 2751 |
|
2752 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
2753 |
! |
|
2754 |
||
10205 | 2755 |
initializeSendButtonIn:bpanel |
2756 |
sendButton := Button |
|
11210 | 2757 |
label:(resources string:'Send') |
2758 |
action:[ |
|
2759 |
sendButton turnOff. |
|
2760 |
self doSend |
|
2761 |
] |
|
2762 |
in:bpanel. |
|
3447 | 2763 |
|
2764 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
2765 |
! |
|
2766 |
||
10205 | 2767 |
initializeStepButtonIn:bpanel |
2768 |
stepButton := Button |
|
11210 | 2769 |
label:(resources string:'Debug_Step') |
2770 |
action:[ |
|
2771 |
stepButton turnOff. |
|
2772 |
self doStep |
|
2773 |
] |
|
2774 |
in:bpanel. |
|
3447 | 2775 |
|
2776 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
2777 |
! |
|
2778 |
||
10205 | 2779 |
initializeTerminateButtonIn:bpanel |
2780 |
terminateButton := Button |
|
11210 | 2781 |
label:(resources string:'Debug_Terminate') |
2782 |
action:[ |
|
2783 |
terminateButton turnOffWithoutRedraw. |
|
2784 |
self doTerminate |
|
2785 |
] |
|
2786 |
in:bpanel. |
|
3447 | 2787 |
|
9135
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2788 |
terminateButton backgroundColor:Color red lightened. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2789 |
"/ terminateButton foregroundColor:Color red. |
b686c004104c
comment/format in: #initializeStepButtonIn:
Claus Gittinger <cg@exept.de>
parents:
9133
diff
changeset
|
2790 |
|
3447 | 2791 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
266 | 2792 |
! |
2793 |
||
1249 | 2794 |
postRealize |
2795 |
super postRealize. |
|
266 | 2796 |
|
2797 |
inspecting ifTrue:[ |
|
11210 | 2798 |
inspectedProcess notNil ifTrue:[ |
2799 |
" |
|
2800 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
2801 |
to run between mine and the debugged processes prio) |
|
2802 |
" |
|
2803 |
Processor activeProcess |
|
2804 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
|
2805 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2806 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2807 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2808 |
self sensor addEventListener:self. |
1249 | 2809 |
|
2810 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 2811 |
! |
2812 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2813 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2814 |
"/ 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
|
2815 |
"/ 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
|
2816 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2817 |
drawableId notNil ifTrue:[ |
11210 | 2818 |
^ self |
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2819 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2820 |
"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
|
2821 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2822 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2823 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2824 |
|
266 | 2825 |
setLabelFor:aMessage in:aProcess |
9403 | 2826 |
|l lines processNameOrNil pidOrNil osPidString| |
6821 | 2827 |
|
2828 |
lines := aMessage asStringCollection. |
|
2829 |
lines size > 1 ifTrue:[ |
|
11210 | 2830 |
l := lines first |
6821 | 2831 |
] ifFalse:[ |
11210 | 2832 |
l := aMessage. |
6821 | 2833 |
]. |
2834 |
||
2835 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2836 |
Error handle:[:ex | |
11210 | 2837 |
l := l , '???' |
1030 | 2838 |
] do:[ |
11210 | 2839 |
processNameOrNil := aProcess name. |
2840 |
processNameOrNil notNil ifTrue:[ |
|
2841 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
2842 |
]. |
|
2843 |
pidOrNil := aProcess id printString. |
|
2844 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 2845 |
]. |
1030 | 2846 |
l := l , ')'. |
266 | 2847 |
self label:l. |
6821 | 2848 |
|
10205 | 2849 |
((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[ |
11210 | 2850 |
osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'. |
9403 | 2851 |
]. |
2852 |
||
8305 | 2853 |
exceptionInfoLabel notNil ifTrue:[ |
11210 | 2854 |
exceptionInfoLabel |
2855 |
label:(resources |
|
2856 |
string:'Exception: %1 in process %2 [%3]%4' |
|
2857 |
with:(lines first colorizeAllWith:Color red) |
|
2858 |
with:(processNameOrNil ? '') |
|
2859 |
with:(pidOrNil ? '') |
|
2860 |
with:(osPidString ? '')) |
|
8305 | 2861 |
]. |
2862 |
||
6821 | 2863 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 2864 |
! ! |
2865 |
||
2866 |
!DebugView methodsFor:'interrupt handling'! |
|
2867 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2868 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2869 |
DebuggingDebugger == true ifTrue:[ |
11210 | 2870 |
'contextIRQ' printCR. |
2871 |
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
|
2872 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2873 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2874 |
|
1364 | 2875 |
"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
|
2876 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2877 |
|
0 | 2878 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2879 |
DebuggingDebugger == true ifTrue:[ |
11210 | 2880 |
'stepIRQ' printCR. |
2881 |
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
|
2882 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2883 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2884 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2885 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2886 |
"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
|
2887 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2888 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2889 |
stepOrNext |
10205 | 2890 |
|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
|
2891 |
inBlock left ignore contextBelow lastWrappedContext |
10205 | 2892 |
leftWrap enteredWrap anyStepBlocks |
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2893 |
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
|
2894 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2895 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
2896 |
"/ DebuggingDebugger := false |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2897 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2898 |
processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'. |
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
2899 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2900 |
skipLineNr == #return ifTrue:[ |
11210 | 2901 |
self label:('stepping context returned ' , ' (process: ' , processName , ')'). |
2902 |
here := thisContext sender sender. |
|
2903 |
here setLineNumber:nil. |
|
2904 |
here := nil. |
|
2905 |
con := thisContext sender sender sender. |
|
2906 |
||
2907 |
HaltInterrupt handle:[:ex | |
|
2908 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
|
2909 |
ex proceed |
|
2910 |
] do:[ |
|
2911 |
self enter:con select:nil. |
|
2912 |
]. |
|
2913 |
con := nil. |
|
2914 |
^ self |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2915 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2916 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2917 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2918 |
"/ "/ 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
|
2919 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2920 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2921 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2922 |
"/ 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
|
2923 |
"/ ^ self |
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 |
|
52 | 2926 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
11210 | 2927 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
2928 |
^ self |
|
52 | 2929 |
]. |
2930 |
||
29 | 2931 |
here := thisContext. "stepInterrupt" |
10205 | 2932 |
here := here sender. "the caller; step- or contextIRQ" |
2933 |
here := here sender. "the interrupted context" |
|
29 | 2934 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2935 |
DebuggingDebugger == true ifTrue:[ |
11210 | 2936 |
'*******' printCR. |
2937 |
'here in ' print. |
|
2938 |
inWrap ifTrue:['(wrap) ' print.]. |
|
2939 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
|
2940 |
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
|
2941 |
]. |
10 | 2942 |
|
2581 | 2943 |
"/ kludge an bug-workaround; |
2944 |
"/ I should not see those ... |
|
2945 |
||
2946 |
here selector == #ioInterrupt ifTrue:[ |
|
11210 | 2947 |
DebuggingDebugger == true ifTrue:[ |
2948 |
'oops - should not get that one' printCR. |
|
2949 |
]. |
|
2950 |
Processor ioInterrupt. |
|
2951 |
StepInterruptPending := 1. |
|
2952 |
InterruptPending := 1. |
|
2953 |
where := nil. here := nil. |
|
2954 |
InStepInterrupt := nil. |
|
2955 |
^ self |
|
2581 | 2956 |
]. |
2957 |
||
2958 |
stepUntilEntering notNil ifTrue:[ |
|
11210 | 2959 |
DebuggingDebugger == true ifTrue:[ |
2960 |
'check if entering ' print. stepUntilEntering printCR. |
|
2961 |
]. |
|
2962 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
2963 |
DebuggingDebugger == true ifTrue:[ |
|
2964 |
'entering...' printCR. |
|
2965 |
]. |
|
2966 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')'). |
|
2967 |
||
2968 |
lastStepUntilEntering := stepUntilEntering. |
|
2969 |
stepUntilEntering := nil. |
|
2970 |
self enter:here select:nil. |
|
2971 |
con := nil. |
|
2972 |
^ self |
|
2973 |
]. |
|
2974 |
"/ see if stepping context is still active ... |
|
2975 |
||
2976 |
con := here. |
|
2977 |
||
2978 |
DebuggingDebugger == true ifTrue:[ |
|
2979 |
'start searching at: ' print. |
|
2980 |
con fullPrint. |
|
2981 |
]. |
|
2982 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
2983 |
con := con sender |
|
2984 |
]. |
|
2985 |
con notNil ifTrue:[ |
|
2986 |
DebuggingDebugger == true ifTrue:[ |
|
2987 |
'steppingContext still active - continue stepping' printCR. |
|
2988 |
]. |
|
2989 |
con := nil. |
|
2990 |
where := nil. here := nil. |
|
2991 |
StepInterruptPending := 1. |
|
2992 |
InterruptPending := 1. |
|
2993 |
InStepInterrupt := nil. |
|
2994 |
^ self |
|
2995 |
]. |
|
2996 |
stepUntilEntering := nil. |
|
2581 | 2997 |
]. |
2998 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2999 |
" |
10205 | 3000 |
kludge to hide breakpoint wrappers in the context list: |
11210 | 3001 |
check if we are in a wrapper methods hidden setup-sequence |
3002 |
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
|
3003 |
" |
29 | 3004 |
isWrap := false. |
57 | 3005 |
left := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3006 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3007 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3008 |
where := here. |
57 | 3009 |
inWrap ifTrue:[ |
11210 | 3010 |
wrappedMethod := nil. |
3011 |
5 timesRepeat:[ |
|
3012 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
|
3013 |
method := where method. |
|
3014 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
3015 |
" |
|
3016 |
in a wrapper method |
|
3017 |
" |
|
3018 |
wrappedMethod ~~ method ifTrue:[ |
|
3019 |
wrappedMethod := method. |
|
3020 |
lastWrappedContext := where. |
|
3021 |
where sender receiver == method originalMethod ifFalse:[ |
|
3022 |
isWrap := true. |
|
3023 |
] |
|
3024 |
] ifFalse:[ |
|
3025 |
where == steppedContext ifTrue:[ |
|
3026 |
||
3027 |
DebuggingDebugger == true ifTrue:[ |
|
3028 |
'change stepCon from: ' print. |
|
3029 |
steppedContext print. |
|
3030 |
' to lastWrapped: ' print. |
|
3031 |
lastWrappedContext printCR. |
|
3032 |
]. |
|
3033 |
||
3034 |
inWrap := false. |
|
3035 |
leftWrap := true. |
|
3036 |
wrapperContext := steppedContext. |
|
3037 |
steppedContext := lastWrappedContext |
|
3038 |
] |
|
3039 |
] |
|
3040 |
]. |
|
3041 |
where := where sender |
|
3042 |
] |
|
3043 |
]. |
|
29 | 3044 |
]. |
3045 |
||
3046 |
isWrap ifTrue:[ |
|
11210 | 3047 |
DebuggingDebugger == true ifTrue:[ |
3048 |
'ignore wrap' printCR. |
|
3049 |
]. |
|
3050 |
||
3051 |
"/ |
|
3052 |
"/ ignore, while in wrappers hidden setup |
|
3053 |
"/ |
|
3054 |
where := nil. here := nil. |
|
3055 |
ObjectMemory flushInlineCaches. |
|
3056 |
||
3057 |
skipLineNr == #return ifTrue:[ |
|
3058 |
DebuggingDebugger == true ifTrue:[ |
|
3059 |
'skipRet in wrap' printCR. |
|
3060 |
] |
|
3061 |
]. |
|
3062 |
||
3063 |
StepInterruptPending := 1. |
|
3064 |
InterruptPending := 1. |
|
3065 |
InStepInterrupt := nil. |
|
3066 |
^ self |
|
29 | 3067 |
]. |
3068 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3069 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 3070 |
|
2581 | 3071 |
DebuggingDebugger == true ifTrue:[ |
11210 | 3072 |
'bigStep is: ' print. bigStep printCR. |
3073 |
'steppedContext is: ' print. steppedContext printCR. |
|
2581 | 3074 |
]. |
3075 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3076 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3077 |
"/ 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
|
3078 |
"/ |
10205 | 3079 |
(bigStep |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
3080 |
and:[steppedContext notNil]) ifTrue:[ |
11210 | 3081 |
" |
3082 |
a step or next - ignore all contexts below the interesting one |
|
3083 |
" |
|
3084 |
where := here. "the interrupted context" |
|
3085 |
contextBelow := nil. |
|
3086 |
||
3087 |
where home notNil ifTrue:[ |
|
3088 |
"/ |
|
3089 |
"/ in a block called by 'our' context ? |
|
3090 |
"/ |
|
3091 |
where home == steppedContext ifTrue:[ |
|
3055 | 3092 |
"/ '*block*' printCR. |
11210 | 3093 |
inBlock := true |
3094 |
] |
|
3095 |
]. |
|
3096 |
||
3097 |
where == steppedContext ifFalse:[ |
|
3098 |
where := where sender. |
|
3099 |
||
3100 |
where notNil ifTrue:[ |
|
3101 |
where home == steppedContext ifTrue:[ |
|
3055 | 3102 |
"/ '*block*' printCR. |
11210 | 3103 |
inBlock := true. |
3104 |
] |
|
3105 |
]. |
|
57 | 3106 |
|
3107 |
"/ 'looking for ' print. |
|
3055 | 3108 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 3109 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3110 |
"/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
|
3111 |
"/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
|
3112 |
|
11210 | 3113 |
where == steppedContext ifFalse:[ |
3114 |
||
3115 |
"/ check if we are in a context below steppedContext |
|
3116 |
"/ (i.e. if steppedContext can be reached from |
|
3117 |
"/ interrupted context. Not using context-ref but its |
|
3118 |
"/ address to avoid creation of many useless contexts.) |
|
3119 |
||
3120 |
inBlock ifFalse:[ |
|
3121 |
[where notNil] whileTrue:[ |
|
3122 |
||
3123 |
"/ if either the receiver or any arg of this context |
|
3124 |
"/ is a block of the steppedContext, we must really |
|
3125 |
"/ do a single step. Otherwise, stepping through a |
|
3126 |
"/ do:-loop would be very difficult. |
|
3127 |
receiver := where receiver. |
|
3128 |
(receiver isBlock |
|
3129 |
and:[(receiver isKindOf:Block) |
|
3130 |
and:[receiver home == steppedContext]]) |
|
3131 |
ifTrue:[ |
|
3132 |
anyStepBlocks := true. |
|
3133 |
] ifFalse:[ |
|
3134 |
where args do:[:arg | |
|
3135 |
(arg isBlock |
|
3136 |
and:[(arg isKindOf:Block) |
|
3137 |
and:[arg home == steppedContext]]) |
|
3138 |
ifTrue:[ |
|
3139 |
anyStepBlocks := true. |
|
3140 |
] |
|
3141 |
] |
|
3142 |
]. |
|
3143 |
||
3144 |
DebuggingDebugger == true ifTrue:[ |
|
3145 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
|
3146 |
where selector printCR. |
|
3147 |
]. |
|
3148 |
||
3149 |
where == steppedContext ifTrue:[ |
|
3055 | 3150 |
"/ 'found it - below; ignore' printCR. |
11210 | 3151 |
" |
3152 |
found the interesting context somwehere up in the |
|
3153 |
chain. We seem to be still below the interesting one ... |
|
3154 |
" |
|
3155 |
tracing == true ifTrue:[ |
|
3156 |
here printString printCR |
|
3157 |
]. |
|
3158 |
" |
|
3159 |
yes, a context below |
|
3160 |
- continue and schedule another stepInterrupt. |
|
3161 |
Must flush caches since optimized methods not always |
|
3162 |
look for pending interrupts |
|
3163 |
" |
|
3164 |
||
3165 |
contextBelow notNil ifTrue:[ |
|
3055 | 3166 |
"/ '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
|
3167 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3168 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3169 |
"/ 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
|
3170 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3171 |
|
11210 | 3172 |
DebuggingDebugger == true ifTrue:[ |
3173 |
'below stepCon; continue until unwind of: ' print. |
|
3174 |
contextBelow printCR. |
|
3175 |
]. |
|
3176 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
|
3177 |
StepInterruptPending := nil. |
|
3178 |
] ifFalse:[ |
|
3179 |
ObjectMemory flushInlineCaches. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3180 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3181 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
3182 |
"/ 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
|
3183 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3184 |
|
11210 | 3185 |
DebuggingDebugger == true ifTrue:[ |
3186 |
'in stepCon; continue single stepping' printCR. |
|
3187 |
]. |
|
3188 |
StepInterruptPending := 1. |
|
3189 |
InterruptPending := 1. |
|
3190 |
]. |
|
3191 |
where := nil. here := nil. |
|
3192 |
InStepInterrupt := nil. |
|
3193 |
||
3194 |
^ self |
|
3195 |
]. |
|
3196 |
||
3197 |
(steppedContext notNil and:[ |
|
3198 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
3199 |
inBlockBelow := true. |
|
3200 |
]. |
|
3201 |
||
3202 |
anyStepBlocks ifFalse:[ |
|
3203 |
inBlock ifFalse:[ |
|
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3204 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3205 |
"/ 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
|
3206 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3207 |
where isBlockContext ifFalse:[ |
11210 | 3208 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
3209 |
]. |
11210 | 3210 |
] |
3211 |
]. |
|
3212 |
where := where sender |
|
3213 |
]. |
|
3214 |
s := 'context returned'. |
|
3215 |
left := true. |
|
3216 |
]. |
|
3217 |
] ifTrue:[ |
|
3055 | 3218 |
"/ 'found it right in sender' printCR. |
11210 | 3219 |
s := 'after step' |
3220 |
]. |
|
3221 |
] ifTrue:[ |
|
3055 | 3222 |
"/ 'found it right away' printCR. |
11210 | 3223 |
s := 'after step' |
3224 |
]. |
|
0 | 3225 |
] ifFalse:[ |
3055 | 3226 |
"/ ' send' printCR. |
11210 | 3227 |
" |
3228 |
a send |
|
3229 |
" |
|
3230 |
DebuggingDebugger == true ifTrue:[ |
|
3231 |
'clear steppedContext' printCR. |
|
3232 |
]. |
|
3233 |
steppedContext := nil. |
|
3234 |
s := 'after send' |
|
0 | 3235 |
]. |
7 | 3236 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3237 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3238 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
11210 | 3239 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3240 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3241 |
|
790 | 3242 |
"/ handle the case, when a subBlock leaves; |
3243 |
"/ continue stepping in the home context. |
|
3244 |
||
3245 |
left ifTrue:[ |
|
11210 | 3246 |
steppedContext home notNil ifTrue:[ |
3247 |
steppedContext := steppedContext home. |
|
3248 |
s := 'after step'. |
|
3249 |
left := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3250 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3251 |
|
11210 | 3252 |
] |
790 | 3253 |
]. |
3254 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3255 |
" |
10205 | 3256 |
kludge to hide breakpoint wrappers in the context list: |
11210 | 3257 |
check if we are in a wrapper methods hidden exit-sequence |
3258 |
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
|
3259 |
" |
10205 | 3260 |
(where isNil |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3261 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3262 |
ifTrue:[ |
11210 | 3263 |
"/ did not find our steppedContext along the chain; |
3264 |
"/ could be in a wrappedMethods exitBlock ... |
|
3265 |
||
3266 |
leftWrap ifFalse:[ |
|
3267 |
where := here. |
|
3268 |
wrappedMethod := nil. |
|
3269 |
5 timesRepeat:[ |
|
3270 |
where notNil ifTrue:[ |
|
3271 |
where isBlockContext ifFalse:[ |
|
3272 |
method := where method. |
|
3273 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
3274 |
where == wrapperContext ifTrue:[ |
|
3275 |
DebuggingDebugger == true ifTrue:[ |
|
3276 |
'change stepCon fromWrapped: ' print. |
|
3277 |
steppedContext print. |
|
3278 |
' to: ' print. |
|
3279 |
wrapperContext printCR. |
|
3280 |
]. |
|
3281 |
||
3282 |
inWrap := true. |
|
3283 |
enteredWrap := true. |
|
3284 |
steppedContext := wrapperContext. |
|
3285 |
wrapperContext := nil. |
|
3286 |
] |
|
3287 |
]. |
|
3288 |
]. |
|
3289 |
where := where sender |
|
3290 |
] |
|
3291 |
]. |
|
3292 |
]. |
|
3293 |
enteredWrap ifTrue:[ |
|
3294 |
ignore := true |
|
3295 |
] |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3296 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3297 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3298 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3299 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3300 |
left ifTrue:[ |
11210 | 3301 |
"/ special care for stepInterrupt in send, |
3302 |
"/ when created a dummy context (lineNr == 1) |
|
3303 |
||
3304 |
steppedContext lineNumber isNil ifTrue:[ |
|
3305 |
steppedContext selector == here sender selector ifTrue:[ |
|
3306 |
left := false. |
|
3307 |
s := 'after step'. |
|
3308 |
steppedContext := here sender. |
|
3309 |
]. |
|
3310 |
]. |
|
3311 |
oneMore := true |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3312 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3313 |
|
57 | 3314 |
inBlock ifTrue:[ |
3055 | 3315 |
"/ 'inBlock' printCR. |
11210 | 3316 |
s := 'in block'. |
57 | 3317 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3318 |
inBlockBelow ifTrue:[ |
11210 | 3319 |
ignore := true |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3320 |
]. |
57 | 3321 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3322 |
DebuggingDebugger == true ifTrue:[ |
11210 | 3323 |
where notNil ifTrue:[ |
3324 |
'(' print. steppedContextLineno print. ') ' print. |
|
3325 |
where printCR. |
|
3326 |
]. |
|
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
3327 |
]. |
57 | 3328 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3329 |
ignore ifFalse:[ |
11210 | 3330 |
(bigStep |
3331 |
and:[steppedContextLineno notNil |
|
3332 |
and:[where notNil |
|
3333 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
|
3334 |
(here isBlockContext |
|
3335 |
and:[(here methodHome == steppedContext) |
|
3336 |
or:[here home == steppedContext]]) ifTrue:[ |
|
3337 |
DebuggingDebugger == true ifTrue:[ |
|
3338 |
'same line but in block' printCR. |
|
3339 |
]. |
|
3340 |
||
3341 |
steppedContext := actualContext := here. |
|
3342 |
steppedContextLineno := here lineNumber. |
|
3343 |
] ifFalse:[ |
|
3344 |
"/ kludge - I only have the info for up to 255 lines |
|
3345 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
3346 |
DebuggingDebugger == true ifTrue:[ |
|
3347 |
'same line - ignored' printCR. |
|
3348 |
]. |
|
3349 |
ignore := true |
|
3350 |
]. |
|
3351 |
]. |
|
3352 |
]. |
|
3353 |
||
3354 |
(left not |
|
3355 |
and:[skipLineNr notNil |
|
3356 |
and:[where notNil |
|
3357 |
and:[where lineNumber notNil |
|
3358 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
|
3359 |
DebuggingDebugger == true ifTrue:[ |
|
3360 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
|
3361 |
]. |
|
3362 |
ignore := true |
|
3363 |
]. |
|
3364 |
||
3365 |
(steppedContextLineno isNil |
|
3366 |
and:[skipLineNr isNil |
|
3367 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
|
3368 |
DebuggingDebugger == true ifTrue:[ |
|
3369 |
'same line2 (after conIRQ) - ignored' printCR. |
|
3370 |
]. |
|
3371 |
ignore := true |
|
3372 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3373 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3374 |
|
57 | 3375 |
ignore ifTrue:[ |
3055 | 3376 |
"/' ' printCR. |
11210 | 3377 |
where := nil. here := nil. |
3378 |
" |
|
3379 |
yes, a context below |
|
3380 |
- continue and schedule another stepInterrupt. |
|
3381 |
Must flush caches since optimized methods not always |
|
3382 |
look for pending interrupts |
|
3383 |
" |
|
3384 |
ObjectMemory flushInlineCaches. |
|
3385 |
StepInterruptPending := 1. |
|
3386 |
InterruptPending := 1. |
|
3387 |
InStepInterrupt := nil. |
|
3388 |
^ self |
|
57 | 3389 |
]. |
3390 |
||
3055 | 3391 |
"/ ' ' printCR. |
57 | 3392 |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
3393 |
self label:(s , ' (process: ' , processName , ')'). |
7 | 3394 |
|
57 | 3395 |
tracing := false. |
3396 |
bigStep := false. |
|
3397 |
||
0 | 3398 |
"release refs to context" |
3399 |
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
|
3400 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3401 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3402 |
DebuggingDebugger == true ifTrue:[ |
11210 | 3403 |
'==> 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
|
3404 |
]. |
1364 | 3405 |
|
3406 |
initiallyShown := nil. |
|
3407 |
(oneMore == true) ifTrue:[ |
|
11210 | 3408 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
3409 |
initiallyShown := 2 |
|
3410 |
] ifFalse:[ |
|
3411 |
initiallyShown := 1 |
|
3412 |
] |
|
1364 | 3413 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3414 |
con := thisContext sender sender. |
3435 | 3415 |
|
9235 | 3416 |
HaltInterrupt handle:[:ex | |
11210 | 3417 |
'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
3418 |
ex proceed |
|
3435 | 3419 |
] do:[ |
11210 | 3420 |
self enter:con select:initiallyShown |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3421 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3422 |
con := nil |
1364 | 3423 |
|
3424 |
"Created: / 14.10.1996 / 12:53:39 / cg" |
|
3447 | 3425 |
"Modified: / 18.11.2001 / 01:00:55 / cg" |
0 | 3426 |
! ! |
3427 |
||
4867 | 3428 |
!DebugView methodsFor:'menu & button actions'! |
266 | 3429 |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3430 |
addBreakpoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3431 |
"add a breakpoint on the selected contexts method - if any" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3432 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3433 |
|implementorClass method| |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3434 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3435 |
selectedContext isNil ifTrue:[ |
11210 | 3436 |
^ self showError:'** select a context first **' |
3482
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 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
11210 | 3439 |
^ self |
10205 | 3440 |
]. |
3441 |
||
3442 |
implementorClass := selectedContext methodClass. |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3443 |
implementorClass notNil ifTrue:[ |
11210 | 3444 |
method := implementorClass compiledMethodAt:selectedContext selector. |
3445 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
|
3446 |
method setBreakPoint |
|
3447 |
] |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3448 |
]. |
3511 | 3449 |
contextView middleButtonMenu disable:#addBreakpoint. |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3450 |
contextView middleButtonMenu enable:#removeBreakpoint. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3451 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3452 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3453 |
! |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3454 |
|
5875 | 3455 |
addBrowserBookmark |
3456 |
"add a browser-bookmark for the selected contexts method" |
|
3457 |
||
3458 |
|cls sel| |
|
3459 |
||
3460 |
selectedContext isNil ifTrue:[^ self]. |
|
3461 |
||
3462 |
cls := selectedContext receiver class. |
|
3463 |
sel := selectedContext selector. |
|
3464 |
(cls includesSelector:sel) ifFalse:[ |
|
11210 | 3465 |
sel := nil |
5875 | 3466 |
]. |
3467 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
3468 |
! |
|
3469 |
||
3511 | 3470 |
allowBreakPointsInDebugger |
3471 |
^ ignoreBreakpoints not |
|
3472 |
! |
|
3473 |
||
3474 |
allowBreakPointsInDebugger:aBoolean |
|
3475 |
ignoreBreakpoints := aBoolean not. |
|
5798 | 3476 |
self initializeMiddleButtonMenu. |
3477 |
self initializeContextViewsMiddleButtonMenu. |
|
3511 | 3478 |
! |
3479 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3480 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3481 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3482 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3483 |
"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
|
3484 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3485 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3486 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3487 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3488 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3489 |
"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
|
3490 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3491 |
|
266 | 3492 |
autoUpdateOff |
3493 |
"stop the update process" |
|
3494 |
||
3495 |
updateProcess notNil ifTrue:[ |
|
11210 | 3496 |
monitorToggle lampColor:(Color yellow). |
3497 |
updateProcess terminate. |
|
3498 |
updateProcess := nil |
|
266 | 3499 |
] |
3500 |
! |
|
3501 |
||
3502 |
autoUpdateOn |
|
3503 |
"fork a subprocess which updates the contextList in regular intervals" |
|
3504 |
||
3505 |
updateProcess isNil ifTrue:[ |
|
11210 | 3506 |
updateProcess := |
3507 |
[ |
|
3508 |
[true] whileTrue:[ |
|
3509 |
monitorToggle showLamp ifTrue:[ |
|
3510 |
monitorToggle lampColor:(Color yellow). |
|
3511 |
] ifFalse:[ |
|
3512 |
monitorToggle activeForegroundColor:Color black. |
|
3513 |
]. |
|
3514 |
(Delay forSeconds:0.25) wait. |
|
3515 |
self updateContext. |
|
3516 |
monitorToggle showLamp ifTrue:[ |
|
3517 |
monitorToggle lampColor:(Color red). |
|
3518 |
] ifFalse:[ |
|
3519 |
monitorToggle activeForegroundColor:Color red. |
|
3520 |
]. |
|
3521 |
(Delay forSeconds:0.25) wait. |
|
3522 |
self updateContext. |
|
3523 |
] |
|
3524 |
] forkAt:(Processor activePriority - 1) |
|
266 | 3525 |
] |
3526 |
||
3527 |
! |
|
3528 |
||
3269 | 3529 |
browseClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3530 |
"browse the receiver's class (of the selected context's message)" |
3269 | 3531 |
|
3532 |
|cls sel| |
|
3533 |
||
3534 |
selectedContext isNil ifTrue:[^ self]. |
|
3535 |
||
3536 |
cls := selectedContext receiver class. |
|
3537 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3538 |
(cls includesSelector:sel) ifFalse:[ |
11210 | 3539 |
sel := nil |
3269 | 3540 |
]. |
3541 |
cls browserClass openInClass:cls selector:sel. |
|
3542 |
||
3543 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3544 |
! |
|
3545 |
||
3546 |
browseClassHierarchy |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3547 |
"browse the receiver's classHierarchy (of the selected context's message)" |
3269 | 3548 |
|
3549 |
|cls mthd| |
|
3550 |
||
3551 |
selectedContext isNil ifTrue:[^ self]. |
|
3552 |
||
3553 |
mthd := selectedContext method. |
|
3447 | 3554 |
mthd notNil ifTrue:[ |
11210 | 3555 |
cls := mthd containingClass. |
3556 |
"/ still nil if unbound - then use receivers class |
|
3447 | 3557 |
]. |
3558 |
cls isNil ifTrue:[ |
|
11210 | 3559 |
cls := selectedContext receiver class |
3269 | 3560 |
]. |
3561 |
cls browserClass browseClassHierarchy:cls. |
|
3562 |
||
3447 | 3563 |
"Modified: / 17.11.2001 / 19:43:06 / cg" |
3269 | 3564 |
! |
3565 |
||
3566 |
browseFullClassProtocol |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3567 |
"browse the receiver's full protocol (of the selected context's message)" |
3269 | 3568 |
|
3569 |
|cls mthd| |
|
3570 |
||
3571 |
selectedContext isNil ifTrue:[^ self]. |
|
3572 |
||
3573 |
mthd := selectedContext method. |
|
3447 | 3574 |
mthd notNil ifTrue:[ |
11210 | 3575 |
cls := mthd containingClass. |
3576 |
"/ still nil if unbound - then use receivers class |
|
3447 | 3577 |
]. |
3578 |
cls isNil ifTrue:[ |
|
11210 | 3579 |
cls := selectedContext receiver class |
3269 | 3580 |
]. |
3581 |
cls browserClass browseFullClassProtocol:cls. |
|
3582 |
||
3447 | 3583 |
"Modified: / 17.11.2001 / 19:43:43 / cg" |
3269 | 3584 |
! |
3585 |
||
3586 |
browseImplementingClass |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3587 |
"browse the implementing class (of the selected context's message)" |
3269 | 3588 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3589 |
|mthd who sel cls home| |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3590 |
|
1452 | 3591 |
selectedContext isNil ifTrue:[^ self]. |
3592 |
||
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3593 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3594 |
mthd notNil ifTrue:[ |
11210 | 3595 |
who := selectedContext method who. |
3596 |
who notNil ifTrue:[ |
|
3597 |
cls := who methodClass. |
|
3598 |
sel := who methodSelector. |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3599 |
] ifFalse:[ |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3600 |
"might have been re-accepted" |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3601 |
(home := selectedContext methodHome) notNil ifTrue:[ |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3602 |
(sel := home selector) notNil ifTrue:[ |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3603 |
cls := home receiver class |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3604 |
whichClassImplements:selectedContext selector. |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3605 |
cls notNil ifTrue:[ |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3606 |
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
|
3607 |
]. |
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3608 |
] |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3609 |
]. |
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3610 |
]. |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3611 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3612 |
cls isNil ifTrue:[ |
11210 | 3613 |
"/ class not found - try receiver |
3614 |
cls := selectedContext receiver class |
|
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3615 |
]. |
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 browserClass openInClass:cls selector:sel. |
266 | 3618 |
|
11303
28e758994349
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11210
diff
changeset
|
3619 |
"Created: / 22-11-1995 / 21:27:01 / cg" |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
3620 |
"Modified: / 01-03-2012 / 14:21:11 / cg" |
266 | 3621 |
! |
3622 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3623 |
browseImplementors |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3624 |
"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
|
3625 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3626 |
selectedContext isNil ifTrue:[ |
11210 | 3627 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3628 |
]. |
4153 | 3629 |
"/ selectedContext receiver class browserClass |
3630 |
UserPreferences systemBrowserClass |
|
11210 | 3631 |
browseImplementorsOf:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3632 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3633 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3634 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3635 |
"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
|
3636 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3637 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3638 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3639 |
(sel := codeView selection) notNil ifTrue:[ |
11210 | 3640 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3641 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3642 |
initial isNil ifTrue:[ |
11210 | 3643 |
initial := selectedContext isNil |
3644 |
ifTrue:[nil] |
|
3645 |
ifFalse:[selectedContext selector]. |
|
10205 | 3646 |
]. |
3647 |
selector := Dialog |
|
11210 | 3648 |
requestSelector:'Selector to browse implementors of:' |
3649 |
initialAnswer:initial. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3650 |
selector size == 0 ifFalse:[ |
11210 | 3651 |
UserPreferences systemBrowserClass |
3652 |
browseImplementorsMatching:selector. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3653 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3654 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3655 |
"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
|
3656 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3657 |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3658 |
browseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3659 |
"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
|
3660 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3661 |
|p appClass| |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3662 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3663 |
p := inspectedProcess ? Processor activeProcess. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3664 |
(p notNil and:[p isGUIProcess]) ifTrue:[ |
11210 | 3665 |
WindowGroup scheduledWindowGroups do:[:wg | |
3666 |
wg process == p ifTrue:[ |
|
3667 |
appClass := wg application class. |
|
3668 |
appClass browserClass openInClass:appClass selector:nil. |
|
3669 |
^ self |
|
3670 |
] |
|
3671 |
] |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3672 |
]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3673 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3674 |
|
3269 | 3675 |
browseReceiversClass |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3676 |
"browse the receiver's class (of the selected context's message)" |
3269 | 3677 |
|
3678 |
|cls sel| |
|
3679 |
||
3680 |
selectedContext isNil ifTrue:[^ self]. |
|
3681 |
||
3682 |
cls := selectedContext receiver class. |
|
3683 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3684 |
(cls includesSelector:sel) ifFalse:[ |
11210 | 3685 |
sel := nil |
3269 | 3686 |
]. |
3687 |
cls browserClass openInClass:cls selector:sel. |
|
3688 |
||
3689 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3690 |
! |
|
3691 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3692 |
browseSenders |
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
3693 |
"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
|
3694 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3695 |
selectedContext isNil ifTrue:[ |
11210 | 3696 |
^ self showError:'** select a context first **' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3697 |
]. |
3140 | 3698 |
UserPreferences systemBrowserClass |
11210 | 3699 |
browseAllCallsOn:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3700 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3701 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3702 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3703 |
"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
|
3704 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3705 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3706 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3707 |
(sel := codeView selection) notNil ifTrue:[ |
11210 | 3708 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3709 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3710 |
initial isNil ifTrue:[ |
11210 | 3711 |
initial := selectedContext isNil |
3712 |
ifTrue:[nil] |
|
3713 |
ifFalse:[selectedContext selector]. |
|
10205 | 3714 |
]. |
3715 |
selector := Dialog |
|
11210 | 3716 |
requestSelector:'Selector to browse senders of:' |
3717 |
initialAnswer:initial. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3718 |
selector size == 0 ifFalse:[ |
11210 | 3719 |
UserPreferences systemBrowserClass |
3720 |
browseAllCallsOn:selector asSymbol. |
|
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3721 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3722 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3723 |
"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
|
3724 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3725 |
|
9626 | 3726 |
configureX:x y:y width:newWidth height:newHeight |
10205 | 3727 |
super configureX:x y:y width:newWidth height:newHeight. |
9626 | 3728 |
LastExtent := self extent. |
3729 |
LastOrigin := self origin. |
|
3730 |
||
3731 |
"Created: / 10-11-2010 / 10:09:11 / cg" |
|
3732 |
! |
|
3733 |
||
266 | 3734 |
copyWalkbackText |
3735 |
"place the contents of the walkback view into the copy-paste buffer. |
|
3736 |
This allows pasting it into some other view for printing ..." |
|
3737 |
||
10760 | 3738 |
|infoText| |
3739 |
||
3740 |
contextArray isEmptyOrNil ifTrue:[ |
|
3741 |
infoText := 'No context, no walkback'. |
|
3742 |
] ifFalse:[ |
|
3743 |
infoText := (contextArray collect:[:con | con fullPrintString]) asStringCollection. |
|
3744 |
]. |
|
3745 |
||
3746 |
self setClipboardText:infoText |
|
266 | 3747 |
|
3748 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
3749 |
! |
|
3750 |
||
3751 |
doAbort |
|
1187 | 3752 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 3753 |
at save places (for example: in the event loop) and returns back |
3754 |
from whatever the process is doing, but does not terminate it." |
|
3755 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3756 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 3757 |
(self confirm:('Code modified - abort anyway ?')) |
3758 |
ifFalse:[ |
|
3759 |
^ self |
|
3760 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3761 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3762 |
|
266 | 3763 |
inspecting ifTrue:[ |
11210 | 3764 |
inspectedProcess isDead ifTrue:[ |
3765 |
self showTerminated. |
|
3766 |
^ self |
|
3767 |
]. |
|
3768 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3769 |
self showError:'** the process does not handle the abort signal **' |
|
3770 |
] ifTrue:[ |
|
3771 |
self interruptProcessWith:[AbortOperationRequest raise]. |
|
3772 |
]. |
|
3773 |
^ self |
|
266 | 3774 |
]. |
3775 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3776 |
steppedContext := wrapperContext := nil. |
266 | 3777 |
haveControl := false. |
3778 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3779 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3780 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3781 |
catchBlock notNil ifTrue:[ |
11210 | 3782 |
abortButton turnOff. |
3783 |
catchBlock value. |
|
3784 |
||
3785 |
"/ not reached |
|
3786 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
266 | 3787 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3788 |
|
266 | 3789 |
^ self. |
3790 |
||
3447 | 3791 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 3792 |
! |
3793 |
||
6487 | 3794 |
doAbortAll |
3795 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
3796 |
at save places (for example: in the event loop) and returns back |
|
3797 |
from whatever the process is doing, but does not terminate it." |
|
3798 |
||
3799 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
11210 | 3800 |
(self confirm:('Code modified - abort anyway ?')) |
3801 |
ifFalse:[ |
|
3802 |
^ self |
|
3803 |
] |
|
6487 | 3804 |
]. |
3805 |
||
3806 |
inspecting ifTrue:[ |
|
11210 | 3807 |
inspectedProcess isDead ifTrue:[ |
3808 |
self showTerminated. |
|
3809 |
^ self |
|
3810 |
]. |
|
3811 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3812 |
self showError:'** the process does not handle the abort signal **' |
|
3813 |
] ifTrue:[ |
|
3814 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
3815 |
]. |
|
3816 |
^ self |
|
6487 | 3817 |
]. |
3818 |
||
3819 |
steppedContext := wrapperContext := nil. |
|
3820 |
haveControl := false. |
|
3821 |
exitAction := #abortAll. |
|
3822 |
||
3823 |
"exit private event-loop" |
|
3824 |
catchBlock notNil ifTrue:[ |
|
11210 | 3825 |
abortButton turnOff. |
3826 |
catchBlock value. |
|
3827 |
||
3828 |
"/ not reached |
|
3829 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
6487 | 3830 |
]. |
3831 |
||
3832 |
^ self. |
|
3833 |
||
3834 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
3835 |
! |
|
3836 |
||
266 | 3837 |
doContinue |
3838 |
"continue from menu" |
|
3839 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3840 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3841 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3842 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 3843 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
3844 |
^ self |
|
3845 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3846 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3847 |
|
266 | 3848 |
inspecting ifTrue:[ |
11210 | 3849 |
device hasColors ifTrue:[ |
3850 |
continueButton foregroundColor:Color red darkened. |
|
3851 |
]. |
|
3852 |
continueButton label:(resources string:'Stop'). |
|
3853 |
continueButton action:[self doStop]. |
|
3854 |
||
3855 |
self processPerform:#resume. |
|
3856 |
||
3857 |
^ self |
|
266 | 3858 |
]. |
3859 |
canContinue ifTrue:[ |
|
11210 | 3860 |
exContext := thisContext findSpecialHandle:false raise:true. |
3861 |
||
3862 |
(exContext notNil |
|
3863 |
and:[ (ex := exContext receiver) isLazyValue not |
|
3864 |
and:[ ex isException |
|
3865 |
and:[ ex signal == NoHandlerError |
|
3866 |
and:[ ex parameter signal == RecursionError]]]]) |
|
3867 |
ifTrue:[ |
|
3868 |
"/ debug due to unhandled recursionInterrupt. |
|
3869 |
"/ ask if we should proceed with more stack. |
|
3870 |
||
3871 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
|
3872 |
answer == true ifTrue:[ |
|
3873 |
proc := Processor activeProcess. |
|
3874 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
|
3875 |
]. |
|
3876 |
]. |
|
3877 |
||
3878 |
steppedContext := wrapperContext := nil. |
|
3879 |
tracing := false. |
|
3880 |
haveControl := false. |
|
3881 |
exitAction := #continue. |
|
3882 |
||
3883 |
"exit private event-loop" |
|
3884 |
catchBlock value. |
|
3885 |
||
3886 |
"/ not reached. |
|
3887 |
'DebugView [warning]: continue failed' errorPrintCR. |
|
3888 |
continueButton turnOff. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3889 |
|
266 | 3890 |
] ifFalse:[ |
11210 | 3891 |
inspecting ifFalse:[ |
3892 |
'DebugView [info]: resuming top context' infoPrintCR. |
|
3893 |
self showSelection:1. |
|
3894 |
self doReturn |
|
3895 |
] |
|
266 | 3896 |
] |
477 | 3897 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3898 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 3899 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 3900 |
! |
3901 |
||
3187 | 3902 |
doDefine |
5955 | 3903 |
|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
|
3904 |
bagOfClassNames bagOfUsedClassNames implClass idx callee restart| |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3905 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3906 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3907 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3908 |
|
3283 | 3909 |
selector := actualContext selector. |
8963 | 3910 |
implClass := actualContext receiver class whichClassIncludesSelector:selector. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3911 |
implClass notNil ifTrue:[ |
11210 | 3912 |
"/ must be a subclassResponsibility |
3913 |
||
3914 |
idx := contextArray identityIndexOf:actualContext. |
|
3915 |
idx > 1 ifTrue:[ |
|
3916 |
callee := contextArray at:idx-1. |
|
3917 |
||
3918 |
callee selector == #subclassResponsibility ifTrue:[ |
|
3919 |
restart := false. |
|
3920 |
] |
|
3921 |
]. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3922 |
]. |
5955 | 3923 |
|
3924 |
"generate nice argument names" |
|
3925 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
3926 |
bagOfUsedClassNames := Bag new. |
|
10205 | 3927 |
argNames := actualContext args |
11210 | 3928 |
collect: |
3929 |
[:eachArg | |
|
3930 |
|nm| |
|
3931 |
||
3932 |
nm := eachArg class name. |
|
3933 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
3934 |
nm article , nm |
|
3935 |
] ifFalse:[ |
|
3936 |
bagOfUsedClassNames add:nm. |
|
3937 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
3938 |
]. |
|
3939 |
]. |
|
5955 | 3940 |
|
3941 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 3942 |
|
3447 | 3943 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
3944 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
3945 |
||
3946 |
actualContext receiver isNil ifTrue:[ |
|
11210 | 3947 |
(self confirm:'Are you sure you want to add this method (to UndefinedObject) ?') |
3948 |
ifFalse:[ |
|
3949 |
^ self |
|
3950 |
] |
|
3447 | 3951 |
]. |
3952 |
||
3953 |
receiversClass := actualContext receiver class. |
|
3954 |
||
3955 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
|
11210 | 3956 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
3957 |
cat := 'accessing'. |
|
3447 | 3958 |
]. |
3959 |
(selector numArgs == 1 |
|
3960 |
and:[(selector endsWith:':') |
|
10205 | 3961 |
and:[receiversClass instVarNames includes:(selector copyWithoutLast:1)]]) |
3447 | 3962 |
ifTrue:[ |
11210 | 3963 |
code := '%1\' , haltStmtFix , '\ %2 := arg.'. |
3964 |
cat := 'accessing'. |
|
3447 | 3965 |
]. |
3966 |
||
3967 |
"/ actualContext receiver isClass ifTrue:[ |
|
3968 |
"/ selector == #new ifTrue:[ |
|
3969 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
3970 |
"/ ]. |
|
3971 |
"/ selector == #'new:' ifTrue:[ |
|
3972 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
3973 |
"/ ]. |
|
3974 |
"/ ]. |
|
3975 |
code isNil ifTrue:[ |
|
11210 | 3976 |
code := '%1\' , haltStmtDef |
10205 | 3977 |
]. |
3978 |
||
3979 |
self |
|
11210 | 3980 |
codeAccept:(code bindWith:proto with:selector) withCRs |
3981 |
inClass:receiversClass |
|
3982 |
unwind:false |
|
3983 |
category:cat |
|
3984 |
onCancel:[^ self]. |
|
3269 | 3985 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3986 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3987 |
restart ifTrue:[ |
11210 | 3988 |
self doRestart |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3989 |
] |
3427 | 3990 |
|
3447 | 3991 |
"Modified: / 17.11.2001 / 23:43:54 / cg" |
3187 | 3992 |
! |
3993 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3994 |
doIgnoreBreakpoints |
3511 | 3995 |
self allowBreakPointsInDebugger:false |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3996 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3997 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3998 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3999 |
"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
|
4000 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4001 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4002 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4003 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4004 |
(self confirm:('Code modified - step anyway ?')) |
4005 |
ifFalse:[ |
|
4006 |
^ self |
|
4007 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4008 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4009 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4010 |
canContinue ifTrue:[ |
11210 | 4011 |
steppedContext := wrapperContext := nil. |
4012 |
haveControl := false. |
|
4013 |
exitAction := #step. |
|
4014 |
||
4015 |
"exit private event-loop" |
|
4016 |
catchBlock value. |
|
4017 |
||
4018 |
"/ not reached |
|
4019 |
'DebugView [warning]: send failed' errorPrintCR. |
|
4020 |
sendButton turnOff. |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4021 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4022 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4023 |
"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
|
4024 |
"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
|
4025 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4026 |
|
266 | 4027 |
doNext |
1072 | 4028 |
"skip for next source-code line; entering blocks" |
266 | 4029 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4030 |
stepHow := #nextIn. |
266 | 4031 |
self doStep:nil |
790 | 4032 |
|
1072 | 4033 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4034 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4035 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4036 |
doNextOut |
1072 | 4037 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4038 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4039 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4040 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4041 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4042 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 4043 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4044 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4045 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4046 |
doNextOver |
1072 | 4047 |
"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
|
4048 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4049 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4050 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4051 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4052 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 4053 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 4054 |
! |
4055 |
||
4056 |
doNoTrace |
|
4057 |
traceView notNil ifTrue:[ |
|
11210 | 4058 |
traceView topView destroy. |
4059 |
traceView := nil. |
|
266 | 4060 |
]. |
4061 |
tracing := false |
|
4062 |
! |
|
4063 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4064 |
doNotIgnoreBreakpoints |
3511 | 4065 |
self allowBreakPointsInDebugger:true |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4066 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
4067 |
|
4356 | 4068 |
doOpenReportMailApp |
4069 |
"open a mail report tool" |
|
4070 |
||
4071 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4072 |
|
4356 | 4073 |
str := '' writeStream. |
4074 |
||
4075 |
str nextPutLine:('Error notification from ' |
|
11210 | 4076 |
, OperatingSystem getLoginName |
4077 |
, '@' |
|
4078 |
, OperatingSystem getHostName). |
|
4356 | 4079 |
str cr. |
4080 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
4081 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 4082 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
4083 |
str nextPutLine:('Description: ' , self label). |
|
4084 |
"/ str nextPutLine:('Error: ', printedException description). |
|
4085 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
4086 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
4087 |
str nextPutLine:'Backtrace:'. |
|
4088 |
str cr. |
|
4089 |
||
4090 |
firstContext notNil ifTrue:[ |
|
11210 | 4091 |
firstContext fullPrintAllOn:str. |
4356 | 4092 |
]. |
4093 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4094 |
|
10205 | 4095 |
SendMailTool |
11210 | 4096 |
openForMessage:(str contents) |
4097 |
withSubject:('STX Error:[', self label, ']') |
|
4098 |
preOpenBlock:[:inst| |
|
4099 |
inst recipientEntryField value:'error@exept.de' |
|
4100 |
]. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4101 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
4102 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 4103 |
! |
4104 |
||
266 | 4105 |
doRestart |
4106 |
"restart - the selected context will be restarted" |
|
10205 | 4107 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4108 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4109 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
4110 |
^ self |
|
4111 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4112 |
]. |
266 | 4113 |
inspecting ifTrue:[ |
11210 | 4114 |
selectedContext isNil ifTrue:[ |
4115 |
^ self showError:'** select a context first **' |
|
4116 |
]. |
|
4117 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
|
4118 |
^ self |
|
266 | 4119 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4120 |
steppedContext := wrapperContext := nil. |
266 | 4121 |
haveControl := false. |
6365 | 4122 |
exitAction := #restart. "exit private event-loop" |
4123 |
||
4124 |
catchBlock value. |
|
4125 |
||
4126 |
"/ normally not reached |
|
10205 | 4127 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4128 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4129 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4130 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4131 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 4132 |
! |
4133 |
||
4134 |
doReturn |
|
4135 |
"return - the selected context will do a ^nil" |
|
4136 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4137 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4138 |
(self confirm:('Code modified - return anyway ?')) |
4139 |
ifFalse:[ |
|
4140 |
^ self |
|
4141 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4142 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4143 |
|
266 | 4144 |
inspecting ifTrue:[ |
11210 | 4145 |
selectedContext isNil ifTrue:[ |
4146 |
^ self showError:'** select a context first **' |
|
4147 |
]. |
|
4148 |
self interruptProcessWith:[selectedContext unwind:nil]. |
|
4149 |
^ self |
|
266 | 4150 |
]. |
4151 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4152 |
steppedContext := wrapperContext := nil. |
266 | 4153 |
haveControl := false. |
4154 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4155 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4156 |
"exit private event-loop" |
6365 | 4157 |
catchBlock value. |
477 | 4158 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4159 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4160 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4161 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4162 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4163 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 4164 |
! |
4165 |
||
4166 |
doSend |
|
4167 |
"single send; reenter with next message send" |
|
4168 |
||
1072 | 4169 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4170 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4171 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4172 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4173 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4174 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4175 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4176 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4177 |
"/ exitAction := #step. |
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 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4180 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4181 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4182 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4183 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4184 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4185 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
4186 |
|
1072 | 4187 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 4188 |
! |
4189 |
||
4190 |
doStep |
|
4191 |
"skip for next send in selected method" |
|
4192 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4193 |
stepHow := #step. |
790 | 4194 |
self doStep:-1 |
4195 |
||
1072 | 4196 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 4197 |
! |
4198 |
||
4199 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4200 |
"common helper for step, skip & next. |
10205 | 4201 |
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
|
4202 |
or to next line (if nil) or to next send (if -1)" |
266 | 4203 |
|
4204 |
|con method| |
|
4205 |
||
4206 |
inspecting ifTrue:[^ self]. |
|
4207 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4208 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4209 |
(self confirm:('Code modified - step anyway ?')) |
4210 |
ifFalse:[ |
|
4211 |
^ self |
|
4212 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4213 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4214 |
|
266 | 4215 |
canContinue ifTrue:[ |
11210 | 4216 |
selectedContext notNil ifTrue:[ |
4217 |
con := actualContext. "/ selectedContext. |
|
4218 |
steppedContextLineno := actualContext lineNumber. |
|
4219 |
] ifFalse:[ |
|
4220 |
con := contextArray at:2. |
|
4221 |
steppedContextLineno := con lineNumber. |
|
4222 |
]. |
|
4223 |
||
4224 |
skipLineNr := lineNr. |
|
4225 |
||
4226 |
lineNr == -1 ifTrue:[ |
|
4227 |
steppedContextLineno := skipLineNr := nil. |
|
4228 |
]. |
|
4229 |
||
4230 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
|
4231 |
steppedContext := contextArray at:1. |
|
4232 |
stepHow := #nextIn. |
|
4233 |
] ifFalse:[ |
|
4234 |
stepHow == #nextOut ifTrue:[ |
|
4235 |
steppedContext := con home. |
|
4236 |
] ifFalse:[ |
|
4237 |
steppedContext := con. |
|
4238 |
]. |
|
4239 |
]. |
|
4240 |
wrapperContext := nil. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4241 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
4242 |
"/ ' 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
|
4243 |
|
11210 | 4244 |
" |
4245 |
if we step in a wrapped method, |
|
4246 |
prepare to skip the prolog ... |
|
4247 |
" |
|
4248 |
||
4249 |
inWrap := false. |
|
4250 |
method := con method. |
|
4251 |
(method notNil |
|
4252 |
and:[method isWrapped |
|
4253 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
|
4254 |
inWrap := true |
|
4255 |
]. |
|
4256 |
||
4257 |
lineNr == #return ifTrue:[ |
|
4258 |
Processor activeProcess forceInterruptOnReturnOf:con. |
|
4259 |
]. |
|
4260 |
||
4261 |
con := nil. |
|
4262 |
bigStep := true. |
|
4263 |
haveControl := false. |
|
4264 |
exitAction := #step. |
|
4265 |
||
4266 |
"exit private event-loop" |
|
4267 |
catchBlock value. |
|
4268 |
||
4269 |
"/ not reached |
|
4270 |
'DebugView [warning]: step failed' errorPrintCR. |
|
4271 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
|
266 | 4272 |
] |
477 | 4273 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4274 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 4275 |
! |
4276 |
||
4277 |
doStop |
|
4278 |
"stop the process (if its running, otherwise this is a no-op)" |
|
4279 |
||
4280 |
inspecting ifTrue:[ |
|
11210 | 4281 |
device hasColors ifTrue:[ |
4282 |
continueButton foregroundColor:Color green darkened darkened. |
|
4283 |
]. |
|
4284 |
continueButton label:(resources string:'Continue'). |
|
4285 |
continueButton action:[self doContinue]. |
|
4286 |
||
4287 |
self processPerform:#stop. |
|
4288 |
||
4289 |
^ self |
|
266 | 4290 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4291 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4292 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 4293 |
! |
4294 |
||
4295 |
doTerminate |
|
4296 |
"terminate - the process has a chance for cleanup" |
|
4297 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4298 |
self checkIfCodeIsReallyModified ifTrue:[ |
11210 | 4299 |
(self confirm:('Code modified - terminate anyway ?')) |
4300 |
ifFalse:[ |
|
4301 |
^ self |
|
4302 |
] |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4303 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4304 |
|
266 | 4305 |
inspecting ifTrue:[ |
11210 | 4306 |
self processPerform:#terminate. |
4307 |
^ self |
|
266 | 4308 |
]. |
4309 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4310 |
steppedContext := wrapperContext := nil. |
266 | 4311 |
haveControl := false. |
10205 | 4312 |
exitAction := #terminate. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4313 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4314 |
"exit private event-loop" |
6365 | 4315 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4316 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4317 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4318 |
inspecting ifFalse:[ |
11210 | 4319 |
'DebugView [warning]: terminate failed' errorPrintCR. |
4320 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
|
4321 |
Debugger newDebugger. |
|
4322 |
Processor activeProcess terminate. |
|
4323 |
] |
|
266 | 4324 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4325 |
terminateButton turnOff. |
477 | 4326 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4327 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 4328 |
! |
4329 |
||
4330 |
doTrace |
|
4331 |
"tracing - not really implemented ..." |
|
4332 |
||
4333 |
self warn:'this function is not yet implemented'. |
|
4334 |
||
4335 |
"/ |v b| |
|
4336 |
"/ |
|
4337 |
"/ traceView isNil ifTrue:[ |
|
4338 |
"/ v := StandardSystemView on:Display. |
|
4339 |
"/ v label:'Debugger-Trace'. |
|
4340 |
"/ v icon:icon. |
|
4341 |
"/ |
|
4342 |
"/ b := Button label:'untrace' in:v. |
|
4343 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
4344 |
"/ b action:[ |
|
4345 |
"/ StepInterruptPending := nil. |
|
4346 |
"/ tracing := false. |
|
4347 |
"/ v unrealize. |
|
4348 |
"/ traceView := nil |
|
4349 |
"/ ]. |
|
4350 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
4351 |
"/ traceView origin:(0 @ (b height)) |
|
4352 |
"/ extent:[v width @ (v height - b height)] |
|
4353 |
"/ ]. |
|
4354 |
"/ v realize. |
|
4355 |
"/ |
|
4356 |
"/ tracing := true. |
|
4357 |
! |
|
4358 |
||
4359 |
doTraceStep |
|
4360 |
"tracestep - not implemented yet" |
|
4361 |
||
4362 |
canContinue ifTrue:[ |
|
11210 | 4363 |
tracing := true. |
4364 |
self doStep |
|
266 | 4365 |
] |
4366 |
! |
|
4367 |
||
4368 |
exit |
|
4369 |
"exit from menu: immediate exit from smalltalk" |
|
4370 |
||
4371 |
OperatingSystem exit |
|
4372 |
! |
|
4373 |
||
8170 | 4374 |
hasHaltsToIgnore |
4375 |
^ IgnoredHalts notEmptyOrNil |
|
4376 |
! |
|
4377 |
||
9922 | 4378 |
ignoreAllHaltsForever |
11210 | 4379 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:true. |
9922 | 4380 |
|
4381 |
"Created: / 08-05-2011 / 10:19:56 / cg" |
|
4382 |
! |
|
4383 |
||
11210 | 4384 |
ignoreAllHaltsUntilShiftKeyIsPressed |
4385 |
self addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true forAll:true. |
|
4386 |
||
4387 |
"Created: / 27-01-2012 / 11:32:14 / cg" |
|
4388 |
! |
|
4389 |
||
8179 | 4390 |
ignoreHaltForever |
11210 | 4391 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false forAll:false. |
4392 |
||
4393 |
"Modified: / 27-01-2012 / 11:31:37 / cg" |
|
4394 |
! |
|
4395 |
||
4396 |
ignoreHaltUntilShiftKeyIsPressed |
|
4397 |
self addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true forAll:false. |
|
4398 |
||
4399 |
"Created: / 27-01-2012 / 11:36:54 / cg" |
|
8179 | 4400 |
! |
4401 |
||
266 | 4402 |
inspectContext |
4403 |
"launch an inspector on the currently selected context" |
|
4404 |
||
4405 |
contextView selection notNil ifTrue:[ |
|
11210 | 4406 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
4407 |
(contextArray at:(contextView selection)) inspect. |
|
4408 |
] |
|
266 | 4409 |
] |
4410 |
! |
|
4411 |
||
8170 | 4412 |
isStoppedAtHaltOrBreakPoint |
4413 |
^ isStoppedAtHaltOrBreakPoint |
|
4414 |
! |
|
4415 |
||
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4416 |
isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4417 |
^ isStoppedAtHaltOrBreakPoint or:[self selectedContextIsWrapped] |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4418 |
! |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4419 |
|
8142 | 4420 |
middleButtonMenu |
4421 |
<resource: #programMenu > |
|
4422 |
||
9488 | 4423 |
|items m nameOfExecutable| |
8142 | 4424 |
|
4425 |
exclusive ifTrue:[ |
|
11210 | 4426 |
items := #( |
4427 |
('Show More WalkBack' showMore ) |
|
4428 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4429 |
('-' ) |
|
4430 |
('Add Breakpoint' addBreakpoint ) |
|
4431 |
('Remove Breakpoint' removeBreakpoint ) |
|
4432 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4433 |
('-' ) |
|
4434 |
). |
|
8142 | 4435 |
] ifFalse:[ |
11210 | 4436 |
items := #( |
4437 |
('Show More WalkBack' showMore ) |
|
4438 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4439 |
('-' ) |
|
4440 |
('Skip' skip ) |
|
4441 |
('Step Out' skipForReturn ) |
|
4442 |
('Skip until Entering...' skipUntilEntering ) |
|
4443 |
('-' ) |
|
8142 | 4444 |
" |
11210 | 4445 |
('Continue' doContinue ) |
4446 |
('Terminate' doTerminate ) |
|
4447 |
('Abort' doAbort ) |
|
4448 |
('-' ) |
|
4449 |
('Step' doStep ) |
|
4450 |
('Send' doSend ) |
|
4451 |
('-' ) |
|
4452 |
('Return' doReturn ) |
|
4453 |
('Restart' doRestart ) |
|
4454 |
('-' ) |
|
8142 | 4455 |
" |
11210 | 4456 |
('Add Breakpoint' addBreakpoint ) |
4457 |
('Remove Breakpoint' removeBreakpoint ) |
|
4458 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4459 |
). |
|
4460 |
||
4461 |
self allowBreakPointsInDebugger ifFalse:[ |
|
4462 |
items := items , #( |
|
4463 |
('Allow Breakpoints && halt in Debugger' doNotIgnoreBreakpoints ) |
|
4464 |
). |
|
4465 |
] ifTrue:[ |
|
4466 |
items := items , #( |
|
4467 |
('Ignore Breakpoints && halt in Debugger' doIgnoreBreakpoints ) |
|
4468 |
). |
|
4469 |
]. |
|
4470 |
||
4471 |
items := items , #( |
|
4472 |
('-' ) |
|
4473 |
('Browse Implementing Class' browseImplementingClass ) |
|
4474 |
('Browse Receivers Class' browseReceiversClass ) |
|
4475 |
('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
|
4476 |
('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
4477 |
('Implementors' browseImplementors ) |
|
4478 |
('Implementors Of...' browseImplementorsOf ) |
|
4479 |
('Senders' browseSenders ) |
|
4480 |
('Senders Of...' browseSendersOf ) |
|
4481 |
('-' ) |
|
4482 |
('Inspect Context' inspectContext ) |
|
4483 |
). |
|
8142 | 4484 |
]. |
4485 |
||
9488 | 4486 |
items := items , #( |
11210 | 4487 |
('Copy WalkBack Text' copyWalkbackText ) |
4488 |
('-' ) |
|
4489 |
('QuickTerminate' quickTerminate ) |
|
4490 |
('=' )). |
|
9488 | 4491 |
|
4492 |
nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName. |
|
4493 |
nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ]. |
|
4494 |
||
4495 |
items := items , { |
|
11210 | 4496 |
{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit }}. |
10205 | 4497 |
|
4498 |
m := PopUpMenu |
|
11210 | 4499 |
itemList:items |
4500 |
resources:resources |
|
4501 |
receiver:self |
|
4502 |
for:contextView. |
|
8142 | 4503 |
|
4504 |
verboseBacktrace ifTrue:[ |
|
11210 | 4505 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
4506 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback |
|
8142 | 4507 |
]. |
4508 |
||
4509 |
inspecting ifTrue:[ |
|
11210 | 4510 |
m notNil ifTrue:[ |
4511 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
4512 |
browseClassHierarchy browseFullClassProtocol |
|
4513 |
browseImplementors browseSenders inspectContext skip doStepOut). |
|
4514 |
]. |
|
8142 | 4515 |
]. |
4516 |
self updateMenuItems. |
|
4517 |
||
4518 |
^ m. |
|
9488 | 4519 |
|
4520 |
"Modified: / 19-05-2010 / 11:49:56 / cg" |
|
8142 | 4521 |
! |
4522 |
||
3447 | 4523 |
openAboutThisApplication |
4524 |
"opens an about box for this application." |
|
4525 |
||
7112 | 4526 |
Dialog aboutClass:self class. |
4527 |
||
4528 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 4529 |
! |
4530 |
||
9612
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4531 |
openBreakPointBrowser |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4532 |
Tools::BreakpointBrowser open |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4533 |
|
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4534 |
"Created: / 27-10-2010 / 12:52:49 / cg" |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4535 |
! |
28363bf9877d
added: #openBreakPointBrowser
Claus Gittinger <cg@exept.de>
parents:
9594
diff
changeset
|
4536 |
|
9922 | 4537 |
openIgnoreAllHaltsUntilTimeElapsedDialog |
4538 |
|answer dT| |
|
4539 |
||
4540 |
[ |
|
11210 | 4541 |
answer := Dialog |
4542 |
request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?') |
|
4543 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
4544 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4545 |
||
4546 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
4547 |
dT notNil ifTrue:[ |
|
4548 |
LastIgnoreHaltDuration := dT. |
|
4549 |
self addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false forAll:true. |
|
4550 |
^ self. |
|
4551 |
]. |
|
9922 | 4552 |
] loop |
4553 |
||
4554 |
"Created: / 08-05-2011 / 10:19:20 / cg" |
|
4555 |
! |
|
4556 |
||
8170 | 4557 |
openIgnoreHaltNTimesDialog |
8179 | 4558 |
|answer n| |
4559 |
||
4560 |
[ |
|
11210 | 4561 |
answer := Dialog |
4562 |
request:(resources string:'How often should this halt be ignored ?') |
|
4563 |
initialAnswer:(LastIgnoreHaltNTimes ? '') printString. |
|
4564 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4565 |
||
4566 |
n := Integer readFrom:answer onError:nil. |
|
4567 |
n notNil ifTrue:[ |
|
4568 |
LastIgnoreHaltNTimes := n. |
|
4569 |
self addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false forAll:false. |
|
4570 |
^ self. |
|
4571 |
]. |
|
8179 | 4572 |
] loop. |
9922 | 4573 |
|
11210 | 4574 |
"Modified: / 27-01-2012 / 11:31:44 / cg" |
8179 | 4575 |
! |
4576 |
||
4577 |
openIgnoreHaltUntilTimeElapsedDialog |
|
4578 |
|answer dT| |
|
4579 |
||
4580 |
[ |
|
11210 | 4581 |
answer := Dialog |
4582 |
request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?') |
|
4583 |
initialAnswer:(LastIgnoreHaltDuration ? '30s') printString. |
|
4584 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4585 |
||
4586 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
|
4587 |
dT notNil ifTrue:[ |
|
4588 |
LastIgnoreHaltDuration := dT. |
|
4589 |
self addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false forAll:false. |
|
4590 |
^ self. |
|
4591 |
]. |
|
8179 | 4592 |
] loop |
9613
380816519281
changed: #openIgnoreHaltUntilTimeElapsedDialog
Claus Gittinger <cg@exept.de>
parents:
9612
diff
changeset
|
4593 |
|
11210 | 4594 |
"Modified: / 27-01-2012 / 11:31:47 / cg" |
8170 | 4595 |
! |
4596 |
||
8620 | 4597 |
openSettingsDialog |
4598 |
|settingsList settingsApp| |
|
4599 |
||
10205 | 4600 |
settingsList := |
11210 | 4601 |
#( |
4602 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
|
4603 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
|
4604 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
4605 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
4606 |
). |
|
8620 | 4607 |
|
4608 |
settingsApp := SettingsDialog new. |
|
9024
fb4eebb44e21
comment/format in: #initialize
Claus Gittinger <cg@exept.de>
parents:
8967
diff
changeset
|
4609 |
"/ settingsApp requestor:self. |
8620 | 4610 |
settingsApp installSettingsEntries:settingsList. |
4611 |
settingsApp allButOpen. |
|
4612 |
settingsApp window label:('Debugger Settings'). |
|
4613 |
settingsApp openWindow. |
|
4614 |
! |
|
4615 |
||
266 | 4616 |
quickTerminate |
4617 |
"quick terminate - the process will get no chance for cleanup actions" |
|
4618 |
||
4619 |
inspecting ifTrue:[ |
|
11210 | 4620 |
self processPerform:#terminateNoSignal. |
4621 |
^ self |
|
266 | 4622 |
]. |
4623 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4624 |
steppedContext := wrapperContext := nil. |
266 | 4625 |
haveControl := false. |
4626 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4627 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4628 |
"exit private event-loop" |
6365 | 4629 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4630 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4631 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4632 |
inspecting ifFalse:[ |
11210 | 4633 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
4634 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
4635 |
Debugger newDebugger. |
|
4636 |
Processor activeProcess terminateNoSignal. |
|
4637 |
] |
|
266 | 4638 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4639 |
terminateButton turnOff. |
477 | 4640 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4641 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 4642 |
! |
4643 |
||
4644 |
removeAllBreakpoints |
|
4645 |
"remove all trace & breakpoints - if any" |
|
4646 |
||
1327 | 4647 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
11210 | 4648 |
self withExecuteCursorDo:[ |
4649 |
MessageTracer unwrapAllMethods |
|
4650 |
] |
|
1319 | 4651 |
] |
1327 | 4652 |
|
1661 | 4653 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
266 | 4654 |
! |
4655 |
||
4656 |
removeBreakpoint |
|
4657 |
"remove breakpoint on the selected contexts method - if any" |
|
4658 |
||
4659 |
|implementorClass method| |
|
4660 |
||
4661 |
selectedContext isNil ifTrue:[ |
|
11210 | 4662 |
^ self showError:'** select a context first **' |
266 | 4663 |
]. |
1327 | 4664 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
11210 | 4665 |
^ self |
10205 | 4666 |
]. |
4667 |
||
4668 |
implementorClass := selectedContext methodClass. |
|
266 | 4669 |
implementorClass notNil ifTrue:[ |
11210 | 4670 |
method := implementorClass compiledMethodAt:selectedContext selector. |
4671 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
|
4672 |
method clearBreakPoint |
|
4673 |
] |
|
266 | 4674 |
]. |
4675 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
3511 | 4676 |
contextView middleButtonMenu enable:#addBreakpoint. |
1327 | 4677 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4678 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
266 | 4679 |
! |
4680 |
||
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4681 |
selectedContextIsWrapped |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4682 |
|con mthd| |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4683 |
|
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4684 |
contextView selection notNil ifTrue:[ |
11210 | 4685 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
4686 |
con := contextArray at:(contextView selection). |
|
4687 |
mthd := con methodHome method. |
|
4688 |
^ mthd notNil and:[mthd isWrapped] |
|
4689 |
] |
|
9547
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4690 |
]. |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4691 |
^ false. |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4692 |
! |
ed64e5a20acf
preps for ignorable method wraps
Claus Gittinger <cg@exept.de>
parents:
9511
diff
changeset
|
4693 |
|
3447 | 4694 |
showDenseWalkback |
3427 | 4695 |
|m| |
4696 |
||
4697 |
m := contextView middleButtonMenu. |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4698 |
verboseBacktrace := false. |
3694 | 4699 |
m labelAt:#showDenseWalkback put:(resources string:'Show Verbose WalkBack'). |
3447 | 4700 |
m selectorAt:#showDenseWalkback put:#showVerboseWalkback. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4701 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4702 |
|
3447 | 4703 |
"Created: / 17.11.2001 / 20:08:08 / cg" |
4704 |
"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
|
4705 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4706 |
|
266 | 4707 |
showMore |
3447 | 4708 |
"double the number of contexts shown" |
266 | 4709 |
|
4710 |
contextArray notNil ifTrue:[ |
|
11210 | 4711 |
nChainShown := nChainShown * 2. |
4712 |
self redisplayBacktrace. |
|
266 | 4713 |
] |
563 | 4714 |
|
3447 | 4715 |
"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
|
4716 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4717 |
|
3447 | 4718 |
showVerboseWalkback |
4719 |
|m| |
|
4720 |
||
4721 |
verboseBacktrace := true. |
|
4722 |
m := contextView middleButtonMenu. |
|
3694 | 4723 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
3447 | 4724 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback. |
4725 |
||
4726 |
self redisplayBacktrace. |
|
4727 |
||
4728 |
"Created: / 17.11.2001 / 20:07:57 / cg" |
|
4729 |
"Modified: / 17.11.2001 / 22:39:41 / cg" |
|
4730 |
! |
|
4731 |
||
4732 |
showingDenseWalkback |
|
4733 |
^ verboseBacktrace == false. |
|
4734 |
||
4735 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
4736 |
! |
|
4737 |
||
4738 |
showingVerboseWalkback |
|
4739 |
^ verboseBacktrace == true. |
|
4740 |
||
4741 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
4742 |
! |
|
4743 |
||
9626 | 4744 |
sizeChanged:how |
10205 | 4745 |
super sizeChanged:how. |
9626 | 4746 |
LastExtent := self extent. |
4747 |
||
4748 |
"Created: / 10-11-2010 / 09:08:41 / cg" |
|
4749 |
! |
|
4750 |
||
266 | 4751 |
skip |
4752 |
"skip for cursor line in selected method" |
|
4753 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4754 |
stepHow := #skip. |
266 | 4755 |
self doStep:codeView cursorLine. |
790 | 4756 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4757 |
"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
|
4758 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4759 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4760 |
skipForReturn |
2581 | 4761 |
"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
|
4762 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4763 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4764 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4765 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4766 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 4767 |
! |
4768 |
||
4769 |
skipUntilEntering |
|
4770 |
"skip until some particular method is invoked." |
|
4771 |
||
4772 |
|selector| |
|
4773 |
||
10205 | 4774 |
selector := Dialog |
11210 | 4775 |
request:'Skip until entering what (matchpattern):' |
4776 |
initialAnswer:self goodSkipUntilSelector. |
|
2581 | 4777 |
selector size == 0 ifTrue:[^ self]. |
4778 |
||
4779 |
stepUntilEntering := selector asSymbol. |
|
4780 |
stepHow := #send. |
|
4781 |
self doStep:-1. |
|
4782 |
||
4783 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 4784 |
! |
4785 |
||
8170 | 4786 |
stopIgnoringHalts |
8179 | 4787 |
self class stopIgnoringHalts |
8170 | 4788 |
! |
4789 |
||
3447 | 4790 |
toggleVerboseWalkback |
4791 |
verboseBacktrace ifFalse:[ |
|
11210 | 4792 |
self showVerboseWalkback |
3447 | 4793 |
] ifTrue:[ |
11210 | 4794 |
self showDenseWalkback |
3447 | 4795 |
]. |
4796 |
||
4797 |
"Modified: / 17.11.2001 / 20:07:45 / cg" |
|
266 | 4798 |
! ! |
4799 |
||
4800 |
!DebugView methodsFor:'private'! |
|
4801 |
||
6487 | 4802 |
abortAllIsHandled |
9750 | 4803 |
^ AbortAllOperationWantedQuery query |
4804 |
||
4805 |
"Modified: / 09-02-2011 / 13:53:13 / cg" |
|
6487 | 4806 |
! |
4807 |
||
266 | 4808 |
busy |
4809 |
^ busy |
|
4810 |
! |
|
4811 |
||
3269 | 4812 |
canBrowseClassHierarchy |
4813 |
|m| |
|
4814 |
||
4815 |
m := contextView middleButtonMenu. |
|
4816 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
|
4817 |
! |
|
4818 |
||
4819 |
canBrowseFullClassProtocol |
|
4820 |
|m| |
|
4821 |
||
4822 |
m := contextView middleButtonMenu. |
|
4823 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
|
4824 |
! |
|
4825 |
||
4826 |
canBrowseImplementingClass |
|
4827 |
|m| |
|
4828 |
||
4829 |
m := contextView middleButtonMenu. |
|
4830 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
|
4831 |
! |
|
4832 |
||
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4833 |
canBrowseProcessesApplication |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4834 |
|p| |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4835 |
|
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4836 |
p := inspectedProcess ? Processor activeProcess. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4837 |
p isNil ifTrue:[^ false]. |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4838 |
^ p isGUIProcess |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4839 |
! |
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
4840 |
|
3269 | 4841 |
canBrowseReceiversClass |
4842 |
|m| |
|
4843 |
||
4844 |
m := contextView middleButtonMenu. |
|
4845 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
|
4846 |
! |
|
4847 |
||
4848 |
canDefineMethod |
|
4849 |
^ defineButton isVisible |
|
4850 |
! |
|
4851 |
||
3447 | 4852 |
canRestart |
4853 |
^ restartButton isEnabled |
|
4854 |
||
4855 |
"Modified: / 17.11.2001 / 19:59:49 / cg" |
|
4856 |
! |
|
4857 |
||
4858 |
canReturn |
|
4859 |
^ returnButton isEnabled |
|
4860 |
||
4861 |
"Modified: / 17.11.2001 / 19:59:18 / cg" |
|
4862 |
! |
|
4863 |
||
9583 | 4864 |
canSendEmail |
4865 |
^ SendMailTool notNil |
|
4866 |
||
4867 |
"Created: / 15-10-2010 / 11:51:23 / cg" |
|
4868 |
! |
|
4869 |
||
3269 | 4870 |
canShowMore |
4871 |
^ canShowMore |
|
4872 |
! |
|
4873 |
||
7797 | 4874 |
contextListEntryFor:aContext |
4875 |
|s| |
|
4876 |
||
4877 |
aContext selector == #doIt ifTrue:[ |
|
11210 | 4878 |
aContext receiver isNil ifTrue:[ |
4879 |
^ 'doIt' allBold |
|
4880 |
] |
|
7797 | 4881 |
]. |
4882 |
||
4883 |
s := Text new writeStream. |
|
4884 |
aContext printOn:s. |
|
4885 |
^ s contents |
|
4886 |
||
4887 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
4888 |
! |
|
4889 |
||
266 | 4890 |
exclusive:aBoolean |
4891 |
exclusive := aBoolean |
|
4892 |
! |
|
4893 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4894 |
explainSelection |
8212 | 4895 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4896 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4897 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4898 |
interval isEmpty ifTrue:[ |
11210 | 4899 |
crsrPos := codeView characterPositionOfCursor. |
4900 |
codeView characterUnderCursor isSeparator ifTrue:[ |
|
4901 |
crsrPos := (crsrPos - 1) max:1 |
|
4902 |
]. |
|
4903 |
interval := crsrPos to:crsrPos. |
|
10205 | 4904 |
]. |
4905 |
self |
|
11210 | 4906 |
withNodeValueAtInterval:interval |
4907 |
do:[:value :description | |
|
4908 |
self showValue:value |
|
4909 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4910 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4911 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4912 |
findNodeForInterval:interval |
8212 | 4913 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4914 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4915 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4916 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
4917 |
source := codeView contentsAsString string. |
10205 | 4918 |
"/ source := currentMethod notNil |
4919 |
"/ ifTrue:[ currentMethod source ] |
|
8396 | 4920 |
"/ ifFalse:[ codeView contents asString ]. |
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
4921 |
source isNil ifTrue:[^ nil]. |
8214 | 4922 |
|
8212 | 4923 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
4924 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4925 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4926 |
|
7912 | 4927 |
findNodeIn:tree forInterval:interval |
4928 |
<resource: #obsolete> |
|
10205 | 4929 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4930 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4931 |
|
7912 | 4932 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4933 |
node := nil. |
10205 | 4934 |
tree nodesDo:[:each | |
11210 | 4935 |
(each intersectsInterval:interval) ifTrue:[ |
4936 |
(node isNil or:[node == each parent]) ifTrue:[ |
|
4937 |
node := each |
|
4938 |
] ifFalse:[ |
|
4939 |
(node parent notNil |
|
4940 |
and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
4941 |
] |
|
4942 |
] |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4943 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4944 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4945 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4946 |
|
2581 | 4947 |
goodSkipUntilSelector |
4948 |
|current| |
|
4949 |
||
4950 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
4951 |
selectedContext isNil ifTrue:[^ nil]. |
|
4952 |
current := selectedContext selector. |
|
4953 |
current isNil ifTrue:[^ nil]. |
|
4954 |
('change:*' match:current) ifTrue:[ |
|
11210 | 4955 |
^ 'update:*' |
2581 | 4956 |
]. |
4957 |
^ nil |
|
4958 |
! |
|
4959 |
||
8179 | 4960 |
haltSelectors |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
4961 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break'). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
4962 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
4963 |
"Modified (format): / 27-01-2012 / 11:10:00 / cg" |
8179 | 4964 |
! |
4965 |
||
3447 | 4966 |
hasContextSelected |
4967 |
^ contextView hasSelection |
|
4968 |
||
4969 |
"Created: / 17.11.2001 / 19:57:03 / cg" |
|
4970 |
! |
|
4971 |
||
10205 | 4972 |
inspectedProcess |
4973 |
^ inspectedProcess |
|
266 | 4974 |
! |
4975 |
||
4976 |
interruptProcessWith:aBlock |
|
4977 |
"let inspected process do something, then update the context list" |
|
4978 |
||
4979 |
inspectedProcess isDead ifTrue:[ |
|
11210 | 4980 |
self showTerminated. |
4981 |
^ self |
|
266 | 4982 |
]. |
4983 |
inspectedProcess interruptWith:aBlock. |
|
4984 |
" |
|
4985 |
give the process a chance to run, then update |
|
4986 |
" |
|
4987 |
(Delay forSeconds:0.2) wait. |
|
4988 |
self setContext:(inspectedProcess suspendedContext). |
|
4989 |
! |
|
4990 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4991 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4992 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4993 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4994 |
|
8194 | 4995 |
openHTMLDocument: anHTMLFilename |
4996 |
"open a HTMLDocumentView on anHTMLFilename" |
|
4997 |
||
4998 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
4999 |
! |
|
5000 |
||
266 | 5001 |
processPerform:aMessage |
5002 |
"do something, then update the context list" |
|
5003 |
||
5004 |
inspectedProcess isDead ifTrue:[ |
|
11210 | 5005 |
self showTerminated. |
5006 |
^ self |
|
266 | 5007 |
]. |
5008 |
inspectedProcess perform:aMessage. |
|
9348
df88a9a5ef36
added: browseProcessesApplication
Claus Gittinger <cg@exept.de>
parents:
9337
diff
changeset
|
5009 |
|
266 | 5010 |
" |
5011 |
give the process a chance to run, then update |
|
5012 |
" |
|
5013 |
(Delay forSeconds:0.2) wait. |
|
5014 |
self setContext:(inspectedProcess suspendedContext). |
|
5015 |
! |
|
5016 |
||
939 | 5017 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5018 |
"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
|
5019 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5020 |
|
939 | 5021 |
|oldSelection oldContext con idx| |
5022 |
||
5023 |
contextArray notNil ifTrue:[ |
|
11210 | 5024 |
self withExecuteCursorDo:[ |
5025 |
oldSelection := contextView selection. |
|
5026 |
oldSelection notNil ifTrue:[ |
|
5027 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
5028 |
]. |
|
5029 |
||
5030 |
con := firstContext. |
|
950 | 5031 |
"/ con := contextArray at:1. |
11210 | 5032 |
"/ force redeisplay, even if same by changing the first entry |
5033 |
contextArray size > 0 ifTrue:[ |
|
5034 |
contextArray at:1 put:nil. |
|
5035 |
]. |
|
5036 |
self setContext:con. |
|
5037 |
||
5038 |
oldContext isNil ifTrue:[ |
|
5039 |
idx := oldSelection |
|
5040 |
] ifFalse:[ |
|
5041 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
5042 |
]. |
|
5043 |
contextView setSelection:idx. |
|
5044 |
idx notNil ifTrue:[ |
|
5045 |
self showSelection:idx |
|
5046 |
] |
|
5047 |
] |
|
939 | 5048 |
] |
5049 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5050 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 5051 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 5052 |
! |
5053 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5054 |
selectedInterval |
7912 | 5055 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5056 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5057 |
|
7823 | 5058 |
showError:message |
5059 |
codeView contents:(resources string:message). |
|
5060 |
shown ifTrue:[ |
|
11210 | 5061 |
exclusive ifTrue:[ |
5062 |
"/ consider this a kludge: |
|
5063 |
"/ if exclusive, cannot use flash, since it suspends |
|
5064 |
"/ (but we cannot suspend here ...) |
|
5065 |
codeView redrawInverted. device flush. |
|
5066 |
OperatingSystem millisecondDelay:200. |
|
5067 |
codeView redraw |
|
5068 |
] ifFalse:[ |
|
5069 |
codeView flash |
|
5070 |
] |
|
7823 | 5071 |
] |
5072 |
||
5073 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
5074 |
! |
|
5075 |
||
5076 |
showTerminated |
|
5077 |
self showError:'** the process has terminated **' |
|
5078 |
! |
|
5079 |
||
5080 |
showValue:aValue |
|
5081 |
"/ TODO: show value in info field |
|
5082 |
"/ Transcript showCR:aValue printString |
|
5083 |
! |
|
5084 |
||
10205 | 5085 |
stepping |
5086 |
^ stepping |
|
5087 |
! |
|
5088 |
||
5089 |
unstep |
|
7823 | 5090 |
stepping := false. |
5091 |
bigStep := false. |
|
5092 |
steppedContext := wrapperContext := nil. |
|
5093 |
exitAction := nil |
|
5094 |
||
5095 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
5096 |
! |
|
5097 |
||
10203 | 5098 |
updateButtonsAndMenuItemsForContext:aContext |
5099 |
|m| |
|
5100 |
||
5101 |
m := contextView middleButtonMenu. |
|
5102 |
m notNil ifTrue:[ |
|
11210 | 5103 |
self updateMenuItems. |
5104 |
||
5105 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
|
5106 |
abortButton enable. |
|
5107 |
m enable:#doAbort. |
|
5108 |
] ifFalse:[ |
|
5109 |
abortButton disable. |
|
5110 |
m disable:#doAbort. |
|
5111 |
]. |
|
5112 |
exclusive ifTrue:[ |
|
5113 |
terminateButton disable. |
|
5114 |
m disable:#doTerminate. |
|
5115 |
] ifFalse:[ |
|
5116 |
terminateButton enable. |
|
5117 |
m enable:#doTerminate. |
|
5118 |
]. |
|
10203 | 5119 |
]. |
5120 |
||
5121 |
mayProceed == false ifTrue:[ |
|
11210 | 5122 |
continueButton disable. |
5123 |
m notNil ifTrue:[m disable:#doContinue]. |
|
10203 | 5124 |
] ifFalse:[ |
11210 | 5125 |
continueButton enable. |
5126 |
m notNil ifTrue:[m enable:#doContinue] |
|
10203 | 5127 |
]. |
5128 |
||
5129 |
"Created: / 06-07-2011 / 12:24:53 / cg" |
|
5130 |
! |
|
5131 |
||
7823 | 5132 |
updateContext |
5133 |
|oldContext idx| |
|
5134 |
||
5135 |
inspectedProcess state == #dead ifTrue:[ |
|
11210 | 5136 |
self showTerminated. |
5137 |
^ self |
|
7823 | 5138 |
]. |
5139 |
||
5140 |
oldContext := selectedContext. |
|
5141 |
[ |
|
11210 | 5142 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
5143 |
oldContext notNil ifTrue:[ |
|
5144 |
contextArray notNil ifTrue:[ |
|
5145 |
idx := contextArray identityIndexOf:oldContext. |
|
5146 |
idx ~~ 0 ifTrue:[ |
|
5147 |
self showSelection:idx |
|
5148 |
] ifFalse:[ |
|
5149 |
codeView contents:('** context returned **') |
|
5150 |
] |
|
5151 |
] |
|
5152 |
] |
|
5153 |
]. |
|
7823 | 5154 |
] valueUninterruptably. |
5155 |
||
5156 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 5157 |
! |
5158 |
||
10203 | 5159 |
updateMenuItems |
5160 |
|m mthd cls mCls rCls| |
|
5161 |
||
5162 |
" |
|
5163 |
enable/disable some menu items |
|
5164 |
" |
|
5165 |
m := contextView middleButtonMenu. |
|
5166 |
m notNil ifTrue:[ |
|
11210 | 5167 |
m disable:#removeBreakpoint. |
5168 |
m disable:#addBreakpoint. |
|
5169 |
canShowMore ifFalse:[ |
|
5170 |
m disable:#showMore |
|
5171 |
]. |
|
5172 |
||
5173 |
selectedContext notNil ifTrue:[ |
|
5174 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
5175 |
||
5176 |
mthd := selectedContext method. |
|
5177 |
mthd notNil ifTrue:[ |
|
5178 |
cls := mCls := mthd containingClass. |
|
5179 |
mthd isBreakpointed ifTrue:[ |
|
5180 |
m enable:#removeBreakpoint. |
|
5181 |
] ifFalse:[ |
|
5182 |
m enable:#addBreakpoint. |
|
5183 |
] |
|
5184 |
]. |
|
5185 |
rCls := selectedContext receiver class. |
|
5186 |
cls isNil ifTrue:[ |
|
5187 |
cls := rCls |
|
5188 |
]. |
|
5189 |
cls notNil ifTrue:[ |
|
5190 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5191 |
rCls == mCls ifTrue:[ |
|
5192 |
m disable:#browseReceiversClass |
|
5193 |
]. |
|
5194 |
mCls isNil ifTrue:[ |
|
5195 |
m disable:#browseImplementingClass |
|
5196 |
] |
|
5197 |
||
5198 |
] ifFalse:[ |
|
5199 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5200 |
]. |
|
5201 |
] ifFalse:[ |
|
5202 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
5203 |
] |
|
10203 | 5204 |
] |
5205 |
! |
|
5206 |
||
8212 | 5207 |
withNodeValueAtInterval:interval do:aBlock |
9294
e19553d7e864
changed: #withNodeValueAtInterval:do:
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
5208 |
|node definingNode nm nmBold varIdx parentNode receiver con receiversNonMetaClass| |
8212 | 5209 |
|
5210 |
"/interval printCR. |
|
10205 | 5211 |
Error |
11210 | 5212 |
handle:[:ex | ] |
5213 |
do:[ |
|
5214 |
[ |
|
5215 |
node := self findNodeForInterval:interval |
|
5216 |
] valueWithWatchDog:[ ^ self ] afterMilliseconds:50. |
|
5217 |
]. |
|
9314
e58b9abd145a
comment/format in: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9308
diff
changeset
|
5218 |
|
8212 | 5219 |
node isNil ifTrue:[ ^ self ]. |
10205 | 5220 |
node isVariable ifFalse:[ |
11210 | 5221 |
"/ Transcript showCR:node. |
5222 |
^ self |
|
8592 | 5223 |
]. |
8212 | 5224 |
|
5225 |
nm := node name. |
|
8214 | 5226 |
nmBold := nm allBold. |
8600 | 5227 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 5228 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 5229 |
receiver := actualContext methodHome receiver. |
8212 | 5230 |
|
5231 |
(nm = 'self') ifTrue:[ |
|
11210 | 5232 |
aBlock value:receiver value:'receiver' allBold. |
5233 |
^ self |
|
8212 | 5234 |
]. |
5235 |
(nm = 'super') ifTrue:[ |
|
11210 | 5236 |
aBlock value:receiver value:'receiver' allBold. |
5237 |
^ self |
|
8212 | 5238 |
]. |
5239 |
(nm = 'thisContext') ifTrue:[ |
|
11210 | 5240 |
aBlock value:actualContext value:'context' allBold. |
5241 |
^ self |
|
8212 | 5242 |
]. |
5243 |
||
5244 |
definingNode := node whoDefines:nm. |
|
5245 |
definingNode isNil ifTrue:[ |
|
11210 | 5246 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
8214 | 5247 |
"/aBlock value:'xIII' value:'instVar'. |
11210 | 5248 |
receiver class isMetaclass ifTrue:[ |
5249 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
5250 |
] ifFalse:[ |
|
5251 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
5252 |
]. |
|
5253 |
^ self |
|
5254 |
]. |
|
5255 |
||
5256 |
receiversNonMetaClass := receiver class theNonMetaclass. |
|
5257 |
(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
5258 |
aBlock value:'' value:'private class ',nmBold. |
|
5259 |
^ self |
|
5260 |
]. |
|
5261 |
(receiversNonMetaClass classVarNames includes:nm) ifTrue:[ |
|
5262 |
aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
|
5263 |
^ self |
|
5264 |
]. |
|
5265 |
receiversNonMetaClass sharedPoolNames do:[:eachPoolName | |
|
5266 |
|pool| |
|
5267 |
||
5268 |
pool := Smalltalk at:eachPoolName. |
|
5269 |
pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName]. |
|
5270 |
(pool classVarNames includes:nm) ifTrue:[ |
|
5271 |
aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '. |
|
5272 |
^ self |
|
5273 |
]. |
|
5274 |
]. |
|
5275 |
(Smalltalk includesKey:nm asSymbol) ifTrue:[ |
|
5276 |
(Smalltalk at:nm asSymbol) isClass ifTrue:[ |
|
5277 |
aBlock value:'class: ',nmBold value:nil. |
|
5278 |
] ifFalse:[ |
|
5279 |
aBlock value:(Smalltalk at:nm asSymbol) value:'global ',nmBold. |
|
5280 |
]. |
|
5281 |
^ self |
|
5282 |
]. |
|
5283 |
aBlock value:'' value:'unknown'. |
|
5284 |
^ self |
|
8212 | 5285 |
]. |
5286 |
"/definingNode printCR. |
|
5287 |
||
5288 |
definingNode isMethod ifTrue:[ |
|
11210 | 5289 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
5290 |
varIdx ~~ 0 ifTrue:[ |
|
5291 |
Error |
|
5292 |
handle:[:ex | ] |
|
5293 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
5294 |
^ self |
|
5295 |
]. |
|
5296 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
5297 |
varIdx ~~ 0 ifTrue:[ |
|
5298 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
5299 |
Error |
|
5300 |
handle:[:ex | ] |
|
5301 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
5302 |
^ self |
|
5303 |
] |
|
5304 |
]. |
|
8212 | 5305 |
]. |
5306 |
||
5307 |
definingNode isBlock ifTrue:[ |
|
11210 | 5308 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
5309 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
5310 |
varIdx ~~ 0 ifTrue:[ |
|
5311 |
"/ am I in this block ? |
|
5312 |
(actualContext lineNumber notNil |
|
5313 |
and:[ definingNode lastLineNumber notNil |
|
5314 |
and:[ (actualContext lineNumber |
|
5315 |
between:definingNode firstLineNumber |
|
5316 |
and:definingNode lastLineNumber) |
|
5317 |
and:[ varIdx <= actualContext numArgs ] ]]) |
|
5318 |
ifTrue:[ |
|
5319 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
5320 |
^ self |
|
5321 |
]. |
|
8214 | 5322 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
11210 | 5323 |
^ self |
5324 |
] |
|
5325 |
]. |
|
8212 | 5326 |
]. |
5327 |
||
5328 |
parentNode := definingNode parent. |
|
5329 |
||
5330 |
[parentNode notNil] whileTrue:[ |
|
5331 |
"/'isMethod ' print. parentNode isMethod printCR. |
|
11210 | 5332 |
parentNode isMethod ifTrue:[ |
5333 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
|
5334 |
varIdx ~~ 0 ifTrue:[ |
|
5335 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
5336 |
Error |
|
5337 |
handle:[:ex | ] |
|
5338 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
5339 |
^ self |
|
5340 |
] |
|
5341 |
]. |
|
5342 |
]. |
|
8212 | 5343 |
"/'isBlock ' print. parentNode isBlock printCR. |
11210 | 5344 |
parentNode isBlock ifTrue:[ |
5345 |
"/ we dont have any information on the inlineability |
|
5346 |
"/ of this block here (RBParser does not know what |
|
5347 |
"/ the compiler does. |
|
5348 |
"/ therefore, it is questionable if we can use the |
|
5349 |
"/ contexts home context here. |
|
5350 |
"/ am I in this block ? |
|
5351 |
con := actualContext. |
|
5352 |
[con notNil |
|
5353 |
and:[ parentNode lastLineNumber notNil |
|
5354 |
and:[ con lineNumber notNil |
|
5355 |
and:[ con lineNumber |
|
5356 |
between:parentNode firstLineNumber |
|
5357 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
|
5358 |
con := con sender. |
|
5359 |
]. |
|
5360 |
con notNil ifTrue:[ |
|
5361 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
5362 |
varIdx ~~ 0 ifTrue:[ |
|
5363 |
Error |
|
5364 |
handle:[:ex | ] |
|
5365 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
5366 |
^ self |
|
5367 |
]. |
|
5368 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
5369 |
varIdx ~~ 0 ifTrue:[ |
|
5370 |
Error |
|
5371 |
handle:[:ex | ] |
|
5372 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
5373 |
^ self |
|
5374 |
]. |
|
5375 |
]. |
|
5376 |
]. |
|
5377 |
parentNode := parentNode parent. |
|
8212 | 5378 |
]. |
8214 | 5379 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
9446 | 5380 |
|
9688
805ea34ba3ef
changed: #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
9662
diff
changeset
|
5381 |
"Modified: / 18-01-2011 / 17:57:34 / cg" |
7823 | 5382 |
! ! |
5383 |
||
5384 |
!DebugView methodsFor:'private queries'! |
|
5385 |
||
5386 |
isAborting |
|
5387 |
^ exitAction == #abort |
|
5388 |
! |
|
5389 |
||
5390 |
setOfHiddenCallingSelectors |
|
5391 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
5392 |
! |
|
5393 |
||
5394 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
5395 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
5396 |
! ! |
|
5397 |
||
9922 | 5398 |
!DebugView methodsFor:'private-breakpoints'! |
5399 |
||
11210 | 5400 |
addIgnoredHaltForCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey forAll:aBoolean |
9922 | 5401 |
|haltingContext haltingMethod lineNrOfHalt| |
5402 |
||
5403 |
aBoolean ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5404 |
haltingMethod := #all |
9922 | 5405 |
] ifFalse:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5406 |
haltingContext := self findHaltingContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5407 |
haltingContext isNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5408 |
Transcript showCR:'no halting context found'. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5409 |
^ self |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5410 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5411 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5412 |
haltingMethod := haltingContext method. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5413 |
lineNrOfHalt := haltingContext lineNumber. |
9922 | 5414 |
]. |
5415 |
||
5416 |
self class |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5417 |
ignoreHaltIn:haltingMethod at:lineNrOfHalt |
11210 | 5418 |
forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey |
5419 |
||
5420 |
"Created: / 27-01-2012 / 11:31:12 / cg" |
|
9922 | 5421 |
! |
5422 |
||
5423 |
canAddBreakpoint |
|
5424 |
|m| |
|
5425 |
||
5426 |
m := contextView middleButtonMenu. |
|
5427 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
5428 |
! |
|
5429 |
||
5430 |
canRemoveBreakpoint |
|
5431 |
|m| |
|
5432 |
||
5433 |
m := contextView middleButtonMenu. |
|
5434 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
5435 |
! |
|
5436 |
||
5437 |
findHaltingContext |
|
5438 |
|haltSelectors| |
|
5439 |
||
5440 |
haltSelectors := self haltSelectors. |
|
5441 |
||
10205 | 5442 |
contextArray keysAndValuesDo:[:idx :con | |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5443 |
|sel con2 sel2 method| |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5444 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5445 |
sel := con selector. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5446 |
(haltSelectors includes:sel) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5447 |
(method := con method) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5448 |
method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5449 |
con2 := contextArray at:idx+1. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5450 |
sel2 := con2 selector. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5451 |
(haltSelectors includes:sel2) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5452 |
con2 method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5453 |
^ contextArray at:idx+2. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5454 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5455 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5456 |
^ contextArray at:idx+1 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5457 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5458 |
method mclass == Breakpoint ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5459 |
(contextArray at:idx+1) infoPrintCR. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5460 |
^ contextArray at:idx+1 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5461 |
]. |
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 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5464 |
con method isWrapped ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5465 |
^ con |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5466 |
]. |
9922 | 5467 |
]. |
5468 |
^ nil |
|
5469 |
||
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5470 |
"Modified: / 27-01-2012 / 11:06:02 / cg" |
9922 | 5471 |
! |
5472 |
||
5473 |
ignoreBreakpoints |
|
5474 |
^ ignoreBreakpoints |
|
5475 |
||
5476 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
5477 |
! ! |
|
5478 |
||
7823 | 5479 |
!DebugView methodsFor:'private-cache handling'! |
5480 |
||
5481 |
cacheMyself |
|
5482 |
"remember myself for next debug session" |
|
5483 |
||
5484 |
"caching the last debugger will make the next debugger appear |
|
5485 |
faster, since no resources have to be allocated in the display. |
|
5486 |
We have to be careful to release all refs to the debuggee, though. |
|
5487 |
Otherwise, the GC will not be able to release it." |
|
5488 |
||
5489 |
windowGroup notNil ifTrue:[ |
|
11210 | 5490 |
windowGroup setProcess:nil. |
7823 | 5491 |
]. |
5492 |
||
5493 |
self releaseDebuggee. |
|
5494 |
||
5495 |
cachable ~~ true ifTrue:[^ self]. |
|
5496 |
||
5497 |
"/ |
|
5498 |
"/ only cache if I am on the Display |
|
5499 |
"/ |
|
5500 |
device == Display ifTrue:[ |
|
11210 | 5501 |
exclusive ifTrue:[ |
5502 |
CachedExclusive := self |
|
5503 |
] ifFalse:[ |
|
5504 |
CachedDebugger := self |
|
5505 |
]. |
|
7823 | 5506 |
]. |
5507 |
||
5508 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
11210 | 5509 |
ObjectMemory stepInterruptHandler:nil |
7823 | 5510 |
]. |
5511 |
||
5512 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
5513 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
5514 |
! |
|
5515 |
||
5516 |
isCached |
|
5517 |
"tell wether we are a cached debugger" |
|
5518 |
||
5519 |
CachedExclusive == self ifTrue:[ |
|
11210 | 5520 |
^ true. |
7823 | 5521 |
]. |
5522 |
CachedDebugger == self ifTrue:[ |
|
11210 | 5523 |
^ true. |
7823 | 5524 |
]. |
5525 |
||
5526 |
^ false. |
|
5527 |
||
5528 |
"Created: 10.7.1997 / 15:22:43 / stefan" |
|
5529 |
! |
|
5530 |
||
5531 |
releaseDebuggee |
|
5532 |
"We have to be careful to release all refs to the debuggee, |
|
5533 |
because we may be in the cache. |
|
5534 |
Otherwise, the GC will not be able to release it" |
|
5535 |
||
5536 |
busy := false. |
|
5537 |
||
5538 |
codeView acceptAction:nil. |
|
5539 |
codeView doItAction:nil. |
|
5540 |
codeView contents:nil. |
|
5541 |
||
5542 |
receiverInspector release. |
|
5543 |
contextInspector release. |
|
5544 |
inspectedProcess := nil. |
|
5545 |
contextArray := nil. |
|
5546 |
selectedContext := actualContext := firstContext := nil. |
|
5547 |
steppedContext := wrapperContext := nil. |
|
5548 |
catchBlock := nil. |
|
5549 |
grabber := nil. |
|
5550 |
self autoUpdateOff. |
|
5551 |
||
5552 |
"Created: / 10.7.1997 / 14:57:51 / stefan" |
|
5553 |
"Modified: / 10.7.1997 / 15:50:38 / stefan" |
|
5554 |
"Modified: / 17.11.2001 / 22:58:17 / cg" |
|
5555 |
! |
|
5556 |
||
5557 |
uncacheMyself |
|
5558 |
"do not remember myself any longer for next debug session" |
|
5559 |
||
5560 |
cachable := false. |
|
5561 |
||
5562 |
CachedExclusive == self ifTrue:[ |
|
11210 | 5563 |
CachedExclusive := nil. |
7823 | 5564 |
]. |
5565 |
CachedDebugger == self ifTrue:[ |
|
11210 | 5566 |
CachedDebugger := nil. |
7823 | 5567 |
]. |
5568 |
OpenDebuggers notNil ifTrue:[ |
|
11210 | 5569 |
OpenDebuggers remove:self ifAbsent:[]. |
7823 | 5570 |
]. |
5571 |
||
5572 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
5573 |
! ! |
|
5574 |
||
10628 | 5575 |
!DebugView methodsFor:'private-code view'! |
5576 |
||
5577 |
codeAspect |
|
5578 |
||
5579 |
^#method |
|
5580 |
||
5581 |
"Created: / 27-07-2011 / 13:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
5582 |
! ! |
|
5583 |
||
7823 | 5584 |
!DebugView methodsFor:'private-context handling'! |
5585 |
||
266 | 5586 |
setContext:aContext |
5587 |
"show calling chain from aContext in the walk-back listview" |
|
5588 |
||
641 | 5589 |
^ 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
|
5590 |
|
641 | 5591 |
"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
|
5592 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5593 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5594 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5595 |
"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
|
5596 |
Most complications here arise from filtering less-interesting contexts |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5597 |
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
|
5598 |
|
3702 | 5599 |
|con text method caller caller2 called called2 m count c cc |
3447 | 5600 |
suspendContext calledBySuspendContext nm h calledContext| |
266 | 5601 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5602 |
(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
|
5603 |
"no change" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5604 |
^ false |
266 | 5605 |
]. |
5606 |
||
8170 | 5607 |
isStoppedAtHaltOrBreakPoint := false. |
939 | 5608 |
firstContext := aContext. |
5609 |
||
266 | 5610 |
m := contextView middleButtonMenu. |
5611 |
m notNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5612 |
m disable:#showMore. |
266 | 5613 |
]. |
3269 | 5614 |
canShowMore := false. |
266 | 5615 |
|
5616 |
aContext isNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5617 |
text := Array with:'** no context **'. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5618 |
contextArray := nil. |
266 | 5619 |
] ifFalse:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5620 |
text := OrderedCollection new:nChainShown. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5621 |
contextArray := OrderedCollection new:nChainShown. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5622 |
con := aContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5623 |
calledContext := nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5624 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5625 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5626 |
"/ with dense backtrace, hide the ProcessorScheduler |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5627 |
"/ 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
|
5628 |
"/ context within the first 10 contexts |
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 |
suspendContext := nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5631 |
c := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5632 |
1 to:10 do:[:i | |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5633 |
|sel| |
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 |
c notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5636 |
(sel := c selector) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5637 |
((sel isSymbol and:[sel startsWith:'suspend']) |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5638 |
and:[c receiver isMemberOf:Process]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5639 |
suspendContext := c. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5640 |
calledBySuspendContext := cc. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5641 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5642 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5643 |
cc := c. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5644 |
c := c sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5645 |
] |
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 |
suspendContext notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5648 |
con := suspendContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5649 |
calledContext := calledBySuspendContext. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5650 |
suspendContext := nil |
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 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5653 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5654 |
con notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5655 |
"/ hide the halt implementation |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5656 |
(self haltSelectors includes:con selector) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5657 |
(method := con method) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5658 |
method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5659 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5660 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5661 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5662 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5663 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5664 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5665 |
method mclass == Breakpoint ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5666 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5667 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5668 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5669 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5670 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5671 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5672 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5673 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5674 |
]. |
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 |
get them all |
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 |
count := 0. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5680 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5681 |
(self haltSelectors includes:con selector) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5682 |
(method := con method) notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5683 |
method mclass == Object ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5684 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5685 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5686 |
method mclass == Breakpoint ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5687 |
isStoppedAtHaltOrBreakPoint := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5688 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5689 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5690 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5691 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5692 |
|
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 |
DebuggingDebugger == true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5695 |
'showingContext1: (' print. con print. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5696 |
') --> ' print. (self showingContext1:con calling:calledContext) printCR. |
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 |
self showingContext1:con calling:calledContext |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5699 |
] whileFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5700 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5701 |
con := con sender. |
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 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5704 |
DebuggingDebugger == true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5705 |
'showingContext2: (' print. con print. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5706 |
') --> ' print. (self showingContext2:con nesting:count) printCR. |
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 |
(self showingContext2:con nesting:count) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5710 |
"/ ignore it, if its in the same |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5711 |
"/ method as the previous context |
3447 | 5712 |
"/ (verboseBacktrace ~~ true |
10205 | 5713 |
"/ and:[count > 0 |
3447 | 5714 |
"/ and:[contextArray last method == con method |
10205 | 5715 |
"/ and:[(contextArray last isBlockContext not |
3447 | 5716 |
"/ & con isBlockContext not) not ]]]) ifTrue:[ |
5717 |
"/ "/ skip it, if its in the same method |
|
5718 |
"/ "/ as the called context. |
|
5719 |
"/ ] ifFalse:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5720 |
contextArray add:con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5721 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5722 |
(MoreDebuggingDetail == true) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5723 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5724 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5725 |
Error |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5726 |
handle:[:ex | nm := '???' ] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5727 |
do:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5728 |
nm := self contextListEntryFor:con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5729 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5730 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5731 |
text add:nm. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5732 |
count := count + 1. |
3447 | 5733 |
"/ ]. |
11209
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 |
"/ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5737 |
"/ 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
|
5738 |
"/ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5739 |
method := con method. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5740 |
(method notNil and:[method isWrapped]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5741 |
called := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5742 |
caller := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5743 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5744 |
called2 := caller. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5745 |
caller2 := caller sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5746 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5747 |
calledContext := called2. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5748 |
con := caller2 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5749 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5750 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5751 |
caller := caller2 := nil |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5752 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5753 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5754 |
"/ with dense backtrace, skip the doIt methods context |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5755 |
"/ (its dummy anyway) and fake that contexts name |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5756 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5757 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5758 |
(con isBlockContext |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5759 |
and:[(h := con home) == con sender |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5760 |
and:[h notNil |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5761 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5762 |
and:[h method who isNil]]]]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5763 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5764 |
con := con sender. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5765 |
text removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5766 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5767 |
text add:(self contextListEntryFor:con methodHome). |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5768 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5769 |
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
|
5770 |
]. |
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 |
"/ with dense backtrace, dont show below the doIt |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5773 |
( verboseBacktrace ~~ true |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5774 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5775 |
con := nil. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5776 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5777 |
calledContext := con. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5778 |
con := con sender |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5779 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5780 |
]. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5781 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5782 |
" |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5783 |
did we reach the end ? |
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 |
(con isNil or:[con sender isNil]) ifTrue:[ |
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 |
"/ the very last one is the startup context |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5788 |
"/ (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
|
5789 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5790 |
(contextArray notEmpty |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5791 |
and:[contextArray last selector isNil]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5792 |
contextArray removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5793 |
text removeLast |
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 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5796 |
verboseBacktrace ~~ true ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5797 |
"/ in dense mode, remove the process startup |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5798 |
"/ contexts (if any) |
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 |
(contextArray size > 0 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5801 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5802 |
con selector == #start ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5803 |
contextArray removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5804 |
text removeLast. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5805 |
|
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5806 |
[contextArray size > 0 |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5807 |
and:[contextArray last methodHome == con]] whileTrue:[ |
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 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5812 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5813 |
] |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5814 |
] ifFalse:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5815 |
m notNil ifTrue:[ |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5816 |
m enable:#showMore. |
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 |
canShowMore := true. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5819 |
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
|
5820 |
]. |
266 | 5821 |
]. |
5822 |
||
5823 |
contextView setList:text. |
|
944 | 5824 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5825 |
releaseInspectors ifTrue:[ |
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5826 |
receiverInspector release. |
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5827 |
contextInspector release. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5828 |
]. |
266 | 5829 |
|
5830 |
m notNil ifTrue:[ |
|
11209
202af72b0a90
comment/format in: #addIgnoredHaltForCount:orTimeDuration:forAll:
Claus Gittinger <cg@exept.de>
parents:
10760
diff
changeset
|
5831 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 5832 |
]. |
3511 | 5833 |
self updateMenuItems. |
266 | 5834 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5835 |
|
7797 | 5836 |
"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
|
5837 |
"Modified: / 27-01-2012 / 11:13:21 / cg" |
266 | 5838 |
! |
5839 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5840 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5841 |
"show calling chain from aContext in the walk-back listview. |
1213 | 5842 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5843 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5844 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5845 |
|
8152 | 5846 |
con := aContext. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5847 |
verboseBacktrace ifFalse:[ |
11210 | 5848 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
5849 |
con := con sender. |
|
5850 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
|
5851 |
con := con sender. |
|
5852 |
]. |
|
5853 |
]. |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5854 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5855 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5856 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5857 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5858 |
"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
|
5859 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5860 |
|
3447 | 5861 |
showingContext1:aContext calling:calledContext |
7823 | 5862 |
"return false, if this (top) context is to be skipped. |
10205 | 5863 |
Here, we hide some well known methods, which are usually not too interesting; |
7823 | 5864 |
the set of methods which are suppressed is my (claus's) own choice." |
5865 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5866 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 5867 |
|
5868 |
verboseBacktrace == true ifTrue:[ ^true ]. |
|
5869 |
aContext isNil ifTrue:[ ^true ]. |
|
5870 |
||
5871 |
sel := aContext selector. |
|
5872 |
rec := aContext receiver. |
|
5873 |
mthd := aContext method. |
|
5874 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
5875 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5876 |
"/ to avoid firing/waiting the lazy or future |
10205 | 5877 |
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
|
5878 |
aContext sender notNil ifTrue:[ |
11210 | 5879 |
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
|
5880 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5881 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5882 |
DebuggingDebugger == true ifTrue:[ |
11210 | 5883 |
'showingContext1: (' print. aContext print. |
5884 |
') calling: (' print. calledContext print. |
|
5885 |
')' printCR. |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5886 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5887 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5888 |
(#(doCallHandler: doRaise |
3447 | 5889 |
) includes:sel) |
11210 | 5890 |
ifTrue:[ |
5891 |
recIsException ifTrue:[ ^ false]. |
|
5892 |
]. |
|
3447 | 5893 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5894 |
(#(raise raiseRequest |
3447 | 5895 |
) includes:sel) |
11210 | 5896 |
ifTrue:[ |
5897 |
recIsException ifTrue:[ |
|
5898 |
(senderRec isLazyValue not |
|
5899 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
|
5900 |
]. |
|
5901 |
]. |
|
3447 | 5902 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5903 |
(#(doWhile: |
3447 | 5904 |
) includes:sel) |
11210 | 5905 |
ifTrue:[ |
5906 |
rec isBlock ifTrue:[ |
|
5907 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
|
5908 |
]. |
|
5909 |
]. |
|
3447 | 5910 |
|
8620 | 5911 |
calledContext notNil ifTrue:[ |
11210 | 5912 |
calledSel := calledContext selector. |
5913 |
calledRec := calledContext receiver. |
|
5914 |
||
5915 |
calledRec isBlock ifTrue:[ |
|
5916 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
5917 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
5918 |
]. |
|
5919 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
5920 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
8620 | 5921 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5922 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5923 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5924 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5925 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5926 |
"/ |
10205 | 5927 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5928 |
"/ ) includes:calledSel) |
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 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5932 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5933 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5934 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5935 |
"/ ]. |
8620 | 5936 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5937 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5938 |
(#(handleDo:) includes:sel) |
11210 | 5939 |
ifTrue:[ |
5940 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
|
5941 |
]. |
|
10205 | 5942 |
(#( |
11210 | 5943 |
withCursor:do: |
5944 |
withWaitCursorDo: |
|
3447 | 5945 |
) includes:sel) |
11210 | 5946 |
ifTrue:[ |
5947 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
5948 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
5949 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
5950 |
]. |
|
10205 | 5951 |
|
5952 |
(#( |
|
11210 | 5953 |
wait |
5954 |
waitWithTimeout: |
|
5955 |
waitWithTimeoutMs: |
|
3447 | 5956 |
) includes:sel) |
11210 | 5957 |
ifTrue:[ |
5958 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
5959 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
5960 |
]. |
|
3447 | 5961 |
|
5962 |
^ true |
|
5963 |
||
9662 | 5964 |
"Created: / 17-11-2001 / 22:24:06 / cg" |
5965 |
"Modified: / 08-12-2010 / 18:21:02 / cg" |
|
3447 | 5966 |
! |
5967 |
||
5968 |
showingContext2:aContext nesting:nesting |
|
7823 | 5969 |
"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
|
5970 |
Here, we hide some well known methods, which are usually |
10205 | 5971 |
not too interesting; |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5972 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 5973 |
|
10205 | 5974 |
|sel rec mClass |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5975 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5976 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5977 |
verboseBacktrace ifTrue:[^ true]. |
3447 | 5978 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5979 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5980 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5981 |
sel := aContext selector. |
939 | 5982 |
mClass := aContext methodClass. |
5983 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5984 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5985 |
sender notNil ifTrue:[ |
11210 | 5986 |
senderSelector := sender selector. |
5987 |
senderReceiver := sender receiver. |
|
5988 |
senderReceiverClass := senderReceiver class. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5989 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5990 |
|
939 | 5991 |
sel == #withCursor:do: ifTrue:[ |
11210 | 5992 |
(mClass == WindowGroup) ifTrue:[^ false]. |
5993 |
(mClass == TopView) ifTrue:[^ false]. |
|
939 | 5994 |
]. |
5995 |
(sel == #withExecuteCursorDo: |
|
5996 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
11210 | 5997 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 5998 |
]. |
5999 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
6000 |
(sel == #do: |
6600 | 6001 |
or:[sel == #from:to:do: |
6601 | 6002 |
or:[sel == #keysAndValuesDo: |
6003 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
11210 | 6004 |
mClass == Array ifTrue:[^ false]. |
6005 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
6006 |
mClass == Set ifTrue:[^ false]. |
|
6007 |
mClass == Dictionary ifTrue:[^ false]. |
|
6008 |
mClass == Interval ifTrue:[^ false]. |
|
10205 | 6009 |
]. |
6010 |
(sel == #perform: |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6011 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6012 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6013 |
or:[sel == #perform:with:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6014 |
or:[sel == #perform:with:with:with:with:]]]]) |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6015 |
ifTrue:[ |
11210 | 6016 |
nesting == 0 ifTrue:[^ true]. |
6017 |
mClass == Array ifTrue:[^ false]. |
|
6018 |
mClass == OrderedCollection ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6019 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6020 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6021 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6022 |
|
939 | 6023 |
(mClass == Object) ifTrue:[ |
11210 | 6024 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 6025 |
]. |
6026 |
||
6027 |
(mClass == Method) ifTrue:[ |
|
11210 | 6028 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 6029 |
]. |
6030 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
6031 |
(mClass == SmallInteger) ifTrue:[ |
11210 | 6032 |
(sel == #to:do:) ifTrue:[^ false]. |
6033 |
(sel == #to:by:do:) ifTrue:[^ false]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
6034 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
6035 |
|
939 | 6036 |
(mClass == Block) ifTrue:[ |
11210 | 6037 |
sel == #ensure: ifTrue:[^ false]. |
6038 |
sel == #ifCurtailed: ifTrue:[^ false]. |
|
6039 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
|
6040 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
|
6041 |
sel == #on:do: ifTrue:[^ false]. |
|
6042 |
||
6043 |
sel == #value ifTrue:[^ false]. |
|
6044 |
sel == #value: ifTrue:[^ false]. |
|
6045 |
sel == #value:value: ifTrue:[^ false]. |
|
6046 |
sel == #value:value:value: ifTrue:[^ false]. |
|
6047 |
sel == #value:value:value:value: ifTrue:[^ false]. |
|
6048 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
|
6049 |
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
|
6050 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6051 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6052 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6053 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6054 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6055 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6056 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6057 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6058 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6059 |
"/ 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
|
6060 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6061 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6062 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6063 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6064 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6065 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6066 |
|
11210 | 6067 |
aContext home notNil ifTrue:[ |
6068 |
aContext home receiver isLazyValue ifFalse:[ |
|
6069 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
|
6070 |
(aContext home selector == #wait) ifTrue:[^ false]. |
|
6071 |
(aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false]. |
|
6072 |
] |
|
6073 |
] |
|
6074 |
] |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6075 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6076 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
6077 |
(rec isExceptionHandler) ifTrue:[ |
11210 | 6078 |
sel == #handle:do: ifTrue:[^ false]. |
6079 |
sel == #handleDo: ifTrue:[^ false]. |
|
6080 |
(sel startsWith:#raise) ifTrue:[^ false]. |
|
6081 |
sel == #answer:do: ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
6082 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
6083 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
11210 | 6084 |
sel == #doRaise ifTrue:[^ false]. |
6085 |
sel == #doCallHandler: ifTrue:[^ false]. |
|
6086 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
|
6087 |
senderReceiverClass == Signal ifTrue:[^ false]. |
|
6088 |
] |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6089 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6090 |
(mClass == Context) ifTrue:[ |
11210 | 6091 |
sel == #unwind ifTrue:[^ false]. |
6092 |
sel == #unwind: ifTrue:[^ false]. |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6093 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6094 |
(mClass == ProcessorScheduler) ifTrue:[ |
11210 | 6095 |
sel == #interruptActive ifTrue:[^ false]. |
6096 |
sel == #threadSwitch: ifTrue:[^ false]. |
|
6097 |
sel == #suspend: 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 == Process ifTrue:[ |
11210 | 6100 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
6101 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6102 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
6103 |
|
9662 | 6104 |
"Created: / 17-11-2001 / 19:34:20 / cg" |
6105 |
"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
|
6106 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
6107 |
|
4859 | 6108 |
!DebugView methodsFor:'private-control loop'! |
266 | 6109 |
|
6110 |
controlLoop |
|
6111 |
"this is a kludge: |
|
11210 | 6112 |
start a dispatchloop which exits when |
6113 |
either continue, return or step is pressed |
|
266 | 6114 |
" |
6115 |
||
6116 |
haveControl := true. |
|
664 | 6117 |
[ |
11210 | 6118 |
[haveControl] whileTrue:[ |
6119 |
self controlLoopCatchingErrors |
|
6120 |
]. |
|
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
6121 |
] ensure:[ |
11210 | 6122 |
catchBlock := nil. |
6123 |
haveControl := false |
|
266 | 6124 |
]. |
664 | 6125 |
|
6126 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 6127 |
! |
6128 |
||
6129 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
6130 |
"this is the debuggers own private event handling loop; |
1187 | 6131 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
6132 |
|
266 | 6133 |
"setup a self removing catch-block" |
6134 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
6135 |
||
6136 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
11210 | 6137 |
"if we do not have multiple processes or its a system process |
6138 |
we start another dispatch loop, which exits when |
|
6139 |
either continue, return or step is pressed |
|
6140 |
or (via the catchBlock) if an error occurs. |
|
6141 |
Since our display is an extra exclusive one, |
|
6142 |
all processing for normal views stops here ... |
|
6143 |
" |
|
6144 |
||
6145 |
WindowGroup setActiveGroup:windowGroup. |
|
6146 |
SignalSet anySignal handle:[:ex | |
|
6147 |
|signal| |
|
6148 |
||
6149 |
signal := ex signal. |
|
6150 |
||
6151 |
self showError:'*** Error in modal debugger: |
|
266 | 6152 |
|
334 | 6153 |
>>>> Signal: ' , signal printString , ' |
266 | 6154 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 6155 |
>>>> From: ' , ex suspendedContext sender printString , ' |
6156 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
6157 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
6158 |
>>>> : ' , 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
|
6159 |
>>>> : ' , 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
|
6160 |
>>>> : ' , 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
|
6161 |
>>>> : ' , 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
|
6162 |
>>>> : ' , 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
|
6163 |
>>>> : ' , 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
|
6164 |
>>>> : ' , 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
|
6165 |
>>>> : ' , 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
|
6166 |
>>>> : ' , 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
|
6167 |
>>>> : ' , 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
|
6168 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 6169 |
>>>> Message: ' , ex description , ' |
266 | 6170 |
|
1187 | 6171 |
caught & ignored.'. |
11210 | 6172 |
ex return. |
6173 |
] do:[ |
|
6174 |
UserNotification handle:[:ex | |
|
6175 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
|
6176 |
ex proceed |
|
6177 |
]. |
|
6178 |
self showError:ex description. |
|
6179 |
ex proceed. |
|
6180 |
] do:[ |
|
6181 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
|
6182 |
haveControl]. |
|
6183 |
] |
|
6184 |
]. |
|
6185 |
WindowGroup setActiveGroup:nil. |
|
266 | 6186 |
] ifFalse:[ |
11210 | 6187 |
"we do have multiple processes - |
6188 |
simply enter the DebugViews-Windowgroup event loop. |
|
6189 |
effectively suspending event processing for the currently |
|
6190 |
active group. |
|
6191 |
" |
|
6192 |
SignalSet anySignal handle:[:ex | |
|
6193 |
|answer signal eMsg| |
|
6194 |
||
6195 |
signal := ex signal. |
|
6196 |
||
6197 |
DebuggingDebugger ~~ true ifTrue:[ |
|
6198 |
(signal == ActivityNotification) ifTrue:[ |
|
6199 |
ex proceed |
|
6200 |
]. |
|
6201 |
"/ |
|
6202 |
"/ ignore exceptions which say they explicitly have to be ignored |
|
6203 |
"/ |
|
6204 |
ex catchInDebugger ifTrue:[ |
|
6205 |
'DebugView [info]: ',signal printString,'-signal in debugger cought for close' infoPrintCR. |
|
6206 |
self destroy. |
|
6207 |
ex reject |
|
6208 |
]. |
|
6209 |
||
6210 |
"/ |
|
6211 |
"/ ignore recursive breakpoints |
|
6212 |
"/ |
|
6213 |
(signal isControlInterrupt) ifTrue:[ |
|
6214 |
ignoreBreakpoints == true ifTrue:[ |
|
6215 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
|
6216 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
|
6217 |
ex proceed |
|
6218 |
]. |
|
6219 |
]. |
|
6220 |
(signal == TerminateProcessRequest) ifTrue:[ |
|
6221 |
"/ mhm - someone wants to shoot me down while debugging ... |
|
6222 |
answer := Dialog |
|
6223 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
|
6224 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
6225 |
values:#( #proceed #close ) |
|
6226 |
default:#close. |
|
6227 |
answer == #close ifTrue:[ |
|
6228 |
self destroy. |
|
6229 |
ex reject |
|
6230 |
]. |
|
6231 |
ex return. |
|
6232 |
]. |
|
6233 |
signal == RecursiveExceptionError ifTrue:[ |
|
6234 |
(ex parameter signal == BreakPointInterrupt) |
|
6235 |
ifTrue:[ |
|
6236 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
|
6237 |
ex proceed. |
|
6238 |
]. |
|
6239 |
||
6240 |
self showError:'*** Recursive error in debugger: |
|
266 | 6241 |
|
6242 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 6243 |
>>>> ' , ex parameter signal printString , ' |
266 | 6244 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 6245 |
>>>> From: ' , ex suspendedContext sender printString , ' |
6246 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
6247 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
6248 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 6249 |
>>>> Message: ' , ex description , ' |
266 | 6250 |
|
1187 | 6251 |
caught & ignored.'. |
11210 | 6252 |
ex return |
6253 |
]. |
|
6254 |
]. |
|
6255 |
||
6256 |
self topView raiseDeiconified. |
|
6257 |
||
6258 |
eMsg := ex description. |
|
6259 |
(ex signal isControlInterrupt) ifTrue:[ |
|
6260 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
|
6261 |
]. |
|
6262 |
Dialog aboutToOpenBoxNotificationSignal |
|
6263 |
handle:[:ex | ex proceed ] |
|
6264 |
do:[ |
|
6265 |
answer := Dialog |
|
6266 |
choose:('Error in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
|
6267 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
6268 |
values:#( #proceed #cancel #debug ) |
|
6269 |
default:#cancel. |
|
6270 |
]. |
|
6271 |
answer == #debug ifTrue:[ |
|
6272 |
'DebugView [info]: cought exception - debugging' infoPrintCR. |
|
6273 |
Debugger |
|
6274 |
enterUnconditional:(ex suspendedContext) |
|
6275 |
withMessage:'Error in debugger: ' , eMsg |
|
6276 |
mayProceed:true. |
|
6277 |
ex proceed. |
|
6278 |
]. |
|
6279 |
answer == #proceed ifTrue:[ |
|
6280 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
|
6281 |
ex proceed. |
|
6282 |
]. |
|
6283 |
'DebugView [info]: cought exception - returning' infoPrintCR. |
|
6284 |
ex return. |
|
6285 |
] do:[ |
|
6286 |
"/ make certain that sub-debuggers, inspectors etc. |
|
6287 |
"/ come up on my device. |
|
6288 |
Screen currentScreenQuerySignal answer:device |
|
6289 |
do:[ |
|
6290 |
windowGroup |
|
6291 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
6292 |
true] |
|
6293 |
onLeave:[] |
|
6294 |
] |
|
6295 |
]. |
|
266 | 6296 |
]. |
6297 |
catchBlock := nil. |
|
6298 |
||
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
6299 |
"Created: / 24.11.1995 / 20:33:45 / cg" |
3447 | 6300 |
"Modified: / 18.11.2001 / 01:04:17 / cg" |
266 | 6301 |
! ! |
6302 |
||
0 | 6303 |
!DebugView methodsFor:'user interaction'! |
6304 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6305 |
checkIfCodeIsReallyModified |
6616 | 6306 |
|source| |
6307 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6308 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6309 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6310 |
currentMethod isNil ifTrue:[ |
11210 | 6311 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6312 |
]. |
6616 | 6313 |
source := currentMethod source. |
6314 |
source notNil ifTrue:[ |
|
11210 | 6315 |
source string = codeView contents string ifTrue:[ |
6316 |
^ false |
|
6317 |
]. |
|
6318 |
(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
|
6319 |
^ false |
|
6320 |
]. |
|
6616 | 6321 |
]. |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6322 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6323 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6324 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6325 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6326 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6327 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6328 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
6329 |
checkSelectionChangeAllowed:newSelection |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6330 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6331 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6332 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6333 |
and:[newSelection = contextView selection]) ifTrue:[ |
11210 | 6334 |
^ true |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6335 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6336 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6337 |
(self confirm:('Code modified - change selection anyway ?')) ifFalse:[ |
11210 | 6338 |
^ false |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6339 |
]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6340 |
codeView modified:false. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
6341 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6342 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6343 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
6344 |
|
266 | 6345 |
codeAccept:someCode |
6346 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
6347 |
and including selected method cannot be continued." |
|
6348 |
||
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6349 |
^ 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
|
6350 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
6351 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 6352 |
! |
6353 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6354 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
3427 | 6355 |
"user wants some code to be recompiled - must unwind stack since everything above |
6356 |
and including selected method cannot be continued." |
|
6357 |
||
6358 |
" |
|
6359 |
actually, this is not true, since the active methods will still be |
|
6360 |
executed correctly - however, the code shown in the debugger is no |
|
6361 |
longer in sync (showing the new code) with the executed code. |
|
6362 |
Therefore, we hide those contexts to avoid confusion .... |
|
6363 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
6364 |
||
6365 |
"walk up context chain and find highest context which is either the selected context, |
|
6366 |
or - if its a block-context - whose home is the selected context" |
|
6367 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6368 |
|con top newMethod| |
3427 | 6369 |
|
6370 |
codeView withWaitCursorDo:[ |
|
11210 | 6371 |
" |
6372 |
find the method-home context for this one |
|
6373 |
" |
|
6374 |
doUnwind ifTrue:[ |
|
6375 |
con := selectedContext. |
|
6376 |
top := con. |
|
6377 |
[con notNil] whileTrue:[ |
|
6378 |
(con methodHome == selectedContext) ifTrue:[ |
|
6379 |
top := con |
|
6380 |
]. |
|
6381 |
con := con sender |
|
6382 |
]. |
|
6383 |
]. |
|
6384 |
||
6385 |
"/ |
|
6386 |
"/ provide the classes nameSpace on a query; |
|
6387 |
"/ in case we accept while in another nameSpace context, |
|
6388 |
"/ (but for a class which is somewhere else) |
|
6389 |
"/ |
|
6390 |
(Class updateChangeFileQuerySignal, |
|
6391 |
Class updateChangeListQuerySignal, |
|
6392 |
Class updateHistoryLineQuerySignal) answer:true |
|
6393 |
do:[ |
|
6394 |
Class nameSpaceQuerySignal |
|
6395 |
answer:(aClass nameSpace) |
|
6396 |
do:[ |
|
6397 |
Class packageQuerySignal |
|
6398 |
answer:(aClass package ? PackageId noProjectID) |
|
6399 |
do:[ |
|
6400 |
codeView contents:someCode. |
|
6401 |
newMethod := aClass compilerClass |
|
6402 |
compile:someCode |
|
6403 |
forClass:aClass |
|
6404 |
inCategory:category |
|
6405 |
notifying:codeView. |
|
6406 |
]. |
|
6407 |
]. |
|
6408 |
]. |
|
6409 |
||
6410 |
inspecting ifFalse:[ |
|
6411 |
" |
|
6412 |
if it worked, remove everything up to and including top |
|
6413 |
from context chain |
|
6414 |
" |
|
6415 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
6416 |
codeView modified:false. |
|
6417 |
||
6418 |
doUnwind ifTrue:[ |
|
6419 |
selectedContext canReturn ifTrue:[ |
|
6420 |
self setContext:(top "sender"). |
|
6421 |
exitAction := #restart. |
|
6422 |
selectedContext setLineNumber:1. |
|
6423 |
self doRestart. |
|
6424 |
] ifFalse:[ |
|
6425 |
self setContext:(top sender). |
|
6426 |
exitAction := #return. |
|
6427 |
]. |
|
6428 |
||
6429 |
" |
|
6430 |
continue/step is no longer possible |
|
6431 |
" |
|
6432 |
"/ continueButton disable. |
|
6433 |
"/ canContinue := false. |
|
6434 |
]. |
|
6435 |
||
6436 |
contextView selection:1. |
|
6437 |
"/ self showSelection:1. |
|
6438 |
"/ contextView makeSelectionVisible. "/ scrollToLine:(selection - 1) |
|
6439 |
] ifFalse:[ |
|
6440 |
^ cancelAction value |
|
6441 |
] |
|
6442 |
]. |
|
3427 | 6443 |
]. |
6444 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
6445 |
"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
|
6446 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
3427 | 6447 |
! |
6448 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6449 |
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
|
6450 |
"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
|
6451 |
and including selected method cannot be continued." |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6452 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6453 |
" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6454 |
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
|
6455 |
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
|
6456 |
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
|
6457 |
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
|
6458 |
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
|
6459 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6460 |
"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
|
6461 |
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
|
6462 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6463 |
|sel implementorClass method category| |
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 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6466 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6467 |
"/ 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
|
6468 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6469 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6470 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6471 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6472 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6473 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6474 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6475 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6476 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6477 |
|
10628 | 6478 |
" |
6479 |
use class&selector to find the method for the compilation |
|
6480 |
and compile. |
|
6481 |
" |
|
6482 |
category := givenCategoryOrNil. |
|
6483 |
sel := selectedContext selector. |
|
6484 |
implementorClass := selectedContext methodClass. |
|
6485 |
implementorClass notNil ifTrue:[ |
|
6486 |
category isNil ifTrue:[ |
|
6487 |
method := selectedContext method. |
|
6488 |
method isNil ifTrue:[ |
|
6489 |
method := implementorClass compiledMethodAt:sel. |
|
6490 |
]. |
|
6491 |
category := method category |
|
6492 |
] |
|
6493 |
] ifFalse:[ |
|
6494 |
implementorClass := selectedContext receiver class. |
|
6495 |
implementorClass ~~ Object ifTrue:[ |
|
6496 |
implementorClass := Dialog |
|
6497 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
|
6498 |
initialAnswer:implementorClass name |
|
6499 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
6500 |
implementorClass size == 0 ifTrue:[ |
|
6501 |
^ cancelAction value "/ cancelled |
|
6502 |
]. |
|
6503 |
implementorClass := Smalltalk classNamed:implementorClass. |
|
6504 |
implementorClass isNil ifTrue:[ |
|
6505 |
Dialog warn:'No such class'. |
|
6506 |
^ cancelAction value "/ cancelled |
|
6507 |
]. |
|
6508 |
]. |
|
6509 |
]. |
|
6510 |
||
6511 |
self |
|
6512 |
codeAccept:someCode |
|
6513 |
inClass:implementorClass |
|
6514 |
unwind:doUnwind |
|
6515 |
category:category |
|
6516 |
onCancel:cancelAction. |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6517 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6518 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6519 |
"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
|
6520 |
"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
|
6521 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6522 |
|
7912 | 6523 |
codeCompletion |
6524 |
|cls| |
|
6525 |
||
8212 | 6526 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 6527 |
|
7912 | 6528 |
cls := currentMethod mclass. |
8212 | 6529 |
cls isNil ifTrue:[ ^ self ]. |
6530 |
||
7912 | 6531 |
UserInformation handle:[:ex | |
11210 | 6532 |
ex proceed. |
7912 | 6533 |
] do:[ |
11210 | 6534 |
DoWhatIMeanSupport codeCompletionForClass:cls context:selectedContext codeView:codeView. |
7912 | 6535 |
]. |
6536 |
! |
|
6537 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6538 |
confirm:aString |
6971 | 6539 |
"open a modal yes-no dialog. |
6540 |
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
|
6541 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6542 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
11210 | 6543 |
^ true |
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6544 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6545 |
^ super confirm:aString. |
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 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
6548 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
6549 |
"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
|
6550 |
Also sent to autoselect an interesting context on entry." |
0 | 6551 |
|
9235 | 6552 |
HaltInterrupt handle:[:ex | |
11210 | 6553 |
ignoreBreakpoints ifFalse:[ex reject]. |
6554 |
('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
|
6555 |
ex proceed |
|
3447 | 6556 |
] do:[ |
11210 | 6557 |
self updateForContext:lineNr |
3269 | 6558 |
]. |
6559 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSĂgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
6560 |
|
3447 | 6561 |
"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
|
6562 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6563 |
|
10205 | 6564 |
hideStackInspector |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6565 |
stackInspector notNil ifTrue:[ |
11210 | 6566 |
stackInspector destroy. |
6567 |
stackInspector := nil. |
|
6568 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
|
6569 |
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
|
6570 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6571 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6572 |
|
9500
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6573 |
methodCodeToggleChanged |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6574 |
|sel| |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6575 |
|
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6576 |
sel := contextView selection. |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6577 |
sel notNil ifTrue:[ |
11210 | 6578 |
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
|
6579 |
] |
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 |
"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
|
6582 |
! |
76bc64543166
care for original vs. current methods code (if it was changed)
Claus Gittinger <cg@exept.de>
parents:
9488
diff
changeset
|
6583 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6584 |
processEvent:anEvent |
6129 | 6585 |
"filter keyboard events for popUp variable value display. |
6586 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6587 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6588 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6589 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6590 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6591 |
evView notNil ifTrue:[ |
11210 | 6592 |
focusView := evView windowGroup focusView. |
6593 |
focusView isNil ifTrue:[ |
|
6594 |
focusView := evView. |
|
6595 |
]. |
|
6596 |
||
6597 |
anEvent isKeyPressEvent ifTrue:[ |
|
6598 |
key := anEvent key. |
|
6599 |
rawKey := anEvent rawKey. |
|
6600 |
||
6601 |
inCodeView := (focusView == codeView |
|
6602 |
or:[focusView isComponentOf:codeView]). |
|
6603 |
inCodeView ifTrue:[ |
|
6604 |
key == #CodeCompletion ifTrue:[ |
|
6605 |
"/ complete the word before/under the cursor. |
|
6606 |
self sensor |
|
6607 |
pushUserEvent:#codeCompletion |
|
6608 |
for:self |
|
6609 |
withArguments:#(). |
|
6610 |
^ true |
|
6611 |
]. |
|
6612 |
]. |
|
6613 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6614 |
|
3602 | 6615 |
false ifTrue:[ |
11210 | 6616 |
anEvent isButtonReleaseEvent ifTrue:[ |
6617 |
anEvent view == codeView ifTrue:[ |
|
6618 |
(RBParser notNil and:[RBParser isLoaded]) |
|
6619 |
ifTrue:[ |
|
6620 |
self sensor |
|
6621 |
pushEvent:anEvent. "/ must be first in queue |
|
6622 |
||
6623 |
self sensor |
|
6624 |
pushUserEvent:#explainSelection |
|
6625 |
for:self |
|
6626 |
withArguments:nil. |
|
6627 |
^ true "/ eaten |
|
6628 |
] |
|
6629 |
] |
|
6630 |
]. |
|
3602 | 6631 |
]. |
6632 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6633 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6634 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6635 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6636 |
|
8212 | 6637 |
setCurrentMethod:aMethodOrNil |
6638 |
currentMethod := aMethodOrNil. |
|
6639 |
! |
|
6640 |
||
1327 | 6641 |
showSelection:lineNr |
6642 |
"user clicked on a header line - show selected code in textView. |
|
6643 |
Also sent to autoselect an interesting context on entry." |
|
6644 |
||
10205 | 6645 |
Notification |
11210 | 6646 |
handle: |
6647 |
[:ex | |
|
6648 |
"/ ex suspendedContext fullPrintAll. |
|
6649 |
Transcript showCR:ex description. |
|
6650 |
"/ Transcript showCR:ex parameter. |
|
6651 |
ex proceed |
|
6652 |
] |
|
6653 |
do: |
|
6654 |
[ |
|
6655 |
Error |
|
6656 |
handle: |
|
6657 |
[:ex | |
|
6658 |
|s con| |
|
6659 |
||
6660 |
ex signal isControlInterrupt |
|
6661 |
ifTrue:[ |
|
6662 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' infoPrintCR. |
|
6663 |
ex proceed |
|
6664 |
]. |
|
6665 |
||
6666 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' bindWith:ex suspendedContext) infoPrintCR. |
|
6667 |
||
6668 |
s := '' writeStream. |
|
6669 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
6670 |
s nextPutLine:'****'. |
|
6671 |
s nextPutAll: '**** '; nextPutLine:(ex description "withCRs"). |
|
6672 |
s nextPutLine:'****'. |
|
6673 |
con := ex suspendedContext. |
|
6674 |
s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6675 |
con := con sender. |
|
6676 |
HaltInterrupt ignoreIn:[ |
|
6677 |
con fullPrintAllOn:s. |
|
6678 |
]. |
|
5842 | 6679 |
"/ [con notNil] whileTrue:[ |
6680 |
"/ Error catch:[:ex | |
|
6681 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6682 |
"/ ]. |
|
4947 | 6683 |
"/ |
5842 | 6684 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
6685 |
"/ con := nil |
|
6686 |
"/ ] ifFalse:[ |
|
6687 |
"/ con := con sender. |
|
6688 |
"/ ] |
|
6689 |
"/ ]. |
|
11210 | 6690 |
codeView contents:(s contents). |
6691 |
ex return. |
|
6692 |
] |
|
6693 |
do: |
|
6694 |
[ |
|
6695 |
self doShowSelection:lineNr |
|
6696 |
] |
|
6697 |
] |
|
1327 | 6698 |
|
6815 | 6699 |
"Modified: / 04-07-2006 / 14:50:06 / cg" |
1327 | 6700 |
! |
6701 |
||
10205 | 6702 |
showStackInspectorFor:con |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6703 |
stackInspector isNil ifTrue:[ |
11210 | 6704 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
6705 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
|
6706 |
stackInspector := InspectorView |
|
6707 |
origin:(0.6 @ 0.0) |
|
6708 |
corner:(1.0 @ 1.0) |
|
6709 |
in:contextInspector superView. |
|
6710 |
stackInspector realize. |
|
6711 |
stackInspector fieldListLabel:'Stack'. |
|
6712 |
stackInspector hideReceiver:true |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6713 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6714 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6715 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6716 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6717 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6718 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6719 |
"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
|
6720 |
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
|
6721 |
|
56 | 6722 |
|con homeContext sel method code canAccept |
105 | 6723 |
implementorClass lineNrInMethod rec m line |
10205 | 6724 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 6725 |
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
|
6726 |
canDefine callee searchClass originalMethod| |
3187 | 6727 |
|
6728 |
canDefine := false. |
|
8212 | 6729 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
6730 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6731 |
contextArray notNil ifTrue:[ |
10628 | 6732 |
lineNr <= contextArray size ifTrue:[ |
6733 |
con := contextArray at:lineNr. |
|
6734 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
|
6735 |
]. |
|
6736 |
" |
|
6737 |
clicking on the '** ...'-line shows more ... |
|
6738 |
" |
|
6739 |
con isNil ifTrue:[ |
|
6740 |
line := contextView list at:lineNr. |
|
6741 |
(line startsWith:'**') ifTrue:[ |
|
6742 |
self showMore. |
|
6743 |
lineNr >= contextArray size ifTrue:[ |
|
6744 |
contextView setSelection:lineNr. |
|
6745 |
con := contextArray at:lineNr ifAbsent:nil |
|
6746 |
] |
|
6747 |
]. |
|
6748 |
con isNil ifTrue:[ |
|
6749 |
codeView contents:nil. |
|
6750 |
^ self |
|
6751 |
]. |
|
6752 |
]. |
|
6753 |
||
6754 |
selectedContext := con. |
|
6755 |
m := contextView middleButtonMenu. |
|
6756 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
|
6757 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
|
6758 |
]. |
|
6759 |
||
6760 |
self withExecuteCursorDo:[ |
|
6761 |
codeSet := false. |
|
6762 |
||
6763 |
" |
|
6764 |
give it to the (lower right) inspector |
|
6765 |
" |
|
6766 |
Error handle:[:ex | |
|
6767 |
'DebugView [warning]: error while accessing context' errorPrintCR. |
|
6768 |
contextInspector inspect:nil. |
|
9479 | 6769 |
"/ ex reject. |
10628 | 6770 |
] do:[ |
6771 |
contextInspector inspect:con. |
|
6772 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
|
6773 |
]. |
|
6774 |
||
6775 |
"/ show a stack inspector sometimes |
|
6776 |
||
6777 |
con hasStackToShow ifTrue:[ |
|
6778 |
self showStackInspectorFor:con |
|
6779 |
] ifFalse:[ |
|
6780 |
self hideStackInspector |
|
6781 |
]. |
|
6782 |
||
6783 |
homeContext := con methodHome. |
|
6784 |
con canReturn ifTrue:[ |
|
6785 |
returnButton enable. restartButton enable. |
|
6786 |
] ifFalse:[ |
|
6787 |
returnButton disable. restartButton disable. |
|
6788 |
]. |
|
6789 |
||
6790 |
lineNrInMethod := con lineNumber. |
|
6791 |
||
6792 |
canAccept := false. |
|
6793 |
||
6794 |
homeContext isNil ifTrue:[ |
|
6795 |
" |
|
6796 |
mhmh - an optimized block |
|
6797 |
should get the block here, and get the method from |
|
6798 |
that one ... |
|
6799 |
But in the current version, there is no easy way to get to the block |
|
6800 |
since that one is not in the context. |
|
6801 |
A future new block calling scheme will fix this |
|
6802 |
(passing the block instead of the home as block argument). |
|
6803 |
" |
|
6804 |
||
6805 |
"temporary kludge - peek into the sender context. |
|
6806 |
If its a do-like method and there is a single block variable |
|
6807 |
in the args or temporaries, that must be the one. |
|
6808 |
This helps in some cases. |
|
6809 |
" |
|
6810 |
(sender := con sender) notNil ifTrue:[ |
|
6811 |
tryVars := false. |
|
6812 |
(selSender := sender selector) notNil ifTrue:[ |
|
6813 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
|
6814 |
tryVars := true. |
|
6815 |
] |
|
6816 |
]. |
|
6817 |
tryVars ifTrue:[ |
|
6818 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
|
6819 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
|
6820 |
possibleBlocks size == 1 ifTrue:[ |
|
6821 |
method := possibleBlocks first method. |
|
6822 |
]. |
|
6823 |
] |
|
6824 |
]. |
|
6825 |
] ifFalse:[ |
|
6826 |
"fetch rec here - so we won't need context in doItAction" |
|
6827 |
rec := homeContext receiver. |
|
6828 |
sel := homeContext selector. |
|
6829 |
sel notNil ifTrue:[ |
|
6830 |
canAccept := true. |
|
6831 |
||
6832 |
implementorClass := homeContext methodClass. |
|
6833 |
implementorClass isNil ifTrue:[ |
|
6834 |
Error handle:[:ex | |
|
6835 |
ex signal == BreakPointInterrupt ifTrue:[ |
|
6836 |
ex proceed. |
|
6837 |
]. |
|
6838 |
code := 'error while asking method for its source'. |
|
6839 |
code := code , Character cr , ex signal printString. |
|
6840 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6841 |
||
6842 |
canAccept := false. |
|
6843 |
ex return. |
|
6844 |
] do:[ |
|
6845 |
" |
|
6846 |
special: look if this context was created by |
|
6847 |
valueWithReceiver kind of method invocation; |
|
6848 |
if so, grab the method from the sender and show it |
|
6849 |
" |
|
6850 |
((sender := homeContext sender) notNil |
|
6851 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
|
6852 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
6853 |
method := sender receiver. |
|
6854 |
canAccept := false. |
|
6855 |
] ifFalse:[ |
|
6856 |
(method := con method) notNil ifTrue:[ |
|
6857 |
canAccept := false. |
|
6858 |
] |
|
6859 |
]. |
|
6860 |
] |
|
6861 |
] ifFalse:[ |
|
6862 |
method := implementorClass compiledMethodAt:sel. |
|
6863 |
]. |
|
6864 |
] |
|
6865 |
]. |
|
6866 |
||
6867 |
homeContext notNil ifTrue:[ |
|
6868 |
searchClass := homeContext searchClass ? rec class. |
|
6869 |
currentMethod := searchClass lookupMethodFor:sel. |
|
6870 |
]. |
|
6871 |
originalMethod := currentMethod. |
|
6872 |
(currentMethod notNil and:[currentMethod ~~ method]) ifTrue:[ |
|
6873 |
originalMethod := method. |
|
6874 |
methodCodeToggleSelectionHolder value = 1 ifTrue:[ |
|
6875 |
method := originalMethod. |
|
6876 |
] ifFalse:[ |
|
6877 |
method := currentMethod. |
|
6878 |
lineNrInMethod := nil. |
|
6879 |
canAccept := true. |
|
6880 |
]. |
|
6881 |
methodCodeToggle beVisible. |
|
6882 |
] ifFalse:[ |
|
6883 |
methodCodeToggle beInvisible. |
|
6884 |
]. |
|
6885 |
||
6886 |
code isNil ifTrue:[ |
|
6887 |
errMsg := nil. |
|
6888 |
method isNil ifTrue:[ |
|
6889 |
"/ fall back heuristics |
|
6890 |
con isBlockContext ifTrue:[ |
|
6891 |
((sender := con sender) notNil |
|
6892 |
and:[((sender selector ? '') startsWith:'value') |
|
6893 |
and:[sender receiver isBlock]]) ifTrue:[ |
|
6894 |
code := sender receiver source. |
|
6895 |
] |
|
6896 |
] ifFalse:[ |
|
6897 |
((sender := con sender) notNil |
|
6898 |
and:[((sender selector ? '') startsWith:'valueWith') |
|
6899 |
and:[sender receiver isMethod]]) ifTrue:[ |
|
6900 |
method := sender receiver. |
|
6901 |
] |
|
6902 |
] |
|
6903 |
]. |
|
6904 |
method notNil ifTrue:[ |
|
6905 |
Error handle:[:ex | |
|
6906 |
ex signal isControlInterrupt ifTrue:[ |
|
6907 |
ex proceed. |
|
6908 |
]. |
|
6909 |
code := 'error while asking method for its source'. |
|
6910 |
code := code , Character cr , ex signal printString. |
|
6911 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6912 |
||
6913 |
canAccept := false. |
|
6914 |
ex return. |
|
6915 |
] do:[ |
|
6916 |
self sensor shiftDown ifTrue:[ |
|
6917 |
code := method decompiledSource |
|
6918 |
] ifFalse:[ |
|
6919 |
code := method source. |
|
6920 |
]. |
|
6921 |
]. |
|
6922 |
code isNil ifTrue:[ |
|
6923 |
method sourceFilename notNil ifTrue:[ |
|
6924 |
codeView contents:(resources |
|
6925 |
string:'** no sourcefile: %1 **' |
|
6926 |
with:method sourceFilename). |
|
6927 |
codeView flash. |
|
6928 |
codeSet := true. |
|
6929 |
] ifFalse:[ |
|
6930 |
[ |
|
6931 |
|src| |
|
6932 |
||
6933 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
|
6934 |
codeView contents:src. |
|
6935 |
codeSet := true. |
|
6936 |
] on: Error do:[ |
|
6937 |
errMsg := '** no source **' |
|
6938 |
]. |
|
6939 |
] |
|
6940 |
]. |
|
6941 |
] ifFalse:[ |
|
6942 |
homeContext isNil ifTrue:[ |
|
6943 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
|
6944 |
] ifFalse:[ |
|
6945 |
errMsg := '** no method - no source **'. |
|
6946 |
canDefine := true. |
|
6947 |
] |
|
6948 |
]. |
|
6949 |
errMsg notNil ifTrue:[ |
|
6950 |
self showError:errMsg. |
|
6951 |
codeSet := true. |
|
6952 |
] |
|
6953 |
]. |
|
6954 |
||
6955 |
code isNil ifTrue:[ |
|
6956 |
"/ canAccept := false. |
|
6957 |
codeSet ifFalse:[ |
|
6958 |
codeView contents:nil. |
|
6959 |
] |
|
6960 |
] ifFalse:[ |
|
6961 |
lineNrInMethod notNil ifTrue:[ |
|
6962 |
lineNrInMethod == 0 ifTrue:[ |
|
6963 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
6964 |
lineNrInMethod := method lineNumber |
|
6965 |
]. |
|
6966 |
"/ guess lineNumber from sent-messages selector |
|
6967 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
|
6968 |
lineNrInMethod == 0 ifTrue:[ |
|
6969 |
|conIdx sentContext messages| |
|
6970 |
||
6971 |
conIdx := contextArray identityIndexOf:con. |
|
6972 |
conIdx > 1 ifTrue:[ |
|
6973 |
sentContext := contextArray at:conIdx-1. |
|
6974 |
sentContext isBlockContext ifFalse:[ |
|
6975 |
(method notNil and:[code notNil]) ifTrue:[ |
|
6976 |
messages := method messagesSent. |
|
6977 |
messages size == 1 ifTrue:[ |
|
6978 |
sentContext selector == messages first ifTrue:[ |
|
6979 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
|
6980 |
] |
|
6981 |
] |
|
6982 |
]. |
|
6983 |
]. |
|
6984 |
]. |
|
6985 |
]. |
|
6986 |
]. |
|
6987 |
]. |
|
6988 |
codeView isCodeView2 ifTrue:[ |
|
10649
3f480fd28a48
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
10628
diff
changeset
|
6989 |
codeView model setValue: code. |
3f480fd28a48
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
10628
diff
changeset
|
6990 |
codeView model changed. |
10628 | 6991 |
codeView methodHolder value: method. |
10752 | 6992 |
codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class]) |
10628 | 6993 |
] ifFalse:[ |
6994 |
||
6995 |
UserPreferences current syntaxColoring ifTrue:[ |
|
6996 |
implementorClass isNil ifTrue:[ |
|
6997 |
(con isBlockContext |
|
6998 |
and:[con home isNil |
|
6999 |
and:[con guessedHome notNil]]) |
|
7000 |
ifTrue:[ |
|
7001 |
implementorClass := con guessedHome mclass |
|
7002 |
] |
|
7003 |
]. |
|
7004 |
implementorClass notNil ifTrue:[ |
|
7005 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
|
7006 |
code size < 100000 ifTrue:[ |
|
7007 |
Error handle:[:ex | |
|
7008 |
] do:[ |
|
7009 |
code := highlighter formatMethod:code in:implementorClass. |
|
7010 |
] |
|
7011 |
] |
|
7012 |
] |
|
7013 |
] |
|
7014 |
]. |
|
1555 | 7015 |
|
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
7016 |
"/ code ~= (codeView contents) ifTrue:[ |
10628 | 7017 |
codeView setContents:code. |
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
7018 |
"/ ]. |
10628 | 7019 |
]. |
7020 |
(lineNrInMethod notNil |
|
7021 |
and:[lineNrInMethod ~~ 0 |
|
7022 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
|
7000 | 7023 |
lineNrInMethod == 255 ifFalse:[ |
10628 | 7024 |
(lineNrInMethod == 255 |
7025 |
and:[method notNil |
|
7026 |
and:[method hasCode not]]) ifTrue:[ |
|
7027 |
"/ means: do not really know in interpreted methods |
|
7028 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
|
7029 |
] ifFalse:[ |
|
7030 |
codeView selectLine:lineNrInMethod. |
|
7031 |
]. |
|
7032 |
codeView makeSelectionVisible |
|
7000 | 7033 |
]. |
10628 | 7034 |
] ifFalse:[ |
7035 |
codeView unselect. |
|
7036 |
codeView scrollToTop |
|
7037 |
] |
|
7038 |
]. |
|
7039 |
||
7040 |
codeView acceptEnabled:canAccept. |
|
7041 |
canAccept ifTrue:[ |
|
7042 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
7043 |
] ifFalse:[ |
|
7044 |
codeView acceptAction:[:code | self beep] |
|
7045 |
]. |
|
7046 |
||
7047 |
receiverInspector inspect:rec. |
|
7048 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
|
7049 |
||
7050 |
" |
|
7051 |
the one below is wrong: currently, the |
|
7052 |
evaluator cannot handle passed contexts. |
|
7053 |
Once it does, pass con as in:-arg |
|
7054 |
" |
|
7055 |
(rec isJavaObject |
|
7056 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
7057 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
7058 |
evaluatorClass := Parser |
|
7059 |
] ifFalse:[ |
|
7060 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
|
7061 |
evaluatorClass := method mclass evaluatorClass. |
|
7062 |
] ifFalse:[ |
|
7063 |
evaluatorClass := rec class evaluatorClass. |
|
7064 |
]. |
|
7065 |
]. |
|
7066 |
||
7067 |
codeView doItAction:[:theCode | |
|
7068 |
evaluatorClass |
|
7069 |
evaluate:theCode |
|
7070 |
in:actualContext |
|
7071 |
receiver:rec |
|
7072 |
notifying:codeView |
|
7073 |
logged:true |
|
7074 |
ifFail:nil |
|
7075 |
]. |
|
7076 |
self setCurrentMethod:method. |
|
7077 |
||
7078 |
selectedContext := homeContext. |
|
7079 |
actualContext := con |
|
7080 |
]. |
|
4122 | 7081 |
] ifFalse:[ |
10628 | 7082 |
codeView contents:nil. |
4122 | 7083 |
]. |
7084 |
codeView modified:false. |
|
7085 |
||
7086 |
con isContext ifFalse:[ |
|
10628 | 7087 |
sendButton disable. |
4122 | 7088 |
] ifTrue:[ |
10628 | 7089 |
sendButton enable. |
10205 | 7090 |
]. |
7091 |
||
7092 |
"clear out locals to prevent keeping around unneeded contexts |
|
4122 | 7093 |
(due to the block held in codeView). |
7094 |
(not really needed, since stuff gets collected away sooner or later ... |
|
7095 |
... but this makes it a bit sooner) |
|
7096 |
" |
|
7097 |
con := nil. |
|
7098 |
homeContext := nil. |
|
7099 |
||
10205 | 7100 |
(callee notNil |
7101 |
and:[callee method notNil |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7102 |
and:[callee method selector == #subclassResponsibility]] |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7103 |
) ifTrue:[ |
10628 | 7104 |
canDefine := true. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7105 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
7106 |
|
4122 | 7107 |
canDefine ifTrue:[ |
10628 | 7108 |
defineButton beVisible. |
4122 | 7109 |
] ifFalse:[ |
10628 | 7110 |
defineButton beInvisible. |
4122 | 7111 |
]. |
7112 |
||
7113 |
" |
|
7114 |
enable/disable some menu items |
|
7115 |
" |
|
7116 |
self updateMenuItems |
|
7117 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
7118 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
10649
3f480fd28a48
changed: #updateForContext:
Claus Gittinger <cg@exept.de>
parents:
10628
diff
changeset
|
7119 |
"Modified: / 22-08-2011 / 13:49:39 / cg" |
10752 | 7120 |
"Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4122 | 7121 |
! ! |
7122 |
||
8170 | 7123 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
7124 |
||
7125 |
ignoreCount:something |
|
7126 |
ignoreCount := something. |
|
7127 |
! |
|
7128 |
||
7129 |
ignoreEndTime:something |
|
7130 |
ignoreEndTime := something. |
|
7131 |
! |
|
7132 |
||
11210 | 7133 |
ignoreUntilShiftKeyPressed:aBoolean |
7134 |
ignoreUntilShiftKeyPressed := aBoolean. |
|
7135 |
||
7136 |
"Created: / 27-01-2012 / 11:35:23 / cg" |
|
7137 |
! |
|
7138 |
||
8170 | 7139 |
method |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7140 |
|m| |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7141 |
|
9922 | 7142 |
weakMethodHolder == #all ifTrue:[^ weakMethodHolder ]. |
7143 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7144 |
m := weakMethodHolder at:1. |
9796 | 7145 |
"/ wait until really gone (it could still be on the call stack |
7146 |
"/ |
|
7147 |
"/ m notNil ifTrue:[ |
|
7148 |
"/ m mclass isNil ifTrue:[ |
|
7149 |
"/ "/ no longer valid |
|
7150 |
"/ weakMethodHolder at:1 put:nil. |
|
7151 |
"/ ^ nil |
|
7152 |
"/ ]. |
|
7153 |
"/ ]. |
|
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7154 |
^ m |
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7155 |
|
9922 | 7156 |
"Modified: / 08-05-2011 / 10:28:10 / cg" |
8170 | 7157 |
! |
7158 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7159 |
method:methodArg lineNumber:lineNumberArg |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7160 |
"/ self assert:(methodArg mclass notNil). |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7161 |
|
9922 | 7162 |
methodArg == #all ifTrue:[ |
11210 | 7163 |
weakMethodHolder := methodArg |
9922 | 7164 |
] ifFalse:[ |
11210 | 7165 |
weakMethodHolder := WeakArray with:methodArg. |
9922 | 7166 |
]. |
8170 | 7167 |
lineNumber := lineNumberArg. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7168 |
|
9922 | 7169 |
"Modified: / 08-05-2011 / 10:28:41 / cg" |
8170 | 7170 |
! ! |
7171 |
||
7172 |
!DebugView::IgnoredHalt methodsFor:'misc'! |
|
7173 |
||
7174 |
decrementIgnoreCount |
|
7175 |
ignoreCount notNil ifTrue:[ |
|
11210 | 7176 |
ignoreCount > 0 ifTrue:[ |
7177 |
ignoreCount := ignoreCount - 1 |
|
7178 |
] |
|
8170 | 7179 |
] |
7180 |
! ! |
|
7181 |
||
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7182 |
!DebugView::IgnoredHalt methodsFor:'printing'! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7183 |
|
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7184 |
printOn:aStream |
9922 | 7185 |
|method| |
7186 |
||
7187 |
(method := self method) isNil ifTrue:[ |
|
11210 | 7188 |
aStream nextPutAll:'an obsolete IgnoredHalt'. |
7189 |
^ self |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7190 |
]. |
9590
41587c52f59c
fixed ignoring halts for breakPoints
Claus Gittinger <cg@exept.de>
parents:
9586
diff
changeset
|
7191 |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7192 |
aStream nextPutAll:'Ignore '. |
11210 | 7193 |
method whoString printOn:aStream. |
7194 |
||
7195 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
7196 |
aStream nextPutAll:' until shiftKey pressed'. |
|
9093
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7197 |
] ifFalse:[ |
11210 | 7198 |
ignoreEndTime notNil ifTrue:[ |
7199 |
aStream nextPutAll:' until '. |
|
7200 |
ignoreEndTime printOn:aStream. |
|
7201 |
] ifFalse:[ |
|
7202 |
(ignoreCount > 0) ifTrue:[ |
|
7203 |
aStream nextPutAll:' for '. |
|
7204 |
ignoreCount printOn:aStream. |
|
7205 |
] ifFalse:[ |
|
7206 |
(ignoreCount < 0) ifTrue:[ |
|
7207 |
aStream nextPutAll:' forEver'. |
|
7208 |
] ifFalse:[ |
|
7209 |
aStream nextPutAll:' no longer'. |
|
7210 |
]. |
|
7211 |
]. |
|
7212 |
]. |
|
7213 |
]. |
|
7214 |
||
7215 |
"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
|
7216 |
! ! |
afeec57f277e
generate a change notification when ignore-halts changes
Claus Gittinger <cg@exept.de>
parents:
9078
diff
changeset
|
7217 |
|
8170 | 7218 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
7219 |
||
9078 | 7220 |
haltIgnoredInfoString |
7221 |
"some string describing why and how this halt is ignored; |
|
7222 |
nil if not ignored" |
|
7223 |
||
7224 |
ignoreCount notNil ifTrue:[ |
|
11210 | 7225 |
ignoreCount > 0 ifTrue:[ |
7226 |
^ '%1 more calls ignored' bindWith:ignoreCount |
|
7227 |
]. |
|
7228 |
^ nil |
|
9078 | 7229 |
]. |
7230 |
ignoreEndTime notNil ifTrue:[ |
|
11210 | 7231 |
(ignoreEndTime > Timestamp now) ifTrue:[ |
7232 |
^ 'ignored until %1' bindWith:ignoreEndTime |
|
7233 |
]. |
|
7234 |
^ nil |
|
7235 |
]. |
|
7236 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
|
7237 |
Display shiftDown ifFalse:[ |
|
7238 |
^ 'ignored until shiftKey is pressed' |
|
7239 |
]. |
|
7240 |
^ nil |
|
9078 | 7241 |
]. |
7242 |
||
7243 |
^ 'ignored until reenabled' |
|
11210 | 7244 |
|
7245 |
"Modified: / 27-01-2012 / 11:35:48 / cg" |
|
9078 | 7246 |
! |
7247 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7248 |
isActive |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7249 |
"true if this ignore-entry is still active" |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7250 |
|
9796 | 7251 |
self method isNil ifTrue:[self halt. ^ false ]. "/ method no longer valid |
11210 | 7252 |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7253 |
ignoreEndTime notNil ifTrue:[ |
11210 | 7254 |
^ ignoreEndTime > Timestamp now |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7255 |
]. |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7256 |
ignoreCount notNil ifTrue:[ |
11210 | 7257 |
^ ignoreCount > 0 |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7258 |
]. |
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7259 |
^ false |
9796 | 7260 |
|
7261 |
"Modified: / 23-03-2011 / 15:21:02 / cg" |
|
11210 | 7262 |
"Modified (format): / 27-01-2012 / 11:25:30 / cg" |
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 |
|
8170 | 7265 |
isForMethod:aMethod line:line |
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7266 |
"/ check in this order - method has a flushing side-effect, which is useful here... |
9922 | 7267 |
weakMethodHolder == #all ifTrue:[^ true]. |
7268 |
||
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7269 |
^ (aMethod = self method) and:[ line = lineNumber ]. |
9922 | 7270 |
|
7271 |
"Modified: / 08-05-2011 / 10:27:31 / cg" |
|
8170 | 7272 |
! |
7273 |
||
7274 |
isHaltIgnored |
|
9078 | 7275 |
"true if this halt should be ignored" |
7276 |
||
11210 | 7277 |
ignoreUntilShiftKeyPressed == true ifTrue:[ |
7278 |
^ Display shiftDown not |
|
7279 |
]. |
|
8170 | 7280 |
ignoreCount notNil ifTrue:[ |
11210 | 7281 |
^ ignoreCount > 0 |
8170 | 7282 |
]. |
7283 |
ignoreEndTime notNil ifTrue:[ |
|
11210 | 7284 |
^ ignoreEndTime > Timestamp now |
8170 | 7285 |
]. |
7286 |
||
7287 |
^ true |
|
11210 | 7288 |
|
7289 |
"Modified: / 27-01-2012 / 11:36:01 / cg" |
|
8170 | 7290 |
! |
7291 |
||
7292 |
isHaltIgnoredInMethod:aMethod line:line |
|
9095 | 7293 |
"/ 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
|
7294 |
|
9094
51cf41fd65a2
added: #removeInactiveIgnores
Claus Gittinger <cg@exept.de>
parents:
9093
diff
changeset
|
7295 |
(self isForMethod:aMethod line:line) ifFalse:[^ false]. |
9095 | 7296 |
"/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored. |
8170 | 7297 |
|
7298 |
^ self isHaltIgnored |
|
7299 |
! ! |
|
7300 |
||
4122 | 7301 |
!DebugView class methodsFor:'documentation'! |
7302 |
||
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7303 |
version |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7304 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.529 2012-03-01 13:21:31 cg Exp $' |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7305 |
! |
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7306 |
|
8952
7742c63ff6f5
catch halts in: #showSelection:
Claus Gittinger <cg@exept.de>
parents:
8745
diff
changeset
|
7307 |
version_CVS |
11304
d142697b6c1e
changed: #browseImplementingClass
Claus Gittinger <cg@exept.de>
parents:
11303
diff
changeset
|
7308 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.529 2012-03-01 13:21:31 cg Exp $' |
10628 | 7309 |
! |
7310 |
||
7311 |
version_SVN |
|
7312 |
^ '§Id: DebugView.st 7818 2011-08-18 11:42:39Z vranyj1 §' |
|
4122 | 7313 |
! ! |
7314 |
||
7315 |
DebugView initialize! |