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