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