author | Claus Gittinger <cg@exept.de> |
Sat, 28 Jun 1997 20:26:15 +0200 | |
changeset 1213 | d0b855852da3 |
parent 1187 | 4fabd7c20b9f |
child 1240 | ff3fdaa72df6 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
45 | 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 |
" |
|
12 |
||
13 |
StandardSystemView subclass:#DebugView |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
14 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
15 |
receiverInspector contextInspector contextArray selectedContext |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
16 |
catchBlock grabber traceView tracing bigStep skipLineNr |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
17 |
steppedContextAddress canAbort abortButton terminateButton |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
18 |
continueButton stepButton nextButton nextOverButton nextOutButton |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
19 |
sendButton returnButton restartButton exclusive inspecting |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
20 |
nChainShown inspectedProcess updateProcess stopButton |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
21 |
updateButton monitorToggle stepping steppedContextLineno |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
22 |
stepForReturn actualContext inWrap stackInspector steppedContext |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
23 |
wrapperContext verboseBacktrace firstContext stepHow' |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
24 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
25 |
DebuggingDebugger VerboseBacktraceDefault DefaultIcon |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
26 |
InitialNCHAINShown' |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
27 |
poolDictionaries:'' |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
28 |
category:'Interface-Debugger' |
0 | 29 |
! |
30 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
31 |
!DebugView class methodsFor:'documentation'! |
29 | 32 |
|
33 |
copyright |
|
34 |
" |
|
35 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
45 | 36 |
All Rights Reserved |
29 | 37 |
|
38 |
This software is furnished under a license and may be used |
|
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
! |
|
0 | 46 |
|
29 | 47 |
documentation |
48 |
" |
|
49 |
this class implements a graphical debugger interface. |
|
50 |
The debugger usually sits on top of the faulting process, |
|
51 |
taking over its event processing. Thus only the 'stopped' process is affected; |
|
52 |
other processes continue to respond to events. |
|
53 |
||
54 |
The one exception is when an error occurs within the dispatcher process |
|
55 |
or in one of the eventhandler processes - in this case, the debugger |
|
56 |
will sit on an exclusive display connection. |
|
57 |
||
58 |
The whole debugging will be changed, once the required process primitives |
|
59 |
are available, which allow control of another processes execution |
|
60 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
61 |
to have the debugger control the debuggee (i.e. two processes) |
|
35 | 62 |
|
63 |
See additional information in 'doc/misc/debugger.doc'. |
|
53 | 64 |
|
65 |
Notice: the DebugView class caches the last used debugger in a class |
|
66 |
variable. It may happen, that a malfunctioning debugger (for example, |
|
67 |
a halfway destoyed one) is kept there. You will notice this, if a |
|
68 |
debugger comes up without showing any contents. In this case, close |
|
69 |
(or destroy) the broken debugView, and execute |
|
508 | 70 |
Debugger newDebugger |
53 | 71 |
which removes the cached debugger and forces creation of a new one the |
72 |
next time. This is a temporary workaround - the debugger will be fixed to |
|
73 |
avoid this problem. |
|
508 | 74 |
|
75 |
[author:] |
|
76 |
Claus Gittinger |
|
77 |
||
78 |
[see also:] |
|
79 |
Exception Signal |
|
80 |
Process |
|
29 | 81 |
" |
82 |
! ! |
|
0 | 83 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
84 |
!DebugView class methodsFor:'initialization'! |
243 | 85 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
86 |
initialize |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
87 |
InitialNCHAINShown := 20. |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
88 |
|
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
89 |
"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
|
90 |
"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
|
91 |
! |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
92 |
|
243 | 93 |
reinitialize |
94 |
self newDebugger |
|
95 |
! ! |
|
96 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
97 |
!DebugView class methodsFor:'instance creation'! |
0 | 98 |
|
266 | 99 |
enter |
100 |
"another way of entering the debugger" |
|
73 | 101 |
|
266 | 102 |
^ self enter:(thisContext sender) withMessage:'Debugger' |
73 | 103 |
|
266 | 104 |
"Debugger enter" |
73 | 105 |
! |
106 |
||
266 | 107 |
enter:aContext |
108 |
"enter the debugger on aContext" |
|
29 | 109 |
|
266 | 110 |
^ self enter:aContext withMessage:'Debugger' |
0 | 111 |
! |
112 |
||
29 | 113 |
enter:aContext withMessage:aString |
53 | 114 |
"enter a debugger; if this is a recursive invocation, enter |
115 |
a MiniDebugger instead. |
|
116 |
This is the standard way of entering the debugger; |
|
117 |
sent from error- and halt messages." |
|
0 | 118 |
|
745
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
119 |
|active found c| |
93 | 120 |
|
57 | 121 |
StepInterruptPending := nil. |
122 |
||
62 | 123 |
thisContext isRecursive ifTrue:[ |
745
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
124 |
"/ care for the special case, were the Debugger was autoloaded. |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
125 |
"/ in this case, thisContext IS recursive, but thats no error |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
126 |
"/ condition. |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
127 |
found := false. |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
128 |
c := thisContext sender. |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
129 |
[found not |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
130 |
and:[c notNil |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
131 |
and:[c selector ~~ #enter:withMessage:]]] whileTrue:[ |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
132 |
c selector == #noByteCode ifTrue:[ |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
133 |
found := true |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
134 |
]. |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
135 |
c := c sender |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
136 |
]. |
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
137 |
|
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
138 |
found ifFalse:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
139 |
('DebugView [warning]: reentered with: ', aString) errorPrintCR. |
941 | 140 |
^ MiniDebugger |
141 |
enterWithMessage:'DebugView [error]: recursive error (in debugger)'. |
|
745
89a242c66cda
handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents:
687
diff
changeset
|
142 |
] |
62 | 143 |
]. |
144 |
||
57 | 145 |
" |
146 |
well, it could be a stepping or sending debugger up there; |
|
147 |
in this case, return to it. This happens, when a stepping process |
|
148 |
runs into an error (for example, a halt). In this case, we want the |
|
149 |
stepping debugger to come up again instead of a new one. |
|
150 |
" |
|
151 |
OpenDebuggers notNil ifTrue:[ |
|
526 | 152 |
active := Processor activeProcess. |
153 |
OpenDebuggers do:[:aDebugger | |
|
775
f741dc4afe19
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
154 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
526 | 155 |
(aDebugger inspectedProcess == active) ifTrue:[ |
57 | 156 |
"/ 'entering stepping debugger again' printNL. |
526 | 157 |
aDebugger unstep. |
158 |
aDebugger setLabelFor:aString in:active. |
|
159 |
^ aDebugger enter:aContext. |
|
160 |
] |
|
161 |
] |
|
162 |
] |
|
57 | 163 |
]. |
164 |
||
53 | 165 |
^ self enterUnconditional:aContext withMessage:aString |
526 | 166 |
|
1101 | 167 |
"Modified: 27.3.1997 / 18:25:44 / cg" |
53 | 168 |
! |
169 |
||
266 | 170 |
enterUnconditional:aContext withMessage:aString |
171 |
"enter a debugger - do not check for recursive invocation" |
|
172 |
||
173 |
|aDebugger| |
|
174 |
||
175 |
StepInterruptPending := nil. |
|
176 |
aDebugger := self new. |
|
177 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
|
178 |
aDebugger enter:aContext. |
|
179 |
^ nil |
|
180 |
||
181 |
"nil halt" |
|
182 |
! |
|
183 |
||
184 |
enterWithMessage:aString |
|
185 |
"the standard way of entering the debugger - sent from Objects |
|
186 |
error- and halt messages" |
|
187 |
||
188 |
^ self enter:(thisContext sender) withMessage:aString |
|
189 |
||
190 |
"Debugger enterWithMessage:'hi there'" |
|
191 |
! |
|
192 |
||
193 |
new |
|
194 |
"return a new DebugView - return a cached debugger if it already |
|
195 |
exists" |
|
53 | 196 |
|
73 | 197 |
|debugger| |
14 | 198 |
|
266 | 199 |
" |
200 |
need a blocking debugger if no processes or |
|
201 |
or if its a timing/interrupt process |
|
202 |
(because otherwise we would not get any events here ... |
|
203 |
" |
|
204 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
959
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
205 |
(CachedExclusive isNil |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
206 |
or:[CachedExclusive device ~~ Screen current]) ifTrue:[ |
875 | 207 |
debugger := self newExclusive |
208 |
] ifFalse:[ |
|
209 |
debugger := CachedExclusive. |
|
210 |
CachedExclusive := nil. |
|
211 |
]. |
|
266 | 212 |
] ifFalse:[ |
1136
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
213 |
CachedDebugger notNil ifTrue:[ |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
214 |
(CachedDebugger device ~~ Screen current |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
215 |
or:[CachedDebugger device isOpen not]) ifTrue:[ |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
216 |
CachedDebugger := nil |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
217 |
] |
959
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
218 |
]. |
1136
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
219 |
|
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
220 |
CachedDebugger isNil ifTrue:[ |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
221 |
Screen current isOpen ifFalse:[ |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
222 |
DeviceWorkstation currentScreenQuerySignal handle:[:ex | |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
223 |
ex proceedWith:Display |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
224 |
] do:[ |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
225 |
debugger := super new. |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
226 |
] |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
227 |
] ifTrue:[ |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
228 |
debugger := super new. |
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
229 |
]. |
875 | 230 |
debugger label:'Debugger'. |
231 |
debugger icon:self defaultIcon. |
|
232 |
] ifFalse:[ |
|
233 |
debugger := CachedDebugger. |
|
234 |
CachedDebugger := nil. |
|
235 |
] |
|
266 | 236 |
]. |
73 | 237 |
^ debugger |
875 | 238 |
|
1136
f6805687a65c
avoid creating a debugger on a closed display device
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
239 |
"Modified: 14.4.1997 / 18:18:30 / cg" |
73 | 240 |
! |
0 | 241 |
|
266 | 242 |
newExclusive |
243 |
"return a debugger for exclusive display access" |
|
244 |
||
245 |
|debugger| |
|
105 | 246 |
|
266 | 247 |
debugger := super new. |
248 |
debugger label:'Debugger'. |
|
875 | 249 |
debugger icon:self defaultIcon. |
266 | 250 |
debugger exclusive:true. |
251 |
^ debugger |
|
875 | 252 |
|
253 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 254 |
! |
255 |
||
29 | 256 |
openOn:aProcess |
257 |
"start a debugger on aProcess |
|
258 |
(actually not more than a good-looking inspector)" |
|
15 | 259 |
|
52 | 260 |
|aDebugger label nm| |
15 | 261 |
|
262 |
aDebugger := super new. |
|
875 | 263 |
aDebugger icon:self defaultIcon. |
29 | 264 |
aProcess notNil ifTrue:[ |
875 | 265 |
nm := aProcess name. |
266 |
nm notNil ifTrue:[ |
|
267 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
|
268 |
] ifFalse:[ |
|
269 |
nm := aProcess id printString |
|
270 |
]. |
|
271 |
label := 'Debugger [' , nm , ']'. |
|
29 | 272 |
] ifFalse:[ |
875 | 273 |
label := 'no process' |
29 | 274 |
]. |
1114 | 275 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 276 |
aDebugger openOn:aProcess. |
277 |
^ nil |
|
875 | 278 |
|
1114 | 279 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 280 |
! ! |
281 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
282 |
!DebugView class methodsFor:'cleanup'! |
485 | 283 |
|
284 |
lowSpaceCleanup |
|
285 |
"in low memory situations, give up cached debuggers" |
|
286 |
||
287 |
CachedDebugger := nil. |
|
288 |
CachedExclusive := nil. |
|
289 |
OpenDebuggers := nil. |
|
290 |
||
291 |
" |
|
292 |
DebugView lowSpaceCleanup |
|
293 |
" |
|
294 |
||
295 |
"Modified: 18.4.1996 / 16:48:03 / cg" |
|
296 |
! |
|
297 |
||
298 |
newDebugger |
|
299 |
"force creation of a new debugger" |
|
300 |
||
301 |
CachedDebugger := nil. |
|
302 |
CachedExclusive := nil. |
|
303 |
OpenDebuggers := nil. |
|
304 |
||
305 |
" |
|
306 |
DebugView newDebugger |
|
307 |
" |
|
308 |
! ! |
|
309 |
||
875 | 310 |
!DebugView class methodsFor:'defaults'! |
311 |
||
312 |
defaultIcon |
|
1148 | 313 |
"return the debuggers default window icon" |
314 |
||
315 |
<resource: #style (#ICON #ICON_FILE)> |
|
316 |
||
317 |
|nm i| |
|
318 |
||
319 |
(i := DefaultIcon) isNil ifTrue:[ |
|
320 |
i := self classResources at:'ICON' default:nil. |
|
321 |
i isNil ifTrue:[ |
|
322 |
nm := ClassResources at:'ICON_FILE' default:'Debugger.xbm'. |
|
323 |
i := Image fromFile:nm resolution:100. |
|
324 |
i isNil ifTrue:[ |
|
325 |
i := Image fromFile:('bitmaps/' , nm) resolution:100. |
|
326 |
i isNil ifTrue:[ |
|
327 |
i := StandardSystemView defaultIcon |
|
328 |
] |
|
329 |
] |
|
1082 | 330 |
]. |
1148 | 331 |
i notNil ifTrue:[ |
332 |
DefaultIcon := i := i on:Display |
|
1082 | 333 |
] |
334 |
]. |
|
1148 | 335 |
^ i |
336 |
||
337 |
"Modified: 19.3.1997 / 20:48:34 / ca" |
|
338 |
"Modified: 18.4.1997 / 15:16:27 / cg" |
|
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
339 |
! |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
340 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
341 |
defaultVerboseBacktrace |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
342 |
^ VerboseBacktraceDefault |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
343 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
344 |
"Created: 11.1.1997 / 12:14:35 / cg" |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
345 |
! |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
346 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
347 |
defaultVerboseBacktrace:aBoolean |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
348 |
VerboseBacktraceDefault := aBoolean |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
349 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
350 |
"Created: 11.1.1997 / 12:14:44 / cg" |
875 | 351 |
! ! |
352 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
353 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
354 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
355 |
interestingContextFrom:aContext |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
356 |
"return an interesting contexts offset, or nil. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
357 |
This is the context initially shown in the walkback. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
358 |
We move up the calling chain, skipping all intermediate Signal |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
359 |
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
|
360 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
361 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
362 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
363 |
|delta con| |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
364 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
365 |
delta := self interestingContextIndexFrom:aContext. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
366 |
con := aContext. |
944 | 367 |
[con notNil and:[delta > 1]] whileTrue:[ |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
368 |
con := con sender. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
369 |
delta := delta - 1. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
370 |
]. |
944 | 371 |
con isNil ifTrue:[ |
372 |
^ aContext |
|
373 |
]. |
|
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
374 |
^ con |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
375 |
|
944 | 376 |
"Modified: 11.1.1997 / 17:58:44 / cg" |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
377 |
! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
378 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
379 |
interestingContextIndexFrom:aContext |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
380 |
"return an interesting contexts offset, or nil. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
381 |
This is the context initially shown in the walkback. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
382 |
We move up the calling chain, skipping all intermediate Signal |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
383 |
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
|
384 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
385 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
386 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
387 |
|c found offset sel prev ex| |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
388 |
|
998 | 389 |
aContext isNil ifTrue:[^ 1]. |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
390 |
aContext isBlockContext ifTrue:[^ 1]. |
944 | 391 |
VerboseBacktraceDefault == true ifTrue:[^ 1]. |
392 |
||
393 |
"/ somewhere, at the bottom, there must be a raise ... |
|
394 |
"/ find the exception |
|
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
395 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
396 |
c := aContext. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
397 |
1 to:5 do:[:i | |
944 | 398 |
c isNil ifTrue:[^ 1]. |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
399 |
sel := c selector. |
923
3878260918ee
better skip raiseRequest as well
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
400 |
((sel == #raise) |
3878260918ee
better skip raiseRequest as well
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
401 |
or:[sel == #raiseRequest]) ifTrue:[ |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
402 |
(c receiver isKindOf:Exception) ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
403 |
ex := c receiver. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
404 |
offset := i. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
405 |
found := c |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
406 |
] ifFalse:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
407 |
(c receiver isSignal) ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
408 |
offset := i. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
409 |
found := c |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
410 |
] |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
411 |
] |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
412 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
413 |
c := c sender. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
414 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
415 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
416 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
417 |
if this is a noHandler exception, skip forward |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
418 |
to the erronous context |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
419 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
420 |
ex notNil ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
421 |
ex signal == Signal noHandlerSignal ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
422 |
c := ex suspendedContext |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
423 |
] |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
424 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
425 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
426 |
(c := found) isNil ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
427 |
"/ this is a kludge, but convenient. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
428 |
"/ show the place where the divisionByZero happend, |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
429 |
"/ not where the signal was raised. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
430 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
431 |
sel := aContext selector. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
432 |
(sel == #// |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
433 |
or:[sel == #/ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
434 |
or:[sel == #\\]]) ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
435 |
^ 2 |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
436 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
437 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
438 |
^ 1 |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
439 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
440 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
441 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
442 |
got it; move up, skipping all intermediate Signal and |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
443 |
Exception contexts |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
444 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
445 |
prev := nil. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
446 |
[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
447 |
((c receiver isSignal) |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
448 |
or:[(c receiver isKindOf:Exception)]) |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
449 |
] whileTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
450 |
prev := c. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
451 |
(c := c sender) isNil ifTrue:[^ offset]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
452 |
offset := offset + 1. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
453 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
454 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
455 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
456 |
now, we are one above the raising context |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
457 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
458 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
459 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
460 |
if the sender-method of the raise is one of objects error methods ... |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
461 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
462 |
( #( halt halt: |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
463 |
error error: |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
464 |
doesNotUnderstand: |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
465 |
subclassResponsibility |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
466 |
primitiveFailed) includes:c selector) |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
467 |
ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
468 |
c selector == #doesNotUnderstand: ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
469 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
470 |
one more up, to get to the originating context |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
471 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
472 |
(c := c sender) isNil ifTrue:[^ offset]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
473 |
offset := offset + 1. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
474 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
475 |
(c := c sender) isNil ifTrue:[^ offset]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
476 |
offset := offset + 1. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
477 |
] ifFalse:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
478 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
479 |
ok, got the raise - if its a BreakPoint, look for the sender |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
480 |
" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
481 |
(MessageTracer notNil and:[prev receiver == MessageTracer breakpointSignal]) ifTrue:[ |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
482 |
offset := offset + 1 |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
483 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
484 |
]. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
485 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
486 |
^ offset |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
487 |
|
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
488 |
"Created: 7.1.1997 / 21:26:05 / cg" |
1101 | 489 |
"Modified: 27.3.1997 / 18:24:59 / cg" |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
490 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
491 |
|
73 | 492 |
!DebugView methodsFor:'basic'! |
493 |
||
266 | 494 |
enter |
495 |
"enter the debugger - on the sending context" |
|
496 |
||
497 |
|where| |
|
498 |
||
499 |
busy := true. |
|
500 |
||
501 |
where := thisContext. "enter" |
|
502 |
where := where sender. "the calling context" |
|
503 |
where notNil ifTrue:[ |
|
504 |
(where receiver == DebugView) ifTrue:[ |
|
505 |
where := where sender |
|
506 |
] |
|
507 |
"where is now interrupted methods context" |
|
508 |
]. |
|
509 |
^ self enter:where |
|
510 |
! |
|
511 |
||
73 | 512 |
enter:aContext |
513 |
"enter the debugger - get and display the context, then start an |
|
514 |
exclusive event loop on top of eveything else" |
|
515 |
||
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
516 |
|con selection m idx retval enteredByInterrupt sel con1 con2| |
73 | 517 |
|
939 | 518 |
verboseBacktrace := VerboseBacktraceDefault ? false. |
519 |
||
73 | 520 |
busy := true. |
521 |
inspecting := false. |
|
522 |
inspectedProcess := Processor activeProcess. |
|
523 |
stepping := false. |
|
524 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
525 |
stepHow := nil. |
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
526 |
nChainShown := InitialNCHAINShown. |
73 | 527 |
|
528 |
"if debugger is entered while a box has grabbed the |
|
529 |
pointer, we must ungrab - otherwise X wont talk to |
|
530 |
us here |
|
531 |
" |
|
532 |
(grabber := device activePointerGrab) notNil ifTrue:[ |
|
425
92f7a92f5c44
ungrab keyboard when entering debugger
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
533 |
device ungrabPointer. |
92f7a92f5c44
ungrab keyboard when entering debugger
Claus Gittinger <cg@exept.de>
parents:
407
diff
changeset
|
534 |
device ungrabKeyboard. |
73 | 535 |
]. |
536 |
||
1004
cb182425a977
oops - dont disable terminateButton
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
537 |
("inspectedProcess suspendedContext isNil |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
538 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
1004
cb182425a977
oops - dont disable terminateButton
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
539 |
|
374 | 540 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
541 |
] ifFalse:[ |
374 | 542 |
terminateButton enable. |
543 |
abortButton enable. |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
544 |
]. |
73 | 545 |
|
546 |
drawableId notNil ifTrue:[ |
|
374 | 547 |
" |
548 |
not the first time - disable buttons & menus |
|
549 |
from previous life |
|
550 |
" |
|
551 |
terminateButton turnOffWithoutRedraw. |
|
552 |
continueButton turnOffWithoutRedraw. |
|
553 |
returnButton turnOffWithoutRedraw. |
|
554 |
restartButton turnOffWithoutRedraw. |
|
555 |
abortButton turnOffWithoutRedraw. |
|
556 |
nextButton turnOffWithoutRedraw. |
|
557 |
stepButton turnOffWithoutRedraw. |
|
558 |
sendButton turnOffWithoutRedraw. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
559 |
|
374 | 560 |
m := contextView middleButtonMenu. |
561 |
m notNil ifTrue:[ |
|
939 | 562 |
m disableAll:#(showMore skip skipForReturn inspectContext). |
563 |
]. |
|
564 |
verboseBacktrace |
|
565 |
ifTrue:[self showVerboseBacktrace] |
|
566 |
ifFalse:[self showDenseBacktrace]. |
|
73 | 567 |
] ifFalse:[ |
374 | 568 |
self iconLabel:'Debugger'. |
132 | 569 |
]. |
570 |
||
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
571 |
windowGroup isNil ifTrue:[ |
374 | 572 |
windowGroup := WindowGroup new. |
573 |
windowGroup addTopView:self. |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
574 |
]. |
132 | 575 |
exclusive ifFalse:[ |
374 | 576 |
"/ create a (modal) windowGroup for myself |
132 | 577 |
|
374 | 578 |
windowGroup setModal:true. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
579 |
] ifTrue:[ |
374 | 580 |
"/ create a windowGroup with a synchronous sensor for me |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
581 |
|
579
d461478b2ac2
device is not needed in SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
563
diff
changeset
|
582 |
windowGroup sensor:(SynchronousWindowSensor new). |
73 | 583 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
584 |
windowGroup setProcess:Processor activeProcess. |
73 | 585 |
|
586 |
" |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
587 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 588 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
589 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
73 | 590 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
591 |
|
73 | 592 |
" |
593 |
and find the one context to show initially |
|
594 |
- if we came here by a send (single step), its the top context; |
|
595 |
- if we came here by a step (i.e. bigStep), its the top context |
|
596 |
(for ifs and whiles) or the sender (for regular sends). |
|
303
1d94813f1977
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
301
diff
changeset
|
597 |
- otherwise, we came here by some signal raise, and we are interested |
73 | 598 |
in the context where the raise actually occured. |
599 |
" |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
600 |
con1 := (contextArray at:1 ifAbsent:nil). |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
601 |
con2 := (contextArray at:2 ifAbsent:nil). |
73 | 602 |
exitAction == #step ifTrue:[ |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
603 |
|
374 | 604 |
selection := 1. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
605 |
steppedContext notNil ifTrue:[ |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
606 |
|
374 | 607 |
" |
608 |
if we came here by a big-step, show the method where we are |
|
609 |
" |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
610 |
con1 == steppedContext ifTrue:[ |
374 | 611 |
selection := 1 |
612 |
] ifFalse:[ |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
613 |
con2 == steppedContext ifTrue:[ |
374 | 614 |
selection := 2 |
615 |
] |
|
616 |
]. |
|
617 |
" |
|
618 |
for bigStep, we could also be in a block below the actual method ... |
|
619 |
" |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
620 |
(con1 home notNil |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
621 |
and:[con1 home == steppedContext]) ifTrue:[ |
374 | 622 |
selection := 1 |
623 |
] ifFalse:[ |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
624 |
(con2 home notNil |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
625 |
and:[con2 home == steppedContext]) ifTrue:[ |
374 | 626 |
selection := 2 |
627 |
] |
|
628 |
]. |
|
629 |
] |
|
73 | 630 |
] ifFalse:[ |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
631 |
steppedContext isNil ifTrue:[ |
374 | 632 |
" |
633 |
preselect a more interesting context, (where halt/raise was ...) |
|
634 |
" |
|
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
635 |
selection := self class interestingContextIndexFrom:aContext. |
374 | 636 |
] ifFalse:[ |
637 |
" |
|
638 |
if we came here by a big-step, show the method where we are |
|
639 |
" |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
640 |
con1 == steppedContext ifTrue:[ |
374 | 641 |
selection := 1 |
642 |
] ifFalse:[ |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
643 |
con2 == steppedContext ifTrue:[ |
374 | 644 |
selection := 2 |
645 |
] |
|
646 |
] |
|
647 |
] |
|
73 | 648 |
]. |
649 |
||
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
650 |
con1 := nil. |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
651 |
con2 := nil. |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
652 |
|
73 | 653 |
selection notNil ifTrue:[ |
374 | 654 |
self showSelection:selection. |
563 | 655 |
contextView setSelection:selection. |
374 | 656 |
selection > 1 ifTrue:[ |
657 |
contextView scrollToLine:(selection - 1) |
|
658 |
] |
|
73 | 659 |
]. |
660 |
||
661 |
m := contextView middleButtonMenu. |
|
662 |
m notNil ifTrue:[ |
|
374 | 663 |
canAbort := inspecting or:[Object abortSignal isHandled]. |
664 |
canAbort ifTrue:[ |
|
665 |
abortButton enable. |
|
666 |
m enable:#doAbort. |
|
667 |
] ifFalse:[ |
|
668 |
abortButton disable. |
|
669 |
m disable:#doAbort. |
|
670 |
]. |
|
671 |
exclusive ifTrue:[ |
|
672 |
terminateButton disable. |
|
673 |
m disable:#doTerminate. |
|
674 |
] ifFalse:[ |
|
675 |
terminateButton enable. |
|
676 |
m enable:#doTerminate. |
|
677 |
] |
|
73 | 678 |
]. |
679 |
||
680 |
" |
|
681 |
drawableId is nil, if this is a new debugger. Then do a realize. |
|
528
a5ba1a3d0b45
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
527
diff
changeset
|
682 |
Otherwise, its probably better to do a map, which shows the |
73 | 683 |
view at the previous position, without a need for the user to set the |
684 |
position again |
|
685 |
" |
|
686 |
drawableId notNil ifTrue:[ |
|
545 | 687 |
self remap. |
73 | 688 |
] ifFalse:[ |
374 | 689 |
self realize. |
73 | 690 |
]. |
870 | 691 |
self realizeAllSubViews. |
73 | 692 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
693 |
exclusive ifTrue:[ |
374 | 694 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
695 |
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
|
696 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
697 |
This is a modal debugger - all event processing is stopped.. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
698 |
Therefore, you cannot interact with other views or |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
699 |
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
|
700 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
701 |
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
|
702 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
703 |
|
73 | 704 |
" |
705 |
bring us to the top |
|
706 |
" |
|
707 |
self raise. |
|
105 | 708 |
device flush. |
73 | 709 |
|
710 |
canContinue := true. |
|
711 |
exitAction := nil. |
|
712 |
||
713 |
" |
|
714 |
enter private event handling loop. This is left (and we come back here again) |
|
715 |
when any button was pressed which requires continuation of the debuggee or |
|
716 |
closedown of the debugger. |
|
717 |
" |
|
718 |
||
132 | 719 |
[self controlLoop] valueOnUnwindDo:[ |
374 | 720 |
windowGroup notNil ifTrue:[ |
721 |
windowGroup setProcess:nil. |
|
722 |
]. |
|
723 |
self destroy |
|
132 | 724 |
]. |
73 | 725 |
|
726 |
" |
|
727 |
release all context stuff. |
|
728 |
This is required to avoid keeping references to the debuggees objects |
|
729 |
forever. (since the debugger is reused for faster startup next time) |
|
730 |
" |
|
731 |
contextArray := nil. |
|
942 | 732 |
contextView contents:nil. |
733 |
||
73 | 734 |
codeView acceptAction:nil. |
942 | 735 |
codeView doItAction:nil. |
736 |
codeView contents:nil. |
|
73 | 737 |
|
738 |
(exitAction ~~ #step) ifTrue:[ |
|
374 | 739 |
receiverInspector release. |
740 |
contextInspector release. |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
741 |
|
528
a5ba1a3d0b45
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
527
diff
changeset
|
742 |
self unmap. |
374 | 743 |
device flush. |
73 | 744 |
|
374 | 745 |
(exitAction == #abort) ifTrue:[ |
746 |
self cacheMyself. |
|
942 | 747 |
|
374 | 748 |
" |
749 |
have to catch errors occuring in unwind-blocks |
|
750 |
" |
|
751 |
ErrorSignal handle:[:ex | |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
752 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
753 |
ex errorString infoPrintCR. |
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
754 |
|
374 | 755 |
ex proceed |
756 |
] do:[ |
|
757 |
Object abortSignal raise. |
|
758 |
]. |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
759 |
'DebugView [warning]: abort failed' errorPrintCR |
374 | 760 |
]. |
61 | 761 |
|
374 | 762 |
(exitAction == #return) ifTrue:[ |
763 |
selectedContext notNil ifTrue:[ |
|
764 |
" |
|
765 |
if there is a selection in the codeView, |
|
766 |
evaluate it and use the result as return value |
|
767 |
" |
|
73 | 768 |
"/ disabled for now, there is almost always a selection (the current line) |
769 |
"/ and that is syntactically incorrect ... |
|
770 |
"/ ... leading to a popup warning from the codeView |
|
771 |
"/ |
|
772 |
"/ codeView hasSelection ifTrue:[ |
|
773 |
"/ Object errorSignal handle:[:ex | |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
774 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
73 | 775 |
"/ retval := nil. |
776 |
"/ ex return |
|
777 |
"/ ] do:[ |
|
687 | 778 |
"/ |s| |
657 | 779 |
"/ |
780 |
"/ s := codeView selection asString. |
|
73 | 781 |
"/ retval := codeView doItAction value:s. |
782 |
"/ ]. |
|
783 |
"/ ]. |
|
784 |
||
374 | 785 |
con := selectedContext. |
786 |
self cacheMyself. |
|
787 |
" |
|
788 |
have to catch errors occuring in unwind-blocks |
|
789 |
" |
|
790 |
Object errorSignal handle:[:ex | |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
791 |
'DebugView [info]: ignored error while unwinding: ' errorPrint. |
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
792 |
ex errorString errorPrintCR. |
374 | 793 |
ex proceed |
794 |
] do:[ |
|
795 |
con unwind:retval. |
|
796 |
]. |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
797 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
374 | 798 |
] |
799 |
]. |
|
73 | 800 |
|
374 | 801 |
(exitAction == #restart) ifTrue:[ |
802 |
selectedContext notNil ifTrue:[ |
|
803 |
con := selectedContext. |
|
804 |
self cacheMyself. |
|
805 |
" |
|
806 |
have to catch errors occuring in unwind-blocks |
|
807 |
" |
|
808 |
Object errorSignal handle:[:ex | |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
809 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
810 |
ex errorString infoPrintCR. |
374 | 811 |
ex proceed |
812 |
] do:[ |
|
813 |
con unwindAndRestart. |
|
814 |
]. |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
815 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
374 | 816 |
] |
817 |
]. |
|
73 | 818 |
|
374 | 819 |
(exitAction == #quickTerminate) ifTrue:[ |
820 |
self cacheMyself. |
|
821 |
Processor activeProcess terminateNoSignal |
|
822 |
]. |
|
73 | 823 |
|
374 | 824 |
(exitAction == #terminate) ifTrue:[ |
825 |
self cacheMyself. |
|
826 |
" |
|
827 |
have to catch errors occuring in unwind-blocks |
|
828 |
" |
|
829 |
Object errorSignal handle:[:ex | |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
830 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
831 |
ex errorString infoPrintCR. |
374 | 832 |
ex proceed |
833 |
] do:[ |
|
834 |
Processor activeProcess terminate. |
|
835 |
]. |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
836 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
374 | 837 |
] |
73 | 838 |
]. |
839 |
||
940 | 840 |
selectedContext := actualContext := firstContext := nil. |
73 | 841 |
|
842 |
grabber notNil ifTrue:[ |
|
374 | 843 |
device grabPointerInView:grabber. |
844 |
grabber := nil. |
|
61 | 845 |
]. |
73 | 846 |
|
847 |
(exitAction == #step) ifTrue:[ |
|
374 | 848 |
" |
849 |
schedule another stepInterrupt |
|
850 |
- must enter myself into the collection of open debuggers, |
|
851 |
in case the stepping process comes back again via a halt or signal |
|
852 |
before the step is finished. In this case, the stepping debugger should |
|
853 |
come up (instead of a new one) |
|
854 |
- must flush caches since optimized methods not always |
|
855 |
look for pending interrupts |
|
856 |
" |
|
857 |
OpenDebuggers isNil ifTrue:[ |
|
858 |
OpenDebuggers := WeakArray with:self |
|
859 |
] ifFalse:[ |
|
860 |
(OpenDebuggers includes:self) ifFalse:[ |
|
861 |
idx := OpenDebuggers identityIndexOf:nil. |
|
775
f741dc4afe19
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
755
diff
changeset
|
862 |
idx == 0 ifTrue:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
863 |
idx := OpenDebuggers identityIndexOf:0 |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
864 |
]. |
374 | 865 |
idx ~~ 0 ifTrue:[ |
866 |
OpenDebuggers at:idx put:self |
|
867 |
] ifFalse:[ |
|
868 |
OpenDebuggers := OpenDebuggers copyWith:self |
|
869 |
] |
|
870 |
] |
|
871 |
]. |
|
872 |
self label:'single stepping - please wait ...'. |
|
873 |
stepping := true. |
|
73 | 874 |
|
374 | 875 |
ObjectMemory stepInterruptHandler:self. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
876 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
877 |
"bigStep" steppedContextLineno notNil ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
878 |
Context singleStepInterruptRequest raiseWith:#next |
529
57a78164dae5
allow different implementations of singleStep (JAVA support)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
879 |
] ifFalse:[ |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
880 |
Context singleStepInterruptRequest raiseWith:#step |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
881 |
] |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
882 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
883 |
"/ see if we came here through an interrupt-action |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
884 |
"/ (i.e. aProcess interruptWith:...) |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
885 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
886 |
enteredByInterrupt := false. |
1101 | 887 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt. |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
888 |
[enteredByInterrupt not |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
889 |
and:[con notNil |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
890 |
and:[con ~~ aContext]]] whileTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
891 |
((sel := con selector) == #timerInterrupt |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
892 |
or:[sel == #ioInterrupt]) ifTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
893 |
enteredByInterrupt := true. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
894 |
] ifFalse:[ |
1101 | 895 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt. |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
896 |
]. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
897 |
]. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
898 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
899 |
ObjectMemory flushInlineCaches. |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
900 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
901 |
enteredByInterrupt ifTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
902 |
"/ dont want to step through all intermediate |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
903 |
"/ (scheduler-) contexts; place a return-trap on the |
1213 | 904 |
"/ one right below the interesting one |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
905 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
906 |
"/ 'special unwind return' printCR. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
907 |
con unwindThenDo:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
908 |
ObjectMemory stepInterruptHandler:self. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
909 |
InStepInterrupt := nil. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
910 |
StepInterruptPending := 1. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
911 |
InterruptPending := 1]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
912 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
913 |
"/ 'normal step return' printCR. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
914 |
skipLineNr ~~ #return ifTrue:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
915 |
StepInterruptPending := 1. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
916 |
InterruptPending := 1. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
917 |
] ifFalse:[ |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
918 |
"/ 'step for return' printCR. |
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
919 |
] |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
920 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
921 |
InStepInterrupt := nil |
374 | 922 |
] |
73 | 923 |
] ifFalse:[ |
374 | 924 |
OpenDebuggers notNil ifTrue:[ |
925 |
idx := OpenDebuggers identityIndexOf:self. |
|
926 |
idx ~~ 0 ifTrue:[ |
|
927 |
OpenDebuggers at:idx put:nil |
|
928 |
] |
|
929 |
]. |
|
930 |
self cacheMyself. |
|
73 | 931 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
932 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
933 |
"Created: 24.11.1995 / 19:52:54 / cg" |
1101 | 934 |
"Modified: 27.3.1997 / 18:28:43 / cg" |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
935 |
"Modified: 17.4.1997 / 13:01:32 / stefan" |
73 | 936 |
! |
937 |
||
938 |
openOn:aProcess |
|
939 |
"enter the debugger on a process - |
|
940 |
in this case, we are just inspecting the context chain of the process, |
|
941 |
not running on top of the debugged process, but as a separate |
|
942 |
one. (think of it as an inspector showing more detail, and offering |
|
943 |
some more control operations)" |
|
944 |
||
127 | 945 |
|bpanel dummy| |
73 | 946 |
|
939 | 947 |
verboseBacktrace := VerboseBacktraceDefault ? false. |
948 |
||
73 | 949 |
busy := true. |
950 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
951 |
stepHow := nil. |
73 | 952 |
inspecting := true. |
953 |
inspectedProcess := aProcess. |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
954 |
nChainShown := InitialNCHAINShown. |
73 | 955 |
|
956 |
bpanel := abortButton superView. |
|
957 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
958 |
"/ stopButton := Button new. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
959 |
"/ stopButton label:(resources at:'stop'); |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
960 |
"/ action:[self doStop]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
961 |
"/ bpanel addSubView:stopButton after:continueButton. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
962 |
"/ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
963 |
bpanel elementsChangeSize:true. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
964 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
965 |
aProcess state == #run ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
966 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
967 |
continueButton foregroundColor:Color red darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
968 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
969 |
continueButton label:(resources at:'stop'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
970 |
continueButton action:[self doStop]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
971 |
returnButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
972 |
restartButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
973 |
] ifFalse:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
974 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
975 |
continueButton foregroundColor:Color green darkened darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
976 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
977 |
continueButton label:(resources at:'continue'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
978 |
continueButton action:[self doContinue]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
979 |
returnButton enable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
980 |
restartButton enable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
981 |
]. |
73 | 982 |
|
92 | 983 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 984 |
dummy borderWidth:0; level:0. |
61 | 985 |
|
73 | 986 |
"/ stepButton destroy. |
987 |
"/ sendButton destroy. |
|
988 |
||
989 |
updateButton := Button |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
990 |
label:(resources at:'update') |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
991 |
action:[self updateContext] |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
992 |
in:bpanel. |
73 | 993 |
monitorToggle := Toggle in:bpanel. |
994 |
monitorToggle label:(resources at:'monitor'). |
|
995 |
monitorToggle pressAction:[self autoUpdateOn]. |
|
996 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
997 |
||
998 |
"can only look into process - context chain is not active" |
|
999 |
canContinue := true. |
|
1000 |
||
1001 |
terminateButton enable. |
|
1002 |
abortButton enable. |
|
1003 |
||
1004 |
sendButton disable. |
|
1005 |
stepButton disable. |
|
78 | 1006 |
nextButton disable. |
73 | 1007 |
"/ continueButton disable. |
1008 |
"/ returnButton disable. |
|
1009 |
"/ restartButton disable. |
|
1010 |
||
1011 |
aProcess isNil ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1012 |
terminateButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1013 |
abortButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1014 |
continueButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1015 |
returnButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1016 |
restartButton disable. |
73 | 1017 |
] ifFalse:[ |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1018 |
(aProcess suspendedContext isNil |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1019 |
or:[aProcess isSystemProcess]) ifTrue:[ |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1020 |
terminateButton disable. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1021 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1022 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1023 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1024 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1025 |
catchBlock := [ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1026 |
catchBlock := nil. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1027 |
contextArray := nil. |
940 | 1028 |
selectedContext := actualContext := firstContext := nil. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1029 |
steppedContext := wrapperContext := nil. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1030 |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1031 |
(exitAction == #terminate) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1032 |
aProcess terminate. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1033 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1034 |
(exitAction == #quickTerminate) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1035 |
aProcess terminateNoSignal. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1036 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1037 |
super destroy |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1038 |
]. |
73 | 1039 |
]. |
1040 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1041 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1042 |
"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
|
1043 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
266 | 1044 |
! ! |
1045 |
||
1046 |
!DebugView methodsFor:'help'! |
|
1047 |
||
1048 |
helpTextFor:aComponent |
|
1049 |
|s| |
|
1050 |
||
1051 |
aComponent == abortButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1052 |
s := 'HELP_ABORT' |
266 | 1053 |
]. |
1054 |
aComponent == terminateButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1055 |
s := 'HELP_TERMINATE' |
266 | 1056 |
]. |
1057 |
aComponent == continueButton ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1058 |
continueButton label = (resources string:'stop') ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1059 |
s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1060 |
] ifFalse:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1061 |
s := 'HELP_CONTINUE' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1062 |
] |
266 | 1063 |
]. |
1064 |
aComponent == stepButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1065 |
s := 'HELP_STEP' |
266 | 1066 |
]. |
1067 |
aComponent == nextButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1068 |
s := 'HELP_NEXT' |
266 | 1069 |
]. |
1065 | 1070 |
aComponent == nextOverButton ifTrue:[ |
1071 |
s := 'HELP_NEXTOVER' |
|
1072 |
]. |
|
1073 |
aComponent == nextOutButton ifTrue:[ |
|
1074 |
s := 'HELP_NEXTOUT' |
|
1075 |
]. |
|
266 | 1076 |
aComponent == stepButton ifTrue:[ |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1077 |
s := 'HELP_STEP' |
266 | 1078 |
]. |
1079 |
aComponent == sendButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1080 |
s := 'HELP_SEND' |
266 | 1081 |
]. |
1082 |
aComponent == returnButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1083 |
s := 'HELP_RETURN' |
266 | 1084 |
]. |
1085 |
aComponent == restartButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1086 |
s := 'HELP_RESTART' |
266 | 1087 |
]. |
1088 |
aComponent == contextView ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1089 |
s := 'HELP_WALKBACK' |
266 | 1090 |
]. |
1091 |
aComponent == codeView ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1092 |
s := 'HELP_CODEVIEW' |
266 | 1093 |
]. |
1094 |
aComponent == monitorToggle ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1095 |
s := 'HELP_MONITOR' |
266 | 1096 |
]. |
1097 |
aComponent == updateButton ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1098 |
s := 'HELP_UPDATE' |
266 | 1099 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1100 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1101 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1102 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1103 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1104 |
s := 'HELP_REC_INSP' |
266 | 1105 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1106 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1107 |
s := 'HELP_CON_INSP' |
266 | 1108 |
]. |
1109 |
||
1110 |
s notNil ifTrue:[ |
|
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1111 |
^ resources string:s |
266 | 1112 |
]. |
1113 |
^ nil |
|
1114 |
||
1115 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 1116 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 1117 |
! ! |
1118 |
||
1119 |
!DebugView methodsFor:'initialization'! |
|
1120 |
||
1121 |
addToCurrentProject |
|
1122 |
"ignored here" |
|
1123 |
||
1124 |
^ self |
|
1125 |
! |
|
1126 |
||
1127 |
initialize |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1128 |
|v panel hpanel bpanel separator img| |
266 | 1129 |
|
1130 |
super initialize. |
|
1131 |
||
1132 |
font := font on:device. |
|
1133 |
||
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
1134 |
verboseBacktrace := VerboseBacktraceDefault ? false. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1135 |
|
266 | 1136 |
busy := false. |
1137 |
exclusive := false. |
|
1138 |
inspecting := false. |
|
1139 |
exitAction := nil. |
|
1140 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1141 |
stepHow := nil. |
266 | 1142 |
canContinue := false. |
1143 |
canAbort := false. |
|
1144 |
||
1145 |
bpanel := HorizontalPanelView |
|
1146 |
"/ origin:(0.0 @ 0.0) |
|
1147 |
"/ extent:(1.0 @ (font height * 2)) |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1148 |
in:self. |
266 | 1149 |
bpanel horizontalLayout:#leftSpace. |
1150 |
bpanel verticalSpace:ViewSpacing // 2. |
|
1151 |
||
1152 |
terminateButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1153 |
label:(resources at:'terminate') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1154 |
action:[terminateButton turnOffWithoutRedraw. self doTerminate] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1155 |
in:bpanel. |
266 | 1156 |
separator := View extent:(10 @ 5) in:bpanel. |
1157 |
separator borderWidth:0; level:0. |
|
1158 |
||
1159 |
abortButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1160 |
label:(resources at:'abort') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1161 |
action:[abortButton turnOffWithoutRedraw. self doAbort] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1162 |
in:bpanel. |
266 | 1163 |
returnButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1164 |
label:(resources at:'return') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1165 |
action:[returnButton turnOff. self doReturn] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1166 |
in:bpanel. |
266 | 1167 |
|
1168 |
restartButton := Button |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1169 |
label:(resources at:'restart') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1170 |
action:[restartButton turnOff. self doRestart] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1171 |
in:bpanel. |
266 | 1172 |
|
1173 |
separator := View extent:(10 @ 5) in:bpanel. |
|
1174 |
separator borderWidth:0; level:0. |
|
73 | 1175 |
|
266 | 1176 |
continueButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1177 |
label:(resources at:'continue') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1178 |
action:[continueButton turnOffWithoutRedraw. self doContinue] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1179 |
in:bpanel. |
266 | 1180 |
|
1181 |
separator := View extent:(10 @ 5) in:bpanel. |
|
1182 |
separator borderWidth:0; level:0. |
|
1183 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1184 |
img := Image fromFile:'bitmaps/stepIn.xpm'. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1185 |
img isNil ifTrue:[ |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1186 |
img := (resources at:'next') |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1187 |
]. |
266 | 1188 |
nextButton := Button |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1189 |
label:img |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1190 |
action:[stepButton turnOff. self doNext] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1191 |
in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1192 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1193 |
img := Image fromFile:'bitmaps/stepOver.xpm'. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1194 |
img isNil ifTrue:[ |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1195 |
img := (resources at:'over') |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1196 |
]. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1197 |
nextOverButton := Button |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1198 |
label:img |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1199 |
action:[stepButton turnOff. self doNextOver] |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1200 |
in:bpanel. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1201 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1202 |
img := Image fromFile:'bitmaps/stepOut.xpm'. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1203 |
img isNil ifTrue:[ |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1204 |
img := (resources at:'out') |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1205 |
]. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1206 |
nextOutButton := Button |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1207 |
label:img |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1208 |
action:[stepButton turnOff. self doNextOut] |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1209 |
in:bpanel. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1210 |
|
266 | 1211 |
stepButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1212 |
label:(resources at:'step') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1213 |
action:[stepButton turnOff. self doStep] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1214 |
in:bpanel. |
266 | 1215 |
sendButton := Button |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1216 |
label:(resources at:'send') |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1217 |
action:[sendButton turnOff. self doSend] |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1218 |
in:bpanel. |
266 | 1219 |
|
1220 |
bpanel origin:(0.0 @ 0.0) |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1221 |
extent:(1.0 @ (bpanel preferredExtent y)). |
73 | 1222 |
|
266 | 1223 |
panel := VariableVerticalPanel |
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1224 |
origin:(0.0 @ bpanel height) |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1225 |
corner:(1.0 @ 1.0) |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1226 |
in:self. |
266 | 1227 |
|
1228 |
v := ScrollableView for:SelectionInListView in:panel. |
|
1229 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
1230 |
||
1231 |
contextView := v scrolledView. |
|
1232 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1233 |
contextView doubleClickAction:[:line | self browse]. |
266 | 1234 |
|
1235 |
v := ScrollableView for:CodeView in:panel. |
|
1236 |
v origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
1237 |
||
1238 |
codeView := v scrolledView. |
|
1239 |
||
1240 |
hpanel := VariableHorizontalPanel in:panel. |
|
1241 |
hpanel origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
1242 |
||
1243 |
receiverInspector := InspectorView |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1244 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1245 |
in:hpanel. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
1246 |
receiverInspector label:'receiver'. |
266 | 1247 |
|
1248 |
contextInspector := ContextInspectorView |
|
494
0d35a48c45bc
double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents:
485
diff
changeset
|
1249 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
1250 |
in:hpanel. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
1251 |
contextInspector label:'context'. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
1252 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1253 |
"Modified: 3.3.1997 / 21:32:55 / cg" |
266 | 1254 |
! |
1255 |
||
1256 |
initializeMiddleButtonMenu |
|
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1257 |
|labels selectors m| |
266 | 1258 |
|
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1259 |
exclusive ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1260 |
labels := resources array:#( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1261 |
'show more' |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1262 |
'show verbose backtrace' |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1263 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1264 |
'remove breakpoint' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1265 |
'remove all trace & breakpoints' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1266 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1267 |
'copy walkback text' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1268 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1269 |
'quickTerminate' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1270 |
'=' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1271 |
'exit smalltalk (no confirmation)' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1272 |
). |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1273 |
selectors := #( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1274 |
showMore |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1275 |
showVerboseBacktrace |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1276 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1277 |
removeBreakpoint |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1278 |
removeAllBreakpoints |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1279 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1280 |
copyWalkbackText |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1281 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1282 |
quickTerminate |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1283 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1284 |
exit |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1285 |
) |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1286 |
] ifFalse:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1287 |
labels := resources array:#( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1288 |
'show more' |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1289 |
'show verbose backtrace' |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1290 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1291 |
'skip' |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1292 |
'step out' |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1293 |
'-' |
266 | 1294 |
" |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1295 |
'continue' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1296 |
'terminate' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1297 |
'abort' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1298 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1299 |
'step' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1300 |
'send' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1301 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1302 |
'return' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1303 |
'restart' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1304 |
'-' |
266 | 1305 |
" |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1306 |
'remove breakpoint' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1307 |
'remove all trace & breakpoints' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1308 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1309 |
'browse' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1310 |
'browse class' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1311 |
'browse class hierarchy' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1312 |
'browse full class protocol' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1313 |
'implementors' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1314 |
'senders' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1315 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1316 |
'inspect context' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1317 |
'copy walkback text' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1318 |
'-' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1319 |
'quickTerminate' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1320 |
'=' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1321 |
'exit smalltalk (no confirmation)' |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1322 |
). |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1323 |
|
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1324 |
selectors := #( |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1325 |
showMore |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1326 |
showVerboseBacktrace |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1327 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1328 |
skip |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1329 |
skipForReturn |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1330 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1331 |
" |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1332 |
doContinue |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1333 |
doTerminate |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1334 |
doAbort |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1335 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1336 |
doStep |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1337 |
doSend |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1338 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1339 |
doReturn |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1340 |
doRestart |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1341 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1342 |
" |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1343 |
removeBreakpoint |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1344 |
removeAllBreakpoints |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1345 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1346 |
browse |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1347 |
browseClass |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1348 |
browseClassHierarchy |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1349 |
browseFullClassProtocol |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1350 |
implementors |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1351 |
senders |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1352 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1353 |
inspectContext |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1354 |
copyWalkbackText |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1355 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1356 |
quickTerminate |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1357 |
nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1358 |
exit |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1359 |
). |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1360 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1361 |
|
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1362 |
m := PopUpMenu |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1363 |
labels:(resources array:labels) |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1364 |
selectors:selectors |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1365 |
receiver:self |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1366 |
for:contextView. |
266 | 1367 |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1368 |
verboseBacktrace ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1369 |
m labelAt:#showVerboseBacktrace put:(resources string:'show dense backtrace'). |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1370 |
m selectorAt:#showVerboseBacktrace put:#showDenseBacktrace |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1371 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1372 |
|
266 | 1373 |
contextView middleButtonMenu:m. |
1374 |
||
1375 |
inspecting ifTrue:[ |
|
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1376 |
m notNil ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1377 |
m disableAll:#(doTraceStep removeBreakpoint browse browseClass |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1378 |
browseClassHierarchy browseFullClassProtocol |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1379 |
implementors senders inspectContext skip doStepOut). |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
1380 |
]. |
266 | 1381 |
] |
1382 |
||
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
1383 |
"Modified: 10.1.1997 / 21:35:36 / cg" |
266 | 1384 |
! |
1385 |
||
1386 |
realize |
|
1387 |
super realize. |
|
1388 |
"/ exclusive ifTrue:[ |
|
1389 |
"/ windowGroup := nil |
|
1390 |
"/ ]. |
|
1391 |
||
1392 |
inspecting ifTrue:[ |
|
1393 |
inspectedProcess notNil ifTrue:[ |
|
1394 |
" |
|
1395 |
set prio somewhat higher (by 2, to allow walkBack-update process |
|
1396 |
to run between mine and the debugged processes prio) |
|
1397 |
" |
|
1398 |
Processor activeProcess |
|
1399 |
priority:(inspectedProcess priority + 2 min:16). |
|
73 | 1400 |
] |
266 | 1401 |
] |
1402 |
! |
|
1403 |
||
1404 |
setLabelFor:aMessage in:aProcess |
|
1405 |
|l nm| |
|
1406 |
||
1407 |
l := aMessage , ' ('. |
|
1030 | 1408 |
Object errorSignal handle:[:ex | |
1409 |
l := l , '???' |
|
1410 |
] do:[ |
|
1411 |
nm := aProcess name. |
|
1412 |
nm notNil ifTrue:[ |
|
1413 |
l := l , (nm contractTo:17) , ''. |
|
1414 |
]. |
|
1415 |
l := l , '[' , aProcess id printString , ']'. |
|
73 | 1416 |
]. |
1030 | 1417 |
l := l , ')'. |
266 | 1418 |
self label:l. |
0 | 1419 |
! ! |
1420 |
||
1421 |
!DebugView methodsFor:'interrupt handling'! |
|
1422 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1423 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1424 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1425 |
'contextIRQ' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1426 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1427 |
^ self stepOrNext |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1428 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1429 |
"Modified: 14.10.1996 / 13:30:47 / cg" |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1430 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1431 |
|
0 | 1432 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1433 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1434 |
'stepIRQ' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1435 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1436 |
^ self stepOrNext |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1437 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1438 |
"Modified: 14.10.1996 / 13:30:56 / cg" |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1439 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1440 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1441 |
stepOrNext |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1442 |
|where here s isWrap method lastWrappedConAddr wrappedMethod |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1443 |
inBlock left ignore contextBelow lastWrappedContext |
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1444 |
leftWrap enteredWrap anyStepBlocks belowSteppedContext| |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1445 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1446 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
1447 |
"/ DebuggingDebugger := false |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1448 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1449 |
skipLineNr == #return ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1450 |
name := Processor activeProcess nameOrId. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1451 |
self label:('context returned ' , ' (process: ' , name , ')'). |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1452 |
here := thisContext sender sender. |
755 | 1453 |
here setLineNumber:nil. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1454 |
here := nil. |
755 | 1455 |
self enter:thisContext sender sender sender. |
554 | 1456 |
^ self |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1457 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1458 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1459 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1460 |
"/ "/ 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
|
1461 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1462 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1463 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1464 |
"/ 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
|
1465 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1466 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1467 |
|
52 | 1468 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
1469 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
554 | 1470 |
^ self |
52 | 1471 |
]. |
1472 |
||
29 | 1473 |
here := thisContext. "stepInterrupt" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1474 |
here := here sender. "the caller; step- or contextIRQ" |
29 | 1475 |
here := here sender. "the interrupted context" |
1476 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1477 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1478 |
'*******' printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1479 |
'here in ' print. |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1480 |
inWrap ifTrue:['(wrap) ' print.]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1481 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1482 |
here selector printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1483 |
]. |
10 | 1484 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1485 |
" |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1486 |
kludge to hide breakpoint wrappers in the context list: |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1487 |
check if we are in a wrapper methods hidden setup-sequence |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1488 |
if so, ignore the interrupt and continue single sending |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1489 |
" |
29 | 1490 |
isWrap := false. |
57 | 1491 |
left := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1492 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1493 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1494 |
where := here. |
57 | 1495 |
inWrap ifTrue:[ |
554 | 1496 |
wrappedMethod := nil. |
1497 |
5 timesRepeat:[ |
|
1498 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
|
1499 |
method := where method. |
|
1500 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
1501 |
" |
|
1502 |
in a wrapper method |
|
1503 |
" |
|
1504 |
wrappedMethod ~~ method ifTrue:[ |
|
1505 |
wrappedMethod := method. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1506 |
lastWrappedContext := where. |
554 | 1507 |
where sender receiver == method originalMethod ifFalse:[ |
1508 |
isWrap := true. |
|
1509 |
] |
|
1510 |
] ifFalse:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1511 |
where == steppedContext ifTrue:[ |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1512 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1513 |
DebuggingDebugger == true ifTrue:[ |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1514 |
'change stepCon from: ' print. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1515 |
steppedContext print. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1516 |
' to lastWrapped: ' print. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1517 |
lastWrappedContext printNL. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1518 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1519 |
|
554 | 1520 |
inWrap := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1521 |
leftWrap := true. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1522 |
wrapperContext := steppedContext. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1523 |
steppedContext := lastWrappedContext |
554 | 1524 |
] |
1525 |
] |
|
1526 |
]. |
|
1527 |
where := where sender |
|
1528 |
] |
|
1529 |
]. |
|
29 | 1530 |
]. |
1531 |
||
1532 |
isWrap ifTrue:[ |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1533 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1534 |
'ignore wrap' printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1535 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1536 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1537 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1538 |
"/ ignore, while in wrappers hidden setup |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1539 |
"/ |
554 | 1540 |
where := nil. here := nil. |
1541 |
ObjectMemory flushInlineCaches. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1542 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1543 |
skipLineNr == #return ifTrue:[ |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1544 |
DebuggingDebugger == true ifTrue:[ |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1545 |
'skipRet in wrap' printCR. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1546 |
] |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1547 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1548 |
|
554 | 1549 |
StepInterruptPending := 1. |
1550 |
InterruptPending := 1. |
|
1551 |
InStepInterrupt := nil. |
|
1552 |
^ nil |
|
29 | 1553 |
]. |
1554 |
||
57 | 1555 |
inBlock := false. |
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1556 |
anyStepBlocks := false. |
57 | 1557 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1558 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1559 |
"/ 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
|
1560 |
"/ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1561 |
(bigStep |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1562 |
and:[steppedContext notNil]) ifTrue:[ |
554 | 1563 |
" |
1564 |
a step or next - ignore all contexts below the interesting one |
|
1565 |
" |
|
1566 |
where := here. "the interrupted context" |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1567 |
contextBelow := nil. |
57 | 1568 |
|
554 | 1569 |
where home notNil ifTrue:[ |
1570 |
"/ |
|
1571 |
"/ in a block called by 'our' context ? |
|
1572 |
"/ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1573 |
where home == steppedContext ifTrue:[ |
57 | 1574 |
"/ '*block*' printNL. |
554 | 1575 |
inBlock := true |
1576 |
] |
|
1577 |
]. |
|
57 | 1578 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1579 |
where == steppedContext ifFalse:[ |
554 | 1580 |
where := where sender. |
57 | 1581 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1582 |
where notNil ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1583 |
where home == steppedContext ifTrue:[ |
57 | 1584 |
"/ '*block*' printNL. |
554 | 1585 |
inBlock := true. |
1586 |
] |
|
1587 |
]. |
|
57 | 1588 |
|
1589 |
"/ 'looking for ' print. |
|
29 | 1590 |
"/ (steppedContextAddress printStringRadix:16)print. '' printNL. |
57 | 1591 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1592 |
"/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
|
1593 |
"/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
|
1594 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1595 |
where == steppedContext ifFalse:[ |
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1596 |
|
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1597 |
"/ check if we are in a context below steppedContext |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1598 |
"/ (i.e. if steppedContext can be reached from |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1599 |
"/ interrupted context. Not using context-ref but its |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1600 |
"/ address to avoid creation of many useless contexts.) |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1601 |
|
554 | 1602 |
inBlock ifFalse:[ |
1603 |
[where notNil] whileTrue:[ |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1604 |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1605 |
"/ if either the receiver or any arg of this context |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1606 |
"/ is a block of the steppedContext, we must really |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1607 |
"/ do a single step. Otherwise, stepping through a |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1608 |
"/ do:-loop would be very difficult. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1609 |
|
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1610 |
(where receiver isBlock |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1611 |
and:[where receiver home == steppedContext]) |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1612 |
ifTrue:[ |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1613 |
anyStepBlocks := true. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1614 |
] ifFalse:[ |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1615 |
where args do:[:arg | |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1616 |
(arg isBlock |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1617 |
and:[arg home == steppedContext]) |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1618 |
ifTrue:[ |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1619 |
anyStepBlocks := true. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1620 |
] |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1621 |
] |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1622 |
]. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1623 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1624 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1625 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1626 |
where selector printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1627 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1628 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1629 |
where == steppedContext ifTrue:[ |
57 | 1630 |
"/ 'found it - below; ignore' printNL. |
554 | 1631 |
" |
1632 |
found the interesting context somwehere up in the |
|
1633 |
chain. We seem to be still below the interesting one ... |
|
1634 |
" |
|
1635 |
tracing == true ifTrue:[ |
|
1636 |
here printString printCR |
|
1637 |
]. |
|
1638 |
" |
|
1639 |
yes, a context below |
|
1640 |
- continue and schedule another stepInterrupt. |
|
1641 |
Must flush caches since optimized methods not always |
|
1642 |
look for pending interrupts |
|
1643 |
" |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1644 |
|
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1645 |
contextBelow notNil ifTrue:[ |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1646 |
"/ 'prepare for unwind-catch' printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1647 |
"/ 'con= ' print. contextBelow printCR. |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1648 |
contextBelow selector notNil ifTrue:[ |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1649 |
self label:'single stepping - please wait ...(' , contextBelow selector , ')'. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1650 |
]. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1651 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1652 |
DebuggingDebugger == true ifTrue:[ |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1653 |
'below stepCon; continue until unwind of: ' print. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1654 |
contextBelow printCR. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1655 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1656 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1657 |
StepInterruptPending := nil. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1658 |
] ifFalse:[ |
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1659 |
ObjectMemory flushInlineCaches. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1660 |
|
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1661 |
here selector notNil ifTrue:[ |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1662 |
self label:'single stepping - please wait ...(' , here selector , ')'. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1663 |
]. |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1664 |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1665 |
DebuggingDebugger == true ifTrue:[ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
1666 |
'in stepCon; continue single stepping' printCR. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1667 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1668 |
StepInterruptPending := 1. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1669 |
InterruptPending := 1. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1670 |
]. |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1671 |
where := nil. here := nil. |
554 | 1672 |
InStepInterrupt := nil. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1673 |
|
554 | 1674 |
^ nil |
1675 |
]. |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1676 |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1677 |
where methodHome == steppedContext methodHome ifTrue:[ |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1678 |
inBlock := true. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1679 |
]. |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1680 |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1681 |
anyStepBlocks ifFalse:[ |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1682 |
inBlock ifFalse:[ |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1683 |
contextBelow := where |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1684 |
] |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1685 |
]. |
554 | 1686 |
where := where sender |
1687 |
]. |
|
799 | 1688 |
s := 'context returned'. |
554 | 1689 |
left := true. |
1690 |
]. |
|
1691 |
] ifTrue:[ |
|
29 | 1692 |
"/ 'found it right in sender' printNL. |
554 | 1693 |
s := 'after step' |
1694 |
]. |
|
1695 |
] ifTrue:[ |
|
29 | 1696 |
"/ 'found it right away' printNL. |
554 | 1697 |
s := 'after step' |
1698 |
]. |
|
0 | 1699 |
] ifFalse:[ |
57 | 1700 |
"/ ' send' printNL. |
554 | 1701 |
" |
1702 |
a send |
|
1703 |
" |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1704 |
DebuggingDebugger == true ifTrue:[ |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1705 |
'clear steppedContext' printCR. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1706 |
]. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1707 |
steppedContext := nil. |
554 | 1708 |
s := 'after send' |
0 | 1709 |
]. |
7 | 1710 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1711 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1712 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1713 |
ignore := true. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1714 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1715 |
|
790 | 1716 |
"/ handle the case, when a subBlock leaves; |
1717 |
"/ continue stepping in the home context. |
|
1718 |
||
1719 |
left ifTrue:[ |
|
1720 |
steppedContext home notNil ifTrue:[ |
|
1721 |
steppedContext := steppedContext home. |
|
1722 |
s := 'after step'. |
|
1723 |
left := false. |
|
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1724 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
1725 |
|
790 | 1726 |
] |
1727 |
]. |
|
1728 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1729 |
" |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1730 |
kludge to hide breakpoint wrappers in the context list: |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1731 |
check if we are in a wrapper methods hidden exit-sequence |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1732 |
if so, ignore the interrupt and continue single sending |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1733 |
" |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1734 |
(where isNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1735 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1736 |
ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1737 |
"/ did not find our steppedContext along the chain; |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1738 |
"/ could be in a wrappedMethods exitBlock ... |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1739 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1740 |
leftWrap ifFalse:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1741 |
where := here. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1742 |
wrappedMethod := nil. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1743 |
5 timesRepeat:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1744 |
where notNil ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1745 |
where isBlockContext ifFalse:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1746 |
method := where method. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1747 |
(method notNil and:[method isWrapped]) ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1748 |
where == wrapperContext ifTrue:[ |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1749 |
DebuggingDebugger == true ifTrue:[ |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1750 |
'change stepCon fromWrapped: ' print. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1751 |
steppedContext print. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1752 |
' to: ' print. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1753 |
wrapperContext printNL. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1754 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1755 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1756 |
inWrap := true. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1757 |
enteredWrap := true. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1758 |
steppedContext := wrapperContext. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1759 |
wrapperContext := nil. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1760 |
] |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1761 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1762 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1763 |
where := where sender |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1764 |
] |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1765 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1766 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1767 |
enteredWrap ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1768 |
ignore := true |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1769 |
] |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1770 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1771 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1772 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1773 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1774 |
left ifTrue:[ |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1775 |
"/ special care for stepInterrupt in send, |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1776 |
"/ when created a dummy context (lineNr == 1) |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1777 |
|
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1778 |
steppedContext lineNumber isNil ifTrue:[ |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1779 |
steppedContext selector == here sender selector ifTrue:[ |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1780 |
left := false. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1781 |
s := 'after step'. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1782 |
steppedContext := here sender. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1783 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1784 |
] |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1785 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
1786 |
|
57 | 1787 |
inBlock ifTrue:[ |
1788 |
"/ 'inBlock' printNL. |
|
554 | 1789 |
s := 'in block'. |
57 | 1790 |
]. |
1791 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1792 |
DebuggingDebugger == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1793 |
where notNil ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1794 |
'(' print. steppedContextLineno print. ') ' print. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1795 |
where print. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1796 |
'[' print. where lineNumber print. ']' printNL. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1797 |
]. |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
1798 |
]. |
57 | 1799 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1800 |
ignore ifFalse:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1801 |
(bigStep |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1802 |
and:[steppedContextLineno notNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1803 |
and:[where notNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1804 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1805 |
(here isBlockContext |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1806 |
and:[(here methodHome == steppedContext) |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1807 |
or:[here home == steppedContext]]) ifTrue:[ |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1808 |
DebuggingDebugger == true ifTrue:[ |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1809 |
'same line but in block' printNL. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1810 |
]. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1811 |
|
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1812 |
steppedContext := actualContext := here. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1813 |
steppedContextLineno := here lineNumber. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1814 |
] ifFalse:[ |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1815 |
DebuggingDebugger == true ifTrue:[ |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1816 |
'same line - ignored' printNL. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1817 |
]. |
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
1818 |
ignore := true |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1819 |
]. |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1820 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1821 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1822 |
(left not |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1823 |
and:[skipLineNr notNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1824 |
and:[where notNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1825 |
and:[where lineNumber < skipLineNr]]]) ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1826 |
DebuggingDebugger == true ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1827 |
'skip (' print. skipLineNr print. ' unreached - ignored' printNL. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1828 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1829 |
ignore := true |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1830 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1831 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1832 |
(steppedContextLineno isNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1833 |
and:[skipLineNr isNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1834 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1835 |
DebuggingDebugger == true ifTrue:[ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1836 |
'same line2 (after conIRQ) - ignored' printNL. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1837 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1838 |
ignore := true |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
1839 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1840 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1841 |
|
57 | 1842 |
ignore ifTrue:[ |
1843 |
"/' ' printNL. |
|
554 | 1844 |
where := nil. here := nil. |
1845 |
" |
|
1846 |
yes, a context below |
|
1847 |
- continue and schedule another stepInterrupt. |
|
1848 |
Must flush caches since optimized methods not always |
|
1849 |
look for pending interrupts |
|
1850 |
" |
|
1851 |
ObjectMemory flushInlineCaches. |
|
1852 |
StepInterruptPending := 1. |
|
1853 |
InterruptPending := 1. |
|
1854 |
InStepInterrupt := nil. |
|
1855 |
^ nil |
|
57 | 1856 |
]. |
1857 |
||
1858 |
"/ ' ' printNL. |
|
1859 |
||
29 | 1860 |
name := Processor activeProcess nameOrId. |
7 | 1861 |
self label:(s , ' (process: ' , name , ')'). |
1862 |
||
57 | 1863 |
tracing := false. |
1864 |
bigStep := false. |
|
1865 |
||
0 | 1866 |
"release refs to context" |
1867 |
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
|
1868 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1869 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
1870 |
DebuggingDebugger == true ifTrue:[ |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
1871 |
'==> enter on: ' print. thisContext sender sender printCR. |
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
1872 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1873 |
self enter:thisContext sender sender |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1874 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
1875 |
"Created: 14.10.1996 / 12:53:39 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1876 |
"Modified: 3.3.1997 / 21:36:35 / cg" |
0 | 1877 |
! ! |
1878 |
||
266 | 1879 |
!DebugView methodsFor:'menu / button actions'! |
1880 |
||
1881 |
autoUpdateOff |
|
1882 |
"stop the update process" |
|
1883 |
||
1884 |
updateProcess notNil ifTrue:[ |
|
1885 |
monitorToggle lampColor:(Color yellow). |
|
1886 |
updateProcess terminate. |
|
1887 |
updateProcess := nil |
|
1888 |
] |
|
1889 |
! |
|
1890 |
||
1891 |
autoUpdateOn |
|
1892 |
"fork a subprocess which updates the contextList in regular intervals" |
|
1893 |
||
1894 |
updateProcess isNil ifTrue:[ |
|
1895 |
updateProcess := |
|
1896 |
[ |
|
1897 |
[true] whileTrue:[ |
|
1898 |
monitorToggle showLamp ifTrue:[ |
|
1899 |
monitorToggle lampColor:(Color yellow). |
|
1900 |
] ifFalse:[ |
|
1901 |
monitorToggle activeForegroundColor:Color black. |
|
1902 |
]. |
|
1903 |
(Delay forSeconds:0.25) wait. |
|
1904 |
self updateContext. |
|
1905 |
monitorToggle showLamp ifTrue:[ |
|
1906 |
monitorToggle lampColor:(Color red). |
|
1907 |
] ifFalse:[ |
|
1908 |
monitorToggle activeForegroundColor:Color red. |
|
1909 |
]. |
|
1910 |
(Delay forSeconds:0.25) wait. |
|
1911 |
self updateContext. |
|
1912 |
] |
|
1913 |
] forkAt:(Processor activePriority - 1) |
|
1914 |
] |
|
1915 |
||
1916 |
! |
|
1917 |
||
1918 |
browse |
|
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1919 |
|mthd who sel cls| |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1920 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1921 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1922 |
mthd notNil ifTrue:[ |
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1923 |
who := selectedContext method who. |
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1924 |
who notNil ifTrue:[ |
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1925 |
cls := who methodClass. |
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1926 |
sel := who methodSelector. |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1927 |
] |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1928 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1929 |
cls isNil ifTrue:[ |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1930 |
"/ class not found - try receiver |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1931 |
cls := selectedContext receiver class |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1932 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1933 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
1934 |
cls browserClass openInClass:cls selector:sel. |
266 | 1935 |
|
1936 |
"Created: 22.11.1995 / 21:27:01 / cg" |
|
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1937 |
"Modified: 1.11.1996 / 16:22:13 / cg" |
266 | 1938 |
! |
1939 |
||
1940 |
browseClass |
|
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1941 |
|cls| |
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1942 |
|
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1943 |
cls := selectedContext method containingClass. |
527 | 1944 |
cls browserClass browseClass:cls |
1945 |
||
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1946 |
"Modified: 1.11.1996 / 16:34:19 / cg" |
266 | 1947 |
! |
1948 |
||
1949 |
browseClassHierarchy |
|
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1950 |
|cls| |
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1951 |
|
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1952 |
cls := selectedContext method containingClass. |
527 | 1953 |
cls browserClass browseClassHierarchy:cls. |
1954 |
||
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1955 |
"Modified: 1.11.1996 / 16:34:31 / cg" |
266 | 1956 |
! |
1957 |
||
1958 |
browseFullClassProtocol |
|
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1959 |
|cls| |
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1960 |
|
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1961 |
cls := selectedContext method containingClass. |
527 | 1962 |
cls browserClass browseFullClassProtocol:cls. |
1963 |
||
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
1964 |
"Modified: 1.11.1996 / 16:34:41 / cg" |
266 | 1965 |
! |
1966 |
||
1967 |
copyWalkbackText |
|
1968 |
"place the contents of the walkback view into the copy-paste buffer. |
|
1969 |
This allows pasting it into some other view for printing ..." |
|
1970 |
||
1971 |
self setTextSelection:(contextArray collect:[:con | con fullPrintString]) asStringCollection |
|
1972 |
||
1973 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
1974 |
! |
|
1975 |
||
1976 |
doAbort |
|
1187 | 1977 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 1978 |
at save places (for example: in the event loop) and returns back |
1979 |
from whatever the process is doing, but does not terminate it." |
|
1980 |
||
1981 |
inspecting ifTrue:[ |
|
477 | 1982 |
inspectedProcess isDead ifTrue:[ |
1983 |
self showTerminated. |
|
1984 |
^ self |
|
1985 |
]. |
|
1986 |
(Object abortSignal isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
1987 |
self showError:'** the process does not handle the abort signal **' |
|
1988 |
] ifTrue:[ |
|
1989 |
self interruptProcessWith:[Object abortSignal raise]. |
|
1990 |
]. |
|
1991 |
^ self |
|
266 | 1992 |
]. |
1993 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
1994 |
steppedContext := wrapperContext := nil. |
266 | 1995 |
haveControl := false. |
1996 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1997 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1998 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
1999 |
catchBlock notNil ifTrue:[ |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2000 |
abortButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2001 |
catchBlock value. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2002 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2003 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2004 |
'DebugView [warning]: abort failed' errorPrintCR. |
266 | 2005 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2006 |
|
266 | 2007 |
^ self. |
2008 |
||
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2009 |
"Modified: 10.1.1997 / 17:38:28 / cg" |
266 | 2010 |
! |
2011 |
||
2012 |
doContinue |
|
2013 |
"continue from menu" |
|
2014 |
||
2015 |
inspecting ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2016 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2017 |
continueButton foregroundColor:Color red darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2018 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2019 |
continueButton label:(resources string:'stop'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2020 |
continueButton action:[self doStop]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2021 |
|
477 | 2022 |
self processPerform:#resume. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2023 |
|
477 | 2024 |
^ self |
266 | 2025 |
]. |
2026 |
canContinue ifTrue:[ |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2027 |
steppedContext := wrapperContext := nil. |
477 | 2028 |
tracing := false. |
2029 |
haveControl := false. |
|
2030 |
exitAction := #continue. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2031 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2032 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2033 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2034 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2035 |
"/ not reached. |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2036 |
'DebugView [warning]: continue failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2037 |
continueButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2038 |
|
266 | 2039 |
] ifFalse:[ |
477 | 2040 |
inspecting ifFalse:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2041 |
'DebugView [info]: resuming top context' infoPrintCR. |
477 | 2042 |
self showSelection:1. |
2043 |
self doReturn |
|
2044 |
] |
|
266 | 2045 |
] |
477 | 2046 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2047 |
"Modified: 10.1.1997 / 17:38:34 / cg" |
266 | 2048 |
! |
2049 |
||
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2050 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2051 |
"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
|
2052 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2053 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2054 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2055 |
canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2056 |
steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2057 |
haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2058 |
exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2059 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2060 |
"exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2061 |
catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2062 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2063 |
"/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2064 |
'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2065 |
sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2066 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2067 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2068 |
"Modified: 10.1.1997 / 17:38:41 / cg" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2069 |
"Created: 6.3.1997 / 21:09:36 / cg" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2070 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2071 |
|
266 | 2072 |
doNext |
1072 | 2073 |
"skip for next source-code line; entering blocks" |
266 | 2074 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2075 |
stepHow := #nextIn. |
266 | 2076 |
self doStep:nil |
790 | 2077 |
|
1072 | 2078 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2079 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2080 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2081 |
doNextOut |
1072 | 2082 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2083 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2084 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2085 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2086 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2087 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 2088 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2089 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2090 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2091 |
doNextOver |
1072 | 2092 |
"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
|
2093 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2094 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2095 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2096 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2097 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 2098 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 2099 |
! |
2100 |
||
2101 |
doNoTrace |
|
2102 |
traceView notNil ifTrue:[ |
|
2103 |
traceView topView destroy. |
|
2104 |
traceView := nil. |
|
2105 |
]. |
|
2106 |
tracing := false |
|
2107 |
! |
|
2108 |
||
2109 |
doRestart |
|
2110 |
"restart - the selected context will be restarted" |
|
2111 |
||
2112 |
inspecting ifTrue:[ |
|
477 | 2113 |
selectedContext isNil ifTrue:[ |
2114 |
^ self showError:'** select a context first **' |
|
2115 |
]. |
|
2116 |
self interruptProcessWith:[selectedContext unwindAndRestart]. |
|
2117 |
^ self |
|
266 | 2118 |
]. |
2119 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2120 |
steppedContext := wrapperContext := nil. |
266 | 2121 |
haveControl := false. |
2122 |
exitAction := #restart. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2123 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2124 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2125 |
catchBlock notNil ifTrue:[catchBlock value]. |
477 | 2126 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2127 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2128 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2129 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2130 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2131 |
"Modified: 10.1.1997 / 17:38:36 / cg" |
266 | 2132 |
! |
2133 |
||
2134 |
doReturn |
|
2135 |
"return - the selected context will do a ^nil" |
|
2136 |
||
2137 |
inspecting ifTrue:[ |
|
477 | 2138 |
selectedContext isNil ifTrue:[ |
2139 |
^ self showError:'** select a context first **' |
|
2140 |
]. |
|
2141 |
self interruptProcessWith:[selectedContext unwind]. |
|
2142 |
^ self |
|
266 | 2143 |
]. |
2144 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2145 |
steppedContext := wrapperContext := nil. |
266 | 2146 |
haveControl := false. |
2147 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2148 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2149 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2150 |
catchBlock notNil ifTrue:[catchBlock value]. |
477 | 2151 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2152 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2153 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2154 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2155 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2156 |
"Modified: 10.1.1997 / 17:38:39 / cg" |
266 | 2157 |
! |
2158 |
||
2159 |
doSend |
|
2160 |
"single send; reenter with next message send" |
|
2161 |
||
1072 | 2162 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2163 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2164 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2165 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2166 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2167 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2168 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2169 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2170 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2171 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2172 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2173 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2174 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2175 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2176 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2177 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2178 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2179 |
|
1072 | 2180 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 2181 |
! |
2182 |
||
2183 |
doStep |
|
2184 |
"skip for next send in selected method" |
|
2185 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2186 |
stepHow := #step. |
790 | 2187 |
self doStep:-1 |
2188 |
||
1072 | 2189 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 2190 |
! |
2191 |
||
2192 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2193 |
"common helper for step, skip & next. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2194 |
Arrange for single-steppping until we pass lineNr (if nonNil) |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2195 |
or to next line (if nil) or to next send (if -1)" |
266 | 2196 |
|
2197 |
|con method| |
|
2198 |
||
2199 |
inspecting ifTrue:[^ self]. |
|
2200 |
||
2201 |
canContinue ifTrue:[ |
|
477 | 2202 |
selectedContext notNil ifTrue:[ |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2203 |
con := actualContext. "/ selectedContext. |
477 | 2204 |
steppedContextLineno := actualContext lineNumber. |
2205 |
] ifFalse:[ |
|
2206 |
con := contextArray at:2. |
|
2207 |
steppedContextLineno := con lineNumber. |
|
2208 |
]. |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2209 |
|
477 | 2210 |
skipLineNr := lineNr. |
266 | 2211 |
|
477 | 2212 |
lineNr == -1 ifTrue:[ |
2213 |
steppedContextLineno := skipLineNr := nil. |
|
2214 |
]. |
|
266 | 2215 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2216 |
stepHow == #send ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2217 |
steppedContext := contextArray at:1. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2218 |
stepHow := #nextIn. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2219 |
] ifFalse:[ |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2220 |
stepHow == #nextOut ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2221 |
steppedContext := con home. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2222 |
] ifFalse:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2223 |
steppedContext := con. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2224 |
]. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2225 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2226 |
wrapperContext := nil. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2227 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2228 |
"/ ' 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
|
2229 |
|
477 | 2230 |
" |
2231 |
if we step in a wrapped method, |
|
2232 |
prepare to skip the prolog ... |
|
2233 |
" |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2234 |
|
477 | 2235 |
inWrap := false. |
2236 |
method := con method. |
|
2237 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
2238 |
inWrap := true |
|
2239 |
]. |
|
266 | 2240 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2241 |
lineNr == #return ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2242 |
Processor activeProcess forceInterruptOnReturnOf:con. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2243 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2244 |
|
477 | 2245 |
con := nil. |
2246 |
bigStep := true. |
|
2247 |
haveControl := false. |
|
2248 |
exitAction := #step. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2249 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2250 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2251 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2252 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2253 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2254 |
'DebugView [warning]: step failed' errorPrintCR. |
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2255 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
266 | 2256 |
] |
477 | 2257 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
2258 |
"Modified: 6.3.1997 / 21:11:38 / cg" |
266 | 2259 |
! |
2260 |
||
2261 |
doStop |
|
2262 |
"stop the process (if its running, otherwise this is a no-op)" |
|
2263 |
||
2264 |
inspecting ifTrue:[ |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2265 |
device hasColors ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2266 |
continueButton foregroundColor:Color green darkened darkened. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2267 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2268 |
continueButton label:(resources string:'continue'). |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2269 |
continueButton action:[self doContinue]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2270 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2271 |
self processPerform:#stop. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2272 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2273 |
^ self |
266 | 2274 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2275 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2276 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 2277 |
! |
2278 |
||
2279 |
doTerminate |
|
2280 |
"terminate - the process has a chance for cleanup" |
|
2281 |
||
2282 |
inspecting ifTrue:[ |
|
477 | 2283 |
self processPerform:#terminate. |
2284 |
^ self |
|
266 | 2285 |
]. |
2286 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2287 |
steppedContext := wrapperContext := nil. |
266 | 2288 |
haveControl := false. |
2289 |
exitAction := #terminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2290 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2291 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2292 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2293 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2294 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2295 |
inspecting ifFalse:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2296 |
'DebugView [warning]: terminate failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2297 |
self warn:'terminate failed'. |
266 | 2298 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2299 |
terminateButton turnOff. |
477 | 2300 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2301 |
"Modified: 10.1.1997 / 17:38:22 / cg" |
266 | 2302 |
! |
2303 |
||
2304 |
doTrace |
|
2305 |
"tracing - not really implemented ..." |
|
2306 |
||
2307 |
self warn:'this function is not yet implemented'. |
|
2308 |
||
2309 |
"/ |v b| |
|
2310 |
"/ |
|
2311 |
"/ traceView isNil ifTrue:[ |
|
2312 |
"/ v := StandardSystemView on:Display. |
|
2313 |
"/ v label:'Debugger-Trace'. |
|
2314 |
"/ v icon:icon. |
|
2315 |
"/ |
|
2316 |
"/ b := Button label:'untrace' in:v. |
|
2317 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
2318 |
"/ b action:[ |
|
2319 |
"/ StepInterruptPending := nil. |
|
2320 |
"/ tracing := false. |
|
2321 |
"/ v unrealize. |
|
2322 |
"/ traceView := nil |
|
2323 |
"/ ]. |
|
2324 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
2325 |
"/ traceView origin:(0 @ (b height)) |
|
2326 |
"/ extent:[v width @ (v height - b height)] |
|
2327 |
"/ ]. |
|
2328 |
"/ v realize. |
|
2329 |
"/ |
|
2330 |
"/ tracing := true. |
|
2331 |
! |
|
2332 |
||
2333 |
doTraceStep |
|
2334 |
"tracestep - not implemented yet" |
|
2335 |
||
2336 |
canContinue ifTrue:[ |
|
2337 |
tracing := true. |
|
2338 |
self doStep |
|
2339 |
] |
|
2340 |
! |
|
2341 |
||
2342 |
exit |
|
2343 |
"exit from menu: immediate exit from smalltalk" |
|
2344 |
||
2345 |
OperatingSystem exit |
|
2346 |
! |
|
2347 |
||
2348 |
implementors |
|
2349 |
"open a browser on the implementors" |
|
2350 |
||
2351 |
selectedContext isNil ifTrue:[ |
|
2352 |
^ self showError:'** select a context first **' |
|
2353 |
]. |
|
2354 |
SystemBrowser browseImplementorsOf:selectedContext selector. |
|
2355 |
! |
|
2356 |
||
2357 |
inspectContext |
|
2358 |
"launch an inspector on the currently selected context" |
|
2359 |
||
2360 |
contextView selection notNil ifTrue:[ |
|
2361 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
|
2362 |
(contextArray at:(contextView selection)) inspect. |
|
2363 |
] |
|
2364 |
] |
|
2365 |
! |
|
2366 |
||
2367 |
quickTerminate |
|
2368 |
"quick terminate - the process will get no chance for cleanup actions" |
|
2369 |
||
2370 |
inspecting ifTrue:[ |
|
477 | 2371 |
self processPerform:#terminateNoSignal. |
2372 |
^ self |
|
266 | 2373 |
]. |
2374 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2375 |
steppedContext := wrapperContext := nil. |
266 | 2376 |
haveControl := false. |
2377 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2378 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2379 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2380 |
catchBlock notNil ifTrue:[catchBlock value]. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2381 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2382 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2383 |
inspecting ifFalse:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2384 |
'DebugView [warning]: terminate failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2385 |
self warn:'terminate failed'. |
266 | 2386 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
2387 |
terminateButton turnOff. |
477 | 2388 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
2389 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 2390 |
! |
2391 |
||
2392 |
removeAllBreakpoints |
|
2393 |
"remove all trace & breakpoints - if any" |
|
2394 |
||
2395 |
MessageTracer unwrapAllMethods |
|
2396 |
! |
|
2397 |
||
2398 |
removeBreakpoint |
|
2399 |
"remove breakpoint on the selected contexts method - if any" |
|
2400 |
||
2401 |
|implementorClass method| |
|
2402 |
||
2403 |
selectedContext isNil ifTrue:[ |
|
2404 |
^ self showError:'** select a context first **' |
|
2405 |
]. |
|
2406 |
||
2407 |
implementorClass := selectedContext methodClass. |
|
2408 |
implementorClass notNil ifTrue:[ |
|
2409 |
method := implementorClass compiledMethodAt:selectedContext selector. |
|
2410 |
(method notNil and:[method isWrapped]) ifTrue:[ |
|
2411 |
MessageTracer unwrapMethod:method |
|
2412 |
] |
|
2413 |
]. |
|
2414 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
2415 |
! |
|
2416 |
||
2417 |
senders |
|
2418 |
"open a browser on the senders" |
|
2419 |
||
2420 |
selectedContext isNil ifTrue:[ |
|
2421 |
^ self showError:'** select a context first **' |
|
2422 |
]. |
|
2423 |
SystemBrowser browseAllCallsOn:selectedContext selector. |
|
2424 |
! |
|
2425 |
||
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2426 |
showDenseBacktrace |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2427 |
verboseBacktrace := false. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2428 |
contextView middleButtonMenu labelAt:#showDenseBacktrace put:(resources string:'show verbose backtrace'). |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2429 |
contextView middleButtonMenu selectorAt:#showDenseBacktrace put:#showVerboseBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2430 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2431 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2432 |
"Created: 10.1.1997 / 21:33:55 / cg" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2433 |
"Modified: 10.1.1997 / 21:37:21 / cg" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2434 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2435 |
|
266 | 2436 |
showMore |
2437 |
"double number of contexts shown" |
|
2438 |
||
2439 |
contextArray notNil ifTrue:[ |
|
563 | 2440 |
nChainShown := nChainShown * 2. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2441 |
self redisplayBacktrace. |
266 | 2442 |
] |
563 | 2443 |
|
950 | 2444 |
"Modified: 12.1.1997 / 01:24:26 / cg" |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2445 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2446 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2447 |
showVerboseBacktrace |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2448 |
verboseBacktrace := true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2449 |
contextView middleButtonMenu labelAt:#showVerboseBacktrace put:(resources string:'dense stack backtrace'). |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2450 |
contextView middleButtonMenu selectorAt:#showVerboseBacktrace put:#showDenseBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2451 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2452 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2453 |
"Modified: 10.1.1997 / 21:37:13 / cg" |
266 | 2454 |
! |
2455 |
||
2456 |
skip |
|
2457 |
"skip for cursor line in selected method" |
|
2458 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2459 |
stepHow := #skip. |
266 | 2460 |
self doStep:codeView cursorLine. |
790 | 2461 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2462 |
"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
|
2463 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2464 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2465 |
skipForReturn |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2466 |
"skip until context is left." |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2467 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2468 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2469 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2470 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2471 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
266 | 2472 |
! ! |
2473 |
||
2474 |
!DebugView methodsFor:'private'! |
|
2475 |
||
2476 |
busy |
|
2477 |
^ busy |
|
2478 |
! |
|
2479 |
||
2480 |
cacheMyself |
|
2481 |
"remember myself for next debug session" |
|
2482 |
||
2483 |
"caching the last debugger will make the next debugger appear |
|
2484 |
faster, since no resources have to be allocated in the display. |
|
2485 |
We have to be careful to release all refs to the debuggee, though. |
|
2486 |
Otherwise, the GC will not be able to release it" |
|
2487 |
||
2488 |
windowGroup notNil ifTrue:[ |
|
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2489 |
windowGroup setProcess:nil. |
266 | 2490 |
]. |
2491 |
||
2492 |
busy := false. |
|
2493 |
codeView acceptAction:nil. |
|
2494 |
codeView doItAction:nil. |
|
2495 |
codeView contents:nil. |
|
2496 |
receiverInspector release. |
|
2497 |
contextInspector release. |
|
2498 |
inspectedProcess := nil. |
|
2499 |
exitAction := nil. |
|
2500 |
contextArray := nil. |
|
940 | 2501 |
selectedContext := actualContext := firstContext := nil. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2502 |
steppedContext := wrapperContext := nil. |
266 | 2503 |
catchBlock := nil. |
2504 |
grabber := nil. |
|
2505 |
self autoUpdateOff. |
|
2506 |
||
959
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2507 |
"/ |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2508 |
"/ only cache if I am on the Display |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2509 |
"/ |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2510 |
device == Display ifTrue:[ |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2511 |
exclusive ifTrue:[ |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2512 |
CachedExclusive := self |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2513 |
] ifFalse:[ |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2514 |
CachedDebugger := self |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2515 |
]. |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2516 |
] |
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2517 |
|
f1faf693f0d7
only cache debugger on the Display
Claus Gittinger <cg@exept.de>
parents:
952
diff
changeset
|
2518 |
"Modified: 15.2.1997 / 18:53:48 / cg" |
266 | 2519 |
! |
2520 |
||
2521 |
exclusive:aBoolean |
|
2522 |
exclusive := aBoolean |
|
2523 |
! |
|
2524 |
||
2525 |
inspectedProcess |
|
2526 |
^ inspectedProcess |
|
2527 |
! |
|
2528 |
||
2529 |
interruptProcessWith:aBlock |
|
2530 |
"let inspected process do something, then update the context list" |
|
2531 |
||
2532 |
inspectedProcess isDead ifTrue:[ |
|
2533 |
self showTerminated. |
|
2534 |
^ self |
|
2535 |
]. |
|
2536 |
inspectedProcess interruptWith:aBlock. |
|
2537 |
" |
|
2538 |
give the process a chance to run, then update |
|
2539 |
" |
|
2540 |
(Delay forSeconds:0.2) wait. |
|
2541 |
self setContext:(inspectedProcess suspendedContext). |
|
2542 |
! |
|
2543 |
||
2544 |
processPerform:aMessage |
|
2545 |
"do something, then update the context list" |
|
2546 |
||
2547 |
inspectedProcess isDead ifTrue:[ |
|
2548 |
self showTerminated. |
|
2549 |
^ self |
|
2550 |
]. |
|
2551 |
inspectedProcess perform:aMessage. |
|
2552 |
" |
|
2553 |
give the process a chance to run, then update |
|
2554 |
" |
|
2555 |
(Delay forSeconds:0.2) wait. |
|
2556 |
self setContext:(inspectedProcess suspendedContext). |
|
2557 |
! |
|
2558 |
||
939 | 2559 |
redisplayBacktrace |
2560 |
|oldSelection oldContext con idx| |
|
2561 |
||
2562 |
contextArray notNil ifTrue:[ |
|
950 | 2563 |
self withWaitCursorDo:[ |
2564 |
oldSelection := contextView selection. |
|
2565 |
oldSelection notNil ifTrue:[ |
|
2566 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
|
2567 |
]. |
|
2568 |
||
2569 |
con := firstContext. |
|
2570 |
"/ con := contextArray at:1. |
|
2571 |
contextArray at:1 put:nil. |
|
2572 |
self setContext:con. |
|
2573 |
||
2574 |
oldContext isNil ifTrue:[ |
|
2575 |
idx := oldSelection |
|
2576 |
] ifFalse:[ |
|
2577 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
|
2578 |
]. |
|
2579 |
contextView setSelection:idx. |
|
2580 |
idx notNil ifTrue:[ |
|
2581 |
self showSelection:idx |
|
2582 |
] |
|
939 | 2583 |
] |
2584 |
] |
|
2585 |
||
2586 |
"Created: 10.1.1997 / 21:36:46 / cg" |
|
950 | 2587 |
"Modified: 12.1.1997 / 01:24:17 / cg" |
939 | 2588 |
! |
2589 |
||
266 | 2590 |
setContext:aContext |
2591 |
"show calling chain from aContext in the walk-back listview" |
|
2592 |
||
641 | 2593 |
^ 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
|
2594 |
|
641 | 2595 |
"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
|
2596 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2597 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2598 |
setContext:aContext releaseInspectors:releaseInspectors |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2599 |
"show calling chain from aContext in the walk-back listview" |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2600 |
|
949 | 2601 |
|con text method caller caller2 m count showIt c suspendContext nm| |
266 | 2602 |
|
2603 |
(contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[ |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2604 |
"no change" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2605 |
^ false |
266 | 2606 |
]. |
2607 |
||
939 | 2608 |
firstContext := aContext. |
2609 |
||
266 | 2610 |
m := contextView middleButtonMenu. |
2611 |
m notNil ifTrue:[ |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2612 |
m disable:#showMore. |
266 | 2613 |
]. |
2614 |
||
2615 |
aContext isNil ifTrue:[ |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2616 |
text := Array with:'** no context **'. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2617 |
contextArray := nil. |
266 | 2618 |
] ifFalse:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2619 |
text := OrderedCollection new:nChainShown. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2620 |
contextArray := OrderedCollection new:nChainShown. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2621 |
con := aContext. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2622 |
|
939 | 2623 |
verboseBacktrace ~~ true ifTrue:[ |
2624 |
"/ with dense backtrace, hide the ProcessorScheduler |
|
944 | 2625 |
"/ contexts at the top; look for a Process>>suspend* |
939 | 2626 |
"/ context within the first 10 contexts |
2627 |
||
2628 |
suspendContext := nil. |
|
2629 |
c := con. |
|
2630 |
1 to:10 do:[:i | |
|
944 | 2631 |
|sel| |
2632 |
||
940 | 2633 |
c notNil ifTrue:[ |
944 | 2634 |
(sel := c selector) notNil ifTrue:[ |
2635 |
((sel startsWith:'suspend') |
|
940 | 2636 |
and:[c receiver isMemberOf:Process]) ifTrue:[ |
2637 |
suspendContext := c |
|
2638 |
]. |
|
2639 |
]. |
|
2640 |
c := c sender. |
|
2641 |
] |
|
939 | 2642 |
]. |
2643 |
suspendContext notNil ifTrue:[ |
|
949 | 2644 |
con := suspendContext. suspendContext := nil |
939 | 2645 |
]. |
2646 |
]. |
|
2647 |
||
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2648 |
" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2649 |
get them all |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2650 |
" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2651 |
count := 0. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2652 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
949 | 2653 |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2654 |
(self showingContext:con) ifTrue:[ |
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2655 |
contextArray add:con. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2656 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2657 |
(MoreDebuggingDetail == true) ifTrue:[ |
949 | 2658 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2659 |
] ifFalse:[ |
949 | 2660 |
nm := con printString. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2661 |
]. |
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2662 |
text add:nm. |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2663 |
count := count + 1. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2664 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2665 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2666 |
method := con method. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2667 |
(method notNil and:[method isWrapped]) ifTrue:[ |
949 | 2668 |
"/ |
2669 |
"/ kludge: if its a wrapped method, then hide the wrap-call |
|
2670 |
"/ |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2671 |
caller := con sender. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2672 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2673 |
caller2 := caller sender. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2674 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2675 |
con := caller2 |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2676 |
] |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2677 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2678 |
caller := caller2 := nil |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2679 |
]. |
949 | 2680 |
|
2681 |
"/ with dense backtrace, skip the doIt methods context |
|
2682 |
"/ (its dummy anyway) and fake that contexts name |
|
2683 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2684 |
verboseBacktrace ~~ true ifTrue:[ |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2685 |
(con isBlockContext |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2686 |
and:[con home == con sender |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2687 |
and:[((con home selector == #doIt) |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2688 |
or:[con home selector == #doIt:]) |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2689 |
and:[con home method who isNil]]]) ifTrue:[ |
949 | 2690 |
con := con sender. |
2691 |
text removeLast. |
|
2692 |
text add:(con methodHome printString) |
|
2693 |
] |
|
2694 |
]. |
|
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2695 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2696 |
"/ and also, all lazy loading intermediates |
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2697 |
|
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2698 |
verboseBacktrace ~~ true ifTrue:[ |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2699 |
(con selector == #noByteCode |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2700 |
and:[con receiver isMethod]) ifTrue:[ |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2701 |
contextArray removeLast. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2702 |
text removeLast. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2703 |
con := con sender. |
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
2704 |
count := count - 1. |
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2705 |
] |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2706 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2707 |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2708 |
con := con sender |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2709 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2710 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2711 |
" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2712 |
did we reach the end ? |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2713 |
" |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2714 |
(con isNil or:[con sender isNil]) ifTrue:[ |
949 | 2715 |
|
2716 |
"/ the very last one is the startup context |
|
2717 |
"/ (in main) - it has nil as receiver and nil as selector |
|
2718 |
||
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2719 |
contextArray last selector isNil ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2720 |
contextArray removeLast. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2721 |
text removeLast |
949 | 2722 |
]. |
2723 |
||
2724 |
verboseBacktrace ~~ true ifTrue:[ |
|
2725 |
"/ in dense mode, remove the process startup |
|
2726 |
"/ contexts (if any) |
|
2727 |
||
2728 |
(con := contextArray last) methodClass == Process ifTrue:[ |
|
2729 |
con selector == #start ifTrue:[ |
|
2730 |
contextArray removeLast. |
|
2731 |
text removeLast. |
|
2732 |
||
2733 |
[contextArray size > 0 |
|
2734 |
and:[contextArray last methodHome == con]] whileTrue:[ |
|
2735 |
contextArray removeLast. |
|
2736 |
text removeLast. |
|
2737 |
] |
|
2738 |
] |
|
2739 |
] |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2740 |
] |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2741 |
] ifFalse:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2742 |
m notNil ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2743 |
m enable:#showMore. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2744 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2745 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2746 |
]. |
266 | 2747 |
]. |
2748 |
||
2749 |
contextView setList:text. |
|
944 | 2750 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2751 |
releaseInspectors ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2752 |
receiverInspector release. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2753 |
contextInspector release. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2754 |
]. |
266 | 2755 |
|
2756 |
m notNil ifTrue:[ |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2757 |
m disable:#removeBreakpoint. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2758 |
m disable:#implementors. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2759 |
m disable:#senders. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2760 |
m disable:#browseClass. |
266 | 2761 |
]. |
2762 |
^ true |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2763 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2764 |
"Created: 14.12.1995 / 19:10:31 / cg" |
1101 | 2765 |
"Modified: 27.3.1997 / 18:25:17 / cg" |
266 | 2766 |
! |
2767 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2768 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2769 |
"show calling chain from aContext in the walk-back listview. |
1213 | 2770 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2771 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2772 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2773 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2774 |
con := aContext. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2775 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2776 |
con := con sender. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2777 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2778 |
con := con sender. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2779 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2780 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2781 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2782 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2783 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2784 |
"Modified: 27.6.1996 / 17:21:59 / cg" |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2785 |
"Created: 20.10.1996 / 18:10:21 / cg" |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2786 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2787 |
|
266 | 2788 |
showError:message |
2789 |
codeView contents:(resources string:message). |
|
2790 |
shown ifTrue:[ |
|
2791 |
exclusive ifTrue:[ |
|
2792 |
"/ consider this a kludge: |
|
2793 |
"/ if exclusive, cannot use flash, since it suspends |
|
2794 |
"/ (but we cannot suspend here ...) |
|
2795 |
codeView redrawInverted. device flush. |
|
2796 |
OperatingSystem millisecondDelay:200. |
|
2797 |
codeView redraw |
|
2798 |
] ifFalse:[ |
|
2799 |
codeView flash |
|
2800 |
] |
|
2801 |
] |
|
2802 |
||
2803 |
"Modified: 24.11.1995 / 22:07:30 / cg" |
|
2804 |
! |
|
2805 |
||
2806 |
showTerminated |
|
2807 |
self showError:'** the process has terminated **' |
|
2808 |
! |
|
2809 |
||
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2810 |
showingContext:aContext |
939 | 2811 |
"return false, if this context is to be skipped. |
2812 |
Here, we hide some wellKnown methods, which are usually |
|
1213 | 2813 |
not too interesting; the set of methods which are suppressed |
939 | 2814 |
is my (claus's) own choice." |
2815 |
||
2816 |
|sel rec mClass| |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2817 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2818 |
verboseBacktrace ifTrue:[^ true]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2819 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2820 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2821 |
sel := aContext selector. |
939 | 2822 |
mClass := aContext methodClass. |
2823 |
||
2824 |
sel == #withCursor:do: ifTrue:[ |
|
2825 |
(mClass == WindowGroup) ifTrue:[^ false]. |
|
2826 |
(mClass == TopView) ifTrue:[^ false]. |
|
2827 |
]. |
|
2828 |
(sel == #withExecuteCursorDo: |
|
2829 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
2830 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
|
2831 |
]. |
|
2832 |
||
2833 |
(mClass == Object) ifTrue:[ |
|
2834 |
(sel startsWith:'perform:') ifTrue:[^ false] |
|
2835 |
]. |
|
2836 |
||
2837 |
(mClass == Method) ifTrue:[ |
|
2838 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
|
2839 |
]. |
|
2840 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2841 |
(mClass == SmallInteger) ifTrue:[ |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2842 |
(sel == #to:do:) ifTrue:[^ false]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2843 |
(sel == #to:by:do:) ifTrue:[^ false]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2844 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2845 |
|
939 | 2846 |
(mClass == Block) ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2847 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2848 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2849 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2850 |
sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2851 |
sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2852 |
sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2853 |
sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2854 |
sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2855 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2856 |
sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2857 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2858 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2859 |
"/ aContext isBlockContext ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2860 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2861 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2862 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2863 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2864 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2865 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2866 |
"/ sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2867 |
"/ ]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2868 |
|
939 | 2869 |
((mClass == Signal) |
2870 |
or:[(mClass == QuerySignal) |
|
2871 |
or:[mClass == SignalSet]] |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2872 |
) ifTrue:[ |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2873 |
sel == #handle:do: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2874 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2875 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2876 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2877 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2878 |
"Created: 10.1.1997 / 21:01:39 / cg" |
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
2879 |
"Modified: 14.1.1997 / 13:25:13 / cg" |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2880 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2881 |
|
266 | 2882 |
stepping |
2883 |
^ stepping |
|
2884 |
! |
|
2885 |
||
2886 |
unstep |
|
2887 |
stepping := false. |
|
2888 |
bigStep := false. |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2889 |
steppedContext := wrapperContext := nil. |
266 | 2890 |
exitAction := nil |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2891 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2892 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
266 | 2893 |
! |
2894 |
||
2895 |
updateContext |
|
2896 |
|oldContext idx| |
|
2897 |
||
2898 |
inspectedProcess state == #dead ifTrue:[ |
|
642
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2899 |
self showTerminated. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2900 |
^ self |
266 | 2901 |
]. |
2902 |
||
2903 |
oldContext := selectedContext. |
|
642
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2904 |
[ |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2905 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
642
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2906 |
oldContext notNil ifTrue:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2907 |
contextArray notNil ifTrue:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2908 |
idx := contextArray identityIndexOf:oldContext. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2909 |
idx ~~ 0 ifTrue:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2910 |
self showSelection:idx |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2911 |
] ifFalse:[ |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2912 |
codeView contents:('** context returned **') |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2913 |
] |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2914 |
] |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2915 |
] |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2916 |
]. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2917 |
] valueUninterruptably. |
77e7e39f503a
update context uninterruptably
Claus Gittinger <cg@exept.de>
parents:
641
diff
changeset
|
2918 |
|
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2919 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
266 | 2920 |
! ! |
2921 |
||
2922 |
!DebugView methodsFor:'private control loop'! |
|
2923 |
||
2924 |
controlLoop |
|
2925 |
"this is a kludge: |
|
664 | 2926 |
start a dispatchloop which exits when |
2927 |
either continue, return or step is pressed |
|
266 | 2928 |
" |
2929 |
||
2930 |
haveControl := true. |
|
664 | 2931 |
[ |
2932 |
[haveControl] whileTrue:[ |
|
2933 |
self controlLoopCatchingErrors |
|
2934 |
]. |
|
2935 |
] valueNowOrOnUnwindDo:[ |
|
2936 |
catchBlock := nil. |
|
2937 |
haveControl := false |
|
266 | 2938 |
]. |
664 | 2939 |
|
2940 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 2941 |
! |
2942 |
||
2943 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2944 |
"this is the debuggers own private event handling loop; |
1187 | 2945 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2946 |
|
266 | 2947 |
"setup a self removing catch-block" |
2948 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
2949 |
||
2950 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
448 | 2951 |
"if we do not have multiple processes or its a system process |
2952 |
we start another dispatch loop, which exits when |
|
2953 |
either continue, return or step is pressed |
|
2954 |
or (via the catchBlock) if an error occurs. |
|
2955 |
Since our display is an extra exclusive one, |
|
2956 |
all processing for normal views stops here ... |
|
2957 |
" |
|
266 | 2958 |
|
448 | 2959 |
WindowGroup setActiveGroup:windowGroup. |
2960 |
SignalSet anySignal handle:[:ex | |
|
2961 |
|signal| |
|
334 | 2962 |
|
448 | 2963 |
signal := ex signal. |
1016 | 2964 |
|
448 | 2965 |
self showError:'*** Error in modal debugger: |
266 | 2966 |
|
334 | 2967 |
>>>> Signal: ' , signal printString , ' |
266 | 2968 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 2969 |
>>>> From: ' , ex suspendedContext sender printString , ' |
2970 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
2971 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
2972 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
266 | 2973 |
>>>> Message: ' , ex errorString , ' |
2974 |
||
1187 | 2975 |
caught & ignored.'. |
448 | 2976 |
ex return. |
2977 |
] do:[ |
|
2978 |
Object userNotificationSignal handle:[:ex | |
|
2979 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
|
2980 |
ex proceed |
|
2981 |
]. |
|
2982 |
self showError:ex errorString |
|
2983 |
] do:[ |
|
530 | 2984 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
2985 |
haveControl]. |
|
448 | 2986 |
] |
2987 |
]. |
|
2988 |
WindowGroup setActiveGroup:nil. |
|
266 | 2989 |
] ifFalse:[ |
448 | 2990 |
"we do have multiple processes - |
2991 |
simply enter the DebugViews-Windowgroup event loop. |
|
2992 |
effectively suspending event processing for the currently |
|
2993 |
active group. |
|
2994 |
" |
|
2995 |
SignalSet anySignal handle:[:ex | |
|
2996 |
|answer signal| |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
2997 |
|
448 | 2998 |
signal := ex signal. |
266 | 2999 |
|
801
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3000 |
DebuggingDebugger ~~ true ifTrue:[ |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3001 |
"/ |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3002 |
"/ ignore recursive breakpoints |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3003 |
"/ |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3004 |
signal == MessageTracer breakpointSignal ifTrue:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3005 |
'DebugView [info]: breakpoint in debugger ignored' infoPrintCR. |
801
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3006 |
ex proceed |
448 | 3007 |
]. |
801
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3008 |
(signal == ActivityNotificationSignal) ifTrue:[ |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3009 |
ex proceed |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3010 |
]. |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3011 |
signal == Exception recursiveExceptionSignal ifTrue:[ |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3012 |
ex parameter signal == MessageTracer breakpointSignal ifTrue:[ |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3013 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
801
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3014 |
ex proceed. |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3015 |
]. |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3016 |
|
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3017 |
self showError:'*** Recursive error in debugger: |
266 | 3018 |
|
3019 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 3020 |
>>>> ' , ex parameter signal printString , ' |
266 | 3021 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 3022 |
>>>> From: ' , ex suspendedContext sender printString , ' |
3023 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
3024 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
3025 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
266 | 3026 |
>>>> Message: ' , ex errorString , ' |
3027 |
||
1187 | 3028 |
caught & ignored.'. |
801
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3029 |
ex return |
9aac5620fff5
allow halt in debugger, if DebuggingDebugger is true.
Claus Gittinger <cg@exept.de>
parents:
799
diff
changeset
|
3030 |
]. |
448 | 3031 |
]. |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
3032 |
|
448 | 3033 |
self topView raiseDeiconified. |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
3034 |
|
448 | 3035 |
answer := Dialog |
3036 |
choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs |
|
949 | 3037 |
labels:#( 'proceed' 'cancel' 'debug' ) |
3038 |
values:#( #proceed #cancel #debug ) |
|
448 | 3039 |
default:#cancel. |
3040 |
answer == #debug ifTrue:[ |
|
3041 |
Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString. |
|
3042 |
ex proceed. |
|
3043 |
]. |
|
3044 |
answer == #proceed ifTrue:[ |
|
3045 |
ex proceed. |
|
3046 |
]. |
|
3047 |
ex return. |
|
3048 |
] do:[ |
|
530 | 3049 |
windowGroup eventLoopWhile:[Processor activeProcess state:#debug. |
3050 |
true] onLeave:[] |
|
448 | 3051 |
]. |
266 | 3052 |
]. |
3053 |
catchBlock := nil. |
|
3054 |
||
3055 |
"Created: 24.11.1995 / 20:33:45 / cg" |
|
1016 | 3056 |
"Modified: 29.1.1997 / 20:39:11 / cg" |
266 | 3057 |
! ! |
3058 |
||
0 | 3059 |
!DebugView methodsFor:'user interaction'! |
3060 |
||
266 | 3061 |
codeAccept:someCode |
3062 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
3063 |
and including selected method cannot be continued." |
|
3064 |
||
3065 |
" |
|
3066 |
actually, this is not true, since the active methods will still be |
|
3067 |
executed correctly - however, the code shown in the debugger is no |
|
3068 |
longer in sync (showing the new code) with the executed code. |
|
3069 |
Therefore, we hide those contexts to avoid confusion .... |
|
3070 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
3071 |
||
3072 |
"walk up context chain and find highest context which is either the selected context, |
|
3073 |
or - if its a block-context - whose home is the selected context" |
|
3074 |
||
3075 |
|con top sel implementorClass method newMethod| |
|
3076 |
||
3077 |
codeView cursor:Cursor execute. |
|
3078 |
||
3079 |
" |
|
3080 |
find the method-home context for this one |
|
3081 |
" |
|
3082 |
con := selectedContext. |
|
3083 |
top := con. |
|
3084 |
[con notNil] whileTrue:[ |
|
1019
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3085 |
(con methodHome == selectedContext) ifTrue:[ |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3086 |
top := con |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3087 |
]. |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3088 |
con := con sender |
266 | 3089 |
]. |
3090 |
" |
|
3091 |
use class&selector to find the method for the compilation |
|
3092 |
and compile. |
|
3093 |
" |
|
3094 |
sel := selectedContext selector. |
|
3095 |
implementorClass := selectedContext methodClass. |
|
3096 |
method := implementorClass compiledMethodAt:sel. |
|
1019
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3097 |
|
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3098 |
"/ |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3099 |
"/ provide the classes nameSpace on a query; |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3100 |
"/ in case we accept while in another nameSpace context, |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3101 |
"/ (but for a class which is somewhere else) |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3102 |
"/ |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3103 |
Class nameSpaceQuerySignal |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3104 |
answer:(implementorClass nameSpace) |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3105 |
do:[ |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3106 |
newMethod := implementorClass compilerClass |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3107 |
compile:someCode |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3108 |
forClass:implementorClass |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3109 |
inCategory:(method category) |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3110 |
notifying:codeView. |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3111 |
]. |
266 | 3112 |
|
3113 |
inspecting ifFalse:[ |
|
1019
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3114 |
" |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3115 |
if it worked, remove everything up to and including top |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3116 |
from context chain |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3117 |
" |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3118 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3119 |
self setContext:(top sender). |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3120 |
|
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3121 |
" |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3122 |
continue/step is no longer possible |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3123 |
" |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3124 |
canContinue := false. |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3125 |
self showSelection:1. |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3126 |
exitAction := #return |
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3127 |
]. |
266 | 3128 |
]. |
3129 |
codeView cursor:Cursor normal |
|
1019
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3130 |
|
c997b2d576c5
when accepting, provide the classes nameSpace
Claus Gittinger <cg@exept.de>
parents:
1016
diff
changeset
|
3131 |
"Modified: 31.1.1997 / 15:02:33 / cg" |
266 | 3132 |
! |
3133 |
||
3134 |
destroy |
|
3135 |
"closing the debugger implies an abort or continue" |
|
3136 |
||
3137 |
contextView middleButtonMenu hide. |
|
3138 |
||
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3139 |
inspecting ifFalse:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3140 |
CachedExclusive == self ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3141 |
CachedExclusive := nil. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3142 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3143 |
CachedDebugger == self ifTrue:[ |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3144 |
CachedDebugger := nil |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3145 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3146 |
|
669
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3147 |
"/ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3148 |
"/ catch invalid return; |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3149 |
"/ this happens, when my process has somehow died (quickterminate) |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3150 |
"/ and I am a leftOver view, which gets terminated via the launchers |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3151 |
"/ #destroy-window function. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3152 |
"/ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3153 |
Context invalidReturnSignal handle:[:ex | |
934 | 3154 |
'DebugView [info]: OOPS - non regular debugView closing' infoPrintCR. |
669
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3155 |
DebugView newDebugger. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3156 |
ex return. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3157 |
] do:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3158 |
inspecting ifFalse:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3159 |
canAbort ifTrue:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3160 |
self doAbort. |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3161 |
] ifFalse:[ |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3162 |
self doContinue |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3163 |
] |
4ac860cdf673
care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents:
664
diff
changeset
|
3164 |
]. |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3165 |
]. |
934 | 3166 |
'DebugView [info]: OOPS - non regular debugView closing' infoPrintCR. |
430
45d1b89689a0
when destroyed (via Launchers menu) dont halt - output a debugMessage
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
3167 |
DebugView newDebugger. |
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3168 |
]. |
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3169 |
|
266 | 3170 |
" |
3171 |
we manually release all private data, since the Debugger |
|
3172 |
is cached for reuse - thus the memory would not be collectable |
|
3173 |
otherwise. |
|
3174 |
" |
|
3175 |
codeView acceptAction:nil. |
|
3176 |
codeView doItAction:nil. |
|
3177 |
codeView contents:nil. |
|
3178 |
catchBlock := nil. |
|
3179 |
||
3180 |
receiverInspector release. |
|
3181 |
contextInspector release. |
|
3182 |
inspectedProcess := nil. |
|
3183 |
exitAction := nil. |
|
3184 |
contextArray := nil. |
|
940 | 3185 |
selectedContext := actualContext := firstContext := nil. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3186 |
steppedContext := wrapperContext := nil. |
266 | 3187 |
grabber := nil. |
3188 |
self autoUpdateOff. |
|
3189 |
||
407
cf196c7cd2e6
oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
3190 |
super destroy "/ 1.12.94 |
266 | 3191 |
|
940 | 3192 |
"Modified: 11.1.1997 / 13:55:09 / cg" |
266 | 3193 |
! |
3194 |
||
0 | 3195 |
showSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
3196 |
"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
|
3197 |
Also sent to autoselect an interesting context on entry." |
0 | 3198 |
|
56 | 3199 |
|con homeContext sel method code canAccept |
105 | 3200 |
implementorClass lineNrInMethod rec m line |
193
8d0b4658249c
added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents:
189
diff
changeset
|
3201 |
sender selSender tryVars possibleBlocks errMsg |
945 | 3202 |
mthd cls codeSet| |
0 | 3203 |
|
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3204 |
MessageTracer breakpointSignal handle:[:ex | |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3205 |
'DebugView [info]: breakpoint in debugger ignored' infoPrintCR. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3206 |
ex proceed |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3207 |
] do:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3208 |
contextArray notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3209 |
lineNr <= contextArray size ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3210 |
con := contextArray at:lineNr. |
939 | 3211 |
]. |
563 | 3212 |
" |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3213 |
clicking on the '** ...'-line shows more ... |
563 | 3214 |
" |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3215 |
con isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3216 |
line := contextView list at:lineNr. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3217 |
(line startsWith:'**') ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3218 |
self showMore. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3219 |
contextView setSelection:lineNr. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3220 |
con := contextArray at:lineNr |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3221 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3222 |
con isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3223 |
codeView contents:nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3224 |
^ self |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3225 |
]. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3226 |
]. |
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
3227 |
|
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3228 |
self withWaitCursorDo:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3229 |
codeSet := false. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3230 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3231 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3232 |
give it to the (lower right) inspector |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3233 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3234 |
contextInspector inspect:con. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3235 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3236 |
con hasStackToShow ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3237 |
stackInspector isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3238 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3239 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3240 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3241 |
stackInspector := InspectorView |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3242 |
origin:(0.6 @ 0.0) corner:(1.0 @ 1.0) |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3243 |
in:contextInspector superView. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3244 |
stackInspector realize. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3245 |
stackInspector label:'stack'. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3246 |
stackInspector hideReceiver:true. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3247 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3248 |
stackInspector inspect:(con stackFrame asArray). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3249 |
stackInspector showLast. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3250 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3251 |
stackInspector notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3252 |
stackInspector destroy. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3253 |
stackInspector := nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3254 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3255 |
contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3256 |
] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3257 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3258 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3259 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3260 |
get the home context |
563 | 3261 |
" |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3262 |
con isBlockContext ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3263 |
homeContext := con methodHome |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3264 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3265 |
homeContext := con |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3266 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3267 |
con canReturn ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3268 |
returnButton enable. restartButton enable. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3269 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3270 |
returnButton disable. restartButton disable. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3271 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3272 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3273 |
lineNrInMethod := con lineNumber. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3274 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3275 |
canAccept := false. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3276 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3277 |
homeContext isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3278 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3279 |
mhmh - an optimized block |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3280 |
should get the block here, and get the method from |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3281 |
that one ... |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3282 |
But in 2.10.x, there is no easy way to get to the block |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3283 |
since that one is not in the context. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3284 |
Starting with 2.11, the new block calling scheme will fix this. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3285 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3286 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3287 |
"temporary kludge - peek into the sender context. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3288 |
If its a do-like method and there is a single block variable |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3289 |
in the args or temporaries, that must be the one. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3290 |
This helps in some cases. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3291 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3292 |
(sender := con sender) notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3293 |
tryVars := false. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3294 |
(selSender := sender selector) notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3295 |
(selSender endsWith:'do:') ifTrue:[ |
563 | 3296 |
tryVars := true. |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3297 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3298 |
(selSender endsWith:'Do:') ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3299 |
tryVars := true. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3300 |
] |
563 | 3301 |
] |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3302 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3303 |
tryVars ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3304 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3305 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3306 |
possibleBlocks size == 1 ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3307 |
method := possibleBlocks first method. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3308 |
]. |
563 | 3309 |
] |
3310 |
]. |
|
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3311 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3312 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3313 |
"fetch rec here - so we wont need context in doItAction" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3314 |
rec := homeContext receiver. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3315 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3316 |
sel := homeContext selector. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3317 |
sel notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3318 |
canAccept := true. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3319 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3320 |
implementorClass := homeContext methodClass. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3321 |
implementorClass isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3322 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3323 |
special: look if this context was created by |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3324 |
valueWithReceiver kind of method invocation; |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3325 |
if so, grab the method from the sender and show it |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3326 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3327 |
((sender := homeContext sender) notNil |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3328 |
and:[(sender selector startsWith:'valueWithReceiver:') |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3329 |
and:[sender receiver isMethod]]) ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3330 |
method := sender receiver. |
655
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
3331 |
self sensor shiftDown ifTrue:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
3332 |
code := method decompiledSource |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
3333 |
] ifFalse:[ |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
3334 |
code := method source. |
c9a1de4e627a
secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents:
654
diff
changeset
|
3335 |
]. |
563 | 3336 |
canAccept := false. |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3337 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3338 |
(method := con method) notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3339 |
self sensor shiftDown ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3340 |
code := method decompiledSource |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3341 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3342 |
code := method source. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3343 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3344 |
canAccept := false. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3345 |
] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3346 |
] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3347 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3348 |
method := implementorClass compiledMethodAt:sel. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3349 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3350 |
] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3351 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3352 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3353 |
code isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3354 |
errMsg := nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3355 |
method notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3356 |
self sensor shiftDown ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3357 |
code := method decompiledSource |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3358 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3359 |
code := method source. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3360 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3361 |
code isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3362 |
method sourceFilename notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3363 |
codeView contents:(resources |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3364 |
string:'** no sourcefile: %1 **' |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3365 |
with:method sourceFilename). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3366 |
codeView flash. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3367 |
codeSet := true. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3368 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3369 |
errMsg := '** no source **' |
563 | 3370 |
] |
3371 |
] |
|
3372 |
] ifFalse:[ |
|
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3373 |
homeContext isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3374 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
563 | 3375 |
] ifFalse:[ |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3376 |
errMsg := '** no method - no source **' |
563 | 3377 |
] |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3378 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3379 |
errMsg notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3380 |
self showError:errMsg. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3381 |
codeSet := true. |
563 | 3382 |
] |
3383 |
]. |
|
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3384 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3385 |
code isNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3386 |
canAccept := false. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3387 |
codeSet ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3388 |
codeView contents:nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3389 |
] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3390 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3391 |
codeView contents:code. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3392 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3393 |
(lineNrInMethod notNil and:[lineNrInMethod ~~ 0]) ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3394 |
"/ lineNrInMethod > codeView list size ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3395 |
"/ lineNrInMethod := codeView list size + 1 |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3396 |
"/ ]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3397 |
"/ codeView selectLine:lineNrInMethod. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3398 |
"/ codeView makeSelectionVisible |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3399 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3400 |
lineNrInMethod <= codeView list size ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3401 |
(lineNrInMethod == 255 |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3402 |
and:[method notNil |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3403 |
and:[method code isNil]]) ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3404 |
"/ means: do not really know in interpreted methods |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3405 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3406 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3407 |
codeView selectLine:lineNrInMethod. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3408 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3409 |
codeView makeSelectionVisible |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3410 |
] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3411 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3412 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3413 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3414 |
canAccept ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3415 |
codeView acceptEnabled:true. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3416 |
codeView acceptAction:[:code | self codeAccept:code asString] |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3417 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3418 |
codeView acceptEnabled:false. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3419 |
codeView acceptAction:[:code | self device beep]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3420 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3421 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3422 |
receiverInspector inspect:rec. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3423 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3424 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3425 |
the one below is wrong: currently, the |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3426 |
evaluator cannot handle passed contexts. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3427 |
Once it does, pass con as in:-arg |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3428 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3429 |
codeView doItAction:[:theCode | |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3430 |
rec class evaluatorClass |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3431 |
evaluate:theCode |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3432 |
in:nil "/ *** con |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3433 |
receiver:rec |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3434 |
notifying:codeView |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3435 |
logged:true |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3436 |
ifFail:nil |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3437 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3438 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3439 |
selectedContext := homeContext. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3440 |
actualContext := con |
563 | 3441 |
]. |
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3442 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3443 |
codeView contents:nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3444 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3445 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3446 |
con isContext ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3447 |
sendButton disable. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3448 |
] ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3449 |
sendButton enable. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3450 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3451 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3452 |
"clear out locals to prevent keeping around unneeded contexts |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3453 |
(due to the block held in codeView). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3454 |
(not really needed, since stuff gets collected away sooner or later ... |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3455 |
... but this makes it a bit sooner) |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3456 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3457 |
con := nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3458 |
homeContext := nil. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3459 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3460 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3461 |
enable/disable some menu items |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3462 |
" |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3463 |
m := contextView middleButtonMenu. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3464 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3465 |
m enableAll:#(implementors senders inspectContext skip skipForReturn). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3466 |
|
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3467 |
(method notNil and:[method isWrapped]) ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3468 |
m enable:#removeBreakpoint. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3469 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3470 |
m disable:#removeBreakpoint. |
563 | 3471 |
]. |
45 | 3472 |
|
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3473 |
mthd := selectedContext method. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3474 |
mthd notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3475 |
cls := mthd containingClass. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3476 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3477 |
m enable:#browseClass. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3478 |
cls notNil ifTrue:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3479 |
m enableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3480 |
] ifFalse:[ |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3481 |
m disableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol). |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3482 |
]. |
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3483 |
] |
0 | 3484 |
]. |
3485 |
||
1076
8c4e8ee0b863
ignore breakpoints while showing source
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
3486 |
"Modified: 17.3.1997 / 15:01:43 / cg" |
73 | 3487 |
! ! |
3488 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
3489 |
!DebugView class methodsFor:'documentation'! |
78 | 3490 |
|
266 | 3491 |
version |
1213 | 3492 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.160 1997-06-28 18:26:15 cg Exp $' |
0 | 3493 |
! ! |
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
3494 |
DebugView initialize! |