author | Claus Gittinger <cg@exept.de> |
Mon, 21 Sep 2009 22:48:23 +0200 | |
changeset 8745 | 8ce9f5d5bd52 |
parent 8656 | 6c92a022f929 |
child 8952 | 7742c63ff6f5 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
13 |
|
0 | 14 |
StandardSystemView subclass:#DebugView |
8215 | 15 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
16 |
receiverInspector contextInspector contextArray selectedContext |
|
17 |
catchBlock grabber mayProceed traceView tracing bigStep |
|
18 |
skipLineNr steppedContextAddress abortButton terminateButton |
|
19 |
continueButton stepButton nextButton nextOverButton nextOutButton |
|
20 |
sendButton returnButton restartButton exclusive inspecting |
|
21 |
nChainShown inspectedProcess updateProcess stopButton |
|
22 |
updateButton defineButton monitorToggle stepping |
|
23 |
steppedContextLineno stepForReturn actualContext inWrap |
|
24 |
stackInspector steppedContext wrapperContext verboseBacktrace |
|
25 |
firstContext stepHow cachable currentMethod ignoreBreakpoints |
|
26 |
stepUntilEntering lastStepUntilEntering |
|
27 |
lastSelectionInReceiverInspector lastSelectionInContextInspector |
|
28 |
canShowMore exitAbort reportButton setOfHiddenCallingSelectors |
|
8305 | 29 |
isStoppedAtHaltOrBreakPoint exceptionInfoLabel' |
8215 | 30 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
31 |
DebuggingDebugger DefaultDebuggerBackgroundColor |
|
32 |
InitialNChainShown IgnoredHalts' |
|
33 |
poolDictionaries:'' |
|
34 |
category:'Interface-Debugger' |
|
0 | 35 |
! |
36 |
||
8170 | 37 |
Object subclass:#IgnoredHalt |
8215 | 38 |
instanceVariableNames:'methodHolder method lineNumber ignoreEndTime ignoreCount' |
39 |
classVariableNames:'' |
|
40 |
poolDictionaries:'' |
|
41 |
privateIn:DebugView |
|
8170 | 42 |
! |
43 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
44 |
!DebugView class methodsFor:'documentation'! |
29 | 45 |
|
46 |
copyright |
|
47 |
" |
|
48 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
49 |
All Rights Reserved |
29 | 50 |
|
51 |
This software is furnished under a license and may be used |
|
52 |
only in accordance with the terms of that license and with the |
|
53 |
inclusion of the above copyright notice. This software may not |
|
54 |
be provided or otherwise made available to, or used by, any |
|
55 |
other person. No title to or ownership of the software is |
|
56 |
hereby transferred. |
|
57 |
" |
|
58 |
! |
|
0 | 59 |
|
29 | 60 |
documentation |
61 |
" |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
62 |
This class implements a graphical debugger interface. |
29 | 63 |
The debugger usually sits on top of the faulting process, |
2358 | 64 |
taking over its event processing. |
65 |
(this is different from other Smalltalk debuggers, which control |
|
66 |
the debuggee as a separate process. Consider this an historic |
|
67 |
leftover - the debugger was one of the first applications written for |
|
68 |
ST/X; however, why should we change it without a particular need ...). |
|
69 |
||
70 |
Only the 'stopped' debugged process is affected; |
|
29 | 71 |
other processes continue to respond to events. |
72 |
||
73 |
The one exception is when an error occurs within the dispatcher process |
|
74 |
or in one of the eventhandler processes - in this case, the debugger |
|
75 |
will sit on an exclusive display connection. |
|
76 |
||
77 |
The whole debugging will be changed, once the required process primitives |
|
78 |
are available, which allow control of another processes execution |
|
79 |
(i.e. single-step, restart & return). The setup will be changed then, |
|
80 |
to have the debugger control the debuggee (i.e. two processes) |
|
35 | 81 |
|
82 |
See additional information in 'doc/misc/debugger.doc'. |
|
53 | 83 |
|
84 |
Notice: the DebugView class caches the last used debugger in a class |
|
85 |
variable. It may happen, that a malfunctioning debugger (for example, |
|
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
86 |
a halfway destroyed one) is kept there. You will notice this, if a |
53 | 87 |
debugger comes up without showing any contents. In this case, close |
88 |
(or destroy) the broken debugView, and execute |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
89 |
Debugger newDebugger |
53 | 90 |
which removes the cached debugger and forces creation of a new one the |
91 |
next time. This is a temporary workaround - the debugger will be fixed to |
|
92 |
avoid this problem. |
|
508 | 93 |
|
94 |
[author:] |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
95 |
Claus Gittinger |
508 | 96 |
|
97 |
[see also:] |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
98 |
Exception Signal |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
99 |
Process |
29 | 100 |
" |
101 |
! ! |
|
0 | 102 |
|
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
103 |
!DebugView class methodsFor:'initialization'! |
243 | 104 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
105 |
initialize |
8148 | 106 |
InitialNChainShown := 20. |
107 |
"/ DefaultDebuggerBackgroundColor := nil. |
|
3387 | 108 |
"/ DefaultDebuggerBackgroundColor := Color red lightened. |
109 |
"/ DefaultDebuggerBackgroundColor := Color blue lightened lightened. |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
110 |
|
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
111 |
"Created: 20.3.1997 / 16:53:37 / cg" |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
112 |
"Modified: 20.3.1997 / 16:54:32 / cg" |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
113 |
! |
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
114 |
|
243 | 115 |
reinitialize |
7822 | 116 |
"reinitialize after an image-restart" |
117 |
||
243 | 118 |
self newDebugger |
119 |
! ! |
|
120 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
121 |
!DebugView class methodsFor:'instance creation'! |
0 | 122 |
|
2421 | 123 |
enter |
124 |
"enter a debugger" |
|
125 |
||
5455 | 126 |
<context: #return> |
127 |
||
8347 | 128 |
^ self |
129 |
enter:thisContext sender |
|
130 |
withMessage:'debugger entered' |
|
131 |
mayProceed:true. |
|
2421 | 132 |
! |
133 |
||
2355 | 134 |
enter:aContext withMessage:aString |
135 |
"enter a debugger" |
|
136 |
||
5455 | 137 |
<context: #return> |
138 |
||
2355 | 139 |
^ self |
140 |
enter:aContext |
|
141 |
withMessage:aString |
|
142 |
mayProceed:true |
|
143 |
! |
|
144 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
145 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 146 |
"enter a debugger; if this is a recursive invocation, enter |
147 |
a MiniDebugger instead. |
|
148 |
This is the standard way of entering the debugger; |
|
149 |
sent from error- and halt messages." |
|
0 | 150 |
|
3447 | 151 |
<context: #return> |
152 |
||
3702 | 153 |
|active| |
93 | 154 |
|
57 | 155 |
StepInterruptPending := nil. |
3998 | 156 |
ControlInterrupt handle:[:ex | |
4676
c809ebc38db9
more info on an ignored breakpoint
Claus Gittinger <cg@exept.de>
parents:
4644
diff
changeset
|
157 |
'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR. |
c809ebc38db9
more info on an ignored breakpoint
Claus Gittinger <cg@exept.de>
parents:
4644
diff
changeset
|
158 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
3998 | 159 |
ex proceed |
160 |
] do:[ |
|
161 |
" |
|
162 |
well, it could be a stepping or sending debugger up there; |
|
163 |
in this case, return to it. This happens, when a stepping process |
|
164 |
runs into an error (for example, a halt). In this case, we want the |
|
165 |
stepping debugger to come up again instead of a new one. |
|
166 |
" |
|
167 |
OpenDebuggers notNil ifTrue:[ |
|
168 |
active := Processor activeProcess. |
|
169 |
OpenDebuggers do:[:aDebugger | |
|
8537 | 170 |
(aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[ |
171 |
(aDebugger inspectedProcess == active) ifTrue:[ |
|
172 |
aDebugger device isOpen ifTrue:[ |
|
173 |
"/ 'entering stepping debugger again' printNL. |
|
174 |
aDebugger unstep. |
|
175 |
aDebugger setLabelFor:aString in:active. |
|
176 |
aDebugger mayProceed:mayProceed. |
|
177 |
^ aDebugger enter:aContext select:nil. |
|
178 |
] |
|
2426 | 179 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
180 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
181 |
] |
3998 | 182 |
]. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
183 |
]. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
184 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
526 | 185 |
|
3447 | 186 |
"Modified: / 18.11.2001 / 00:48:03 / cg" |
53 | 187 |
! |
188 |
||
8347 | 189 |
enterException:ex |
190 |
"enter a debugger; if this is a recursive invocation, enter |
|
191 |
a MiniDebugger instead. |
|
192 |
This is the standard way of entering the debugger; |
|
193 |
sent from error- and halt messages." |
|
194 |
||
195 |
^ self |
|
196 |
enter:ex returnableSuspendedContext |
|
197 |
withMessage:ex descriptionForDebugger |
|
198 |
mayProceed:(ex mayProceed). |
|
199 |
! |
|
200 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
201 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 202 |
"enter a debugger - do not check for recursive invocation" |
203 |
||
5455 | 204 |
<context: #return> |
205 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
206 |
|aDebugger| |
266 | 207 |
|
208 |
StepInterruptPending := nil. |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
209 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
210 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
211 |
"/ to avoid recursive debugging ... |
3447 | 212 |
ControlInterrupt handle:[:ex | |
213 |
'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR. |
|
4676
c809ebc38db9
more info on an ignored breakpoint
Claus Gittinger <cg@exept.de>
parents:
4644
diff
changeset
|
214 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
215 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
216 |
] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
217 |
aDebugger := self new. |
3447 | 218 |
]. |
219 |
||
220 |
aDebugger isNil ifTrue:[ |
|
221 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
|
222 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
223 |
mayProceed ifTrue:[ |
|
224 |
(Dialog confirm:'Error/Breakpoint cought.\\Press Continue or Abort.' withCRs |
|
225 |
yesLabel:'Continue' noLabel:'Abort') |
|
226 |
ifTrue:[ |
|
227 |
^ nil |
|
228 |
]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
229 |
] ifFalse:[ |
3447 | 230 |
self information:'Error cought.\\Press OK to abort the operation.' withCRs. |
231 |
]. |
|
232 |
AbortOperationRequest raise. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
233 |
"not reached" |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
234 |
]. |
3447 | 235 |
|
236 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
237 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 238 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
239 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
240 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
241 |
" |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
242 |
nil halt |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
243 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
244 |
|
3447 | 245 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 246 |
! |
247 |
||
6430 | 248 |
enterWithMessage:message |
249 |
"enter a debugger" |
|
250 |
||
251 |
<context: #return> |
|
252 |
||
8347 | 253 |
^ self |
254 |
enter:(thisContext sender) |
|
255 |
withMessage:message |
|
256 |
mayProceed:true. |
|
6430 | 257 |
! |
258 |
||
266 | 259 |
new |
2358 | 260 |
"return a new DebugView. |
261 |
- return a cached debugger if it already exists. |
|
262 |
Also, care for remote displays on which no debugger is wanted |
|
263 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
264 |
||
265 |
|debugger currentScreen debuggerDevice| |
|
266 |
||
267 |
currentScreen := Screen current. |
|
14 | 268 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
269 |
currentScreen notNil ifTrue:[ |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
270 |
(currentScreen suppressDebugger) ifTrue:[ |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
271 |
"/ no debuggers with that device - show an alertBox which aborts... |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
272 |
^ nil. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
273 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
274 |
(currentScreen mayOpenDebugger) ifFalse:[ |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
275 |
"/ no debugger on that device - but on the main screen |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
276 |
currentScreen := Screen default. |
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
277 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
278 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
279 |
|
266 | 280 |
" |
281 |
need a blocking debugger if no processes or |
|
282 |
or if its a timing/interrupt process |
|
283 |
(because otherwise we would not get any events here ... |
|
284 |
" |
|
285 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
286 |
((debugger := CachedExclusive) isNil |
2426 | 287 |
or:[debugger device ~~ currentScreen |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
288 |
or:[currentScreen isNil |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
289 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
290 |
debugger := self newExclusive |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
291 |
]. |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
292 |
CachedExclusive := nil. |
266 | 293 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
294 |
CachedDebugger notNil ifTrue:[ |
2358 | 295 |
(CachedDebugger device ~~ currentScreen |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
296 |
or:[currentScreen isNil |
7981
658dac13ed05
cache only my real instances (not sub-instances)
Claus Gittinger <cg@exept.de>
parents:
7971
diff
changeset
|
297 |
or:[currentScreen isOpen not |
658dac13ed05
cache only my real instances (not sub-instances)
Claus Gittinger <cg@exept.de>
parents:
7971
diff
changeset
|
298 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
299 |
CachedDebugger := nil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
300 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
301 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
302 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
303 |
(debugger := CachedDebugger) notNil ifTrue:[ |
2358 | 304 |
CachedDebugger := nil. |
305 |
] ifFalse:[ |
|
306 |
debuggerDevice := currentScreen. |
|
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
307 |
debuggerDevice isNil ifTrue:[ |
2352 | 308 |
"/ use the default display |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
309 |
debuggerDevice := Screen default. |
2358 | 310 |
]. |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
311 |
(debuggerDevice isNil |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
312 |
or:[debuggerDevice isOpen not |
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
313 |
"/ or:[debuggerDevice mayOpenDebugger not] |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
314 |
]) ifTrue:[ |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
315 |
"/ no debugger |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
316 |
^ nil. |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
317 |
]. |
2358 | 318 |
|
319 |
Screen currentScreenQuerySignal answer:debuggerDevice |
|
320 |
do:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
321 |
debugger := super new. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
322 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
323 |
debugger label:'Debugger'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
324 |
debugger icon:self defaultIcon. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
325 |
] |
266 | 326 |
]. |
73 | 327 |
^ debugger |
875 | 328 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
329 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 330 |
! |
0 | 331 |
|
266 | 332 |
newExclusive |
333 |
"return a debugger for exclusive display access" |
|
334 |
||
335 |
|debugger| |
|
105 | 336 |
|
266 | 337 |
debugger := super new. |
338 |
debugger label:'Debugger'. |
|
875 | 339 |
debugger icon:self defaultIcon. |
266 | 340 |
debugger exclusive:true. |
341 |
^ debugger |
|
875 | 342 |
|
343 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 344 |
! |
345 |
||
29 | 346 |
openOn:aProcess |
347 |
"start a debugger on aProcess |
|
348 |
(actually not more than a good-looking inspector)" |
|
15 | 349 |
|
52 | 350 |
|aDebugger label nm| |
15 | 351 |
|
352 |
aDebugger := super new. |
|
875 | 353 |
aDebugger icon:self defaultIcon. |
29 | 354 |
aProcess notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
355 |
nm := aProcess name. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
356 |
nm notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
357 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
358 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
359 |
nm := aProcess id printString |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
360 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
361 |
label := 'Debugger [' , nm , ']'. |
29 | 362 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
363 |
label := 'no process' |
29 | 364 |
]. |
1114 | 365 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 366 |
aDebugger openOn:aProcess. |
367 |
^ nil |
|
875 | 368 |
|
1114 | 369 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 370 |
! ! |
371 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
372 |
!DebugView class methodsFor:'cleanup'! |
485 | 373 |
|
374 |
lowSpaceCleanup |
|
375 |
"in low memory situations, give up cached debuggers" |
|
376 |
||
377 |
CachedDebugger := nil. |
|
378 |
CachedExclusive := nil. |
|
379 |
OpenDebuggers := nil. |
|
380 |
||
381 |
" |
|
382 |
DebugView lowSpaceCleanup |
|
383 |
" |
|
384 |
||
385 |
"Modified: 18.4.1996 / 16:48:03 / cg" |
|
386 |
! |
|
387 |
||
388 |
newDebugger |
|
2358 | 389 |
"force creation of a new debugger (give up cached debuggers)" |
485 | 390 |
|
391 |
CachedDebugger := nil. |
|
392 |
CachedExclusive := nil. |
|
393 |
OpenDebuggers := nil. |
|
394 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
395 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
4356 | 396 |
Debugger := self |
397 |
]. |
|
398 |
||
485 | 399 |
" |
400 |
DebugView newDebugger |
|
401 |
" |
|
402 |
! ! |
|
403 |
||
875 | 404 |
!DebugView class methodsFor:'defaults'! |
405 |
||
406 |
defaultIcon |
|
7632
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
407 |
"return the browsers default window icon" |
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
408 |
|
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
409 |
<resource: #programImage> |
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
410 |
|
7647 | 411 |
^ ToolbarIconLibrary debug22x22Icon |
412 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
|
413 |
||
414 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
415 |
! |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
416 |
|
8194 | 417 |
defaultIconForAboutBox |
418 |
<resource: #programImage> |
|
419 |
||
420 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
|
421 |
! |
|
422 |
||
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
423 |
defaultVerboseBacktrace |
8148 | 424 |
<resource: #obsolete> |
425 |
self obsoleteMethodWarning. |
|
426 |
^ UserPreferences current verboseBacktraceInDebugger |
|
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
427 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
428 |
"Created: 11.1.1997 / 12:14:35 / cg" |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
429 |
! |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
430 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
431 |
defaultVerboseBacktrace:aBoolean |
8148 | 432 |
<resource: #obsolete> |
433 |
self obsoleteMethodWarning. |
|
434 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
3441 | 435 |
! |
436 |
||
437 |
updateStyleCache |
|
6136 | 438 |
"extract values from the styleSheet and cache them in class variables" |
439 |
||
440 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
441 |
||
3441 | 442 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
443 |
||
444 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
875 | 445 |
! ! |
446 |
||
8179 | 447 |
!DebugView class methodsFor:'ignoring halts'! |
448 |
||
449 |
hasIgnoredHalts |
|
450 |
^ IgnoredHalts notEmptyOrNil |
|
451 |
! |
|
452 |
||
453 |
stopIgnoringHalts |
|
454 |
IgnoredHalts := nil |
|
455 |
! ! |
|
456 |
||
3269 | 457 |
!DebugView class methodsFor:'menu specs'! |
458 |
||
459 |
menuSpec |
|
460 |
"This resource specification was automatically generated |
|
461 |
by the MenuEditor of ST/X." |
|
462 |
||
463 |
"Do not manually edit this!! If it is corrupted, |
|
464 |
the MenuEditor may not be able to read the specification." |
|
465 |
||
466 |
" |
|
467 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
468 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
469 |
" |
|
470 |
||
471 |
<resource: #menu> |
|
472 |
||
473 |
^ |
|
5875 | 474 |
#(Menu |
475 |
( |
|
476 |
(MenuItem |
|
8626 | 477 |
label: 'File' |
478 |
translateLabel: true |
|
479 |
submenu: |
|
480 |
(Menu |
|
481 |
( |
|
482 |
(MenuItem |
|
8656 | 483 |
label: 'Report a Bug via eMail...' |
8626 | 484 |
itemValue: doOpenReportMailApp |
485 |
translateLabel: true |
|
486 |
) |
|
487 |
(MenuItem |
|
488 |
label: '-' |
|
489 |
) |
|
490 |
(MenuItem |
|
491 |
label: 'Exit' |
|
492 |
itemValue: closeRequest |
|
493 |
translateLabel: true |
|
494 |
isVisible: isInspecting |
|
495 |
) |
|
496 |
(MenuItem |
|
497 |
label: 'Close Debugger and Abort' |
|
498 |
itemValue: closeRequest |
|
499 |
translateLabel: true |
|
500 |
isVisible: isNotInspecting |
|
501 |
) |
|
502 |
) |
|
503 |
nil |
|
504 |
nil |
|
505 |
) |
|
506 |
) |
|
507 |
||
508 |
(MenuItem |
|
5875 | 509 |
label: 'View' |
510 |
translateLabel: true |
|
511 |
submenu: |
|
512 |
(Menu |
|
513 |
( |
|
514 |
(MenuItem |
|
515 |
enabled: canShowMore |
|
8142 | 516 |
label: 'Show More WalkBack' |
5875 | 517 |
itemValue: showMore |
518 |
translateLabel: true |
|
5110 | 519 |
) |
5875 | 520 |
(MenuItem |
8142 | 521 |
label: 'Show Verbose WalkBack' |
5875 | 522 |
itemValue: toggleVerboseWalkback |
523 |
translateLabel: true |
|
524 |
isVisible: showingDenseWalkback |
|
5110 | 525 |
) |
5875 | 526 |
(MenuItem |
8142 | 527 |
label: 'Show Dense WalkBack' |
5875 | 528 |
itemValue: toggleVerboseWalkback |
529 |
translateLabel: true |
|
530 |
isVisible: showingVerboseWalkback |
|
5110 | 531 |
) |
5875 | 532 |
(MenuItem |
533 |
label: '-' |
|
5110 | 534 |
) |
5875 | 535 |
(MenuItem |
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
536 |
label: 'Raise Debugger when Entering' |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
537 |
itemValue: autoRaiseView: |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
538 |
translateLabel: true |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
539 |
indication: autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
540 |
) |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
541 |
(MenuItem |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
542 |
label: '-' |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
543 |
) |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
544 |
(MenuItem |
8626 | 545 |
label: 'Settings...' |
546 |
itemValue: openSettingsDialog |
|
5875 | 547 |
translateLabel: true |
5110 | 548 |
) |
549 |
) |
|
550 |
nil |
|
551 |
nil |
|
552 |
) |
|
553 |
) |
|
5875 | 554 |
(MenuItem |
555 |
label: 'Process' |
|
556 |
translateLabel: true |
|
557 |
submenu: |
|
558 |
(Menu |
|
559 |
( |
|
560 |
(MenuItem |
|
561 |
label: 'Continue' |
|
562 |
itemValue: doContinue |
|
563 |
translateLabel: true |
|
3269 | 564 |
) |
5875 | 565 |
(MenuItem |
566 |
label: '-' |
|
3269 | 567 |
) |
5875 | 568 |
(MenuItem |
569 |
label: 'Abort' |
|
570 |
itemValue: doAbort |
|
571 |
translateLabel: true |
|
3269 | 572 |
) |
5875 | 573 |
(MenuItem |
6487 | 574 |
enabled: abortAllIsHandled |
575 |
label: 'Abort All' |
|
576 |
itemValue: doAbortAll |
|
577 |
translateLabel: true |
|
578 |
) |
|
579 |
(MenuItem |
|
5875 | 580 |
label: '-' |
3269 | 581 |
) |
5875 | 582 |
(MenuItem |
583 |
label: 'Terminate' |
|
584 |
itemValue: doTerminate |
|
585 |
translateLabel: true |
|
3269 | 586 |
) |
587 |
) |
|
588 |
nil |
|
589 |
nil |
|
590 |
) |
|
591 |
) |
|
5875 | 592 |
(MenuItem |
593 |
label: 'Context' |
|
594 |
translateLabel: true |
|
595 |
submenu: |
|
596 |
(Menu |
|
597 |
( |
|
598 |
(MenuItem |
|
599 |
enabled: canReturn |
|
600 |
label: 'Return' |
|
601 |
itemValue: doReturn |
|
602 |
translateLabel: true |
|
603 |
) |
|
604 |
(MenuItem |
|
605 |
enabled: canRestart |
|
606 |
label: 'Restart' |
|
607 |
itemValue: doRestart |
|
608 |
translateLabel: true |
|
3447 | 609 |
) |
5875 | 610 |
(MenuItem |
611 |
label: '-' |
|
3447 | 612 |
) |
5875 | 613 |
(MenuItem |
614 |
enabled: hasContextSelected |
|
615 |
label: 'Inspect' |
|
616 |
itemValue: inspectContext |
|
617 |
translateLabel: true |
|
3447 | 618 |
) |
5875 | 619 |
(MenuItem |
620 |
label: 'Copy WalkBack Text' |
|
621 |
itemValue: copyWalkbackText |
|
622 |
translateLabel: true |
|
3447 | 623 |
) |
5875 | 624 |
(MenuItem |
625 |
label: 'Bookmark Method in SystemBrowser' |
|
626 |
itemValue: addBrowserBookmark |
|
627 |
translateLabel: true |
|
3447 | 628 |
) |
629 |
) |
|
630 |
nil |
|
631 |
nil |
|
632 |
) |
|
633 |
) |
|
5875 | 634 |
(MenuItem |
635 |
label: 'Class' |
|
636 |
translateLabel: true |
|
637 |
submenu: |
|
638 |
(Menu |
|
639 |
( |
|
640 |
(MenuItem |
|
641 |
enabled: canBrowseImplementingClass |
|
642 |
label: 'Browse Implementing Class' |
|
643 |
itemValue: browseImplementingClass |
|
644 |
translateLabel: true |
|
3269 | 645 |
) |
5875 | 646 |
(MenuItem |
647 |
enabled: canBrowseReceiversClass |
|
648 |
label: 'Browse Receivers Class' |
|
649 |
itemValue: browseReceiversClass |
|
650 |
translateLabel: true |
|
3269 | 651 |
) |
5875 | 652 |
(MenuItem |
653 |
label: '-' |
|
3269 | 654 |
) |
5875 | 655 |
(MenuItem |
656 |
enabled: canBrowseClassHierarchy |
|
657 |
label: 'Browse Receivers Class Hierarchy' |
|
658 |
itemValue: browseClassHierarchy |
|
659 |
translateLabel: true |
|
3269 | 660 |
) |
5875 | 661 |
(MenuItem |
662 |
enabled: canBrowseFullClassProtocol |
|
663 |
label: 'Browse Receivers Full Protocol' |
|
664 |
itemValue: browseFullClassProtocol |
|
665 |
translateLabel: true |
|
3269 | 666 |
) |
667 |
) |
|
668 |
nil |
|
669 |
nil |
|
670 |
) |
|
671 |
) |
|
5875 | 672 |
(MenuItem |
673 |
label: 'Selector' |
|
674 |
translateLabel: true |
|
675 |
submenu: |
|
676 |
(Menu |
|
677 |
( |
|
678 |
(MenuItem |
|
679 |
label: 'Browse Implementors...' |
|
680 |
itemValue: browseImplementorsOf |
|
681 |
translateLabel: true |
|
3269 | 682 |
) |
5875 | 683 |
(MenuItem |
684 |
label: 'Browse Senders...' |
|
685 |
itemValue: browseSendersOf |
|
686 |
translateLabel: true |
|
3269 | 687 |
) |
5875 | 688 |
(MenuItem |
689 |
label: '-' |
|
3269 | 690 |
) |
5875 | 691 |
(MenuItem |
692 |
enabled: canDefineMethod |
|
8142 | 693 |
label: 'Define Missing Method' |
5875 | 694 |
itemValue: doDefineMethod |
695 |
translateLabel: true |
|
3269 | 696 |
) |
697 |
) |
|
698 |
nil |
|
699 |
nil |
|
700 |
) |
|
701 |
) |
|
5875 | 702 |
(MenuItem |
703 |
label: 'Breakpoint' |
|
704 |
translateLabel: true |
|
705 |
submenu: |
|
706 |
(Menu |
|
707 |
( |
|
708 |
(MenuItem |
|
709 |
enabled: canRemoveBreakpoint |
|
8142 | 710 |
label: 'Remove Breakpoint' |
5875 | 711 |
itemValue: removeBreakpoint |
712 |
translateLabel: true |
|
3269 | 713 |
) |
5875 | 714 |
(MenuItem |
715 |
label: 'Remove all Breakpoints' |
|
716 |
itemValue: removeAllBreakpoints |
|
717 |
translateLabel: true |
|
3511 | 718 |
) |
5875 | 719 |
(MenuItem |
720 |
label: '-' |
|
3511 | 721 |
) |
5875 | 722 |
(MenuItem |
723 |
enabled: canAddBreakpoint |
|
8142 | 724 |
label: 'Add Breakpoint' |
5875 | 725 |
itemValue: addBreakpoint |
726 |
translateLabel: true |
|
3269 | 727 |
) |
5875 | 728 |
(MenuItem |
729 |
label: '-' |
|
3269 | 730 |
) |
5875 | 731 |
(MenuItem |
8179 | 732 |
label: 'Ignore this Halt/BreakPoint' |
8170 | 733 |
translateLabel: true |
734 |
submenu: |
|
735 |
(Menu |
|
736 |
( |
|
737 |
(MenuItem |
|
8171 | 738 |
enabled: isStoppedAtHaltOrBreakPoint |
8179 | 739 |
label: 'Forever (Until Ignoring is Stopped)' |
740 |
itemValue: ignoreHaltForever |
|
8170 | 741 |
translateLabel: true |
742 |
) |
|
743 |
(MenuItem |
|
8171 | 744 |
enabled: isStoppedAtHaltOrBreakPoint |
8170 | 745 |
label: 'For the Next N Times...' |
746 |
itemValue: openIgnoreHaltNTimesDialog |
|
747 |
translateLabel: true |
|
748 |
) |
|
8171 | 749 |
(MenuItem |
8179 | 750 |
enabled: isStoppedAtHaltOrBreakPoint |
751 |
label: 'For Some Time...' |
|
752 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
8171 | 753 |
translateLabel: true |
754 |
) |
|
8170 | 755 |
) |
756 |
nil |
|
757 |
nil |
|
758 |
) |
|
759 |
) |
|
8179 | 760 |
(MenuItem |
761 |
enabled: hasHaltsToIgnore |
|
762 |
label: 'Stop Ignoring' |
|
763 |
itemValue: stopIgnoringHalts |
|
764 |
translateLabel: true |
|
765 |
) |
|
766 |
(MenuItem |
|
767 |
label: '-' |
|
768 |
) |
|
769 |
(MenuItem |
|
770 |
label: 'Allow Breakpoints in Debugger' |
|
771 |
itemValue: allowBreakPointsInDebugger: |
|
772 |
translateLabel: true |
|
773 |
indication: allowBreakPointsInDebugger |
|
774 |
) |
|
3269 | 775 |
) |
776 |
nil |
|
777 |
nil |
|
778 |
) |
|
779 |
) |
|
5875 | 780 |
(MenuItem |
781 |
label: 'Help' |
|
782 |
translateLabel: true |
|
783 |
startGroup: right |
|
784 |
submenu: |
|
785 |
(Menu |
|
786 |
( |
|
787 |
(MenuItem |
|
788 |
label: 'Debuggers Documentation' |
|
789 |
itemValue: openHTMLDocument: |
|
790 |
translateLabel: true |
|
8194 | 791 |
argument: 'tools/debugger/TOP.html' |
3269 | 792 |
) |
5875 | 793 |
(MenuItem |
794 |
label: '-' |
|
3269 | 795 |
) |
5875 | 796 |
(MenuItem |
797 |
label: 'About DebugView...' |
|
798 |
itemValue: openAboutThisApplication |
|
799 |
translateLabel: true |
|
3269 | 800 |
) |
801 |
) |
|
802 |
nil |
|
803 |
nil |
|
804 |
) |
|
805 |
) |
|
806 |
) |
|
807 |
nil |
|
808 |
nil |
|
809 |
) |
|
810 |
! ! |
|
811 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
812 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
813 |
|
4121 | 814 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
815 |
"return an interesting context to be shown in an error notifier. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
816 |
We move up the calling chain, skipping intermediate Signal |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
817 |
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
|
818 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
819 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
820 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
821 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
822 |
|
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
823 |
someContexts := Array new:25. |
2042 | 824 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
825 |
idx := 1. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
826 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
827 |
someContexts at:idx put:con. |
2042 | 828 |
con := con sender. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
829 |
idx := idx + 1. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
830 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
831 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
832 |
^ someContexts at:idx. |
3447 | 833 |
! |
834 |
||
835 |
interestingContextIndexIn:aContextArray |
|
836 |
"return an interesting contexts offset, or nil. |
|
837 |
This is the context initially shown in the walkback. |
|
838 |
We move up the calling chain, skipping all intermediate Signal |
|
839 |
and Exception contexts, to present the context in which the error |
|
840 |
actually occured. |
|
841 |
Just for your convenience :-)" |
|
842 |
||
8152 | 843 |
|con found offset sel prev ex rcvr nMax idx| |
3447 | 844 |
|
7713 | 845 |
"/ Transcript showCR:aContextArray. |
7648 | 846 |
|
3447 | 847 |
nMax := aContextArray size. |
848 |
nMax <= 1 ifTrue:[^ 1]. |
|
849 |
con := aContextArray at:1. |
|
850 |
con isBlockContext ifTrue:[^ 1]. |
|
851 |
||
852 |
"/ somewhere, at the bottom, there must be a raise ... |
|
853 |
"/ find the exception |
|
854 |
||
855 |
1 to:5 do:[:i | |
|
856 |
con := aContextArray at:i ifAbsent:nil. |
|
857 |
con notNil ifTrue:[ |
|
858 |
sel := con selector. |
|
7823 | 859 |
(sel startsWith:'raise') ifTrue:[ |
3447 | 860 |
rcvr := con receiver. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
861 |
(rcvr isLazyValue not and:[rcvr isException]) ifTrue:[ |
3447 | 862 |
ex := rcvr. |
863 |
offset := i. |
|
864 |
found := con |
|
865 |
] ifFalse:[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
866 |
(rcvr isLazyValue not and:[rcvr isExceptionCreator]) ifTrue:[ |
3447 | 867 |
offset := i. |
868 |
found := con |
|
869 |
] |
|
870 |
] |
|
871 |
]. |
|
872 |
]. |
|
873 |
]. |
|
874 |
||
875 |
" |
|
876 |
if this is a noHandler exception, skip forward |
|
877 |
to the erronous context |
|
878 |
" |
|
879 |
ex notNil ifTrue:[ |
|
880 |
ex signal == Signal noHandlerSignal ifTrue:[ |
|
881 |
found := ex suspendedContext |
|
882 |
] |
|
883 |
]. |
|
884 |
||
885 |
found isNil ifTrue:[ |
|
886 |
"/ this is a kludge, but convenient. |
|
6579 | 887 |
"/ show the place where the error (divisionByZero...) happend, |
3447 | 888 |
"/ not where the signal was raised. |
7823 | 889 |
con := (aContextArray at:1). |
890 |
sel := con methodHome selector. |
|
3447 | 891 |
|
892 |
"/ typically a DivisionByZero - show caller of division |
|
893 |
(sel == #// |
|
894 |
or:[sel == #/ |
|
895 |
or:[sel == #\\]]) ifTrue:[ |
|
896 |
^ 2 |
|
897 |
]. |
|
898 |
||
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
899 |
"/ show the place of the bad message; not where the Signal was raised... |
3447 | 900 |
(sel == #doesNotUnderstand:) ifTrue:[ |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
901 |
idx := 3. |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
902 |
nMax > 2 ifTrue:[ |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
903 |
sel := (aContextArray at:idx) selector. |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
904 |
sel == #doesNotUnderstand: ifTrue:[ |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
905 |
idx := 4 |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
906 |
]. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
907 |
nMax > idx ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
908 |
sel := (aContextArray at:idx) selector. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
909 |
"/ show the place of the perfor-send; not where the Signal was raised... |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
910 |
((sel == #perform:) |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
911 |
or:[sel startsWith:'perform:with']) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
912 |
idx := idx + 1 |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
913 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
914 |
] |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
915 |
]. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
916 |
^ idx min:nMax |
3447 | 917 |
]. |
918 |
||
919 |
"/ show the bad method; not where the Signal was raised... |
|
920 |
(sel == #noByteCode) ifTrue:[ |
|
921 |
^ 2 |
|
922 |
]. |
|
923 |
||
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
924 |
"/ "/ show the place of the halt; not where the HaltSignal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
925 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
926 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
927 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
928 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
929 |
"/ "/ show the place of the shouldImplement; not where the Signal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
930 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
931 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
932 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
933 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
934 |
"/ "/ show the place of error-call; not where the ErrorSignal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
935 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
936 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
937 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
938 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
939 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
940 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
941 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
942 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
943 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
944 |
"/ ]. |
7862 | 945 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
946 |
"/ show the place of signalInterrupt-call; not where the Signal was raised... |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
947 |
(sel == #signalInterrupt:) ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
948 |
^ 2 |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
949 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
950 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
951 |
"/ "/ show the place of error-call; not where the ErrorSignal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
952 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
953 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
954 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
955 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
956 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
957 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
958 |
"/ "/ show the place of the send; not where the Signal was raised... |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
959 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
960 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
961 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
962 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
963 |
"/ show the place of the bad index; not where the Signal was raised... |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
964 |
( #(#notIndexed |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
965 |
#indexNotIntegerOrOutOfBounds: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
966 |
#subscriptBoundsError: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
967 |
#elementBoundsError: |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
968 |
"/ #subclassResponsibility |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
969 |
) includes:sel) ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
970 |
idx := 2. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
971 |
[ idx <= 3 |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
972 |
and:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
973 |
sel := (aContextArray at:idx) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
974 |
#(#notIndexed |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
975 |
#indexNotIntegerOrOutOfBounds: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
976 |
#subscriptBoundsError: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
977 |
#elementBoundsError: ) includes:sel |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
978 |
] |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
979 |
] whileTrue:[ idx := idx + 1 ]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
980 |
sel := (aContextArray at:idx) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
981 |
(nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
982 |
ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
983 |
sel := (aContextArray at:idx+1) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
984 |
(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
985 |
ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
986 |
sel := (aContextArray at:idx+2) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
987 |
(nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel]) |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
988 |
ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
989 |
^ idx+3 |
3447 | 990 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
991 |
^ idx+2 |
3447 | 992 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
993 |
^ idx+1 |
3447 | 994 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
995 |
^ idx |
3447 | 996 |
]. |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
997 |
offset := 1. |
8152 | 998 |
]. |
999 |
||
1000 |
"/ the above is all too hard-coded; |
|
1001 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
1002 |
"/ as more methods get flagged, remove code from above. |
|
1003 |
con := aContextArray at:offset ifAbsent:nil. |
|
1004 |
||
1005 |
[ |
|
1006 |
con notNil |
|
1007 |
and:[ con methodHome notNil |
|
1008 |
and:[ con methodHome method notNil |
|
1009 |
and:[ con methodHome method shouldBeSkippedInDebuggersWalkBack ]]] |
|
1010 |
] whileTrue:[ |
|
1011 |
"/ Transcript showCR:con methodHome method. |
|
1012 |
offset := offset + 1. |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
1013 |
con := aContextArray at:offset ifAbsent:nil. |
8152 | 1014 |
]. |
3447 | 1015 |
|
1016 |
" |
|
1017 |
got it; move up, skipping all intermediate Signal and |
|
1018 |
Exception contexts |
|
1019 |
" |
|
1020 |
prev := nil. |
|
1021 |
rcvr := con receiver. |
|
1022 |
[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
1023 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 1024 |
] whileTrue:[ |
1025 |
prev := con. |
|
1026 |
nMax > offset ifFalse:[^ offset]. |
|
1027 |
||
1028 |
offset := offset + 1. |
|
1029 |
con := aContextArray at:offset. |
|
1030 |
rcvr := con receiver. |
|
1031 |
]. |
|
1032 |
||
1033 |
" |
|
1034 |
now, we are one above the raising context |
|
1035 |
" |
|
1036 |
||
1037 |
" |
|
1038 |
if the sender-method of the raise is one of objects error methods ... |
|
1039 |
" |
|
1040 |
( #( halt halt: |
|
1041 |
error error: |
|
1042 |
doesNotUnderstand: |
|
1043 |
subclassResponsibility |
|
1044 |
primitiveFailed) includes:con selector) |
|
1045 |
ifTrue:[ |
|
1046 |
con selector == #doesNotUnderstand: ifTrue:[ |
|
1047 |
" |
|
1048 |
one more up, to get to the originating context |
|
1049 |
" |
|
1050 |
con := aContextArray at:(offset + 1). |
|
1051 |
con isNil ifTrue:[^ offset]. |
|
1052 |
offset := offset + 1. |
|
1053 |
]. |
|
1054 |
con := aContextArray at:(offset + 1). |
|
1055 |
con isNil ifTrue:[^ offset]. |
|
1056 |
offset := offset + 1. |
|
1057 |
] ifFalse:[ |
|
1058 |
" |
|
1059 |
ok, got the raise - if its a BreakPoint, look for the sender |
|
1060 |
" |
|
8154 | 1061 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
3447 | 1062 |
offset := offset + 1 |
1063 |
]. |
|
1064 |
]. |
|
1065 |
||
1066 |
^ offset |
|
1067 |
||
7713 | 1068 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
7862 | 1069 |
"Modified: / 15-10-2007 / 16:50:27 / cg" |
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1070 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1071 |
|
73 | 1072 |
!DebugView methodsFor:'basic'! |
1073 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1074 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1075 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1076 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1077 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1078 |
m notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1079 |
self updateMenuItems. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1080 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1081 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1082 |
abortButton enable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1083 |
m enable:#doAbort. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1084 |
] ifFalse:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1085 |
abortButton disable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1086 |
m disable:#doAbort. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1087 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1088 |
exclusive ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1089 |
terminateButton disable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1090 |
m disable:#doTerminate. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1091 |
] ifFalse:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1092 |
terminateButton enable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1093 |
m enable:#doTerminate. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1094 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1095 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1096 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1097 |
mayProceed == false ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1098 |
continueButton disable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1099 |
m notNil ifTrue:[m disable:#doContinue]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1100 |
] ifFalse:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1101 |
continueButton enable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1102 |
m notNil ifTrue:[m enable:#doContinue] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1103 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1104 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1105 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1106 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1107 |
|
1364 | 1108 |
enter:aContext select:initialSelectionOrNil |
73 | 1109 |
"enter the debugger - get and display the context, then start an |
1110 |
exclusive event loop on top of eveything else" |
|
1111 |
||
3447 | 1112 |
<context: #return> |
1113 |
||
8170 | 1114 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext haltingMethod lineNrInHaltingMethod |
1115 |
c| |
|
3447 | 1116 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1117 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1118 |
'==> enter: (' print. aContext print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1119 |
') select: ' print. initialSelectionOrNil printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1120 |
]. |
3447 | 1121 |
thisContext isRecursive ifTrue:[ |
1122 |
"/ care for the special case, were the Debugger was autoloaded. |
|
1123 |
"/ in this case, thisContext IS recursive, but thats no error |
|
1124 |
"/ condition. |
|
1125 |
foundNoByteCodeContext := false. |
|
6730 | 1126 |
foundExitContext := false. |
1127 |
||
1128 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1129 |
[ |
|
1130 |
foundNoByteCodeContext not |
|
1131 |
and:[ foundExitContext not |
|
3447 | 1132 |
and:[c notNil |
6730 | 1133 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
1134 |
]]]] |
|
1135 |
whileTrue:[ |
|
1136 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
1137 |
foundExitContext := true |
|
1138 |
]. |
|
3447 | 1139 |
c selector == #noByteCode ifTrue:[ |
1140 |
foundNoByteCodeContext := true |
|
1141 |
]. |
|
6730 | 1142 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
3447 | 1143 |
]. |
1144 |
||
6730 | 1145 |
(foundNoByteCodeContext not |
1146 |
and:[ foundExitContext not]) ifFalse:[ |
|
3447 | 1147 |
('DebugView [warning]: reentered') errorPrintCR. |
1148 |
||
1149 |
^ MiniDebugger |
|
1150 |
enter:aContext |
|
1151 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
1152 |
mayProceed:mayProceed. |
|
6730 | 1153 |
]. |
1154 |
foundExitContext ifTrue:[ |
|
1155 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
1156 |
^ self. |
|
1157 |
]. |
|
3447 | 1158 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1159 |
|
2591
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1160 |
"/'entering: ' print. aContext printCR. |
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1161 |
"/'initial: ' print. initialSelectionOrNil printCR. |
8170 | 1162 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1163 |
||
1164 |
"/ should a halt be ignored ? |
|
1165 |
IgnoredHalts notNil ifTrue:[ |
|
1166 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
8179 | 1167 |
c isNil ifTrue:[ |
1168 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
1169 |
]. |
|
8170 | 1170 |
c notNil ifTrue:[ |
1171 |
c := c sender. |
|
1172 |
haltingMethod := c method. |
|
1173 |
lineNrInHaltingMethod := c lineNumber. |
|
8180 | 1174 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
8170 | 1175 |
IgnoredHalts do:[:ign | |
1176 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) ifTrue:[ |
|
8181 | 1177 |
Transcript showCR:'Debugger: ignored halt in ', haltingMethod whoString. |
8170 | 1178 |
ign decrementIgnoreCount. |
1179 |
ign isHaltIgnored ifFalse:[ |
|
8181 | 1180 |
Transcript showCR:'Debugger: no longer ignore halt in ', haltingMethod whoString. |
8170 | 1181 |
IgnoredHalts remove:ign ifAbsent:[]. |
1182 |
]. |
|
1183 |
^ self. |
|
1184 |
]. |
|
1185 |
]. |
|
1186 |
IgnoredHalts do:[:ign | |
|
8171 | 1187 |
(ign method isNil |
1188 |
or:[ ign isForMethod:haltingMethod line:lineNrInHaltingMethod ]) ifTrue:[ |
|
8170 | 1189 |
IgnoredHalts remove:ign ifAbsent:[]. |
1190 |
]. |
|
1191 |
]. |
|
1192 |
] |
|
1193 |
]. |
|
1194 |
||
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1195 |
iAmNew := drawableId isNil. |
73 | 1196 |
|
8148 | 1197 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1198 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
1199 |
busy := cachable := true. |
73 | 1200 |
inspecting := false. |
1201 |
inspectedProcess := Processor activeProcess. |
|
1202 |
stepping := false. |
|
1203 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1204 |
stepHow := nil. |
8148 | 1205 |
nChainShown := InitialNChainShown. |
73 | 1206 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1207 |
"/ if debugger is entered while a box has grabbed the |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1208 |
"/ pointer, we must ungrab - otherwise X wont talk to us here. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1209 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1210 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1211 |
"/ Q: this is good for multi-screen apps (where an error should not happen), |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1212 |
"/ but not for multi-user development, where the debugger is entered often. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1213 |
"/ What is a good solution to this dilemma ? |
1279
84ec8d33eba8
ungrab all screens in case of an error
Claus Gittinger <cg@exept.de>
parents:
1274
diff
changeset
|
1214 |
Screen allScreens do:[:aScreen | |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1215 |
aScreen ungrabPointer. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1216 |
aScreen ungrabKeyboard. |
73 | 1217 |
]. |
1218 |
||
1004
cb182425a977
oops - dont disable terminateButton
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
1219 |
("inspectedProcess suspendedContext isNil |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1220 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
1004
cb182425a977
oops - dont disable terminateButton
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
1221 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1222 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1223 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1224 |
terminateButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1225 |
abortButton enable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1226 |
]. |
73 | 1227 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1228 |
iAmNew ifFalse:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1229 |
"/ not the first time - disable buttons & menus |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1230 |
"/ from the previous life |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1231 |
self turnOffAllButtons. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1232 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1233 |
m := contextView middleButtonMenu. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1234 |
m notNil ifTrue:[ |
5195
5a2d612e1adb
oops - skip was always disabled
Claus Gittinger <cg@exept.de>
parents:
5170
diff
changeset
|
1235 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1236 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1237 |
verboseBacktrace |
3447 | 1238 |
ifTrue:[self showVerboseWalkback] |
1239 |
ifFalse:[self showDenseWalkback]. |
|
132 | 1240 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1241 |
self iconLabel:'Debugger'. |
132 | 1242 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1243 |
windowGroup isNil ifTrue:[ |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1244 |
self windowGroup: WindowGroup new. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1245 |
windowGroup addTopView:self. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1246 |
]. |
132 | 1247 |
exclusive ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1248 |
"/ create a (modal) windowGroup for myself |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1249 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1250 |
windowGroup setModal:true. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1251 |
] ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1252 |
"/ create a windowGroup with a synchronous sensor for me |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1253 |
|
3769 | 1254 |
windowGroup beSynchronous. |
73 | 1255 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1256 |
windowGroup setProcess:Processor activeProcess. |
73 | 1257 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1258 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 1259 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1260 |
self setContext:aContext releaseInspectors:(exitAction ~~ #step). |
2591
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1261 |
"/'after setContext; first is ' print. |
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1262 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1263 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
73 | 1264 |
|
1265 |
m := contextView middleButtonMenu. |
|
1266 |
m notNil ifTrue:[ |
|
3269 | 1267 |
self updateMenuItems. |
1268 |
||
5821
a5ef70570c6c
Check for AbortOperationRequest in suspendedContext.
Stefan Vogel <sv@exept.de>
parents:
5798
diff
changeset
|
1269 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1270 |
abortButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1271 |
m enable:#doAbort. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1272 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1273 |
abortButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1274 |
m disable:#doAbort. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1275 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1276 |
exclusive ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1277 |
terminateButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1278 |
m disable:#doTerminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1279 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1280 |
terminateButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1281 |
m enable:#doTerminate. |
3447 | 1282 |
]. |
1283 |
iAmNew ifFalse:[ |
|
5195
5a2d612e1adb
oops - skip was always disabled
Claus Gittinger <cg@exept.de>
parents:
5170
diff
changeset
|
1284 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
3447 | 1285 |
]. |
73 | 1286 |
]. |
1287 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1288 |
mayProceed == false ifTrue:[ |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1289 |
continueButton disable. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1290 |
m notNil ifTrue:[m disable:#doContinue]. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1291 |
] ifFalse:[ |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1292 |
continueButton enable. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1293 |
m notNil ifTrue:[m enable:#doContinue] |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1294 |
]. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1295 |
|
73 | 1296 |
" |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1297 |
If this is a new debugger, do a realize. |
528
a5ba1a3d0b45
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
527
diff
changeset
|
1298 |
Otherwise, its probably better to do a map, which shows the |
73 | 1299 |
view at the previous position, without a need for the user to set the |
1300 |
position again |
|
1301 |
" |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1302 |
iAmNew ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1303 |
self remap. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1304 |
] ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1305 |
self realize. |
73 | 1306 |
]. |
8193
9a4febdd8202
Raise debugger to the very top when entering
Stefan Vogel <sv@exept.de>
parents:
8181
diff
changeset
|
1307 |
self setForegroundWindow. |
73 | 1308 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1309 |
exclusive ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1310 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1311 |
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
|
1312 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1313 |
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
|
1314 |
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
|
1315 |
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
|
1316 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1317 |
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
|
1318 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1319 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1320 |
self autoRaiseView ifTrue:[ |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1321 |
"/ self raise. |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1322 |
self raiseDeiconified. |
7971 | 1323 |
self topView |
1324 |
activate; setForegroundWindow; activate. |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1325 |
]. |
1486
6ae442626f20
wait until visible before starting to draw
Claus Gittinger <cg@exept.de>
parents:
1484
diff
changeset
|
1326 |
|
73 | 1327 |
canContinue := true. |
1328 |
exitAction := nil. |
|
1329 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1330 |
"/ enter private event handling loop. This is left (and we come back here again) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1331 |
"/ when any button was pressed which requires continuation of the debuggee or |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1332 |
"/ closedown of the debugger. |
3701
ef73aac8e8d5
Use #ifCurtailed: instead of #valueOnUnwindDo:
Stefan Vogel <sv@exept.de>
parents:
3694
diff
changeset
|
1333 |
[self controlLoop] ifCurtailed:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1334 |
windowGroup notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1335 |
windowGroup setProcess:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1336 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1337 |
self destroy |
132 | 1338 |
]. |
73 | 1339 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1340 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1341 |
"/ This is required to avoid keeping references to the debuggees objects |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1342 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 1343 |
contextView contents:nil. |
1344 |
||
73 | 1345 |
codeView acceptAction:nil. |
942 | 1346 |
codeView doItAction:nil. |
73 | 1347 |
|
4892 | 1348 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
1349 |
ObjectMemory stepInterruptHandler:nil. |
|
1350 |
]. |
|
1351 |
||
3447 | 1352 |
"/ not stepping - close window |
73 | 1353 |
(exitAction ~~ #step) ifTrue:[ |
3165
03d3c485e67d
remember selected entry in inspectors;
Claus Gittinger <cg@exept.de>
parents:
3140
diff
changeset
|
1354 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
03d3c485e67d
remember selected entry in inspectors;
Claus Gittinger <cg@exept.de>
parents:
3140
diff
changeset
|
1355 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1356 |
receiverInspector release. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1357 |
contextInspector release. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1358 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1359 |
self unmap. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1360 |
device flush. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1361 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1362 |
(exitAction == #abort) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1363 |
self exit_abort. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1364 |
]. |
6487 | 1365 |
(exitAction == #abortAll) ifTrue:[ |
1366 |
self exit_abortAll. |
|
1367 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1368 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1369 |
(exitAction == #return) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1370 |
self exit_return. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1371 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1372 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1373 |
(exitAction == #restart) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1374 |
self exit_restart. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1375 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1376 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1377 |
(exitAction == #quickTerminate) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1378 |
self exit_quickTerminate. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1379 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1380 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1381 |
(exitAction == #terminate) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1382 |
self exit_terminate. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1383 |
] |
73 | 1384 |
]. |
1385 |
||
3447 | 1386 |
"/ stepping - window stays open |
1387 |
||
940 | 1388 |
selectedContext := actualContext := firstContext := nil. |
73 | 1389 |
|
2472 | 1390 |
"/ restore the previous pointer grab |
73 | 1391 |
grabber notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1392 |
device grabPointerInView:grabber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1393 |
grabber := nil. |
61 | 1394 |
]. |
73 | 1395 |
|
1396 |
(exitAction == #step) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1397 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1398 |
schedule another stepInterrupt |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1399 |
- must enter myself into the collection of open debuggers, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1400 |
in case the stepping process comes back again via a halt or signal |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1401 |
before the step is finished. In this case, the stepping debugger should |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1402 |
come up (instead of a new one) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1403 |
- must flush caches since optimized methods not always |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1404 |
look for pending interrupts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1405 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1406 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1407 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1408 |
"/ also must care for stepping into a return |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1409 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1410 |
steppedContext notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1411 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1412 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1413 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1414 |
OpenDebuggers isNil ifTrue:[ |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1415 |
OpenDebuggers := WeakIdentitySet new. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1416 |
]. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1417 |
OpenDebuggers add:self. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1418 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1419 |
self label:'single stepping - please wait ...'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1420 |
stepping := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1421 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1422 |
ObjectMemory stepInterruptHandler:self. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
1423 |
Processor activeProcess stepInterruptHandler:self. |
2963 | 1424 |
ObjectMemory flushCaches. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
1425 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1426 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1427 |
"bigStep" steppedContextLineno notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1428 |
Context singleStepInterruptRequest raiseWith:#next |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1429 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1430 |
Context singleStepInterruptRequest raiseWith:#step |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1431 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1432 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1433 |
"/ see if we came here through an interrupt-action |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1434 |
"/ (i.e. aProcess interruptWith:...) |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1435 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1436 |
enteredByInterrupt := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1437 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1438 |
[enteredByInterrupt not |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1439 |
and:[con notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1440 |
and:[con ~~ aContext]]] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1441 |
((sel := con selector) == #timerInterrupt |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1442 |
or:[sel == #ioInterrupt]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1443 |
enteredByInterrupt := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1444 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1445 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1446 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1447 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1448 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1449 |
ObjectMemory flushInlineCaches. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1450 |
|
1456 | 1451 |
DebuggingDebugger == true ifTrue:[ |
1452 |
enteredByInterrupt printCR. |
|
1453 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1454 |
enteredByInterrupt ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1455 |
"/ dont want to step through all intermediate |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1456 |
"/ (scheduler-) contexts; place a return-trap on the |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1457 |
"/ one right below the interesting one |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1458 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1459 |
"/ 'special unwind return' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1460 |
con unwindThenDo:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
1461 |
Processor activeProcess stepInterruptHandler:self. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1462 |
ObjectMemory stepInterruptHandler:self. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1463 |
InStepInterrupt := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1464 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1465 |
InterruptPending := 1]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1466 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1467 |
"/ 'normal step return' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1468 |
skipLineNr ~~ #return ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1469 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1470 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1471 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1472 |
"/ 'step for return' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1473 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1474 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1475 |
InStepInterrupt := nil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1476 |
] |
73 | 1477 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1478 |
OpenDebuggers notNil ifTrue:[ |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1479 |
OpenDebuggers remove:self ifAbsent:[]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1480 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1481 |
self cacheMyself. |
73 | 1482 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1483 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1484 |
"Modified: / 17-04-1997 / 13:01:32 / stefan" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1485 |
"Created: / 30-10-1997 / 21:08:18 / cg" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1486 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
7830 | 1487 |
"Modified: / 28-07-2007 / 12:12:03 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1488 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1489 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1490 |
exit_abort |
5455 | 1491 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
1492 |
"/ that one would run on top of this context. |
|
1493 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1494 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1495 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
1496 |
"/ done in the #enter:select method. |
|
1497 |
"/ You are not expected to understand this. |
|
1498 |
||
6487 | 1499 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
1500 |
! |
|
1501 |
||
1502 |
exit_abortAll |
|
1503 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1504 |
"/ that one would run on top of this context. |
|
1505 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1506 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1507 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
1508 |
"/ done in the #enter:select method. |
|
1509 |
"/ You are not expected to understand this. |
|
1510 |
||
1511 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1512 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1513 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1514 |
exit_quickTerminate |
3447 | 1515 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1516 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1517 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1518 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 1519 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1520 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1521 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1522 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1523 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1524 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1525 |
selectedContext notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1526 |
con := selectedContext. |
3447 | 1527 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1528 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1529 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1530 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1531 |
Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1532 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
4816 | 1533 |
ex description infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1534 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1535 |
] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1536 |
con unwindAndRestart. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1537 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1538 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1539 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1540 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1541 |
"Created: / 16.11.2001 / 17:23:17 / cg" |
3447 | 1542 |
"Modified: / 17.11.2001 / 23:37:09 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1543 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1544 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1545 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1546 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1547 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1548 |
selectedContext notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1549 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1550 |
if there is a selection in the codeView, |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1551 |
evaluate it and use the result as return value |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1552 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1553 |
"/ disabled for now, there is almost always a selection (the current line) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1554 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1555 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1556 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1557 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1558 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1559 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1560 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1561 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1562 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1563 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1564 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1565 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1566 |
"/ retVal := codeView doItAction value:s. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1567 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1568 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1569 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1570 |
con := selectedContext. |
3447 | 1571 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1572 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1573 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1574 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1575 |
Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1576 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
4816 | 1577 |
ex description infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1578 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1579 |
] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1580 |
con unwind:retVal. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1581 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1582 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1583 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1584 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1585 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 1586 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1587 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1588 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1589 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1590 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1591 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1592 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1593 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1594 |
Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1595 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
4816 | 1596 |
ex description infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1597 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1598 |
] do:[ |
3447 | 1599 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1600 |
Processor activeProcess terminate. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1601 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1602 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1603 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1604 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 1605 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
1606 |
! |
|
1607 |
||
6487 | 1608 |
exit_unwindThenDo:aBlock |
1609 |
|con| |
|
1610 |
||
1611 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1612 |
"/ that one would run on top of this context. |
|
1613 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1614 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1615 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
1616 |
"/ done in the #enter:select method. |
|
1617 |
"/ You are not expected to understand this. |
|
1618 |
||
1619 |
" |
|
1620 |
have to catch errors occuring in unwind-blocks |
|
1621 |
" |
|
1622 |
self cacheMyself. |
|
1623 |
||
1624 |
Error handle:[:ex | |
|
1625 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1626 |
ex description infoPrintCR. |
|
1627 |
||
1628 |
ex proceed |
|
1629 |
] do:[ |
|
1630 |
"/ find the enter:select context. |
|
1631 |
con := thisContext sender. |
|
1632 |
[ |
|
1633 |
(con selector == #enter:select:) |
|
1634 |
and:[con receiver == self] |
|
1635 |
] |
|
1636 |
whileFalse:[ con := con sender ]. |
|
1637 |
||
1638 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
1639 |
con sender receiver == self class ifTrue:[ |
|
1640 |
con := con sender. |
|
1641 |
con sender receiver == self class ifTrue:[ |
|
1642 |
con := con sender. |
|
1643 |
con isBlockContext ifTrue:[ |
|
1644 |
con := con methodHome. |
|
1645 |
] |
|
1646 |
]. |
|
1647 |
]. |
|
1648 |
||
1649 |
con unwindThenDo:aBlock. |
|
1650 |
]. |
|
1651 |
'DebugView [warning]: abort failed' errorPrintCR |
|
1652 |
||
1653 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
1654 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
1655 |
! |
|
1656 |
||
3447 | 1657 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
1658 |
|selection con1 con2 h| |
|
1659 |
||
1660 |
initialSelectionOrNil notNil ifTrue:[ |
|
1661 |
^ initialSelectionOrNil |
|
1662 |
]. |
|
1663 |
||
1664 |
" |
|
1665 |
and find the one context to show initially |
|
1666 |
- if we came here by a send (single step), its the top context; |
|
1667 |
- if we came here by a step (i.e. bigStep), its the top context |
|
1668 |
(for ifs and whiles) or the sender (for regular sends). |
|
1669 |
- otherwise, we came here by some signal raise, and we are interested |
|
1670 |
in the context where the raise actually occured. |
|
1671 |
" |
|
1672 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
1673 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
1674 |
||
1675 |
exitAction == #step ifTrue:[ |
|
1676 |
selection := 1. |
|
1677 |
steppedContext notNil ifTrue:[ |
|
1678 |
||
1679 |
" |
|
1680 |
if we came here by a big-step, show the method where we are |
|
1681 |
" |
|
1682 |
con1 == steppedContext ifTrue:[ |
|
1683 |
selection := 1 |
|
1684 |
] ifFalse:[ |
|
1685 |
con2 == steppedContext ifTrue:[ |
|
1686 |
selection := 2 |
|
1687 |
] |
|
1688 |
]. |
|
1689 |
" |
|
1690 |
for bigStep, we could also be in a block below the actual method ... |
|
1691 |
" |
|
1692 |
((h := con1 home) notNil |
|
1693 |
and:[h == steppedContext]) ifTrue:[ |
|
1694 |
selection := 1 |
|
1695 |
] ifFalse:[ |
|
1696 |
(con2 notNil |
|
1697 |
and:[(h := con2 home) notNil |
|
1698 |
and:[h == steppedContext]]) ifTrue:[ |
|
1699 |
selection := 2 |
|
1700 |
] |
|
1701 |
]. |
|
1702 |
h := nil. |
|
1703 |
] |
|
1704 |
] ifFalse:[ |
|
1705 |
steppedContext isNil ifTrue:[ |
|
1706 |
" |
|
1707 |
preselect a more interesting context, (where halt/raise was ...) |
|
1708 |
" |
|
1709 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
1710 |
selection := self class interestingContextIndexIn:contextArray. |
|
1711 |
selection := selection min:(contextArray size). |
|
1712 |
] ifFalse:[ |
|
1713 |
" |
|
1714 |
if we came here by a big-step, show the method where we are |
|
1715 |
" |
|
1716 |
con1 == steppedContext ifTrue:[ |
|
1717 |
selection := 1 |
|
1718 |
] ifFalse:[ |
|
1719 |
con2 == steppedContext ifTrue:[ |
|
1720 |
selection := 2. |
|
1721 |
] |
|
1722 |
] |
|
1723 |
] |
|
1724 |
]. |
|
1725 |
^ selection |
|
1726 |
||
1727 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
1728 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 1729 |
! |
1730 |
||
5110 | 1731 |
isInspecting |
1732 |
^ inspecting |
|
1733 |
! |
|
1734 |
||
1735 |
isNotInspecting |
|
1736 |
^ inspecting not |
|
1737 |
! |
|
1738 |
||
73 | 1739 |
openOn:aProcess |
1740 |
"enter the debugger on a process - |
|
1741 |
in this case, we are just inspecting the context chain of the process, |
|
1742 |
not running on top of the debugged process, but as a separate |
|
1743 |
one. (think of it as an inspector showing more detail, and offering |
|
1744 |
some more control operations)" |
|
1745 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1746 |
|bpanel dummy w| |
73 | 1747 |
|
8148 | 1748 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1749 |
|
73 | 1750 |
busy := true. |
1751 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1752 |
stepHow := nil. |
73 | 1753 |
inspecting := true. |
1754 |
inspectedProcess := aProcess. |
|
8148 | 1755 |
nChainShown := InitialNChainShown. |
73 | 1756 |
|
1757 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1758 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1759 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1760 |
"/ get the max size & freeze button |
6647 | 1761 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1762 |
w := continueButton preferredWidth. |
6647 | 1763 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1764 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1765 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1766 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1767 |
aProcess state == #run ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1768 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1769 |
continueButton foregroundColor:Color red darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1770 |
]. |
6647 | 1771 |
continueButton label:(resources string:'Stop'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1772 |
continueButton action:[self doStop]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1773 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1774 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1775 |
continueButton foregroundColor:Color green darkened darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1776 |
]. |
6647 | 1777 |
continueButton label:(resources string:'Continue'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1778 |
continueButton action:[self doContinue]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1779 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1780 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 1781 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1782 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1783 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1784 |
|
92 | 1785 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 1786 |
dummy borderWidth:0; level:0. |
61 | 1787 |
|
73 | 1788 |
"/ stepButton destroy. |
1789 |
"/ sendButton destroy. |
|
1790 |
||
1791 |
updateButton := Button |
|
6647 | 1792 |
label:(resources string:'Update') |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1793 |
action:[self updateContext] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1794 |
in:bpanel. |
73 | 1795 |
monitorToggle := Toggle in:bpanel. |
6647 | 1796 |
monitorToggle label:(resources string:'Monitor'). |
73 | 1797 |
monitorToggle pressAction:[self autoUpdateOn]. |
1798 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
1799 |
||
1800 |
"can only look into process - context chain is not active" |
|
1801 |
canContinue := true. |
|
1802 |
||
1803 |
terminateButton enable. |
|
1804 |
abortButton enable. |
|
1805 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1806 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1807 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1808 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1809 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1810 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 1811 |
|
1812 |
aProcess isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1813 |
terminateButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1814 |
abortButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1815 |
continueButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1816 |
returnButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1817 |
restartButton disable. |
73 | 1818 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1819 |
(aProcess suspendedContext isNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1820 |
or:[aProcess isSystemProcess]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1821 |
terminateButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1822 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1823 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1824 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1825 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1826 |
catchBlock := [ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1827 |
catchBlock := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1828 |
contextArray := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1829 |
selectedContext := actualContext := firstContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1830 |
steppedContext := wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1831 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1832 |
(exitAction == #terminate) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1833 |
aProcess terminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1834 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1835 |
(exitAction == #quickTerminate) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1836 |
aProcess terminateNoSignal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1837 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1838 |
super destroy |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1839 |
]. |
73 | 1840 |
]. |
1841 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1842 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1843 |
"Modified: 20.3.1997 / 16:53:56 / cg" |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1844 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1845 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1846 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1847 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 1848 |
|selection| |
1849 |
||
1850 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1851 |
selection notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1852 |
self showSelection:selection. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1853 |
contextView setSelection:selection. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1854 |
selection > 1 ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1855 |
contextView scrollToLine:(selection - 1) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1856 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1857 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1858 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1859 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 1860 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1861 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1862 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1863 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1864 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1865 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1866 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1867 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1868 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1869 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1870 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1871 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1872 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1873 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 1874 |
! ! |
1875 |
||
1876 |
!DebugView methodsFor:'help'! |
|
1877 |
||
8212 | 1878 |
flyByHelpDependsOnPositionIn:aView |
1879 |
"subclasses where the help-text depends upon the pointer position might |
|
1880 |
want to redefine this" |
|
1881 |
||
1882 |
^ aView == codeView |
|
1883 |
! |
|
1884 |
||
3510 | 1885 |
flyByHelpTextFor:aComponent |
1886 |
|s| |
|
1887 |
||
1888 |
aComponent == abortButton ifTrue:[ |
|
1889 |
s := 'Abort (Unwind to EventLoop)' |
|
1890 |
]. |
|
1891 |
aComponent == terminateButton ifTrue:[ |
|
1892 |
s := 'Terminate Process (Close View)' |
|
1893 |
]. |
|
1894 |
aComponent == continueButton ifTrue:[ |
|
6647 | 1895 |
continueButton label = (resources string:'Stop') ifTrue:[ |
3510 | 1896 |
s := 'Stop' |
1897 |
] ifFalse:[ |
|
1898 |
s := 'Continue Execution' |
|
1899 |
] |
|
1900 |
]. |
|
1901 |
aComponent == stepButton ifTrue:[ |
|
1902 |
s := 'Step to Next Send' |
|
1903 |
]. |
|
1904 |
aComponent == nextButton ifTrue:[ |
|
1905 |
s := 'Step to Next Line' |
|
1906 |
]. |
|
1907 |
aComponent == nextOverButton ifTrue:[ |
|
1908 |
s := 'Step Over' |
|
1909 |
]. |
|
1910 |
aComponent == nextOutButton ifTrue:[ |
|
1911 |
s := 'Step Out' |
|
1912 |
]. |
|
1913 |
aComponent == sendButton ifTrue:[ |
|
1914 |
s := 'Send Next Message' |
|
1915 |
]. |
|
1916 |
aComponent == returnButton ifTrue:[ |
|
1917 |
s := 'Return from selected Method' |
|
1918 |
]. |
|
1919 |
aComponent == restartButton ifTrue:[ |
|
1920 |
s := 'Restart selected Method' |
|
1921 |
]. |
|
1922 |
aComponent == monitorToggle ifTrue:[ |
|
1923 |
s := 'Toggle Monitoring' |
|
1924 |
]. |
|
1925 |
aComponent == updateButton ifTrue:[ |
|
1926 |
s := 'Update' |
|
1927 |
]. |
|
8656 | 1928 |
aComponent == reportButton ifTrue:[ |
1929 |
s := 'Send a Defect Report via eMail' |
|
1930 |
]. |
|
3510 | 1931 |
s notNil ifTrue:[ |
1932 |
^ resources string:s |
|
1933 |
]. |
|
1934 |
^ nil |
|
1935 |
||
1936 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1937 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
|
1938 |
! |
|
1939 |
||
8212 | 1940 |
flyByHelpTextFor:aComponent at:aPointOrNil |
8396 | 1941 |
|s vline line col pos interval| |
8212 | 1942 |
|
1943 |
aComponent == codeView ifFalse:[^ nil]. |
|
1944 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
1945 |
||
8396 | 1946 |
vline := codeView visibleLineOfY:aPointOrNil y. |
1947 |
col := codeView colOfX:aPointOrNil x inVisibleLine:vline. |
|
1948 |
line := codeView visibleLineToAbsoluteLine:vline. |
|
8212 | 1949 |
|
1950 |
pos := codeView characterPositionOfLine:line col:col. |
|
1951 |
interval := pos to:pos. |
|
1952 |
||
1953 |
self |
|
1954 |
withNodeValueAtInterval:interval |
|
8214 | 1955 |
do:[:value :description | |
8592 | 1956 |
|valueClassString valueString| |
1957 |
||
1958 |
valueClassString := value class name. |
|
8222 | 1959 |
value isString ifTrue:[ |
8410 | 1960 |
value isText ifTrue:[ |
1961 |
valueString := '"',(value contractTo:80),'"'. |
|
1962 |
] ifFalse:[ |
|
1963 |
valueString := value storeString contractTo:80. |
|
1964 |
] |
|
8222 | 1965 |
] ifFalse:[ |
8225
ff017ea74571
care for errors when showing the flyBy printString of a value
Claus Gittinger <cg@exept.de>
parents:
8222
diff
changeset
|
1966 |
Error handle:[:ex | |
ff017ea74571
care for errors when showing the flyBy printString of a value
Claus Gittinger <cg@exept.de>
parents:
8222
diff
changeset
|
1967 |
valueString := '??? (',ex description,')' |
ff017ea74571
care for errors when showing the flyBy printString of a value
Claus Gittinger <cg@exept.de>
parents:
8222
diff
changeset
|
1968 |
] do:[ |
8525
a035ad0cc67b
flyByHelp fix (slow printString generation)
Claus Gittinger <cg@exept.de>
parents:
8519
diff
changeset
|
1969 |
[ |
a035ad0cc67b
flyByHelp fix (slow printString generation)
Claus Gittinger <cg@exept.de>
parents:
8519
diff
changeset
|
1970 |
valueString := value printString contractTo:80. |
a035ad0cc67b
flyByHelp fix (slow printString generation)
Claus Gittinger <cg@exept.de>
parents:
8519
diff
changeset
|
1971 |
] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30. |
8225
ff017ea74571
care for errors when showing the flyBy printString of a value
Claus Gittinger <cg@exept.de>
parents:
8222
diff
changeset
|
1972 |
] |
8222 | 1973 |
]. |
8214 | 1974 |
description isEmptyOrNil ifTrue:[ |
8592 | 1975 |
s := valueString , ' (',valueClassString,')' |
8214 | 1976 |
] ifFalse:[ |
8592 | 1977 |
s := description , ': ', valueString, ' (',valueClassString,')' |
8214 | 1978 |
]. |
8212 | 1979 |
]. |
8592 | 1980 |
"/ Transcript showCR:s. |
1981 |
^ s |
|
8212 | 1982 |
! |
1983 |
||
266 | 1984 |
helpTextFor:aComponent |
1985 |
|s| |
|
1986 |
||
1987 |
aComponent == abortButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1988 |
s := 'HELP_ABORT' |
266 | 1989 |
]. |
1990 |
aComponent == terminateButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1991 |
s := 'HELP_TERMINATE' |
266 | 1992 |
]. |
1993 |
aComponent == continueButton ifTrue:[ |
|
6647 | 1994 |
continueButton label = (resources string:'Stop') ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1995 |
s := 'HELP_STOP' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1996 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1997 |
s := 'HELP_CONTINUE' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1998 |
] |
266 | 1999 |
]. |
2000 |
aComponent == stepButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2001 |
s := 'HELP_STEP' |
266 | 2002 |
]. |
2003 |
aComponent == nextButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2004 |
s := 'HELP_NEXT' |
266 | 2005 |
]. |
1065 | 2006 |
aComponent == nextOverButton ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2007 |
s := 'HELP_NEXTOVER' |
1065 | 2008 |
]. |
2009 |
aComponent == nextOutButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2010 |
s := 'HELP_NEXTOUT' |
1065 | 2011 |
]. |
266 | 2012 |
aComponent == stepButton ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2013 |
s := 'HELP_STEP' |
266 | 2014 |
]. |
2015 |
aComponent == sendButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2016 |
s := 'HELP_SEND' |
266 | 2017 |
]. |
2018 |
aComponent == returnButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2019 |
s := 'HELP_RETURN' |
266 | 2020 |
]. |
2021 |
aComponent == restartButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2022 |
s := 'HELP_RESTART' |
266 | 2023 |
]. |
2024 |
aComponent == contextView ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2025 |
s := 'HELP_WALKBACK' |
266 | 2026 |
]. |
2027 |
aComponent == codeView ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2028 |
s := 'HELP_CODEVIEW' |
266 | 2029 |
]. |
2030 |
aComponent == monitorToggle ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2031 |
s := 'HELP_MONITOR' |
266 | 2032 |
]. |
2033 |
aComponent == updateButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2034 |
s := 'HELP_UPDATE' |
266 | 2035 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2036 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2037 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
2038 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2039 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2040 |
s := 'HELP_REC_INSP' |
266 | 2041 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
2042 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2043 |
s := 'HELP_CON_INSP' |
266 | 2044 |
]. |
2045 |
||
2046 |
s notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2047 |
^ resources string:s |
266 | 2048 |
]. |
2049 |
^ nil |
|
2050 |
||
2051 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 2052 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 2053 |
! ! |
2054 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2055 |
!DebugView methodsFor:'initialization & release'! |
266 | 2056 |
|
2057 |
addToCurrentProject |
|
2058 |
"ignored here" |
|
2059 |
||
2060 |
^ self |
|
2061 |
! |
|
2062 |
||
2115 | 2063 |
destroy |
2064 |
"closing the debugger implies an abort or continue" |
|
2065 |
||
2404 | 2066 |
|m| |
2067 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
2068 |
self checkIfCodeIsReallyModified ifTrue:[ |
2115 | 2069 |
(self confirm:('Code modified - exit anyway ?')) |
2070 |
ifFalse:[ |
|
2071 |
^ self |
|
2072 |
] |
|
2073 |
]. |
|
2074 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2075 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2076 |
|
2404 | 2077 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 2078 |
inspecting ifFalse:[ |
2079 |
"I am running on top of a process, abort or continue it" |
|
2080 |
||
2081 |
windowGroup notNil ifTrue:[ |
|
2082 |
windowGroup setProcess:nil. |
|
2083 |
]. |
|
2084 |
self uncacheMyself. |
|
2085 |
||
2086 |
"/ |
|
2087 |
"/ catch invalid return; |
|
2088 |
"/ this happens, when my process has somehow died (quickterminate) |
|
2089 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
2090 |
"/ #destroy-window function. |
|
2091 |
"/ |
|
3124
540feceebffa
invalidReturnSignal -> cannotReturnSignal
Claus Gittinger <cg@exept.de>
parents:
3121
diff
changeset
|
2092 |
Context cannotReturnSignal handle:[:ex | |
2115 | 2093 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
2094 |
self uncacheMyself. |
|
2095 |
Debugger newDebugger. |
|
2096 |
ex return. |
|
2097 |
] do:[ |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2098 |
AbortOperationRequest isHandled ifTrue:[ |
2115 | 2099 |
self doAbort. |
2100 |
] ifFalse:[ |
|
2101 |
self doContinue |
|
2102 |
] |
|
2103 |
]. |
|
2104 |
"/ We don't reach this point normally |
|
2105 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2106 |
Debugger newDebugger. |
|
2107 |
self uncacheMyself. |
|
2108 |
]. |
|
2109 |
||
2299 | 2110 |
Debugger newDebugger. |
2115 | 2111 |
"/ since I am going to be destroyed, remove me from the cache |
2112 |
self uncacheMyself. |
|
2113 |
super destroy. |
|
2114 |
||
2115 |
"Modified: / 10.7.1997 / 17:15:41 / stefan" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2116 |
"Modified: / 16.11.2001 / 17:38:15 / cg" |
2115 | 2117 |
! |
2118 |
||
266 | 2119 |
initialize |
8148 | 2120 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
2121 |
newLayout v| |
|
266 | 2122 |
|
2123 |
super initialize. |
|
2124 |
||
2340 | 2125 |
font := font onDevice:device. |
266 | 2126 |
|
8148 | 2127 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2128 |
ignoreBreakpoints := true. "/ ignore halts/breakpoints in doIts of |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2129 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2130 |
|
266 | 2131 |
busy := false. |
2132 |
exclusive := false. |
|
2133 |
inspecting := false. |
|
2134 |
exitAction := nil. |
|
2135 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2136 |
stepHow := nil. |
266 | 2137 |
canContinue := false. |
2138 |
||
3269 | 2139 |
mH := 0. |
2140 |
||
3447 | 2141 |
menuPanel := MenuPanel in:self. |
8131 | 2142 |
menuPanel receiver:self. |
3447 | 2143 |
menuPanel verticalLayout:false. |
8131 | 2144 |
menu := self class menuSpec decodeAsLiteralArray. |
2145 |
menu findGuiResourcesIn:self. |
|
2146 |
menuPanel menu:menu. |
|
3447 | 2147 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2148 |
mH := menuPanel preferredHeight. |
3447 | 2149 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2150 |
||
8148 | 2151 |
newLayout := UserPreferences current useNewLayoutInDebugger. |
2152 |
newLayout ifFalse:[ |
|
3269 | 2153 |
bpanel := HorizontalPanelView in:self. |
3447 | 2154 |
|
3269 | 2155 |
self initializeButtonsIn:bpanel. |
2156 |
||
8194 | 2157 |
bH := bpanel preferredHeight + 5. |
3269 | 2158 |
bpanel origin:(0.0 @ mH) |
2159 |
extent:(1.0 @ bH). |
|
2160 |
panel := VariableVerticalPanel |
|
2161 |
origin:(0.0 @ (mH + bH)) |
|
2162 |
corner:(1.0 @ 1.0) |
|
2163 |
in:self. |
|
2164 |
||
2165 |
v := self initializeContextListViewIn:panel. |
|
2166 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2167 |
||
2168 |
codePanel := View in:panel. |
|
2169 |
v := self initializeCodeViewIn:codePanel. |
|
2170 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
2171 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2172 |
||
2173 |
v := self initializeInspectorViewsIn:panel. |
|
2174 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
2175 |
||
8148 | 2176 |
] ifTrue:[ |
3269 | 2177 |
bpanel1 := HorizontalPanelView in:self. |
2178 |
self initializeButtons1In:bpanel1. |
|
2179 |
||
8194 | 2180 |
bH1 := bpanel1 preferredHeight + 5. |
3269 | 2181 |
bpanel1 origin:(0.0 @ mH) |
2182 |
extent:(1.0 @ bH1). |
|
2183 |
panel := VariableVerticalPanel |
|
2184 |
origin:(0.0 @ (mH + bH1)) |
|
2185 |
corner:(1.0 @ 1.0) |
|
2186 |
in:self. |
|
8194 | 2187 |
"/ panel showHandle:true. |
2188 |
"/ panel handlePosition:#left. |
|
3269 | 2189 |
|
2190 |
v := self initializeContextListViewIn:panel. |
|
2191 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2192 |
||
2193 |
codePanel := View in:panel. |
|
2194 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
2195 |
self initializeButtons2In:bpanel2. |
|
2196 |
||
8194 | 2197 |
bH2 := bpanel2 preferredHeight + 5. |
3269 | 2198 |
bpanel2 origin:(0.0 @ 0.0) |
2199 |
extent:(1.0 @ bH2). |
|
2200 |
||
8305 | 2201 |
exceptionInfoLabel := Label label:'' in:codePanel. |
2202 |
exceptionInfoLabel adjust:#left. |
|
2203 |
exceptionInfoLabel |
|
2204 |
origin:(0.0 @ bH2) |
|
2205 |
extent:(1.0 @ (exceptionInfoLabel preferredHeight)). |
|
2206 |
||
3269 | 2207 |
v := self initializeCodeViewIn:codePanel. |
8305 | 2208 |
v origin:(0.0 @ (bH2+(exceptionInfoLabel preferredHeight))) corner:(1.0 @ 1.0). |
3269 | 2209 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
2210 |
||
2211 |
v := self initializeInspectorViewsIn:panel. |
|
2212 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
2213 |
]. |
|
2214 |
||
3387 | 2215 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
2216 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2217 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2218 |
|
3387 | 2219 |
|
3269 | 2220 |
" |
2221 |
Debugger newDebugger |
|
2222 |
" |
|
3447 | 2223 |
|
2224 |
"Modified: / 17.11.2001 / 20:50:24 / cg" |
|
3269 | 2225 |
! |
2226 |
||
3447 | 2227 |
initializeAbortButtonIn:bpanel |
3269 | 2228 |
abortButton := Button |
6647 | 2229 |
label:(resources string:'Abort') |
3269 | 2230 |
action:[ |
2231 |
abortButton turnOffWithoutRedraw. |
|
2232 |
self doAbort |
|
2233 |
] |
|
2234 |
in:bpanel. |
|
3447 | 2235 |
|
2236 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
2237 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
2238 |
! |
|
2239 |
||
2240 |
initializeButtons1In:bpanel |
|
2241 |
|separator| |
|
2242 |
||
2243 |
bpanel horizontalLayout:#leftMax. "was: #left. " |
|
2244 |
bpanel verticalLayout:#centerMax. |
|
2245 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2246 |
||
8194 | 2247 |
self initializeContinueButtonIn:bpanel. |
2248 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2249 |
separator borderWidth:0; level:0. |
|
3447 | 2250 |
self initializeAbortButtonIn:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2251 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2252 |
separator := View extent:(10 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2253 |
separator borderWidth:0; level:0. |
3269 | 2254 |
|
3447 | 2255 |
self initializeTerminateButtonIn:bpanel. |
2256 |
||
2257 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2258 |
separator borderWidth:0; level:0. |
|
2259 |
||
2260 |
self initializeDefineButtonIn:bpanel. |
|
4356 | 2261 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
2262 |
self initializeReportButtonIn:bpanel. |
|
2263 |
]. |
|
3447 | 2264 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 2265 |
! |
2266 |
||
2267 |
initializeButtons2In:bpanel |
|
2268 |
|separator| |
|
2269 |
||
3447 | 2270 |
bpanel horizontalLayout:#leftMax. "was: #left. " |
3269 | 2271 |
bpanel verticalLayout:#centerMax. |
2272 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2273 |
||
3447 | 2274 |
self initializeNextButtonIn:bpanel. |
2275 |
self initializeStepButtonIn:bpanel. |
|
2276 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2277 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2278 |
"/ I disabled the stepIn / stepOut buttons - for now. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2279 |
"/ they do not work relyable with inlined blocks yet. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2280 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2281 |
|
3269 | 2282 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2283 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2284 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2285 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2286 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2287 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2288 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2289 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2290 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2291 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2292 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2293 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2294 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2295 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2296 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2297 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2298 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2299 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2300 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2301 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2302 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2303 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2304 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2305 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2306 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2307 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2308 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2309 |
|
3447 | 2310 |
self initializeSendButtonIn:bpanel. |
2311 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2312 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2313 |
separator borderWidth:0; level:0. |
3269 | 2314 |
|
3447 | 2315 |
self initializeReturnButtonIn:bpanel. |
2316 |
self initializeRestartButtonIn:bpanel. |
|
2317 |
||
2318 |
"Modified: / 17.11.2001 / 21:01:38 / cg" |
|
3269 | 2319 |
! |
2320 |
||
2321 |
initializeButtonsIn:bpanel |
|
2322 |
|separator| |
|
2323 |
||
2324 |
bpanel horizontalLayout:#left. |
|
2325 |
bpanel verticalLayout:#centerMax. |
|
2326 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2327 |
||
3447 | 2328 |
self initializeAbortButtonIn:bpanel. |
2329 |
||
3269 | 2330 |
separator := View extent:(10 @ 5) in:bpanel. |
2331 |
separator borderWidth:0; level:0. |
|
2332 |
||
3447 | 2333 |
self initializeContinueButtonIn:bpanel. |
3269 | 2334 |
|
2335 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2336 |
separator borderWidth:0; level:0. |
|
2337 |
||
3447 | 2338 |
self initializeReturnButtonIn:bpanel. |
2339 |
self initializeRestartButtonIn:bpanel. |
|
3269 | 2340 |
|
2341 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2342 |
separator borderWidth:0; level:0. |
|
2343 |
||
3447 | 2344 |
self initializeNextButtonIn:bpanel. |
2345 |
self initializeStepButtonIn:bpanel. |
|
2346 |
||
3269 | 2347 |
"/ cg: |
2348 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
2349 |
"/ they do not work relyable with inlined blocks yet. |
|
2350 |
"/ |
|
2351 |
||
2352 |
||
2353 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
2354 |
"/ img isNil ifTrue:[ |
|
2355 |
"/ img := (resources at:'next') |
|
2356 |
"/ ]. |
|
2357 |
"/ nextButton := Button |
|
2358 |
"/ label:img |
|
2359 |
"/ action:[stepButton turnOff. self doNext] |
|
2360 |
"/ in:bpanel. |
|
2361 |
"/ |
|
2362 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
2363 |
"/ img isNil ifTrue:[ |
|
2364 |
"/ img := (resources at:'over') |
|
2365 |
"/ ]. |
|
2366 |
"/ nextOverButton := Button |
|
2367 |
"/ label:img |
|
2368 |
"/ action:[stepButton turnOff. self doNextOver] |
|
2369 |
"/ in:bpanel. |
|
2370 |
"/ |
|
2371 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
2372 |
"/ img isNil ifTrue:[ |
|
2373 |
"/ img := (resources at:'out') |
|
2374 |
"/ ]. |
|
2375 |
"/ nextOutButton := Button |
|
2376 |
"/ label:img |
|
2377 |
"/ action:[stepButton turnOff. self doNextOut] |
|
2378 |
"/ in:bpanel. |
|
2379 |
||
3447 | 2380 |
self initializeSendButtonIn:bpanel. |
2381 |
||
3187 | 2382 |
separator := View extent:(30 @ 5) in:bpanel. |
2383 |
separator borderWidth:0; level:0. |
|
3269 | 2384 |
|
3447 | 2385 |
self initializeTerminateButtonIn:bpanel. |
2386 |
||
3269 | 2387 |
separator := View extent:(30 @ 5) in:bpanel. |
2388 |
separator borderWidth:0; level:0. |
|
2389 |
||
3447 | 2390 |
self initializeDefineButtonIn:bpanel. |
4356 | 2391 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
2392 |
self initializeReportButtonIn:bpanel. |
|
2393 |
]. |
|
2394 |
||
3447 | 2395 |
|
2396 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
2397 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 2398 |
! |
2399 |
||
2400 |
initializeCodeViewIn:panel |
|
2401 |
|v| |
|
2402 |
||
2403 |
v := HVScrollableView |
|
2404 |
for:CodeView |
|
2405 |
miniScrollerH:true |
|
2406 |
miniScrollerV:false |
|
2407 |
in:panel. |
|
2408 |
||
2409 |
"/ v autoHideScrollBars:true. |
|
2410 |
codeView := v scrolledView. |
|
8212 | 2411 |
codeView enableMotionEvents. "/ for active help |
3269 | 2412 |
|
2413 |
^ v |
|
2414 |
! |
|
2415 |
||
2416 |
initializeContextListViewIn:panel |
|
2417 |
|v| |
|
266 | 2418 |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2419 |
v := HVScrollableView |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2420 |
for:SelectionInListView |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2421 |
miniScrollerH:true |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2422 |
miniScrollerV:false |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2423 |
in:panel. |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2424 |
v autoHideHorizontalScrollBar:true. |
266 | 2425 |
|
2426 |
contextView := v scrolledView. |
|
2427 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 2428 |
contextView doubleClickAction:[:line | self browseImplementingClass]. |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
2429 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 2430 |
|
5453 | 2431 |
contextView middleButtonMenu:(self middleButtonMenu). |
2432 |
||
3269 | 2433 |
^ v |
2434 |
! |
|
2435 |
||
5453 | 2436 |
initializeContextViewsMiddleButtonMenu |
2437 |
<resource: #programMenu > |
|
2438 |
||
2439 |
contextView middleButtonMenu:(self middleButtonMenu). |
|
2440 |
! |
|
2441 |
||
3447 | 2442 |
initializeContinueButtonIn:bpanel |
2443 |
continueButton := Button |
|
6647 | 2444 |
label:(resources string:'Continue') |
3447 | 2445 |
action:[ |
2446 |
continueButton turnOffWithoutRedraw. |
|
2447 |
self doContinue |
|
2448 |
] |
|
2449 |
in:bpanel. |
|
2450 |
||
2451 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
2452 |
! |
|
2453 |
||
2454 |
initializeDefineButtonIn:bpanel |
|
2455 |
defineButton := Button |
|
6647 | 2456 |
label:(resources string:'Define') |
3447 | 2457 |
action:[ |
2458 |
defineButton turnOffWithoutRedraw. |
|
2459 |
self doDefine |
|
2460 |
] |
|
2461 |
in:bpanel. |
|
2462 |
defineButton beInvisible |
|
2463 |
||
2464 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
2465 |
! |
|
2466 |
||
3269 | 2467 |
initializeInspectorViewsIn:panel |
2468 |
|hpanel| |
|
266 | 2469 |
|
2470 |
hpanel := VariableHorizontalPanel in:panel. |
|
2471 |
||
2472 |
receiverInspector := InspectorView |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2473 |
origin:(0.0 @ 0.0) corner:(0.5 @ 1.0) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2474 |
in:hpanel. |
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2475 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 2476 |
|
2477 |
contextInspector := ContextInspectorView |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2478 |
origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2479 |
in:hpanel. |
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2480 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2481 |
|
3269 | 2482 |
^ hpanel |
266 | 2483 |
! |
2484 |
||
3447 | 2485 |
initializeNextButtonIn:bpanel |
2486 |
nextButton := Button |
|
6647 | 2487 |
label:(resources string:'Next') |
3447 | 2488 |
action:[ |
2489 |
stepButton turnOff. |
|
2490 |
self doNext |
|
2491 |
] |
|
2492 |
in:bpanel. |
|
2493 |
||
2494 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
2495 |
! |
|
2496 |
||
4356 | 2497 |
initializeReportButtonIn:bpanel |
2498 |
reportButton := Button |
|
8656 | 2499 |
label:(resources string:'Report by Mail...') |
4356 | 2500 |
action:[ |
2501 |
reportButton turnOffWithoutRedraw. |
|
2502 |
self doOpenReportMailApp. |
|
2503 |
] |
|
2504 |
in:bpanel. |
|
2505 |
||
2506 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
2507 |
! |
|
2508 |
||
3447 | 2509 |
initializeRestartButtonIn:bpanel |
2510 |
restartButton := Button |
|
6647 | 2511 |
label:(resources string:'Restart') |
3447 | 2512 |
action:[ |
2513 |
restartButton turnOff. |
|
2514 |
self doRestart |
|
2515 |
] |
|
2516 |
in:bpanel. |
|
2517 |
||
2518 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
|
2519 |
! |
|
2520 |
||
2521 |
initializeReturnButtonIn:bpanel |
|
2522 |
returnButton := Button |
|
6647 | 2523 |
label:(resources string:'Return') |
3447 | 2524 |
action:[ |
2525 |
returnButton turnOff. |
|
2526 |
self doReturn |
|
2527 |
] |
|
2528 |
in:bpanel. |
|
2529 |
||
2530 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
2531 |
! |
|
2532 |
||
2533 |
initializeSendButtonIn:bpanel |
|
2534 |
sendButton := Button |
|
6647 | 2535 |
label:(resources string:'Send') |
3447 | 2536 |
action:[ |
2537 |
sendButton turnOff. |
|
2538 |
self doSend |
|
2539 |
] |
|
2540 |
in:bpanel. |
|
2541 |
||
2542 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
2543 |
! |
|
2544 |
||
2545 |
initializeStepButtonIn:bpanel |
|
2546 |
stepButton := Button |
|
6647 | 2547 |
label:(resources string:'Step') |
3447 | 2548 |
action:[ |
2549 |
stepButton turnOff. |
|
2550 |
self doStep |
|
2551 |
] |
|
2552 |
in:bpanel. |
|
2553 |
||
2554 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
2555 |
! |
|
2556 |
||
2557 |
initializeTerminateButtonIn:bpanel |
|
2558 |
terminateButton := Button |
|
6647 | 2559 |
label:(resources string:'Terminate') |
3447 | 2560 |
action:[ |
2561 |
terminateButton turnOffWithoutRedraw. |
|
2562 |
self doTerminate |
|
2563 |
] |
|
2564 |
in:bpanel. |
|
2565 |
||
2566 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
266 | 2567 |
! |
2568 |
||
1249 | 2569 |
postRealize |
2570 |
super postRealize. |
|
266 | 2571 |
|
2572 |
inspecting ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2573 |
inspectedProcess notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2574 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2575 |
set prio somewhat higher (by 2, to allow walkBack-update process |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2576 |
to run between mine and the debugged processes prio) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2577 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2578 |
Processor activeProcess |
6464 | 2579 |
priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2580 |
] |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2581 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2582 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2583 |
self sensor addEventListener:self. |
1249 | 2584 |
|
2585 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 2586 |
! |
2587 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2588 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2589 |
"/ redefined - since the debugView runs on top of |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2590 |
"/ the debuggee, there would be no event loop for me. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2591 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2592 |
drawableId notNil ifTrue:[ |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2593 |
^ self |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2594 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2595 |
"physically create the view & subviews" |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2596 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2597 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2598 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2599 |
|
266 | 2600 |
setLabelFor:aMessage in:aProcess |
8305 | 2601 |
|l lines processNameOrNil pidOrNil| |
6821 | 2602 |
|
2603 |
lines := aMessage asStringCollection. |
|
2604 |
lines size > 1 ifTrue:[ |
|
2605 |
l := lines first |
|
2606 |
] ifFalse:[ |
|
2607 |
l := aMessage. |
|
2608 |
]. |
|
2609 |
||
2610 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2611 |
Error handle:[:ex | |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2612 |
l := l , '???' |
1030 | 2613 |
] do:[ |
8305 | 2614 |
processNameOrNil := aProcess name. |
2615 |
processNameOrNil notNil ifTrue:[ |
|
2616 |
l := l , (processNameOrNil contractTo:20) , ''. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2617 |
]. |
8305 | 2618 |
pidOrNil := aProcess id printString. |
2619 |
l := l , '[' , pidOrNil , ']'. |
|
73 | 2620 |
]. |
1030 | 2621 |
l := l , ')'. |
266 | 2622 |
self label:l. |
6821 | 2623 |
|
8305 | 2624 |
exceptionInfoLabel notNil ifTrue:[ |
2625 |
exceptionInfoLabel |
|
2626 |
label:(resources |
|
2627 |
string:'Exception: %1 in process %2 [%3]' |
|
2628 |
with:(lines first colorizeAllWith:Color red) |
|
2629 |
with:(processNameOrNil ? '') |
|
2630 |
with:(pidOrNil ? '')) |
|
2631 |
]. |
|
2632 |
||
6821 | 2633 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
0 | 2634 |
! ! |
2635 |
||
2636 |
!DebugView methodsFor:'interrupt handling'! |
|
2637 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2638 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2639 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2640 |
'contextIRQ' printCR. |
2581 | 2641 |
thisContext sender fullPrint. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2642 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2643 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2644 |
|
1364 | 2645 |
"Modified: / 30.10.1997 / 21:22:25 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2646 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2647 |
|
0 | 2648 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2649 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2650 |
'stepIRQ' printCR. |
2581 | 2651 |
thisContext sender fullPrint. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2652 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2653 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2654 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2655 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2656 |
"Modified: / 13.1.1998 / 21:14:11 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2657 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2658 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2659 |
stepOrNext |
3055 | 2660 |
|where here con s isWrap method wrappedMethod |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2661 |
inBlock left ignore contextBelow lastWrappedContext |
3055 | 2662 |
leftWrap enteredWrap anyStepBlocks |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2663 |
oneMore initiallyShown inBlockBelow receiver| |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2664 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2665 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
2666 |
"/ DebuggingDebugger := false |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2667 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2668 |
skipLineNr == #return ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2669 |
name := Processor activeProcess nameOrId. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2670 |
self label:('stepping context returned ' , ' (process: ' , name , ')'). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2671 |
here := thisContext sender sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2672 |
here setLineNumber:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2673 |
here := nil. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2674 |
con := thisContext sender sender sender. |
3435 | 2675 |
|
2676 |
BreakPointInterrupt handle:[:ex | |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
2677 |
('DebugView [info]: breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR. |
3435 | 2678 |
ex proceed |
2679 |
] do:[ |
|
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2680 |
self enter:con select:nil. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2681 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2682 |
con := nil. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2683 |
^ self |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2684 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2685 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2686 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2687 |
"/ "/ 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
|
2688 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2689 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2690 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2691 |
"/ 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
|
2692 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2693 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2694 |
|
52 | 2695 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2696 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2697 |
^ self |
52 | 2698 |
]. |
2699 |
||
29 | 2700 |
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
|
2701 |
here := here sender. "the caller; step- or contextIRQ" |
29 | 2702 |
here := here sender. "the interrupted context" |
2703 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2704 |
DebuggingDebugger == true ifTrue:[ |
3055 | 2705 |
'*******' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2706 |
'here in ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2707 |
inWrap ifTrue:['(wrap) ' print.]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2708 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
3055 | 2709 |
here selector printCR. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2710 |
]. |
10 | 2711 |
|
2581 | 2712 |
"/ kludge an bug-workaround; |
2713 |
"/ I should not see those ... |
|
2714 |
||
2715 |
here selector == #ioInterrupt ifTrue:[ |
|
2716 |
DebuggingDebugger == true ifTrue:[ |
|
2717 |
'oops - should not get that one' printCR. |
|
2718 |
]. |
|
2719 |
Processor ioInterrupt. |
|
2720 |
StepInterruptPending := 1. |
|
2721 |
InterruptPending := 1. |
|
2722 |
where := nil. here := nil. |
|
2723 |
InStepInterrupt := nil. |
|
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2724 |
^ self |
2581 | 2725 |
]. |
2726 |
||
2727 |
stepUntilEntering notNil ifTrue:[ |
|
2728 |
DebuggingDebugger == true ifTrue:[ |
|
2729 |
'check if entering ' print. stepUntilEntering printCR. |
|
2730 |
]. |
|
2731 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
2732 |
DebuggingDebugger == true ifTrue:[ |
|
2733 |
'entering...' printCR. |
|
2734 |
]. |
|
2735 |
name := Processor activeProcess nameOrId. |
|
2736 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , name , ')'). |
|
2737 |
||
2738 |
lastStepUntilEntering := stepUntilEntering. |
|
2739 |
stepUntilEntering := nil. |
|
2740 |
self enter:here select:nil. |
|
2741 |
con := nil. |
|
2742 |
^ self |
|
2743 |
]. |
|
2744 |
"/ see if stepping context is still active ... |
|
2745 |
||
2746 |
con := here. |
|
2747 |
||
2748 |
DebuggingDebugger == true ifTrue:[ |
|
2749 |
'start searching at: ' print. |
|
2750 |
con fullPrint. |
|
2751 |
]. |
|
2752 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
2753 |
con := con sender |
|
2754 |
]. |
|
2755 |
con notNil ifTrue:[ |
|
2756 |
DebuggingDebugger == true ifTrue:[ |
|
2757 |
'steppingContext still active - continue stepping' printCR. |
|
2758 |
]. |
|
2759 |
con := nil. |
|
2760 |
where := nil. here := nil. |
|
2761 |
StepInterruptPending := 1. |
|
2762 |
InterruptPending := 1. |
|
2763 |
InStepInterrupt := nil. |
|
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2764 |
^ self |
2581 | 2765 |
]. |
2766 |
stepUntilEntering := nil. |
|
2767 |
]. |
|
2768 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2769 |
" |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2770 |
kludge to hide breakpoint wrappers in the context list: |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2771 |
check if we are in a wrapper methods hidden setup-sequence |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2772 |
if so, ignore the interrupt and continue single sending |
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2773 |
" |
29 | 2774 |
isWrap := false. |
57 | 2775 |
left := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2776 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2777 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2778 |
where := here. |
57 | 2779 |
inWrap ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2780 |
wrappedMethod := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2781 |
5 timesRepeat:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2782 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2783 |
method := where method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2784 |
(method notNil and:[method isWrapped]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2785 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2786 |
in a wrapper method |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2787 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2788 |
wrappedMethod ~~ method ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2789 |
wrappedMethod := method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2790 |
lastWrappedContext := where. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2791 |
where sender receiver == method originalMethod ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2792 |
isWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2793 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2794 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2795 |
where == steppedContext ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2796 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2797 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2798 |
'change stepCon from: ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2799 |
steppedContext print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2800 |
' to lastWrapped: ' print. |
3055 | 2801 |
lastWrappedContext printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2802 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2803 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2804 |
inWrap := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2805 |
leftWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2806 |
wrapperContext := steppedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2807 |
steppedContext := lastWrappedContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2808 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2809 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2810 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2811 |
where := where sender |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2812 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2813 |
]. |
29 | 2814 |
]. |
2815 |
||
2816 |
isWrap ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2817 |
DebuggingDebugger == true ifTrue:[ |
3055 | 2818 |
'ignore wrap' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2819 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2820 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2821 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2822 |
"/ ignore, while in wrappers hidden setup |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2823 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2824 |
where := nil. here := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2825 |
ObjectMemory flushInlineCaches. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2826 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2827 |
skipLineNr == #return ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2828 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2829 |
'skipRet in wrap' printCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2830 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2831 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2832 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2833 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2834 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2835 |
InStepInterrupt := nil. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2836 |
^ self |
29 | 2837 |
]. |
2838 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2839 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 2840 |
|
2581 | 2841 |
DebuggingDebugger == true ifTrue:[ |
2842 |
'bigStep is: ' print. bigStep printCR. |
|
2843 |
'steppedContext is: ' print. steppedContext printCR. |
|
2844 |
]. |
|
2845 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2846 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2847 |
"/ 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
|
2848 |
"/ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
2849 |
(bigStep |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
2850 |
and:[steppedContext notNil]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2851 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2852 |
a step or next - ignore all contexts below the interesting one |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2853 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2854 |
where := here. "the interrupted context" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2855 |
contextBelow := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2856 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2857 |
where home notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2858 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2859 |
"/ in a block called by 'our' context ? |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2860 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2861 |
where home == steppedContext ifTrue:[ |
3055 | 2862 |
"/ '*block*' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2863 |
inBlock := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2864 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2865 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2866 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2867 |
where == steppedContext ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2868 |
where := where sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2869 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2870 |
where notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2871 |
where home == steppedContext ifTrue:[ |
3055 | 2872 |
"/ '*block*' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2873 |
inBlock := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2874 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2875 |
]. |
57 | 2876 |
|
2877 |
"/ 'looking for ' print. |
|
3055 | 2878 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 2879 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
2880 |
"/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
|
2881 |
"/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
|
2882 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2883 |
where == steppedContext ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2884 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2885 |
"/ check if we are in a context below steppedContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2886 |
"/ (i.e. if steppedContext can be reached from |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2887 |
"/ interrupted context. Not using context-ref but its |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2888 |
"/ address to avoid creation of many useless contexts.) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2889 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2890 |
inBlock ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2891 |
[where notNil] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2892 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2893 |
"/ if either the receiver or any arg of this context |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2894 |
"/ is a block of the steppedContext, we must really |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2895 |
"/ do a single step. Otherwise, stepping through a |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2896 |
"/ do:-loop would be very difficult. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2897 |
receiver := where receiver. |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2898 |
(receiver isBlock |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2899 |
and:[(receiver isKindOf:Block) |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2900 |
and:[receiver home == steppedContext]]) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2901 |
ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2902 |
anyStepBlocks := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2903 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2904 |
where args do:[:arg | |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2905 |
(arg isBlock |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2906 |
and:[(arg isKindOf:Block) |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2907 |
and:[arg home == steppedContext]]) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2908 |
ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2909 |
anyStepBlocks := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2910 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2911 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2912 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2913 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2914 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2915 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
3055 | 2916 |
where selector printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2917 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2918 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2919 |
where == steppedContext ifTrue:[ |
3055 | 2920 |
"/ 'found it - below; ignore' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2921 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2922 |
found the interesting context somwehere up in the |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2923 |
chain. We seem to be still below the interesting one ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2924 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2925 |
tracing == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2926 |
here printString printCR |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2927 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2928 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2929 |
yes, a context below |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2930 |
- continue and schedule another stepInterrupt. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2931 |
Must flush caches since optimized methods not always |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2932 |
look for pending interrupts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2933 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2934 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2935 |
contextBelow notNil ifTrue:[ |
3055 | 2936 |
"/ 'prepare for unwind-catch' printCR. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2937 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2938 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2939 |
"/ self label:'single stepping - please wait ...(' , contextBelow selector , ')'. |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2940 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2941 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2942 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2943 |
'below stepCon; continue until unwind of: ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2944 |
contextBelow printCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2945 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2946 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2947 |
StepInterruptPending := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2948 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2949 |
ObjectMemory flushInlineCaches. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2950 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2951 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2952 |
"/ self label:'single stepping - please wait ...(' , here selector , ')'. |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2953 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2954 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2955 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2956 |
'in stepCon; continue single stepping' printCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2957 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2958 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2959 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2960 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2961 |
where := nil. here := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2962 |
InStepInterrupt := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2963 |
|
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2964 |
^ self |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2965 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2966 |
|
1537 | 2967 |
(steppedContext notNil and:[ |
2968 |
where methodHome == steppedContext methodHome]) ifTrue:[ |
|
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2969 |
inBlockBelow := true. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2970 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2971 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2972 |
anyStepBlocks ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2973 |
inBlock ifFalse:[ |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2974 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2975 |
"/ which does not honor interrupt-on-return of block contexts |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2976 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2977 |
where isBlockContext ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2978 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2979 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2980 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2981 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2982 |
where := where sender |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2983 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2984 |
s := 'context returned'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2985 |
left := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2986 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2987 |
] ifTrue:[ |
3055 | 2988 |
"/ 'found it right in sender' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2989 |
s := 'after step' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2990 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2991 |
] ifTrue:[ |
3055 | 2992 |
"/ 'found it right away' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2993 |
s := 'after step' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2994 |
]. |
0 | 2995 |
] ifFalse:[ |
3055 | 2996 |
"/ ' send' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2997 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2998 |
a send |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2999 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3000 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3001 |
'clear steppedContext' printCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3002 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3003 |
steppedContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3004 |
s := 'after send' |
0 | 3005 |
]. |
7 | 3006 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3007 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3008 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3009 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3010 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3011 |
|
790 | 3012 |
"/ handle the case, when a subBlock leaves; |
3013 |
"/ continue stepping in the home context. |
|
3014 |
||
3015 |
left ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3016 |
steppedContext home notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3017 |
steppedContext := steppedContext home. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3018 |
s := 'after step'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3019 |
left := false. |
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3020 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
3021 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3022 |
] |
790 | 3023 |
]. |
3024 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3025 |
" |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3026 |
kludge to hide breakpoint wrappers in the context list: |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3027 |
check if we are in a wrapper methods hidden exit-sequence |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3028 |
if so, ignore the interrupt and continue single sending |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3029 |
" |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3030 |
(where isNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3031 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3032 |
ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3033 |
"/ did not find our steppedContext along the chain; |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3034 |
"/ could be in a wrappedMethods exitBlock ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3035 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3036 |
leftWrap ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3037 |
where := here. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3038 |
wrappedMethod := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3039 |
5 timesRepeat:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3040 |
where notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3041 |
where isBlockContext ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3042 |
method := where method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3043 |
(method notNil and:[method isWrapped]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3044 |
where == wrapperContext ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3045 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3046 |
'change stepCon fromWrapped: ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3047 |
steppedContext print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3048 |
' to: ' print. |
3055 | 3049 |
wrapperContext printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3050 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3051 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3052 |
inWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3053 |
enteredWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3054 |
steppedContext := wrapperContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3055 |
wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3056 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3057 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3058 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3059 |
where := where sender |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3060 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3061 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3062 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3063 |
enteredWrap ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3064 |
ignore := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3065 |
] |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3066 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3067 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3068 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3069 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3070 |
left ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3071 |
"/ special care for stepInterrupt in send, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3072 |
"/ when created a dummy context (lineNr == 1) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3073 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3074 |
steppedContext lineNumber isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3075 |
steppedContext selector == here sender selector ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3076 |
left := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3077 |
s := 'after step'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3078 |
steppedContext := here sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3079 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3080 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3081 |
oneMore := true |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3082 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
3083 |
|
57 | 3084 |
inBlock ifTrue:[ |
3055 | 3085 |
"/ 'inBlock' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3086 |
s := 'in block'. |
57 | 3087 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3088 |
inBlockBelow ifTrue:[ |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3089 |
ignore := true |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
3090 |
]. |
57 | 3091 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3092 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3093 |
where notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3094 |
'(' print. steppedContextLineno print. ') ' print. |
3055 | 3095 |
where printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3096 |
]. |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
3097 |
]. |
57 | 3098 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3099 |
ignore ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3100 |
(bigStep |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3101 |
and:[steppedContextLineno notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3102 |
and:[where notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3103 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3104 |
(here isBlockContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3105 |
and:[(here methodHome == steppedContext) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3106 |
or:[here home == steppedContext]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3107 |
DebuggingDebugger == true ifTrue:[ |
3055 | 3108 |
'same line but in block' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3109 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3110 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3111 |
steppedContext := actualContext := here. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3112 |
steppedContextLineno := here lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3113 |
] ifFalse:[ |
3063 | 3114 |
"/ kludge - I only have the info for up to 255 lines |
3115 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
3116 |
DebuggingDebugger == true ifTrue:[ |
|
3117 |
'same line - ignored' printCR. |
|
3118 |
]. |
|
3119 |
ignore := true |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3120 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3121 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3122 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3123 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3124 |
(left not |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3125 |
and:[skipLineNr notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3126 |
and:[where notNil |
1764
e7aa6f50e766
care for nil-linenumber in stepOrNext.
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3127 |
and:[where lineNumber notNil |
e7aa6f50e766
care for nil-linenumber in stepOrNext.
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3128 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3129 |
DebuggingDebugger == true ifTrue:[ |
3055 | 3130 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3131 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3132 |
ignore := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3133 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3134 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3135 |
(steppedContextLineno isNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3136 |
and:[skipLineNr isNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3137 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3138 |
DebuggingDebugger == true ifTrue:[ |
3055 | 3139 |
'same line2 (after conIRQ) - ignored' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3140 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3141 |
ignore := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3142 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3143 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3144 |
|
57 | 3145 |
ignore ifTrue:[ |
3055 | 3146 |
"/' ' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3147 |
where := nil. here := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3148 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3149 |
yes, a context below |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3150 |
- continue and schedule another stepInterrupt. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3151 |
Must flush caches since optimized methods not always |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3152 |
look for pending interrupts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3153 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3154 |
ObjectMemory flushInlineCaches. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3155 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3156 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3157 |
InStepInterrupt := nil. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3158 |
^ self |
57 | 3159 |
]. |
3160 |
||
3055 | 3161 |
"/ ' ' printCR. |
57 | 3162 |
|
29 | 3163 |
name := Processor activeProcess nameOrId. |
7 | 3164 |
self label:(s , ' (process: ' , name , ')'). |
3165 |
||
57 | 3166 |
tracing := false. |
3167 |
bigStep := false. |
|
3168 |
||
0 | 3169 |
"release refs to context" |
3170 |
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
|
3171 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3172 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3173 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3174 |
'==> enter on: ' print. thisContext sender sender printCR. |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3175 |
]. |
1364 | 3176 |
|
3177 |
initiallyShown := nil. |
|
3178 |
(oneMore == true) ifTrue:[ |
|
1871
971fe3afd573
care for nil lineNumber in context (how can this happen ?)
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3179 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3180 |
initiallyShown := 2 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3181 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3182 |
initiallyShown := 1 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3183 |
] |
1364 | 3184 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3185 |
con := thisContext sender sender. |
3435 | 3186 |
|
3187 |
BreakPointInterrupt handle:[:ex | |
|
3447 | 3188 |
'DebugView [info]: breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
3435 | 3189 |
ex proceed |
3190 |
] do:[ |
|
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3191 |
self enter:con select:initiallyShown |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3192 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3193 |
con := nil |
1364 | 3194 |
|
3195 |
"Created: / 14.10.1996 / 12:53:39 / cg" |
|
3447 | 3196 |
"Modified: / 18.11.2001 / 01:00:55 / cg" |
0 | 3197 |
! ! |
3198 |
||
4867 | 3199 |
!DebugView methodsFor:'menu & button actions'! |
266 | 3200 |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3201 |
addBreakpoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3202 |
"add a breakpoint on the selected contexts method - if any" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3203 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3204 |
|implementorClass method| |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3205 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3206 |
selectedContext isNil ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3207 |
^ self showError:'** select a context first **' |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3208 |
]. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3209 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3210 |
^ self |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3211 |
]. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3212 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3213 |
implementorClass := selectedContext methodClass. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3214 |
implementorClass notNil ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3215 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3216 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3217 |
method setBreakPoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3218 |
] |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3219 |
]. |
3511 | 3220 |
contextView middleButtonMenu disable:#addBreakpoint. |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3221 |
contextView middleButtonMenu enable:#removeBreakpoint. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3222 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3223 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3224 |
! |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3225 |
|
5875 | 3226 |
addBrowserBookmark |
3227 |
"add a browser-bookmark for the selected contexts method" |
|
3228 |
||
3229 |
|cls sel| |
|
3230 |
||
3231 |
selectedContext isNil ifTrue:[^ self]. |
|
3232 |
||
3233 |
cls := selectedContext receiver class. |
|
3234 |
sel := selectedContext selector. |
|
3235 |
(cls includesSelector:sel) ifFalse:[ |
|
3236 |
sel := nil |
|
3237 |
]. |
|
3238 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
3239 |
! |
|
3240 |
||
3511 | 3241 |
allowBreakPointsInDebugger |
3242 |
^ ignoreBreakpoints not |
|
3243 |
! |
|
3244 |
||
3245 |
allowBreakPointsInDebugger:aBoolean |
|
3246 |
ignoreBreakpoints := aBoolean not. |
|
5798 | 3247 |
self initializeMiddleButtonMenu. |
3248 |
self initializeContextViewsMiddleButtonMenu. |
|
3511 | 3249 |
! |
3250 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3251 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3252 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3253 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3254 |
"Created: / 15-05-2007 / 13:29:55 / cg" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3255 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3256 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3257 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3258 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3259 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3260 |
"Created: / 15-05-2007 / 13:30:04 / cg" |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3261 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3262 |
|
266 | 3263 |
autoUpdateOff |
3264 |
"stop the update process" |
|
3265 |
||
3266 |
updateProcess notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3267 |
monitorToggle lampColor:(Color yellow). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3268 |
updateProcess terminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3269 |
updateProcess := nil |
266 | 3270 |
] |
3271 |
! |
|
3272 |
||
3273 |
autoUpdateOn |
|
3274 |
"fork a subprocess which updates the contextList in regular intervals" |
|
3275 |
||
3276 |
updateProcess isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3277 |
updateProcess := |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3278 |
[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3279 |
[true] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3280 |
monitorToggle showLamp ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3281 |
monitorToggle lampColor:(Color yellow). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3282 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3283 |
monitorToggle activeForegroundColor:Color black. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3284 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3285 |
(Delay forSeconds:0.25) wait. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3286 |
self updateContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3287 |
monitorToggle showLamp ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3288 |
monitorToggle lampColor:(Color red). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3289 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3290 |
monitorToggle activeForegroundColor:Color red. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3291 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3292 |
(Delay forSeconds:0.25) wait. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3293 |
self updateContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3294 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3295 |
] forkAt:(Processor activePriority - 1) |
266 | 3296 |
] |
3297 |
||
3298 |
! |
|
3299 |
||
3269 | 3300 |
browseClass |
3301 |
"browse the reveivers class (of the selected contexts message)" |
|
3302 |
||
3303 |
|cls sel| |
|
3304 |
||
3305 |
selectedContext isNil ifTrue:[^ self]. |
|
3306 |
||
3307 |
cls := selectedContext receiver class. |
|
3308 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3309 |
(cls includesSelector:sel) ifFalse:[ |
3269 | 3310 |
sel := nil |
3311 |
]. |
|
3312 |
cls browserClass openInClass:cls selector:sel. |
|
3313 |
||
3314 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3315 |
! |
|
3316 |
||
3317 |
browseClassHierarchy |
|
3318 |
"browse the reveivers classHierarchy (of the selected contexts message)" |
|
3319 |
||
3320 |
|cls mthd| |
|
3321 |
||
3322 |
selectedContext isNil ifTrue:[^ self]. |
|
3323 |
||
3324 |
mthd := selectedContext method. |
|
3447 | 3325 |
mthd notNil ifTrue:[ |
3326 |
cls := mthd containingClass. |
|
3327 |
"/ still nil if unbound - then use receivers class |
|
3328 |
]. |
|
3329 |
cls isNil ifTrue:[ |
|
3269 | 3330 |
cls := selectedContext receiver class |
3331 |
]. |
|
3332 |
cls browserClass browseClassHierarchy:cls. |
|
3333 |
||
3447 | 3334 |
"Modified: / 17.11.2001 / 19:43:06 / cg" |
3269 | 3335 |
! |
3336 |
||
3337 |
browseFullClassProtocol |
|
3338 |
"browse the reveivers full protocol (of the selected contexts message)" |
|
3339 |
||
3340 |
|cls mthd| |
|
3341 |
||
3342 |
selectedContext isNil ifTrue:[^ self]. |
|
3343 |
||
3344 |
mthd := selectedContext method. |
|
3447 | 3345 |
mthd notNil ifTrue:[ |
3346 |
cls := mthd containingClass. |
|
3347 |
"/ still nil if unbound - then use receivers class |
|
3348 |
]. |
|
3349 |
cls isNil ifTrue:[ |
|
3269 | 3350 |
cls := selectedContext receiver class |
3351 |
]. |
|
3352 |
cls browserClass browseFullClassProtocol:cls. |
|
3353 |
||
3447 | 3354 |
"Modified: / 17.11.2001 / 19:43:43 / cg" |
3269 | 3355 |
! |
3356 |
||
3357 |
browseImplementingClass |
|
3358 |
"browse the implementing class (of the selected contexts message)" |
|
3359 |
||
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
3360 |
|mthd who sel cls| |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3361 |
|
1452 | 3362 |
selectedContext isNil ifTrue:[^ self]. |
3363 |
||
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3364 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3365 |
mthd notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3366 |
who := selectedContext method who. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3367 |
who notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3368 |
cls := who methodClass. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3369 |
sel := who methodSelector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3370 |
] |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3371 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3372 |
cls isNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3373 |
"/ class not found - try receiver |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3374 |
cls := selectedContext receiver class |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3375 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3376 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3377 |
cls browserClass openInClass:cls selector:sel. |
266 | 3378 |
|
1452 | 3379 |
"Created: / 22.11.1995 / 21:27:01 / cg" |
3380 |
"Modified: / 3.2.1998 / 19:46:40 / cg" |
|
266 | 3381 |
! |
3382 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3383 |
browseImplementors |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3384 |
"open a browser on the implementors of the selected methods selector" |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3385 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3386 |
selectedContext isNil ifTrue:[ |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3387 |
^ self showError:'** select a context first **' |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3388 |
]. |
4153 | 3389 |
"/ selectedContext receiver class browserClass |
3390 |
UserPreferences systemBrowserClass |
|
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2678
diff
changeset
|
3391 |
browseImplementorsOf:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3392 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3393 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3394 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3395 |
"open a browser on the implementors of some selector" |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3396 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3397 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3398 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3399 |
(sel := codeView selection) notNil ifTrue:[ |
2812 | 3400 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3401 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3402 |
initial isNil ifTrue:[ |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3403 |
initial := selectedContext isNil |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3404 |
ifTrue:[nil] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3405 |
ifFalse:[selectedContext selector]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3406 |
]. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3407 |
selector := Dialog |
3320 | 3408 |
requestSelector:'Selector to browse implementors of:' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3409 |
initialAnswer:initial. |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3410 |
selector size == 0 ifFalse:[ |
3140 | 3411 |
UserPreferences systemBrowserClass |
4153 | 3412 |
browseImplementorsMatching:selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3413 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3414 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3415 |
"Modified: / 6.2.2000 / 01:05:14 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3416 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3417 |
|
3269 | 3418 |
browseReceiversClass |
3419 |
"browse the reveivers class (of the selected contexts message)" |
|
3420 |
||
3421 |
|cls sel| |
|
3422 |
||
3423 |
selectedContext isNil ifTrue:[^ self]. |
|
3424 |
||
3425 |
cls := selectedContext receiver class. |
|
3426 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3427 |
(cls includesSelector:sel) ifFalse:[ |
3269 | 3428 |
sel := nil |
3429 |
]. |
|
3430 |
cls browserClass openInClass:cls selector:sel. |
|
3431 |
||
3432 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3433 |
! |
|
3434 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3435 |
browseSenders |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3436 |
"open a browser on the senders of the selected methods selector" |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3437 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3438 |
selectedContext isNil ifTrue:[ |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3439 |
^ self showError:'** select a context first **' |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3440 |
]. |
3140 | 3441 |
UserPreferences systemBrowserClass |
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2678
diff
changeset
|
3442 |
browseAllCallsOn:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3443 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3444 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3445 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3446 |
"open a browser on the senders of some selector" |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3447 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3448 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3449 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3450 |
(sel := codeView selection) notNil ifTrue:[ |
2812 | 3451 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3452 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3453 |
initial isNil ifTrue:[ |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3454 |
initial := selectedContext isNil |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3455 |
ifTrue:[nil] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3456 |
ifFalse:[selectedContext selector]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3457 |
]. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3458 |
selector := Dialog |
3333 | 3459 |
requestSelector:'Selector to browse senders of:' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3460 |
initialAnswer:initial. |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3461 |
selector size == 0 ifFalse:[ |
3140 | 3462 |
UserPreferences systemBrowserClass |
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2678
diff
changeset
|
3463 |
browseAllCallsOn:selector asSymbol. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3464 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3465 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3466 |
"Modified: / 6.2.2000 / 01:05:29 / cg" |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3467 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3468 |
|
266 | 3469 |
copyWalkbackText |
3470 |
"place the contents of the walkback view into the copy-paste buffer. |
|
3471 |
This allows pasting it into some other view for printing ..." |
|
3472 |
||
6034 | 3473 |
self setClipboardText:(contextArray collect:[:con | con fullPrintString]) asStringCollection |
266 | 3474 |
|
3475 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
3476 |
! |
|
3477 |
||
3478 |
doAbort |
|
1187 | 3479 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 3480 |
at save places (for example: in the event loop) and returns back |
3481 |
from whatever the process is doing, but does not terminate it." |
|
3482 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3483 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3484 |
(self confirm:('Code modified - abort anyway ?')) |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3485 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3486 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3487 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3488 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3489 |
|
266 | 3490 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3491 |
inspectedProcess isDead ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3492 |
self showTerminated. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3493 |
^ self |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3494 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
3495 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3496 |
self showError:'** the process does not handle the abort signal **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3497 |
] ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
3498 |
self interruptProcessWith:[AbortOperationRequest raise]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3499 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3500 |
^ self |
266 | 3501 |
]. |
3502 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3503 |
steppedContext := wrapperContext := nil. |
266 | 3504 |
haveControl := false. |
3505 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3506 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3507 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3508 |
catchBlock notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3509 |
abortButton turnOff. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3510 |
catchBlock value. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3511 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3512 |
"/ not reached |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3513 |
'DebugView [warning]: abort failed' errorPrintCR. |
266 | 3514 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3515 |
|
266 | 3516 |
^ self. |
3517 |
||
3447 | 3518 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 3519 |
! |
3520 |
||
6487 | 3521 |
doAbortAll |
3522 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
3523 |
at save places (for example: in the event loop) and returns back |
|
3524 |
from whatever the process is doing, but does not terminate it." |
|
3525 |
||
3526 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
3527 |
(self confirm:('Code modified - abort anyway ?')) |
|
3528 |
ifFalse:[ |
|
3529 |
^ self |
|
3530 |
] |
|
3531 |
]. |
|
3532 |
||
3533 |
inspecting ifTrue:[ |
|
3534 |
inspectedProcess isDead ifTrue:[ |
|
3535 |
self showTerminated. |
|
3536 |
^ self |
|
3537 |
]. |
|
3538 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3539 |
self showError:'** the process does not handle the abort signal **' |
|
3540 |
] ifTrue:[ |
|
3541 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
3542 |
]. |
|
3543 |
^ self |
|
3544 |
]. |
|
3545 |
||
3546 |
steppedContext := wrapperContext := nil. |
|
3547 |
haveControl := false. |
|
3548 |
exitAction := #abortAll. |
|
3549 |
||
3550 |
"exit private event-loop" |
|
3551 |
catchBlock notNil ifTrue:[ |
|
3552 |
abortButton turnOff. |
|
3553 |
catchBlock value. |
|
3554 |
||
3555 |
"/ not reached |
|
3556 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
3557 |
]. |
|
3558 |
||
3559 |
^ self. |
|
3560 |
||
3561 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
3562 |
! |
|
3563 |
||
266 | 3564 |
doContinue |
3565 |
"continue from menu" |
|
3566 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3567 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3568 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3569 |
self checkIfCodeIsReallyModified ifTrue:[ |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3570 |
(self confirm:('Code modified - continue anyway ?')) ifFalse:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3571 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3572 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3573 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3574 |
|
266 | 3575 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3576 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3577 |
continueButton foregroundColor:Color red darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3578 |
]. |
6647 | 3579 |
continueButton label:(resources string:'Stop'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3580 |
continueButton action:[self doStop]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3581 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3582 |
self processPerform:#resume. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3583 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3584 |
^ self |
266 | 3585 |
]. |
3586 |
canContinue ifTrue:[ |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3587 |
exContext := thisContext findSpecialHandle:false raise:true. |
1725 | 3588 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3589 |
(exContext notNil |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
3590 |
and:[ (ex := exContext receiver) isLazyValue not |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
3591 |
and:[ ex isException |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3592 |
and:[ ex signal == NoHandlerError |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3593 |
and:[ ex parameter signal == RecursionError]]]]) |
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3594 |
ifTrue:[ |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3595 |
"/ debug due to unhandled recursionInterrupt. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3596 |
"/ ask if we should proceed with more stack. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3597 |
|
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3598 |
answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3599 |
answer == true ifTrue:[ |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3600 |
proc := Processor activeProcess. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3601 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3602 |
]. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3603 |
]. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3604 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3605 |
steppedContext := wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3606 |
tracing := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3607 |
haveControl := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3608 |
exitAction := #continue. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3609 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3610 |
"exit private event-loop" |
6365 | 3611 |
catchBlock value. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3612 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3613 |
"/ not reached. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3614 |
'DebugView [warning]: continue failed' errorPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3615 |
continueButton turnOff. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3616 |
|
266 | 3617 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3618 |
inspecting ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3619 |
'DebugView [info]: resuming top context' infoPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3620 |
self showSelection:1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3621 |
self doReturn |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3622 |
] |
266 | 3623 |
] |
477 | 3624 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3625 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 3626 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 3627 |
! |
3628 |
||
3187 | 3629 |
doDefine |
5955 | 3630 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3631 |
bagOfClassNames bagOfUsedClassNames implClass idx callee restart| |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3632 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3633 |
selectionIndex := contextView selection. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3634 |
restart := true. |
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3635 |
|
3283 | 3636 |
selector := actualContext selector. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3637 |
implClass := actualContext receiver class whichClassImplements:selector. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3638 |
implClass notNil ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3639 |
"/ must be a subclassResponsibility |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3640 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3641 |
idx := contextArray identityIndexOf:actualContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3642 |
idx > 1 ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3643 |
callee := contextArray at:idx-1. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3644 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3645 |
callee selector == #subclassResponsibility ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3646 |
restart := false. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3647 |
] |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3648 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3649 |
]. |
5955 | 3650 |
|
3651 |
"generate nice argument names" |
|
3652 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
3653 |
bagOfUsedClassNames := Bag new. |
|
3654 |
argNames := actualContext args |
|
3655 |
collect: |
|
3656 |
[:eachArg | |
|
3657 |
|nm| |
|
3658 |
||
3659 |
nm := eachArg class name. |
|
3660 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
3661 |
nm article , nm |
|
3662 |
] ifFalse:[ |
|
3663 |
bagOfUsedClassNames add:nm. |
|
3664 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
3665 |
]. |
|
3666 |
]. |
|
3667 |
||
3668 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 3669 |
|
3447 | 3670 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
3671 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
3672 |
||
3673 |
actualContext receiver isNil ifTrue:[ |
|
3674 |
(self confirm:'Are you sure you want to add this method (to UndefinedObject) ?') |
|
3675 |
ifFalse:[ |
|
3676 |
^ self |
|
3677 |
] |
|
3678 |
]. |
|
3679 |
||
3680 |
receiversClass := actualContext receiver class. |
|
3681 |
||
3682 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
|
3683 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
|
3684 |
cat := 'accessing'. |
|
3685 |
]. |
|
3686 |
(selector numArgs == 1 |
|
3687 |
and:[(selector endsWith:':') |
|
3688 |
and:[receiversClass instVarNames includes:(selector copyWithoutLast:1)]]) |
|
3689 |
ifTrue:[ |
|
3690 |
code := '%1\' , haltStmtFix , '\ %2 := arg.'. |
|
3691 |
cat := 'accessing'. |
|
3692 |
]. |
|
3693 |
||
3694 |
"/ actualContext receiver isClass ifTrue:[ |
|
3695 |
"/ selector == #new ifTrue:[ |
|
3696 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
3697 |
"/ ]. |
|
3698 |
"/ selector == #'new:' ifTrue:[ |
|
3699 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
3700 |
"/ ]. |
|
3701 |
"/ ]. |
|
3702 |
code isNil ifTrue:[ |
|
3703 |
code := '%1\' , haltStmtDef |
|
3704 |
]. |
|
3705 |
||
3187 | 3706 |
self |
3447 | 3707 |
codeAccept:(code bindWith:proto with:selector) withCRs |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3708 |
inClass:receiversClass |
3427 | 3709 |
unwind:false |
3447 | 3710 |
category:cat |
3427 | 3711 |
onCancel:[^ self]. |
3269 | 3712 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3713 |
self doShowSelection:selectionIndex. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3714 |
restart ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3715 |
self doRestart |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
3716 |
] |
3427 | 3717 |
|
3447 | 3718 |
"Modified: / 17.11.2001 / 23:43:54 / cg" |
3187 | 3719 |
! |
3720 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3721 |
doIgnoreBreakpoints |
3511 | 3722 |
self allowBreakPointsInDebugger:false |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3723 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3724 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3725 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3726 |
"single send; reenter with next message send" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3727 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3728 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3729 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3730 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3731 |
(self confirm:('Code modified - step anyway ?')) |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3732 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3733 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3734 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3735 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3736 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3737 |
canContinue ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3738 |
steppedContext := wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3739 |
haveControl := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3740 |
exitAction := #step. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3741 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3742 |
"exit private event-loop" |
6365 | 3743 |
catchBlock value. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3744 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3745 |
"/ not reached |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3746 |
'DebugView [warning]: send failed' errorPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3747 |
sendButton turnOff. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3748 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3749 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3750 |
"Created: / 6.3.1997 / 21:09:36 / cg" |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3751 |
"Modified: / 29.7.1998 / 21:49:29 / cg" |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3752 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3753 |
|
266 | 3754 |
doNext |
1072 | 3755 |
"skip for next source-code line; entering blocks" |
266 | 3756 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3757 |
stepHow := #nextIn. |
266 | 3758 |
self doStep:nil |
790 | 3759 |
|
1072 | 3760 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3761 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3762 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3763 |
doNextOut |
1072 | 3764 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3765 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3766 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3767 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3768 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3769 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 3770 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3771 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3772 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3773 |
doNextOver |
1072 | 3774 |
"skip for next source-code line; skip over blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3775 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3776 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3777 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3778 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3779 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 3780 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 3781 |
! |
3782 |
||
3783 |
doNoTrace |
|
3784 |
traceView notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3785 |
traceView topView destroy. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3786 |
traceView := nil. |
266 | 3787 |
]. |
3788 |
tracing := false |
|
3789 |
! |
|
3790 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3791 |
doNotIgnoreBreakpoints |
3511 | 3792 |
self allowBreakPointsInDebugger:true |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3793 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3794 |
|
4356 | 3795 |
doOpenReportMailApp |
3796 |
"open a mail report tool" |
|
3797 |
||
3798 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3799 |
|
4356 | 3800 |
str := '' writeStream. |
3801 |
||
3802 |
str nextPutLine:('Error notification from ' |
|
3803 |
, OperatingSystem getLoginName |
|
3804 |
, '@' |
|
3805 |
, OperatingSystem getHostName). |
|
3806 |
str cr. |
|
3807 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
3808 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 3809 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
3810 |
str nextPutLine:('Description: ' , self label). |
|
3811 |
"/ str nextPutLine:('Error: ', printedException description). |
|
3812 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
3813 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
3814 |
str nextPutLine:'Backtrace:'. |
|
3815 |
str cr. |
|
3816 |
||
3817 |
firstContext notNil ifTrue:[ |
|
3818 |
firstContext fullPrintAllOn:str. |
|
3819 |
]. |
|
3820 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3821 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3822 |
SendMailTool |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3823 |
openForMessage:(str contents) |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3824 |
withSubject:('STX Error:[', self label, ']') |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3825 |
preOpenBlock:[:inst| |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3826 |
inst recipientEntryField value:'error@exept.de' |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3827 |
]. |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3828 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3829 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 3830 |
! |
3831 |
||
266 | 3832 |
doRestart |
3833 |
"restart - the selected context will be restarted" |
|
6365 | 3834 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3835 |
self checkIfCodeIsReallyModified ifTrue:[ |
6365 | 3836 |
(self confirm:('Code modified - restart anyway ?')) ifFalse:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3837 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3838 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3839 |
]. |
266 | 3840 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3841 |
selectedContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3842 |
^ self showError:'** select a context first **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3843 |
]. |
6365 | 3844 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3845 |
^ self |
266 | 3846 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3847 |
steppedContext := wrapperContext := nil. |
266 | 3848 |
haveControl := false. |
6365 | 3849 |
exitAction := #restart. "exit private event-loop" |
3850 |
||
3851 |
catchBlock value. |
|
3852 |
||
3853 |
"/ normally not reached |
|
3854 |
||
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3855 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3856 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3857 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3858 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 3859 |
! |
3860 |
||
3861 |
doReturn |
|
3862 |
"return - the selected context will do a ^nil" |
|
3863 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3864 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3865 |
(self confirm:('Code modified - return anyway ?')) |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3866 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3867 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3868 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3869 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3870 |
|
266 | 3871 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3872 |
selectedContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3873 |
^ self showError:'** select a context first **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3874 |
]. |
2313 | 3875 |
self interruptProcessWith:[selectedContext unwind:nil]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3876 |
^ self |
266 | 3877 |
]. |
3878 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3879 |
steppedContext := wrapperContext := nil. |
266 | 3880 |
haveControl := false. |
3881 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3882 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3883 |
"exit private event-loop" |
6365 | 3884 |
catchBlock value. |
477 | 3885 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3886 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3887 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3888 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3889 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3890 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 3891 |
! |
3892 |
||
3893 |
doSend |
|
3894 |
"single send; reenter with next message send" |
|
3895 |
||
1072 | 3896 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3897 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3898 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3899 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3900 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3901 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3902 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3903 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3904 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3905 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3906 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3907 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3908 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3909 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3910 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3911 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3912 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3913 |
|
1072 | 3914 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 3915 |
! |
3916 |
||
3917 |
doStep |
|
3918 |
"skip for next send in selected method" |
|
3919 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3920 |
stepHow := #step. |
790 | 3921 |
self doStep:-1 |
3922 |
||
1072 | 3923 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 3924 |
! |
3925 |
||
3926 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3927 |
"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
|
3928 |
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
|
3929 |
or to next line (if nil) or to next send (if -1)" |
266 | 3930 |
|
3931 |
|con method| |
|
3932 |
||
3933 |
inspecting ifTrue:[^ self]. |
|
3934 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3935 |
self checkIfCodeIsReallyModified ifTrue:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3936 |
(self confirm:('Code modified - step anyway ?')) |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3937 |
ifFalse:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3938 |
^ self |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3939 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3940 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3941 |
|
266 | 3942 |
canContinue ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3943 |
selectedContext notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3944 |
con := actualContext. "/ selectedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3945 |
steppedContextLineno := actualContext lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3946 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3947 |
con := contextArray at:2. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3948 |
steppedContextLineno := con lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3949 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3950 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3951 |
skipLineNr := lineNr. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3952 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3953 |
lineNr == -1 ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3954 |
steppedContextLineno := skipLineNr := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3955 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3956 |
|
2581 | 3957 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3958 |
steppedContext := contextArray at:1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3959 |
stepHow := #nextIn. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3960 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3961 |
stepHow == #nextOut ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3962 |
steppedContext := con home. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3963 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3964 |
steppedContext := con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3965 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3966 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3967 |
wrapperContext := nil. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3968 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3969 |
"/ ' 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
|
3970 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3971 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3972 |
if we step in a wrapped method, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3973 |
prepare to skip the prolog ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3974 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3975 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3976 |
inWrap := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3977 |
method := con method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3978 |
(method notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3979 |
and:[method isWrapped |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3980 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3981 |
inWrap := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3982 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3983 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3984 |
lineNr == #return ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3985 |
Processor activeProcess forceInterruptOnReturnOf:con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3986 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3987 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3988 |
con := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3989 |
bigStep := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3990 |
haveControl := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3991 |
exitAction := #step. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3992 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3993 |
"exit private event-loop" |
6365 | 3994 |
catchBlock value. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3995 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3996 |
"/ not reached |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3997 |
'DebugView [warning]: step failed' errorPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3998 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
266 | 3999 |
] |
477 | 4000 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4001 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 4002 |
! |
4003 |
||
4004 |
doStop |
|
4005 |
"stop the process (if its running, otherwise this is a no-op)" |
|
4006 |
||
4007 |
inspecting ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4008 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4009 |
continueButton foregroundColor:Color green darkened darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4010 |
]. |
6647 | 4011 |
continueButton label:(resources string:'Continue'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4012 |
continueButton action:[self doContinue]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4013 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4014 |
self processPerform:#stop. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4015 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4016 |
^ self |
266 | 4017 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4018 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
4019 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 4020 |
! |
4021 |
||
4022 |
doTerminate |
|
4023 |
"terminate - the process has a chance for cleanup" |
|
4024 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
4025 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4026 |
(self confirm:('Code modified - terminate anyway ?')) |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4027 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4028 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4029 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4030 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4031 |
|
266 | 4032 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4033 |
self processPerform:#terminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4034 |
^ self |
266 | 4035 |
]. |
4036 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4037 |
steppedContext := wrapperContext := nil. |
266 | 4038 |
haveControl := false. |
4039 |
exitAction := #terminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4040 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4041 |
"exit private event-loop" |
6365 | 4042 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4043 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4044 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4045 |
inspecting ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4046 |
'DebugView [warning]: terminate failed' errorPrintCR. |
5884 | 4047 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
4048 |
Debugger newDebugger. |
|
4049 |
Processor activeProcess terminate. |
|
4050 |
] |
|
266 | 4051 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4052 |
terminateButton turnOff. |
477 | 4053 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
4054 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 4055 |
! |
4056 |
||
4057 |
doTrace |
|
4058 |
"tracing - not really implemented ..." |
|
4059 |
||
4060 |
self warn:'this function is not yet implemented'. |
|
4061 |
||
4062 |
"/ |v b| |
|
4063 |
"/ |
|
4064 |
"/ traceView isNil ifTrue:[ |
|
4065 |
"/ v := StandardSystemView on:Display. |
|
4066 |
"/ v label:'Debugger-Trace'. |
|
4067 |
"/ v icon:icon. |
|
4068 |
"/ |
|
4069 |
"/ b := Button label:'untrace' in:v. |
|
4070 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
4071 |
"/ b action:[ |
|
4072 |
"/ StepInterruptPending := nil. |
|
4073 |
"/ tracing := false. |
|
4074 |
"/ v unrealize. |
|
4075 |
"/ traceView := nil |
|
4076 |
"/ ]. |
|
4077 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
4078 |
"/ traceView origin:(0 @ (b height)) |
|
4079 |
"/ extent:[v width @ (v height - b height)] |
|
4080 |
"/ ]. |
|
4081 |
"/ v realize. |
|
4082 |
"/ |
|
4083 |
"/ tracing := true. |
|
4084 |
! |
|
4085 |
||
4086 |
doTraceStep |
|
4087 |
"tracestep - not implemented yet" |
|
4088 |
||
4089 |
canContinue ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4090 |
tracing := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4091 |
self doStep |
266 | 4092 |
] |
4093 |
! |
|
4094 |
||
4095 |
exit |
|
4096 |
"exit from menu: immediate exit from smalltalk" |
|
4097 |
||
4098 |
OperatingSystem exit |
|
4099 |
! |
|
4100 |
||
8170 | 4101 |
hasHaltsToIgnore |
4102 |
^ IgnoredHalts notEmptyOrNil |
|
4103 |
! |
|
4104 |
||
8179 | 4105 |
ignoreHaltForever |
4106 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil. |
|
4107 |
! |
|
4108 |
||
266 | 4109 |
inspectContext |
4110 |
"launch an inspector on the currently selected context" |
|
4111 |
||
4112 |
contextView selection notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4113 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4114 |
(contextArray at:(contextView selection)) inspect. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4115 |
] |
266 | 4116 |
] |
4117 |
! |
|
4118 |
||
8170 | 4119 |
isStoppedAtHaltOrBreakPoint |
4120 |
^ isStoppedAtHaltOrBreakPoint |
|
4121 |
! |
|
4122 |
||
8142 | 4123 |
middleButtonMenu |
4124 |
<resource: #programMenu > |
|
4125 |
||
4126 |
|items m| |
|
4127 |
||
4128 |
exclusive ifTrue:[ |
|
4129 |
items := #( |
|
4130 |
('Show More WalkBack' showMore ) |
|
4131 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4132 |
('-' ) |
|
4133 |
('Add Breakpoint' addBreakpoint ) |
|
4134 |
('Remove Breakpoint' removeBreakpoint ) |
|
4135 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4136 |
('-' ) |
|
4137 |
('Copy WalkBack Text' copyWalkbackText ) |
|
4138 |
('-' ) |
|
4139 |
('QuickTerminate' quickTerminate ) |
|
4140 |
('=' ) |
|
4141 |
('Exit Smalltalk (No Confirmation)' exit ) |
|
4142 |
). |
|
4143 |
] ifFalse:[ |
|
4144 |
items := #( |
|
4145 |
('Show More WalkBack' showMore ) |
|
4146 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4147 |
('-' ) |
|
4148 |
('Skip' skip ) |
|
4149 |
('Step Out' skipForReturn ) |
|
4150 |
('Skip until Entering...' skipUntilEntering ) |
|
4151 |
('-' ) |
|
4152 |
" |
|
4153 |
('Continue' doContinue ) |
|
4154 |
('Terminate' doTerminate ) |
|
4155 |
('Abort' doAbort ) |
|
4156 |
('-' ) |
|
4157 |
('Step' doStep ) |
|
4158 |
('Send' doSend ) |
|
4159 |
('-' ) |
|
4160 |
('Return' doReturn ) |
|
4161 |
('Restart' doRestart ) |
|
4162 |
('-' ) |
|
4163 |
" |
|
4164 |
('Add Breakpoint' addBreakpoint ) |
|
4165 |
('Remove Breakpoint' removeBreakpoint ) |
|
4166 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4167 |
). |
|
4168 |
||
4169 |
self allowBreakPointsInDebugger ifFalse:[ |
|
4170 |
items := items , #( |
|
4171 |
('Allow Breakpoints && halt in Debugger' doNotIgnoreBreakpoints ) |
|
4172 |
). |
|
4173 |
] ifTrue:[ |
|
4174 |
items := items , #( |
|
4175 |
('Ignore Breakpoints && halt in Debugger' doIgnoreBreakpoints ) |
|
4176 |
). |
|
4177 |
]. |
|
4178 |
||
4179 |
items := items , #( |
|
4180 |
('-' ) |
|
4181 |
('Browse Implementing Class' browseImplementingClass ) |
|
4182 |
('Browse Receivers Class' browseReceiversClass ) |
|
4183 |
('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
|
4184 |
('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
4185 |
('Implementors' browseImplementors ) |
|
4186 |
('Implementors Of...' browseImplementorsOf ) |
|
4187 |
('Senders' browseSenders ) |
|
4188 |
('Senders Of...' browseSendersOf ) |
|
4189 |
('-' ) |
|
4190 |
('Inspect Context' inspectContext ) |
|
4191 |
('Copy WalkBack Text' copyWalkbackText ) |
|
4192 |
('-' ) |
|
4193 |
('QuickTerminate' quickTerminate ) |
|
4194 |
('=' ) |
|
4195 |
('Exit Smalltalk (No Confirmation)' exit ) |
|
4196 |
). |
|
4197 |
]. |
|
4198 |
||
4199 |
||
4200 |
m := PopUpMenu |
|
4201 |
itemList:items |
|
4202 |
resources:resources |
|
4203 |
receiver:self |
|
4204 |
for:contextView. |
|
4205 |
||
4206 |
verboseBacktrace ifTrue:[ |
|
4207 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
|
4208 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback |
|
4209 |
]. |
|
4210 |
||
4211 |
inspecting ifTrue:[ |
|
4212 |
m notNil ifTrue:[ |
|
4213 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
4214 |
browseClassHierarchy browseFullClassProtocol |
|
4215 |
browseImplementors browseSenders inspectContext skip doStepOut). |
|
4216 |
]. |
|
4217 |
]. |
|
4218 |
self updateMenuItems. |
|
4219 |
||
4220 |
^ m. |
|
4221 |
! |
|
4222 |
||
3447 | 4223 |
openAboutThisApplication |
4224 |
"opens an about box for this application." |
|
4225 |
||
7112 | 4226 |
Dialog aboutClass:self class. |
4227 |
||
4228 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 4229 |
! |
4230 |
||
8170 | 4231 |
openIgnoreHaltNTimesDialog |
8179 | 4232 |
|answer n| |
4233 |
||
4234 |
[ |
|
4235 |
answer := Dialog request:'How often should this halt be ignored ?'. |
|
4236 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4237 |
||
4238 |
n := Integer readFrom:answer onError:nil. |
|
4239 |
n notNil ifTrue:[ |
|
4240 |
self addIgnoredHaltForCount:n orTimeDuration:nil. |
|
4241 |
^ self. |
|
8170 | 4242 |
]. |
8179 | 4243 |
] loop. |
4244 |
! |
|
4245 |
||
4246 |
openIgnoreHaltUntilTimeElapsedDialog |
|
4247 |
|answer dT| |
|
4248 |
||
4249 |
[ |
|
4250 |
answer := Dialog request:'How long should this halt/breakpoint be ignored (s/m/h) ?'. |
|
4251 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4252 |
||
8580 | 4253 |
dT := TimeDuration readFrom:answer onError:[ nil ]. |
8179 | 4254 |
dT notNil ifTrue:[ |
4255 |
self addIgnoredHaltForCount:nil orTimeDuration:dT. |
|
4256 |
^ self. |
|
4257 |
]. |
|
4258 |
] loop |
|
8170 | 4259 |
! |
4260 |
||
8620 | 4261 |
openSettingsDialog |
4262 |
|settingsList settingsApp| |
|
4263 |
||
4264 |
settingsList := |
|
4265 |
#( |
|
8626 | 4266 |
#('Debugger' #'AbstractSettingsApplication::DebuggerSettingsAppl' ) |
8620 | 4267 |
#('Editor' #'AbstractSettingsApplication::EditSettingsAppl' ) |
4268 |
#('Syntax Color' #'AbstractSettingsApplication::SyntaxColorSettingsAppl' ) |
|
4269 |
#('Code Format' #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl' ) |
|
4270 |
). |
|
4271 |
||
4272 |
settingsApp := SettingsDialog new. |
|
4273 |
settingsApp requestor:self. |
|
4274 |
settingsApp installSettingsEntries:settingsList. |
|
4275 |
settingsApp allButOpen. |
|
4276 |
settingsApp window label:('Debugger Settings'). |
|
4277 |
settingsApp openWindow. |
|
4278 |
! |
|
4279 |
||
266 | 4280 |
quickTerminate |
4281 |
"quick terminate - the process will get no chance for cleanup actions" |
|
4282 |
||
4283 |
inspecting ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4284 |
self processPerform:#terminateNoSignal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4285 |
^ self |
266 | 4286 |
]. |
4287 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4288 |
steppedContext := wrapperContext := nil. |
266 | 4289 |
haveControl := false. |
4290 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4291 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4292 |
"exit private event-loop" |
6365 | 4293 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4294 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4295 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4296 |
inspecting ifFalse:[ |
5884 | 4297 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
4298 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
4299 |
Debugger newDebugger. |
|
4300 |
Processor activeProcess terminateNoSignal. |
|
4301 |
] |
|
266 | 4302 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4303 |
terminateButton turnOff. |
477 | 4304 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4305 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 4306 |
! |
4307 |
||
4308 |
removeAllBreakpoints |
|
4309 |
"remove all trace & breakpoints - if any" |
|
4310 |
||
1327 | 4311 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
1661 | 4312 |
self withExecuteCursorDo:[ |
4313 |
MessageTracer unwrapAllMethods |
|
4314 |
] |
|
1319 | 4315 |
] |
1327 | 4316 |
|
1661 | 4317 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
266 | 4318 |
! |
4319 |
||
4320 |
removeBreakpoint |
|
4321 |
"remove breakpoint on the selected contexts method - if any" |
|
4322 |
||
4323 |
|implementorClass method| |
|
4324 |
||
4325 |
selectedContext isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4326 |
^ self showError:'** select a context first **' |
266 | 4327 |
]. |
1327 | 4328 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4329 |
^ self |
1319 | 4330 |
]. |
266 | 4331 |
|
4332 |
implementorClass := selectedContext methodClass. |
|
4333 |
implementorClass notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4334 |
method := implementorClass compiledMethodAt:selectedContext selector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4335 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4336 |
method clearBreakPoint |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4337 |
] |
266 | 4338 |
]. |
4339 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
3511 | 4340 |
contextView middleButtonMenu enable:#addBreakpoint. |
1327 | 4341 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4342 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
266 | 4343 |
! |
4344 |
||
3447 | 4345 |
showDenseWalkback |
3427 | 4346 |
|m| |
4347 |
||
4348 |
m := contextView middleButtonMenu. |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4349 |
verboseBacktrace := false. |
3694 | 4350 |
m labelAt:#showDenseWalkback put:(resources string:'Show Verbose WalkBack'). |
3447 | 4351 |
m selectorAt:#showDenseWalkback put:#showVerboseWalkback. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4352 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4353 |
|
3447 | 4354 |
"Created: / 17.11.2001 / 20:08:08 / cg" |
4355 |
"Modified: / 17.11.2001 / 22:39:48 / cg" |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4356 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4357 |
|
266 | 4358 |
showMore |
3447 | 4359 |
"double the number of contexts shown" |
266 | 4360 |
|
4361 |
contextArray notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4362 |
nChainShown := nChainShown * 2. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4363 |
self redisplayBacktrace. |
266 | 4364 |
] |
563 | 4365 |
|
3447 | 4366 |
"Modified: / 17.11.2001 / 20:14:31 / cg" |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4367 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4368 |
|
3447 | 4369 |
showVerboseWalkback |
4370 |
|m| |
|
4371 |
||
4372 |
verboseBacktrace := true. |
|
4373 |
m := contextView middleButtonMenu. |
|
3694 | 4374 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
3447 | 4375 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback. |
4376 |
||
4377 |
self redisplayBacktrace. |
|
4378 |
||
4379 |
"Created: / 17.11.2001 / 20:07:57 / cg" |
|
4380 |
"Modified: / 17.11.2001 / 22:39:41 / cg" |
|
4381 |
! |
|
4382 |
||
4383 |
showingDenseWalkback |
|
4384 |
^ verboseBacktrace == false. |
|
4385 |
||
4386 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
4387 |
! |
|
4388 |
||
4389 |
showingVerboseWalkback |
|
4390 |
^ verboseBacktrace == true. |
|
4391 |
||
4392 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
4393 |
! |
|
4394 |
||
266 | 4395 |
skip |
4396 |
"skip for cursor line in selected method" |
|
4397 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4398 |
stepHow := #skip. |
266 | 4399 |
self doStep:codeView cursorLine. |
790 | 4400 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4401 |
"Modified: 3.3.1997 / 20:56:23 / cg" |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4402 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4403 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4404 |
skipForReturn |
2581 | 4405 |
"skip until the selected context is left." |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4406 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4407 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4408 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4409 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4410 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 4411 |
! |
4412 |
||
4413 |
skipUntilEntering |
|
4414 |
"skip until some particular method is invoked." |
|
4415 |
||
4416 |
|selector| |
|
4417 |
||
4418 |
selector := Dialog |
|
4419 |
request:'Skip until entering what (matchpattern):' |
|
4420 |
initialAnswer:self goodSkipUntilSelector. |
|
4421 |
selector size == 0 ifTrue:[^ self]. |
|
4422 |
||
4423 |
stepUntilEntering := selector asSymbol. |
|
4424 |
stepHow := #send. |
|
4425 |
self doStep:-1. |
|
4426 |
||
4427 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 4428 |
! |
4429 |
||
8170 | 4430 |
stopIgnoringHalts |
8179 | 4431 |
self class stopIgnoringHalts |
8170 | 4432 |
! |
4433 |
||
3447 | 4434 |
toggleVerboseWalkback |
4435 |
verboseBacktrace ifFalse:[ |
|
4436 |
self showVerboseWalkback |
|
4437 |
] ifTrue:[ |
|
4438 |
self showDenseWalkback |
|
4439 |
]. |
|
4440 |
||
4441 |
"Modified: / 17.11.2001 / 20:07:45 / cg" |
|
266 | 4442 |
! ! |
4443 |
||
4444 |
!DebugView methodsFor:'private'! |
|
4445 |
||
6487 | 4446 |
abortAllIsHandled |
4447 |
^ AbortAllOperationRequest isHandled |
|
4448 |
! |
|
4449 |
||
8179 | 4450 |
addIgnoredHaltForCount:countOrNil orTimeDuration:dTOrNil |
4451 |
|haltingContext haltingMethod lineNrOfHalt |
|
4452 |
oldEntry ign| |
|
4453 |
||
4454 |
haltingContext := self findHaltingContext. |
|
4455 |
haltingMethod := haltingContext method. |
|
4456 |
lineNrOfHalt := haltingContext lineNumber. |
|
4457 |
||
4458 |
IgnoredHalts notNil ifTrue:[ |
|
4459 |
oldEntry := IgnoredHalts |
|
4460 |
detect:[:ign | ign isForMethod:haltingMethod line:lineNrOfHalt] |
|
4461 |
ifNone:nil. |
|
4462 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
4463 |
]. |
|
4464 |
||
4465 |
(countOrNil notNil or:[dTOrNil notNil]) ifTrue:[ |
|
4466 |
IgnoredHalts isNil ifTrue:[ |
|
4467 |
IgnoredHalts := OrderedCollection new. |
|
4468 |
]. |
|
4469 |
ign := IgnoredHalt new method:haltingMethod lineNumber:lineNrOfHalt. |
|
4470 |
||
4471 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
4472 |
ign ignoreCount:countOrNil. |
|
4473 |
]. |
|
4474 |
||
4475 |
(dTOrNil notNil) ifTrue:[ |
|
4476 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
4477 |
]. |
|
4478 |
IgnoredHalts add:ign. |
|
4479 |
]. |
|
4480 |
! |
|
4481 |
||
266 | 4482 |
busy |
4483 |
^ busy |
|
4484 |
! |
|
4485 |
||
3511 | 4486 |
canAddBreakpoint |
4487 |
|m| |
|
4488 |
||
4489 |
m := contextView middleButtonMenu. |
|
4490 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
4491 |
! |
|
4492 |
||
3269 | 4493 |
canBrowseClassHierarchy |
4494 |
|m| |
|
4495 |
||
4496 |
m := contextView middleButtonMenu. |
|
4497 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
|
4498 |
! |
|
4499 |
||
4500 |
canBrowseFullClassProtocol |
|
4501 |
|m| |
|
4502 |
||
4503 |
m := contextView middleButtonMenu. |
|
4504 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
|
4505 |
! |
|
4506 |
||
4507 |
canBrowseImplementingClass |
|
4508 |
|m| |
|
4509 |
||
4510 |
m := contextView middleButtonMenu. |
|
4511 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
|
4512 |
! |
|
4513 |
||
4514 |
canBrowseReceiversClass |
|
4515 |
|m| |
|
4516 |
||
4517 |
m := contextView middleButtonMenu. |
|
4518 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
|
4519 |
! |
|
4520 |
||
4521 |
canDefineMethod |
|
4522 |
^ defineButton isVisible |
|
4523 |
! |
|
4524 |
||
4525 |
canRemoveBreakpoint |
|
4526 |
|m| |
|
4527 |
||
4528 |
m := contextView middleButtonMenu. |
|
4529 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
4530 |
! |
|
4531 |
||
3447 | 4532 |
canRestart |
4533 |
^ restartButton isEnabled |
|
4534 |
||
4535 |
"Modified: / 17.11.2001 / 19:59:49 / cg" |
|
4536 |
! |
|
4537 |
||
4538 |
canReturn |
|
4539 |
^ returnButton isEnabled |
|
4540 |
||
4541 |
"Modified: / 17.11.2001 / 19:59:18 / cg" |
|
4542 |
! |
|
4543 |
||
3269 | 4544 |
canShowMore |
4545 |
^ canShowMore |
|
4546 |
! |
|
4547 |
||
7797 | 4548 |
contextListEntryFor:aContext |
4549 |
|s| |
|
4550 |
||
4551 |
aContext selector == #doIt ifTrue:[ |
|
4552 |
aContext receiver isNil ifTrue:[ |
|
4553 |
^ 'doIt' asText allBold |
|
4554 |
] |
|
4555 |
]. |
|
4556 |
||
4557 |
s := Text new writeStream. |
|
4558 |
aContext printOn:s. |
|
4559 |
^ s contents |
|
4560 |
||
4561 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
4562 |
! |
|
4563 |
||
266 | 4564 |
exclusive:aBoolean |
4565 |
exclusive := aBoolean |
|
4566 |
! |
|
4567 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4568 |
explainSelection |
8212 | 4569 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4570 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4571 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4572 |
interval isEmpty ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4573 |
crsrPos := codeView characterPositionOfCursor. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4574 |
codeView characterUnderCursor isSeparator ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4575 |
crsrPos := (crsrPos - 1) max:1 |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4576 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4577 |
interval := crsrPos to:crsrPos. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4578 |
]. |
8212 | 4579 |
self |
4580 |
withNodeValueAtInterval:interval |
|
8214 | 4581 |
do:[:value :description | |
8212 | 4582 |
self showValue:value |
4583 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4584 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4585 |
|
8179 | 4586 |
findHaltingContext |
4587 |
|haltSelectors| |
|
4588 |
||
4589 |
haltSelectors := self haltSelectors. |
|
4590 |
||
4591 |
contextArray keysAndValuesDo:[:idx :con | |
|
4592 |
|sel con2 sel2| |
|
4593 |
||
4594 |
sel := con selector. |
|
4595 |
(haltSelectors includes:sel) ifTrue:[ |
|
4596 |
con method mclass == Object ifTrue:[ |
|
4597 |
con2 := contextArray at:idx+1. |
|
4598 |
sel2 := con2 selector. |
|
4599 |
(haltSelectors includes:sel2) ifTrue:[ |
|
4600 |
con2 method mclass == Object ifTrue:[ |
|
4601 |
^ contextArray at:idx+2. |
|
4602 |
] |
|
4603 |
]. |
|
4604 |
^ contextArray at:idx+1 |
|
4605 |
]. |
|
4606 |
]. |
|
4607 |
]. |
|
4608 |
^ nil |
|
4609 |
! |
|
4610 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4611 |
findNodeForInterval:interval |
8212 | 4612 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4613 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4614 |
interval isEmpty ifTrue: [^ nil]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4615 |
|
8487
ddf59247960c
slow runArray (text) operations
Claus Gittinger <cg@exept.de>
parents:
8432
diff
changeset
|
4616 |
source := codeView contentsAsString string. |
8396 | 4617 |
"/ source := currentMethod notNil |
4618 |
"/ ifTrue:[ currentMethod source ] |
|
4619 |
"/ ifFalse:[ codeView contents asString ]. |
|
8257
106d3fecbca0
findNodeForInterval: care for nonexisting source
Claus Gittinger <cg@exept.de>
parents:
8225
diff
changeset
|
4620 |
source isNil ifTrue:[^ nil]. |
8214 | 4621 |
|
8212 | 4622 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
4623 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4624 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4625 |
|
7912 | 4626 |
findNodeIn:tree forInterval:interval |
4627 |
<resource: #obsolete> |
|
4628 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4629 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4630 |
|
7912 | 4631 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4632 |
node := nil. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4633 |
tree nodesDo:[:each | |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4634 |
(each intersectsInterval:interval) ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4635 |
(node isNil or:[node == each parent]) ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4636 |
node := each |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4637 |
] ifFalse:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4638 |
(node parent notNil |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4639 |
and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4640 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4641 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4642 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4643 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4644 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4645 |
|
2581 | 4646 |
goodSkipUntilSelector |
4647 |
|current| |
|
4648 |
||
4649 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
4650 |
selectedContext isNil ifTrue:[^ nil]. |
|
4651 |
current := selectedContext selector. |
|
4652 |
current isNil ifTrue:[^ nil]. |
|
4653 |
('change:*' match:current) ifTrue:[ |
|
4654 |
^ 'update:*' |
|
4655 |
]. |
|
4656 |
^ nil |
|
4657 |
! |
|
4658 |
||
8179 | 4659 |
haltSelectors |
4660 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:'). |
|
4661 |
! |
|
4662 |
||
3447 | 4663 |
hasContextSelected |
4664 |
^ contextView hasSelection |
|
4665 |
||
4666 |
"Created: / 17.11.2001 / 19:57:03 / cg" |
|
4667 |
! |
|
4668 |
||
4669 |
ignoreBreakpoints |
|
4670 |
^ ignoreBreakpoints |
|
4671 |
||
4672 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
4673 |
! |
|
4674 |
||
266 | 4675 |
inspectedProcess |
4676 |
^ inspectedProcess |
|
4677 |
! |
|
4678 |
||
4679 |
interruptProcessWith:aBlock |
|
4680 |
"let inspected process do something, then update the context list" |
|
4681 |
||
4682 |
inspectedProcess isDead ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4683 |
self showTerminated. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4684 |
^ self |
266 | 4685 |
]. |
4686 |
inspectedProcess interruptWith:aBlock. |
|
4687 |
" |
|
4688 |
give the process a chance to run, then update |
|
4689 |
" |
|
4690 |
(Delay forSeconds:0.2) wait. |
|
4691 |
self setContext:(inspectedProcess suspendedContext). |
|
4692 |
! |
|
4693 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4694 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4695 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4696 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4697 |
|
8194 | 4698 |
openHTMLDocument: anHTMLFilename |
4699 |
"open a HTMLDocumentView on anHTMLFilename" |
|
4700 |
||
4701 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
4702 |
! |
|
4703 |
||
266 | 4704 |
processPerform:aMessage |
4705 |
"do something, then update the context list" |
|
4706 |
||
4707 |
inspectedProcess isDead ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4708 |
self showTerminated. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4709 |
^ self |
266 | 4710 |
]. |
4711 |
inspectedProcess perform:aMessage. |
|
4712 |
" |
|
4713 |
give the process a chance to run, then update |
|
4714 |
" |
|
4715 |
(Delay forSeconds:0.2) wait. |
|
4716 |
self setContext:(inspectedProcess suspendedContext). |
|
4717 |
! |
|
4718 |
||
939 | 4719 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4720 |
"force redisplay of the walkBack list; invoked when the |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4721 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4722 |
|
939 | 4723 |
|oldSelection oldContext con idx| |
4724 |
||
4725 |
contextArray notNil ifTrue:[ |
|
1661 | 4726 |
self withExecuteCursorDo:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4727 |
oldSelection := contextView selection. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4728 |
oldSelection notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4729 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4730 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4731 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4732 |
con := firstContext. |
950 | 4733 |
"/ con := contextArray at:1. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4734 |
"/ force redeisplay, even if same by changing the first entry |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4735 |
contextArray size > 0 ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4736 |
contextArray at:1 put:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4737 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4738 |
self setContext:con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4739 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4740 |
oldContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4741 |
idx := oldSelection |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4742 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4743 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4744 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4745 |
contextView setSelection:idx. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4746 |
idx notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4747 |
self showSelection:idx |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4748 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4749 |
] |
939 | 4750 |
] |
4751 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4752 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 4753 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 4754 |
! |
4755 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4756 |
selectedInterval |
7912 | 4757 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4758 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4759 |
|
7823 | 4760 |
showError:message |
4761 |
codeView contents:(resources string:message). |
|
4762 |
shown ifTrue:[ |
|
4763 |
exclusive ifTrue:[ |
|
4764 |
"/ consider this a kludge: |
|
4765 |
"/ if exclusive, cannot use flash, since it suspends |
|
4766 |
"/ (but we cannot suspend here ...) |
|
4767 |
codeView redrawInverted. device flush. |
|
4768 |
OperatingSystem millisecondDelay:200. |
|
4769 |
codeView redraw |
|
4770 |
] ifFalse:[ |
|
4771 |
codeView flash |
|
4772 |
] |
|
4773 |
] |
|
4774 |
||
4775 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
4776 |
! |
|
4777 |
||
4778 |
showTerminated |
|
4779 |
self showError:'** the process has terminated **' |
|
4780 |
! |
|
4781 |
||
4782 |
showValue:aValue |
|
4783 |
"/ TODO: show value in info field |
|
4784 |
"/ Transcript showCR:aValue printString |
|
4785 |
! |
|
4786 |
||
4787 |
stepping |
|
4788 |
^ stepping |
|
4789 |
! |
|
4790 |
||
4791 |
unstep |
|
4792 |
stepping := false. |
|
4793 |
bigStep := false. |
|
4794 |
steppedContext := wrapperContext := nil. |
|
4795 |
exitAction := nil |
|
4796 |
||
4797 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
4798 |
! |
|
4799 |
||
4800 |
updateContext |
|
4801 |
|oldContext idx| |
|
4802 |
||
4803 |
inspectedProcess state == #dead ifTrue:[ |
|
4804 |
self showTerminated. |
|
4805 |
^ self |
|
4806 |
]. |
|
4807 |
||
4808 |
oldContext := selectedContext. |
|
4809 |
[ |
|
4810 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
|
4811 |
oldContext notNil ifTrue:[ |
|
4812 |
contextArray notNil ifTrue:[ |
|
4813 |
idx := contextArray identityIndexOf:oldContext. |
|
4814 |
idx ~~ 0 ifTrue:[ |
|
4815 |
self showSelection:idx |
|
4816 |
] ifFalse:[ |
|
4817 |
codeView contents:('** context returned **') |
|
4818 |
] |
|
4819 |
] |
|
4820 |
] |
|
4821 |
]. |
|
4822 |
] valueUninterruptably. |
|
4823 |
||
4824 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 4825 |
! |
4826 |
||
4827 |
withNodeValueAtInterval:interval do:aBlock |
|
8214 | 4828 |
|node definingNode nm nmBold varIdx parentNode receiver con| |
8212 | 4829 |
|
4830 |
"/interval printCR. |
|
8592 | 4831 |
Error |
4832 |
handle:[:ex | ] |
|
4833 |
do:[ node := self findNodeForInterval:interval ]. |
|
8212 | 4834 |
"/node printCR. |
4835 |
node isNil ifTrue:[ ^ self ]. |
|
8592 | 4836 |
node isVariable ifFalse:[ |
4837 |
"/ Transcript showCR:node. |
|
4838 |
^ self |
|
4839 |
]. |
|
8212 | 4840 |
|
4841 |
nm := node name. |
|
8214 | 4842 |
nmBold := nm allBold. |
8600 | 4843 |
actualContext isNil ifTrue:[^ self ]. |
8636 | 4844 |
actualContext methodHome isNil ifTrue:[^ self ]. |
8214 | 4845 |
receiver := actualContext methodHome receiver. |
8212 | 4846 |
|
4847 |
(nm = 'self') ifTrue:[ |
|
8214 | 4848 |
aBlock value:receiver value:'receiver' allBold. |
8212 | 4849 |
^ self |
4850 |
]. |
|
4851 |
(nm = 'super') ifTrue:[ |
|
8214 | 4852 |
aBlock value:receiver value:'receiver' allBold. |
8212 | 4853 |
^ self |
4854 |
]. |
|
4855 |
(nm = 'thisContext') ifTrue:[ |
|
8214 | 4856 |
aBlock value:actualContext value:'context' allBold. |
8212 | 4857 |
^ self |
4858 |
]. |
|
4859 |
||
4860 |
definingNode := node whoDefines:nm. |
|
4861 |
definingNode isNil ifTrue:[ |
|
8214 | 4862 |
(receiver class allInstVarNames includes:nm) ifTrue:[ |
4863 |
"/aBlock value:'xIII' value:'instVar'. |
|
4864 |
receiver class isMetaclass ifTrue:[ |
|
4865 |
aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold. |
|
4866 |
] ifFalse:[ |
|
4867 |
aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold. |
|
4868 |
]. |
|
4869 |
^ self |
|
4870 |
]. |
|
4871 |
||
4872 |
(receiver class theNonMetaclass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[ |
|
4873 |
aBlock value:'' value:'private class ',nmBold. |
|
4874 |
^ self |
|
8212 | 4875 |
]. |
8214 | 4876 |
(receiver class theNonMetaclass classVarNames includes:nm) ifTrue:[ |
8327 | 4877 |
aBlock value:((currentMethod mclass ? receiver class) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold. |
8214 | 4878 |
^ self |
4879 |
]. |
|
4880 |
(Smalltalk includesKey:nm asSymbol) ifTrue:[ |
|
4881 |
(Smalltalk at:nm asSymbol) isClass ifTrue:[ |
|
4882 |
aBlock value:'class: ',nmBold value:nil. |
|
4883 |
] ifFalse:[ |
|
4884 |
aBlock value:(Smalltalk at:nm asSymbol) value:'global ',nmBold. |
|
4885 |
]. |
|
4886 |
^ self |
|
4887 |
]. |
|
4888 |
aBlock value:'' value:'unknown'. |
|
8212 | 4889 |
^ self |
4890 |
]. |
|
4891 |
"/definingNode printCR. |
|
4892 |
||
4893 |
definingNode isMethod ifTrue:[ |
|
4894 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
|
4895 |
varIdx ~~ 0 ifTrue:[ |
|
8214 | 4896 |
Error |
4897 |
handle:[:ex | ] |
|
4898 |
do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ]. |
|
8212 | 4899 |
^ self |
8214 | 4900 |
]. |
4901 |
varIdx := definingNode temporaries findFirst:[:var | var name = nm]. |
|
4902 |
varIdx ~~ 0 ifTrue:[ |
|
4903 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
4904 |
Error |
|
4905 |
handle:[:ex | ] |
|
4906 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
4907 |
^ self |
|
4908 |
] |
|
4909 |
]. |
|
8212 | 4910 |
]. |
4911 |
||
4912 |
definingNode isBlock ifTrue:[ |
|
4913 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
|
4914 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
4915 |
varIdx ~~ 0 ifTrue:[ |
|
8214 | 4916 |
"/ am I in this block ? |
4917 |
(actualContext lineNumber notNil |
|
8429 | 4918 |
and:[ definingNode lastLineNumber notNil |
4919 |
and:[ (actualContext lineNumber |
|
8217
11afd2a78c62
changed #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
8215
diff
changeset
|
4920 |
between:definingNode firstLineNumber |
11afd2a78c62
changed #withNodeValueAtInterval:do:
Claus Gittinger <cg@exept.de>
parents:
8215
diff
changeset
|
4921 |
and:definingNode lastLineNumber) |
8429 | 4922 |
and:[ varIdx <= actualContext numArgs ] ]]) |
8214 | 4923 |
ifTrue:[ |
4924 |
aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold . |
|
4925 |
^ self |
|
4926 |
]. |
|
4927 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
|
8212 | 4928 |
^ self |
4929 |
] |
|
4930 |
]. |
|
4931 |
]. |
|
4932 |
||
4933 |
parentNode := definingNode parent. |
|
4934 |
||
4935 |
[parentNode notNil] whileTrue:[ |
|
4936 |
"/'isMethod ' print. parentNode isMethod printCR. |
|
4937 |
parentNode isMethod ifTrue:[ |
|
8214 | 4938 |
varIdx := parentNode temporaries findFirst:[:var | var name = nm]. |
8212 | 4939 |
varIdx ~~ 0 ifTrue:[ |
4940 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
8214 | 4941 |
Error |
4942 |
handle:[:ex | ] |
|
4943 |
do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ]. |
|
8212 | 4944 |
^ self |
4945 |
] |
|
4946 |
]. |
|
4947 |
]. |
|
4948 |
"/'isBlock ' print. parentNode isBlock printCR. |
|
4949 |
parentNode isBlock ifTrue:[ |
|
8214 | 4950 |
"/ we dont have any information on the inlineability |
4951 |
"/ of this block here (RBParser does not know what |
|
4952 |
"/ the compiler does. |
|
4953 |
"/ therefore, it is questionable if we can use the |
|
4954 |
"/ contexts home context here. |
|
4955 |
"/ am I in this block ? |
|
4956 |
con := actualContext. |
|
4957 |
[con notNil |
|
8432 | 4958 |
and:[ parentNode lastLineNumber notNil |
8214 | 4959 |
and:[ con lineNumber notNil |
4960 |
and:[ con lineNumber |
|
4961 |
between:parentNode firstLineNumber |
|
8432 | 4962 |
and:parentNode lastLineNumber ]]]] whileTrue:[ |
8214 | 4963 |
con := con sender. |
8212 | 4964 |
]. |
8214 | 4965 |
con notNil ifTrue:[ |
4966 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
4967 |
varIdx ~~ 0 ifTrue:[ |
|
4968 |
Error |
|
4969 |
handle:[:ex | ] |
|
4970 |
do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ]. |
|
4971 |
^ self |
|
4972 |
]. |
|
4973 |
varIdx := parentNode body temporaries findFirst:[:var | var name = nm]. |
|
4974 |
varIdx ~~ 0 ifTrue:[ |
|
4975 |
Error |
|
4976 |
handle:[:ex | ] |
|
4977 |
do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ]. |
|
4978 |
^ self |
|
4979 |
]. |
|
8212 | 4980 |
]. |
4981 |
]. |
|
4982 |
parentNode := parentNode parent. |
|
4983 |
]. |
|
8214 | 4984 |
aBlock value:nmBold , ' is not in scope of selected context' value:nil. |
7823 | 4985 |
! ! |
4986 |
||
4987 |
!DebugView methodsFor:'private queries'! |
|
4988 |
||
4989 |
isAborting |
|
4990 |
^ exitAction == #abort |
|
4991 |
! |
|
4992 |
||
4993 |
setOfHiddenCallingSelectors |
|
4994 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
4995 |
! |
|
4996 |
||
4997 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
4998 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
4999 |
! ! |
|
5000 |
||
5001 |
!DebugView methodsFor:'private-cache handling'! |
|
5002 |
||
5003 |
cacheMyself |
|
5004 |
"remember myself for next debug session" |
|
5005 |
||
5006 |
"caching the last debugger will make the next debugger appear |
|
5007 |
faster, since no resources have to be allocated in the display. |
|
5008 |
We have to be careful to release all refs to the debuggee, though. |
|
5009 |
Otherwise, the GC will not be able to release it." |
|
5010 |
||
5011 |
windowGroup notNil ifTrue:[ |
|
5012 |
windowGroup setProcess:nil. |
|
5013 |
]. |
|
5014 |
||
5015 |
self releaseDebuggee. |
|
5016 |
||
5017 |
cachable ~~ true ifTrue:[^ self]. |
|
5018 |
||
5019 |
"/ |
|
5020 |
"/ only cache if I am on the Display |
|
5021 |
"/ |
|
5022 |
device == Display ifTrue:[ |
|
5023 |
exclusive ifTrue:[ |
|
5024 |
CachedExclusive := self |
|
5025 |
] ifFalse:[ |
|
5026 |
CachedDebugger := self |
|
5027 |
]. |
|
5028 |
]. |
|
5029 |
||
5030 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
5031 |
ObjectMemory stepInterruptHandler:nil |
|
5032 |
]. |
|
5033 |
||
5034 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
5035 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
5036 |
! |
|
5037 |
||
5038 |
isCached |
|
5039 |
"tell wether we are a cached debugger" |
|
5040 |
||
5041 |
CachedExclusive == self ifTrue:[ |
|
5042 |
^ true. |
|
5043 |
]. |
|
5044 |
CachedDebugger == self ifTrue:[ |
|
5045 |
^ true. |
|
5046 |
]. |
|
5047 |
||
5048 |
^ false. |
|
5049 |
||
5050 |
"Created: 10.7.1997 / 15:22:43 / stefan" |
|
5051 |
! |
|
5052 |
||
5053 |
releaseDebuggee |
|
5054 |
"We have to be careful to release all refs to the debuggee, |
|
5055 |
because we may be in the cache. |
|
5056 |
Otherwise, the GC will not be able to release it" |
|
5057 |
||
5058 |
busy := false. |
|
5059 |
||
5060 |
codeView acceptAction:nil. |
|
5061 |
codeView doItAction:nil. |
|
5062 |
codeView contents:nil. |
|
5063 |
||
5064 |
receiverInspector release. |
|
5065 |
contextInspector release. |
|
5066 |
inspectedProcess := nil. |
|
5067 |
contextArray := nil. |
|
5068 |
selectedContext := actualContext := firstContext := nil. |
|
5069 |
steppedContext := wrapperContext := nil. |
|
5070 |
catchBlock := nil. |
|
5071 |
grabber := nil. |
|
5072 |
self autoUpdateOff. |
|
5073 |
||
5074 |
"Created: / 10.7.1997 / 14:57:51 / stefan" |
|
5075 |
"Modified: / 10.7.1997 / 15:50:38 / stefan" |
|
5076 |
"Modified: / 17.11.2001 / 22:58:17 / cg" |
|
5077 |
! |
|
5078 |
||
5079 |
uncacheMyself |
|
5080 |
"do not remember myself any longer for next debug session" |
|
5081 |
||
5082 |
cachable := false. |
|
5083 |
||
5084 |
CachedExclusive == self ifTrue:[ |
|
5085 |
CachedExclusive := nil. |
|
5086 |
]. |
|
5087 |
CachedDebugger == self ifTrue:[ |
|
5088 |
CachedDebugger := nil. |
|
5089 |
]. |
|
5090 |
OpenDebuggers notNil ifTrue:[ |
|
5091 |
OpenDebuggers remove:self ifAbsent:[]. |
|
5092 |
]. |
|
5093 |
||
5094 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
5095 |
! ! |
|
5096 |
||
5097 |
!DebugView methodsFor:'private-context handling'! |
|
5098 |
||
266 | 5099 |
setContext:aContext |
5100 |
"show calling chain from aContext in the walk-back listview" |
|
5101 |
||
641 | 5102 |
^ 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
|
5103 |
|
641 | 5104 |
"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
|
5105 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5106 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5107 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5108 |
"show calling chain from aContext in the walk-back listview. |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5109 |
Most complications here arise from filtering less-interesting contexts |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5110 |
if not in verbose-context mode." |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5111 |
|
3702 | 5112 |
|con text method caller caller2 called called2 m count c cc |
3447 | 5113 |
suspendContext calledBySuspendContext nm h calledContext| |
266 | 5114 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5115 |
(contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5116 |
"no change" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5117 |
^ false |
266 | 5118 |
]. |
5119 |
||
8170 | 5120 |
isStoppedAtHaltOrBreakPoint := false. |
939 | 5121 |
firstContext := aContext. |
5122 |
||
266 | 5123 |
m := contextView middleButtonMenu. |
5124 |
m notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5125 |
m disable:#showMore. |
266 | 5126 |
]. |
3269 | 5127 |
canShowMore := false. |
266 | 5128 |
|
5129 |
aContext isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5130 |
text := Array with:'** no context **'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5131 |
contextArray := nil. |
266 | 5132 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5133 |
text := OrderedCollection new:nChainShown. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5134 |
contextArray := OrderedCollection new:nChainShown. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5135 |
con := aContext. |
3447 | 5136 |
calledContext := nil. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5137 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5138 |
verboseBacktrace ~~ true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5139 |
"/ with dense backtrace, hide the ProcessorScheduler |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5140 |
"/ contexts at the top; look for a Process>>suspend* |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5141 |
"/ context within the first 10 contexts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5142 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5143 |
suspendContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5144 |
c := con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5145 |
1 to:10 do:[:i | |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5146 |
|sel| |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5147 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5148 |
c notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5149 |
(sel := c selector) notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5150 |
((sel isSymbol and:[sel startsWith:'suspend']) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5151 |
and:[c receiver isMemberOf:Process]) ifTrue:[ |
3447 | 5152 |
suspendContext := c. |
5153 |
calledBySuspendContext := cc. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5154 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5155 |
]. |
3447 | 5156 |
cc := c. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5157 |
c := c sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5158 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5159 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5160 |
suspendContext notNil ifTrue:[ |
3447 | 5161 |
con := suspendContext. |
5162 |
calledContext := calledBySuspendContext. |
|
5163 |
suspendContext := nil |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5164 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5165 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5166 |
|
8170 | 5167 |
con notNil ifTrue:[ |
5168 |
"/ hide the halt implementation |
|
8179 | 5169 |
(self haltSelectors includes:con selector) ifTrue:[ |
8170 | 5170 |
(con method notNil and:[con method mclass == Object]) ifTrue:[ |
5171 |
isStoppedAtHaltOrBreakPoint := true. |
|
5172 |
verboseBacktrace ~~ true ifTrue:[ |
|
3447 | 5173 |
calledContext := con. |
3427 | 5174 |
con := con sender. |
5175 |
] |
|
7823 | 5176 |
]. |
3427 | 5177 |
] |
5178 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5179 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5180 |
get them all |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5181 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5182 |
count := 0. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5183 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
8179 | 5184 |
(self haltSelectors includes:con selector) ifTrue:[ |
8170 | 5185 |
(con method notNil and:[con method mclass == Object]) ifTrue:[ |
5186 |
isStoppedAtHaltOrBreakPoint := true. |
|
5187 |
] |
|
5188 |
]. |
|
5189 |
||
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5190 |
[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5191 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5192 |
'showingContext1: (' print. con print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5193 |
') --> ' print. (self showingContext1:con calling:calledContext) printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5194 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5195 |
self showingContext1:con calling:calledContext |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5196 |
] whileFalse:[ |
3447 | 5197 |
calledContext := con. |
5198 |
con := con sender. |
|
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
5199 |
]. |
3447 | 5200 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5201 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5202 |
'showingContext2: (' print. con print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5203 |
') --> ' print. (self showingContext2:con nesting:count) printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5204 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5205 |
|
3447 | 5206 |
(self showingContext2:con nesting:count) ifTrue:[ |
1646 | 5207 |
"/ ignore it, if its in the same |
5208 |
"/ method as the previous context |
|
3447 | 5209 |
"/ (verboseBacktrace ~~ true |
5210 |
"/ and:[count > 0 |
|
5211 |
"/ and:[contextArray last method == con method |
|
5212 |
"/ and:[(contextArray last isBlockContext not |
|
5213 |
"/ & con isBlockContext not) not ]]]) ifTrue:[ |
|
5214 |
"/ "/ skip it, if its in the same method |
|
5215 |
"/ "/ as the called context. |
|
5216 |
"/ ] ifFalse:[ |
|
1646 | 5217 |
contextArray add:con. |
5218 |
||
5219 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
5220 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
5221 |
] ifFalse:[ |
|
7797 | 5222 |
Error |
5223 |
handle:[:ex | nm := '???' ] |
|
5224 |
do:[ |
|
5225 |
nm := self contextListEntryFor:con. |
|
5226 |
]. |
|
1646 | 5227 |
]. |
5228 |
text add:nm. |
|
5229 |
count := count + 1. |
|
3447 | 5230 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5231 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5232 |
|
3447 | 5233 |
"/ |
5234 |
"/ kludge: if its a wrapped method, then hide the wrap-call |
|
5235 |
"/ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5236 |
method := con method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5237 |
(method notNil and:[method isWrapped]) ifTrue:[ |
3447 | 5238 |
called := con. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5239 |
caller := con sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5240 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
3447 | 5241 |
called2 := caller. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5242 |
caller2 := caller sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5243 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
3447 | 5244 |
calledContext := called2. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5245 |
con := caller2 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5246 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5247 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5248 |
caller := caller2 := nil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5249 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5250 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5251 |
"/ with dense backtrace, skip the doIt methods context |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5252 |
"/ (its dummy anyway) and fake that contexts name |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5253 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5254 |
verboseBacktrace ~~ true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5255 |
(con isBlockContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5256 |
and:[(h := con home) == con sender |
7843
7e4538e4c2cf
changed #setContext:releaseInspectors: take care of nil home context
Stefan Vogel <sv@exept.de>
parents:
7830
diff
changeset
|
5257 |
and:[h notNil |
6622
cf89940b5d30
configurable set of hidden selectors
Claus Gittinger <cg@exept.de>
parents:
6616
diff
changeset
|
5258 |
and:[(self setOfHiddenCallingSelectors includes:h selector) |
7843
7e4538e4c2cf
changed #setContext:releaseInspectors: take care of nil home context
Stefan Vogel <sv@exept.de>
parents:
7830
diff
changeset
|
5259 |
and:[h method who isNil]]]]) ifTrue:[ |
3447 | 5260 |
calledContext := con. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5261 |
con := con sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5262 |
text removeLast. |
7797 | 5263 |
|
5264 |
text add:(self contextListEntryFor:con methodHome). |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5265 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5266 |
h := nil. "/ never keep refs to contexts unless you really need them ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5267 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5268 |
|
3427 | 5269 |
"/ with dense backtrace, dont show below the doIt |
5270 |
( verboseBacktrace ~~ true |
|
6622
cf89940b5d30
configurable set of hidden selectors
Claus Gittinger <cg@exept.de>
parents:
6616
diff
changeset
|
5271 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
3427 | 5272 |
con := nil. |
5273 |
] ifFalse:[ |
|
3447 | 5274 |
calledContext := con. |
3427 | 5275 |
con := con sender |
5276 |
] |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5277 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5278 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5279 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5280 |
did we reach the end ? |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5281 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5282 |
(con isNil or:[con sender isNil]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5283 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5284 |
"/ the very last one is the startup context |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5285 |
"/ (in main) - it has nil as receiver and nil as selector |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5286 |
|
1906
58200b8df8f7
check for empty contextArray
Claus Gittinger <cg@exept.de>
parents:
1871
diff
changeset
|
5287 |
(contextArray notEmpty |
58200b8df8f7
check for empty contextArray
Claus Gittinger <cg@exept.de>
parents:
1871
diff
changeset
|
5288 |
and:[contextArray last selector isNil]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5289 |
contextArray removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5290 |
text removeLast |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5291 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5292 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5293 |
verboseBacktrace ~~ true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5294 |
"/ in dense mode, remove the process startup |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5295 |
"/ contexts (if any) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5296 |
|
2299 | 5297 |
(contextArray size > 0 |
5298 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5299 |
con selector == #start ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5300 |
contextArray removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5301 |
text removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5302 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5303 |
[contextArray size > 0 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5304 |
and:[contextArray last methodHome == con]] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5305 |
contextArray removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5306 |
text removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5307 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5308 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5309 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5310 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5311 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5312 |
m notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5313 |
m enable:#showMore. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5314 |
]. |
3269 | 5315 |
canShowMore := true. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5316 |
text add:(resources string:'*** more walkback follows - click here to see them ***') |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5317 |
]. |
266 | 5318 |
]. |
5319 |
||
5320 |
contextView setList:text. |
|
944 | 5321 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5322 |
releaseInspectors ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5323 |
receiverInspector release. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5324 |
contextInspector release. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5325 |
]. |
266 | 5326 |
|
5327 |
m notNil ifTrue:[ |
|
6275 | 5328 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 5329 |
]. |
3511 | 5330 |
self updateMenuItems. |
266 | 5331 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5332 |
|
7797 | 5333 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
5334 |
"Modified: / 21-05-2007 / 13:31:02 / cg" |
|
266 | 5335 |
! |
5336 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5337 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5338 |
"show calling chain from aContext in the walk-back listview. |
1213 | 5339 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5340 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5341 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5342 |
|
8152 | 5343 |
con := aContext. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5344 |
verboseBacktrace ifFalse:[ |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5345 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5346 |
con := con sender. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5347 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5348 |
con := con sender. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5349 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5350 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5351 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5352 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5353 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5354 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5355 |
"Modified: / 17.1.1998 / 12:43:19 / cg" |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5356 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5357 |
|
3447 | 5358 |
showingContext1:aContext calling:calledContext |
7823 | 5359 |
"return false, if this (top) context is to be skipped. |
5360 |
Here, we hide some well known methods, which are usually not too interesting; |
|
5361 |
the set of methods which are suppressed is my (claus's) own choice." |
|
5362 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5363 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 5364 |
|
5365 |
verboseBacktrace == true ifTrue:[ ^true ]. |
|
5366 |
aContext isNil ifTrue:[ ^true ]. |
|
5367 |
||
5368 |
sel := aContext selector. |
|
5369 |
rec := aContext receiver. |
|
5370 |
mthd := aContext method. |
|
5371 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
5372 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5373 |
"/ to avoid firing/waiting the lazy or future |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5374 |
recIsException := (rec isLazyValue not) and:[rec isException]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5375 |
aContext sender notNil ifTrue:[ |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5376 |
senderRec := aContext sender receiver |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5377 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5378 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5379 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5380 |
'showingContext1: (' print. aContext print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5381 |
') calling: (' print. calledContext print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5382 |
')' printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5383 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5384 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5385 |
(#(doCallHandler: doRaise |
3447 | 5386 |
) includes:sel) |
5387 |
ifTrue:[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5388 |
recIsException ifTrue:[ ^ false]. |
3447 | 5389 |
]. |
5390 |
||
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5391 |
(#(raise raiseRequest |
3447 | 5392 |
) includes:sel) |
5393 |
ifTrue:[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5394 |
recIsException ifTrue:[ |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5395 |
(senderRec isLazyValue not |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5396 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
3447 | 5397 |
]. |
5398 |
]. |
|
5399 |
||
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5400 |
(#(doWhile: |
3447 | 5401 |
) includes:sel) |
5402 |
ifTrue:[ |
|
5403 |
rec isBlock ifTrue:[ |
|
8620 | 5404 |
true "aContext sender isBlockContext" ifTrue:[^ false]. |
3447 | 5405 |
]. |
5406 |
]. |
|
5407 |
||
8620 | 5408 |
calledContext notNil ifTrue:[ |
5409 |
calledSel := calledContext selector. |
|
5410 |
calledRec := calledContext receiver. |
|
5411 |
||
5412 |
calledRec isBlock ifTrue:[ |
|
5413 |
(calledSel == #ensure:) ifTrue:[^ false]. |
|
5414 |
(calledSel == #ifCurtailed:) ifTrue:[^ false]. |
|
5415 |
]. |
|
5416 |
(calledSel == #handle:do:) ifTrue:[^ false]. |
|
5417 |
(calledSel == #answer:do:) ifTrue:[^ false]. |
|
5418 |
||
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5419 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5420 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5421 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5422 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5423 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5424 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5425 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5426 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5427 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5428 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5429 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5430 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5431 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5432 |
"/ ]. |
8620 | 5433 |
]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5434 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5435 |
(#(handleDo:) includes:sel) |
3447 | 5436 |
ifTrue:[ |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5437 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
3447 | 5438 |
]. |
5439 |
(#( |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5440 |
withCursor:do: |
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5441 |
withWaitCursorDo: |
3447 | 5442 |
) includes:sel) |
5443 |
ifTrue:[ |
|
5444 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
5445 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
5446 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
5447 |
]. |
|
5448 |
||
5449 |
(#( |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5450 |
wait |
3447 | 5451 |
) includes:sel) |
5452 |
ifTrue:[ |
|
5453 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
5454 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
5455 |
]. |
|
5456 |
||
5457 |
^ true |
|
5458 |
||
5459 |
"Created: / 17.11.2001 / 22:24:06 / cg" |
|
5460 |
"Modified: / 17.11.2001 / 22:41:42 / cg" |
|
5461 |
! |
|
5462 |
||
5463 |
showingContext2:aContext nesting:nesting |
|
7823 | 5464 |
"return false, if this (intermediate) context is to be skipped. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5465 |
Here, we hide some well known methods, which are usually |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5466 |
not too interesting; |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5467 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 5468 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5469 |
|sel rec mClass |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5470 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5471 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5472 |
verboseBacktrace ifTrue:[^ true]. |
3447 | 5473 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5474 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5475 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5476 |
sel := aContext selector. |
939 | 5477 |
mClass := aContext methodClass. |
5478 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5479 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5480 |
sender notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5481 |
senderSelector := sender selector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5482 |
senderReceiver := sender receiver. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5483 |
senderReceiverClass := senderReceiver class. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5484 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5485 |
|
939 | 5486 |
sel == #withCursor:do: ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5487 |
(mClass == WindowGroup) ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5488 |
(mClass == TopView) ifTrue:[^ false]. |
939 | 5489 |
]. |
5490 |
(sel == #withExecuteCursorDo: |
|
5491 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5492 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 5493 |
]. |
5494 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
5495 |
(sel == #do: |
6600 | 5496 |
or:[sel == #from:to:do: |
6601 | 5497 |
or:[sel == #keysAndValuesDo: |
5498 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5499 |
mClass == Array ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5500 |
mClass == OrderedCollection ifTrue:[^ false]. |
6601 | 5501 |
mClass == Set ifTrue:[^ false]. |
5502 |
mClass == Dictionary ifTrue:[^ false]. |
|
5503 |
mClass == Interval ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5504 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5505 |
(sel == #perform: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5506 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5507 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5508 |
or:[sel == #perform:with:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5509 |
or:[sel == #perform:with:with:with:with:]]]]) |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5510 |
ifTrue:[ |
1499
6ed7024b9929
show a perform: context, if its the top-one.
Claus Gittinger <cg@exept.de>
parents:
1486
diff
changeset
|
5511 |
nesting == 0 ifTrue:[^ true]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5512 |
mClass == Array ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5513 |
mClass == OrderedCollection ifTrue:[^ false]. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5514 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5515 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5516 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5517 |
|
939 | 5518 |
(mClass == Object) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5519 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 5520 |
]. |
5521 |
||
5522 |
(mClass == Method) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5523 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 5524 |
]. |
5525 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5526 |
(mClass == SmallInteger) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5527 |
(sel == #to:do:) ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5528 |
(sel == #to:by:do:) ifTrue:[^ false]. |
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5529 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5530 |
|
939 | 5531 |
(mClass == Block) ifTrue:[ |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5532 |
sel == #ensure: ifTrue:[^ false]. |
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5533 |
sel == #ifCurtailed: ifTrue:[^ false]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5534 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5535 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5536 |
sel == #on:do: ifTrue:[^ false]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5537 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5538 |
sel == #value ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5539 |
sel == #value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5540 |
sel == #value:value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5541 |
sel == #value:value:value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5542 |
sel == #value:value:value:value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5543 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5544 |
sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5545 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5546 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5547 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5548 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5549 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5550 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5551 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5552 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5553 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5554 |
"/ sel == #value:value:value:value:value:value: ifTrue:[^ false]. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5555 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5556 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5557 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5558 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5559 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5560 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5561 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5562 |
aContext home notNil ifTrue:[ |
5271
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5563 |
aContext home receiver isLazyValue ifFalse:[ |
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5564 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5565 |
(aContext home selector == #wait) ifTrue:[^ false] |
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5566 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5567 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5568 |
] |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5569 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5570 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5571 |
(rec isExceptionHandler) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5572 |
sel == #handle:do: ifTrue:[^ false]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5573 |
sel == #handleDo: ifTrue:[^ false]. |
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5574 |
(sel startsWith:#raise) ifTrue:[^ false]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5575 |
sel == #answer:do: ifTrue:[^ false]. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5576 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5577 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5578 |
sel == #doRaise ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5579 |
sel == #doCallHandler: ifTrue:[^ false]. |
2312 | 5580 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5581 |
senderReceiverClass == Signal ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5582 |
] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5583 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5584 |
(mClass == Context) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5585 |
sel == #unwind ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5586 |
sel == #unwind: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5587 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5588 |
(mClass == ProcessorScheduler) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5589 |
sel == #interruptActive ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5590 |
sel == #threadSwitch: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5591 |
sel == #suspend: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5592 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5593 |
mClass == Process ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5594 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5595 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5596 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5597 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5598 |
"Modified: / 15.1.1998 / 19:47:36 / cg" |
3447 | 5599 |
"Created: / 17.11.2001 / 19:34:20 / cg" |
1240
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
5600 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
5601 |
|
4859 | 5602 |
!DebugView methodsFor:'private-control loop'! |
266 | 5603 |
|
5604 |
controlLoop |
|
5605 |
"this is a kludge: |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5606 |
start a dispatchloop which exits when |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5607 |
either continue, return or step is pressed |
266 | 5608 |
" |
5609 |
||
5610 |
haveControl := true. |
|
664 | 5611 |
[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5612 |
[haveControl] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5613 |
self controlLoopCatchingErrors |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5614 |
]. |
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
5615 |
] ensure:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5616 |
catchBlock := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5617 |
haveControl := false |
266 | 5618 |
]. |
664 | 5619 |
|
5620 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 5621 |
! |
5622 |
||
5623 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
5624 |
"this is the debuggers own private event handling loop; |
1187 | 5625 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
5626 |
|
266 | 5627 |
"setup a self removing catch-block" |
5628 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
5629 |
||
5630 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5631 |
"if we do not have multiple processes or its a system process |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5632 |
we start another dispatch loop, which exits when |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5633 |
either continue, return or step is pressed |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5634 |
or (via the catchBlock) if an error occurs. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5635 |
Since our display is an extra exclusive one, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5636 |
all processing for normal views stops here ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5637 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5638 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5639 |
WindowGroup setActiveGroup:windowGroup. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5640 |
SignalSet anySignal handle:[:ex | |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5641 |
|signal| |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5642 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5643 |
signal := ex signal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5644 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5645 |
self showError:'*** Error in modal debugger: |
266 | 5646 |
|
334 | 5647 |
>>>> Signal: ' , signal printString , ' |
266 | 5648 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 5649 |
>>>> From: ' , ex suspendedContext sender printString , ' |
5650 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
5651 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
5652 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5653 |
>>>> : ' , ex suspendedContext sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5654 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5655 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5656 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5657 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5658 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5659 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5660 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5661 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5662 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 5663 |
>>>> Message: ' , ex description , ' |
266 | 5664 |
|
1187 | 5665 |
caught & ignored.'. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5666 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5667 |
] do:[ |
4816 | 5668 |
UserNotification handle:[:ex | |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5669 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5670 |
ex proceed |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5671 |
]. |
6361
d1145c85e0fb
oops - must proceed after catching a UserNotification
Claus Gittinger <cg@exept.de>
parents:
6275
diff
changeset
|
5672 |
self showError:ex description. |
d1145c85e0fb
oops - must proceed after catching a UserNotification
Claus Gittinger <cg@exept.de>
parents:
6275
diff
changeset
|
5673 |
ex proceed. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5674 |
] do:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5675 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5676 |
haveControl]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5677 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5678 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5679 |
WindowGroup setActiveGroup:nil. |
266 | 5680 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5681 |
"we do have multiple processes - |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5682 |
simply enter the DebugViews-Windowgroup event loop. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5683 |
effectively suspending event processing for the currently |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5684 |
active group. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5685 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5686 |
SignalSet anySignal handle:[:ex | |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
5687 |
|answer signal eMsg| |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5688 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5689 |
signal := ex signal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5690 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5691 |
DebuggingDebugger ~~ true ifTrue:[ |
6172 | 5692 |
(signal == ActivityNotification) ifTrue:[ |
5693 |
ex proceed |
|
5694 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5695 |
"/ |
7888 | 5696 |
"/ ignore exceptions which say they explicitly have to be ignored |
5697 |
"/ |
|
5698 |
ex catchInDebugger ifTrue:[ |
|
5699 |
'DebugView [info]: ',signal printString,'-signal in debugger cought for close' infoPrintCR. |
|
5700 |
self destroy. |
|
5701 |
ex reject |
|
5702 |
]. |
|
5703 |
||
5704 |
"/ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5705 |
"/ ignore recursive breakpoints |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5706 |
"/ |
3431 | 5707 |
(signal isControlInterrupt) ifTrue:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5708 |
ignoreBreakpoints == true ifTrue:[ |
3447 | 5709 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
8181 | 5710 |
('DebugView [info]: ',ex suspendedContext printString) infoPrintCR. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5711 |
ex proceed |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5712 |
]. |
1762
cd2bec8238fa
ignare halts while handling my own events.
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5713 |
]. |
3447 | 5714 |
(signal == TerminateProcessRequest) ifTrue:[ |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5715 |
"/ mhm - someone wants to shoot me down while debugging ... |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5716 |
answer := Dialog |
3447 | 5717 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
5718 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5719 |
values:#( #proceed #close ) |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5720 |
default:#close. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5721 |
answer == #close ifTrue:[ |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5722 |
self destroy. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5723 |
ex reject |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5724 |
]. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5725 |
ex return. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5726 |
]. |
3447 | 5727 |
signal == RecursiveExceptionError ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
5728 |
(ex parameter signal == BreakPointInterrupt) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5729 |
ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5730 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5731 |
ex proceed. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5732 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5733 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5734 |
self showError:'*** Recursive error in debugger: |
266 | 5735 |
|
5736 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 5737 |
>>>> ' , ex parameter signal printString , ' |
266 | 5738 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 5739 |
>>>> From: ' , ex suspendedContext sender printString , ' |
5740 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
5741 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
5742 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 5743 |
>>>> Message: ' , ex description , ' |
266 | 5744 |
|
1187 | 5745 |
caught & ignored.'. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5746 |
ex return |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5747 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5748 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5749 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5750 |
self topView raiseDeiconified. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5751 |
|
4816 | 5752 |
eMsg := ex description. |
3431 | 5753 |
(ex signal isControlInterrupt) ifTrue:[ |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
5754 |
eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
5755 |
]. |
8745 | 5756 |
Dialog aboutToOpenBoxNotificationSignal |
5757 |
handle:[:ex | ex proceed ] |
|
5758 |
do:[ |
|
5759 |
answer := Dialog |
|
3447 | 5760 |
choose:('Error in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
5761 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5762 |
values:#( #proceed #cancel #debug ) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5763 |
default:#cancel. |
8745 | 5764 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5765 |
answer == #debug ifTrue:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5766 |
'DebugView [info]: cought exception - debugging' infoPrintCR. |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
5767 |
Debugger |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
5768 |
enterUnconditional:(ex suspendedContext) |
3447 | 5769 |
withMessage:'Error in debugger: ' , eMsg |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
5770 |
mayProceed:true. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5771 |
ex proceed. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5772 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5773 |
answer == #proceed ifTrue:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5774 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5775 |
ex proceed. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5776 |
]. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5777 |
'DebugView [info]: cought exception - returning' infoPrintCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5778 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5779 |
] do:[ |
2358 | 5780 |
"/ make certain that sub-debuggers, inspectors etc. |
5781 |
"/ come up on my device. |
|
5782 |
Screen currentScreenQuerySignal answer:device |
|
5783 |
do:[ |
|
3447 | 5784 |
windowGroup |
5785 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
5786 |
true] |
|
5787 |
onLeave:[] |
|
2358 | 5788 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5789 |
]. |
266 | 5790 |
]. |
5791 |
catchBlock := nil. |
|
5792 |
||
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5793 |
"Created: / 24.11.1995 / 20:33:45 / cg" |
3447 | 5794 |
"Modified: / 18.11.2001 / 01:04:17 / cg" |
266 | 5795 |
! ! |
5796 |
||
0 | 5797 |
!DebugView methodsFor:'user interaction'! |
5798 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5799 |
checkIfCodeIsReallyModified |
6616 | 5800 |
|source| |
5801 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5802 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5803 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5804 |
currentMethod isNil ifTrue:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5805 |
^ false |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5806 |
]. |
6616 | 5807 |
source := currentMethod source. |
5808 |
source notNil ifTrue:[ |
|
5809 |
source string = codeView contents string ifTrue:[ |
|
5810 |
^ false |
|
5811 |
]. |
|
5812 |
(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
|
5813 |
^ false |
|
5814 |
]. |
|
5815 |
]. |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5816 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5817 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5818 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5819 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5820 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5821 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5822 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5823 |
checkSelectionChangeAllowed:newSelection |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5824 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5825 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5826 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5827 |
and:[newSelection = contextView selection]) ifTrue:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5828 |
^ true |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5829 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5830 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5831 |
(self confirm:('Code modified - change selection anyway ?')) ifFalse:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5832 |
^ false |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5833 |
]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5834 |
codeView modified:false. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5835 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5836 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5837 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5838 |
|
266 | 5839 |
codeAccept:someCode |
5840 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
5841 |
and including selected method cannot be continued." |
|
5842 |
||
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
5843 |
^ self codeAccept:someCode unwind:false "true" category:nil onCancel:nil |
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
5844 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
5845 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 5846 |
! |
5847 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5848 |
codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction |
3427 | 5849 |
"user wants some code to be recompiled - must unwind stack since everything above |
5850 |
and including selected method cannot be continued." |
|
5851 |
||
5852 |
" |
|
5853 |
actually, this is not true, since the active methods will still be |
|
5854 |
executed correctly - however, the code shown in the debugger is no |
|
5855 |
longer in sync (showing the new code) with the executed code. |
|
5856 |
Therefore, we hide those contexts to avoid confusion .... |
|
5857 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
5858 |
||
5859 |
"walk up context chain and find highest context which is either the selected context, |
|
5860 |
or - if its a block-context - whose home is the selected context" |
|
5861 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5862 |
|con top newMethod| |
3427 | 5863 |
|
5864 |
codeView withWaitCursorDo:[ |
|
5865 |
" |
|
5866 |
find the method-home context for this one |
|
5867 |
" |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5868 |
doUnwind ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5869 |
con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5870 |
top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5871 |
[con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5872 |
(con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5873 |
top := con |
3427 | 5874 |
]. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5875 |
con := con sender |
3427 | 5876 |
]. |
5877 |
]. |
|
5878 |
||
5879 |
"/ |
|
5880 |
"/ provide the classes nameSpace on a query; |
|
5881 |
"/ in case we accept while in another nameSpace context, |
|
5882 |
"/ (but for a class which is somewhere else) |
|
5883 |
"/ |
|
6818
8f6c68046792
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
6815
diff
changeset
|
5884 |
(Class updateChangeFileQuerySignal, |
8f6c68046792
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
6815
diff
changeset
|
5885 |
Class updateChangeListQuerySignal, |
8f6c68046792
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
6815
diff
changeset
|
5886 |
Class updateHistoryLineQuerySignal) answer:true |
3427 | 5887 |
do:[ |
6171
5ea312ba7d88
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
6136
diff
changeset
|
5888 |
Class nameSpaceQuerySignal |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5889 |
answer:(aClass nameSpace) |
3427 | 5890 |
do:[ |
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5891 |
Class packageQuerySignal |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5892 |
answer:(aClass package ? Project noProjectID) |
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5893 |
do:[ |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5894 |
codeView contents:someCode. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5895 |
newMethod := aClass compilerClass |
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5896 |
compile:someCode |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5897 |
forClass:aClass |
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5898 |
inCategory:category |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5899 |
notifying:codeView. |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5900 |
]. |
3427 | 5901 |
]. |
5902 |
]. |
|
5903 |
||
5904 |
inspecting ifFalse:[ |
|
5905 |
" |
|
5906 |
if it worked, remove everything up to and including top |
|
5907 |
from context chain |
|
5908 |
" |
|
5909 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
5910 |
codeView modified:false. |
|
5911 |
||
5912 |
doUnwind ifTrue:[ |
|
3447 | 5913 |
selectedContext canReturn ifTrue:[ |
5914 |
self setContext:(top "sender"). |
|
5915 |
exitAction := #restart. |
|
5916 |
selectedContext setLineNumber:1. |
|
5917 |
self doRestart. |
|
5918 |
] ifFalse:[ |
|
5919 |
self setContext:(top sender). |
|
5920 |
exitAction := #return. |
|
5921 |
]. |
|
3427 | 5922 |
|
5923 |
" |
|
5924 |
continue/step is no longer possible |
|
5925 |
" |
|
4120 | 5926 |
"/ continueButton disable. |
5927 |
"/ canContinue := false. |
|
3427 | 5928 |
]. |
3447 | 5929 |
|
5930 |
contextView selection:1. |
|
5931 |
"/ self showSelection:1. |
|
5932 |
"/ contextView makeSelectionVisible. "/ scrollToLine:(selection - 1) |
|
3427 | 5933 |
] ifFalse:[ |
5934 |
^ cancelAction value |
|
5935 |
] |
|
5936 |
]. |
|
5937 |
]. |
|
5938 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5939 |
"Created: / 17-11-2001 / 21:50:55 / cg" |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5940 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
3427 | 5941 |
! |
5942 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5943 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5944 |
"user wants some code to be recompiled - must unwind stack since everything above |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5945 |
and including selected method cannot be continued." |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5946 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5947 |
" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5948 |
actually, this is not true, since the active methods will still be |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5949 |
executed correctly - however, the code shown in the debugger is no |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5950 |
longer in sync (showing the new code) with the executed code. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5951 |
Therefore, we hide those contexts to avoid confusion .... |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5952 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5953 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5954 |
"walk up context chain and find highest context which is either the selected context, |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5955 |
or - if its a block-context - whose home is the selected context" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5956 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5957 |
|sel implementorClass method category| |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5958 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5959 |
codeView withWaitCursorDo:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5960 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5961 |
"/ find the method-home context for this one |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5962 |
"/ " |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5963 |
"/ con := selectedContext. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5964 |
"/ top := con. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5965 |
"/ [con notNil] whileTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5966 |
"/ (con methodHome == selectedContext) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5967 |
"/ top := con |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5968 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5969 |
"/ con := con sender |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5970 |
"/ ]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5971 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5972 |
" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5973 |
use class&selector to find the method for the compilation |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5974 |
and compile. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5975 |
" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5976 |
category := givenCategoryOrNil. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5977 |
sel := selectedContext selector. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5978 |
implementorClass := selectedContext methodClass. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5979 |
implementorClass notNil ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5980 |
category isNil ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5981 |
method := implementorClass compiledMethodAt:sel. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5982 |
category := method category |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5983 |
] |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5984 |
] ifFalse:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5985 |
implementorClass := selectedContext receiver class. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5986 |
implementorClass ~~ Object ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5987 |
implementorClass := Dialog |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5988 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5989 |
initialAnswer:implementorClass name |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5990 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5991 |
implementorClass size == 0 ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5992 |
^ cancelAction value "/ cancelled |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5993 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5994 |
implementorClass := Smalltalk classNamed:implementorClass. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5995 |
implementorClass isNil ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5996 |
Dialog warn:'No such class'. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5997 |
^ cancelAction value "/ cancelled |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5998 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
5999 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6000 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6001 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6002 |
self |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6003 |
codeAccept:someCode |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6004 |
inClass:implementorClass |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6005 |
unwind:doUnwind |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6006 |
category:category |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6007 |
onCancel:cancelAction. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6008 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6009 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6010 |
"Created: / 17-11-2001 / 21:50:55 / cg" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6011 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6012 |
! |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6013 |
|
7912 | 6014 |
codeCompletion |
6015 |
|cls| |
|
6016 |
||
8212 | 6017 |
currentMethod isNil ifTrue:[ ^ self ]. |
8338 | 6018 |
|
7912 | 6019 |
cls := currentMethod mclass. |
8212 | 6020 |
cls isNil ifTrue:[ ^ self ]. |
6021 |
||
7912 | 6022 |
UserInformation handle:[:ex | |
6023 |
ex proceed. |
|
6024 |
] do:[ |
|
8338 | 6025 |
DoWhatIMeanSupport codeCompletionForClass:cls context:selectedContext codeView:codeView. |
7912 | 6026 |
]. |
6027 |
! |
|
6028 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6029 |
confirm:aString |
6971 | 6030 |
"open a modal yes-no dialog. |
6031 |
Redefined here, to answer true, if exclusice Debugger, which cannot handle popup boxes" |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6032 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6033 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6034 |
^ true |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6035 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6036 |
^ super confirm:aString. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6037 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
6038 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
6039 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
6040 |
"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
|
6041 |
Also sent to autoselect an interesting context on entry." |
0 | 6042 |
|
3447 | 6043 |
BreakPointInterrupt handle:[:ex | |
6215 | 6044 |
ignoreBreakpoints ifFalse:[ex reject]. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6045 |
('DebugView [info]: breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR. |
3447 | 6046 |
ex proceed |
6047 |
] do:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6048 |
self updateForContext:lineNr |
3269 | 6049 |
]. |
6050 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
6051 |
|
3447 | 6052 |
"Modified: / 17.11.2001 / 22:12:16 / cg" |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6053 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6054 |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6055 |
hideStackInspector |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6056 |
stackInspector notNil ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6057 |
stackInspector destroy. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6058 |
stackInspector := nil. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6059 |
receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6060 |
contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0) |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6061 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6062 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6063 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6064 |
processEvent:anEvent |
6129 | 6065 |
"filter keyboard events for popUp variable value display. |
6066 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6067 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6068 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6069 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6070 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6071 |
evView notNil ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6072 |
focusView := evView windowGroup focusView. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6073 |
focusView isNil ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6074 |
focusView := evView. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6075 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6076 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6077 |
anEvent isKeyPressEvent ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6078 |
key := anEvent key. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6079 |
rawKey := anEvent rawKey. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6080 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6081 |
inCodeView := (focusView == codeView |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6082 |
or:[focusView isComponentOf:codeView]). |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6083 |
inCodeView ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6084 |
key == #CodeCompletion ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6085 |
"/ complete the word before/under the cursor. |
7912 | 6086 |
self sensor |
6087 |
pushUserEvent:#codeCompletion |
|
6088 |
for:self |
|
6089 |
withArguments:#(). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6090 |
^ true |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6091 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6092 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6093 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6094 |
|
3602 | 6095 |
false ifTrue:[ |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6096 |
anEvent isButtonReleaseEvent ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6097 |
anEvent view == codeView ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6098 |
(RBParser notNil and:[RBParser isLoaded]) |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6099 |
ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6100 |
self sensor |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6101 |
pushEvent:anEvent. "/ must be first in queue |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6102 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6103 |
self sensor |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6104 |
pushUserEvent:#explainSelection |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6105 |
for:self |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6106 |
withArguments:nil. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6107 |
^ true "/ eaten |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6108 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6109 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6110 |
]. |
3602 | 6111 |
]. |
6112 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6113 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6114 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6115 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6116 |
|
8212 | 6117 |
setCurrentMethod:aMethodOrNil |
6118 |
currentMethod := aMethodOrNil. |
|
6119 |
! |
|
6120 |
||
1327 | 6121 |
showSelection:lineNr |
6122 |
"user clicked on a header line - show selected code in textView. |
|
6123 |
Also sent to autoselect an interesting context on entry." |
|
6124 |
||
5842 | 6125 |
Notification |
6126 |
handle: |
|
6127 |
[:ex | |
|
5879 | 6128 |
"/ ex suspendedContext fullPrintAll. |
6129 |
Transcript showCR:ex description. |
|
6130 |
"/ Transcript showCR:ex parameter. |
|
5842 | 6131 |
ex proceed |
6132 |
] |
|
6133 |
do: |
|
6134 |
[ |
|
6135 |
Error |
|
6136 |
handle: |
|
6137 |
[:ex | |
|
6138 |
|s con| |
|
6139 |
||
6140 |
ex signal isControlInterrupt |
|
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6141 |
ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6142 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' infoPrintCR. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6143 |
ex proceed |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6144 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6145 |
|
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6146 |
('DebugView [info]: error at %1 when showing selection in debugger ignored' bindWith:ex suspendedContext) infoPrintCR. |
5842 | 6147 |
|
6148 |
s := '' writeStream. |
|
6149 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
6150 |
s nextPutLine:'****'. |
|
6815 | 6151 |
s nextPutAll: '**** '; nextPutLine:(ex description "withCRs"). |
5842 | 6152 |
s nextPutLine:'****'. |
6153 |
con := ex suspendedContext. |
|
6154 |
s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6155 |
con := con sender. |
|
6156 |
||
6157 |
con fullPrintAllOn:s. |
|
6158 |
||
6159 |
"/ [con notNil] whileTrue:[ |
|
6160 |
"/ Error catch:[:ex | |
|
6161 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
6162 |
"/ ]. |
|
4947 | 6163 |
"/ |
5842 | 6164 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
6165 |
"/ con := nil |
|
6166 |
"/ ] ifFalse:[ |
|
6167 |
"/ con := con sender. |
|
6168 |
"/ ] |
|
6169 |
"/ ]. |
|
6170 |
codeView contents:(s contents). |
|
6171 |
ex return. |
|
6172 |
] |
|
6173 |
do: |
|
6174 |
[ |
|
6175 |
self doShowSelection:lineNr |
|
6176 |
] |
|
6177 |
] |
|
1327 | 6178 |
|
6815 | 6179 |
"Modified: / 04-07-2006 / 14:50:06 / cg" |
1327 | 6180 |
! |
6181 |
||
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6182 |
showStackInspectorFor:con |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6183 |
stackInspector isNil ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6184 |
receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6185 |
contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6186 |
stackInspector := InspectorView |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6187 |
origin:(0.6 @ 0.0) |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6188 |
corner:(1.0 @ 1.0) |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6189 |
in:contextInspector superView. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6190 |
stackInspector realize. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6191 |
stackInspector fieldListLabel:'Stack'. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6192 |
stackInspector hideReceiver:true |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6193 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6194 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6195 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6196 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6197 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6198 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6199 |
"show selected code for lineNr in contextList in textView. |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6200 |
Also used to autoselect an interesting context on entry." |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6201 |
|
56 | 6202 |
|con homeContext sel method code canAccept |
105 | 6203 |
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
|
6204 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 6205 |
codeSet highlighter evaluatorClass |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6206 |
canDefine callee| |
3187 | 6207 |
|
6208 |
canDefine := false. |
|
8212 | 6209 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
6210 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
6211 |
contextArray notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6212 |
lineNr <= contextArray size ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6213 |
con := contextArray at:lineNr. |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6214 |
callee := contextArray at:lineNr-1 ifAbsent:nil. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6215 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6216 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6217 |
clicking on the '** ...'-line shows more ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6218 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6219 |
con isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6220 |
line := contextView list at:lineNr. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6221 |
(line startsWith:'**') ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6222 |
self showMore. |
1408
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
6223 |
lineNr >= contextArray size ifTrue:[ |
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
6224 |
contextView setSelection:lineNr. |
2299 | 6225 |
con := contextArray at:lineNr ifAbsent:nil |
1408
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
6226 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6227 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6228 |
con isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6229 |
codeView contents:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6230 |
^ self |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6231 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6232 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6233 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6234 |
selectedContext := con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6235 |
m := contextView middleButtonMenu. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6236 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
6237 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6238 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6239 |
|
1661 | 6240 |
self withExecuteCursorDo:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6241 |
codeSet := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6242 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6243 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6244 |
give it to the (lower right) inspector |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6245 |
" |
6247 | 6246 |
Error handle:[:ex | |
6247 |
'DebugView [warning]: error while accessing context' errorPrintCR. |
|
6248 |
contextInspector inspect:nil. |
|
6249 |
ex reject. |
|
6250 |
] do:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6251 |
contextInspector inspect:con. |
3427 | 6252 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
6247 | 6253 |
]. |
1386
55632b45ced2
more skipping in dense backtrace
Claus Gittinger <cg@exept.de>
parents:
1372
diff
changeset
|
6254 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6255 |
"/ show a stack inspector sometimes |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6256 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6257 |
con hasStackToShow ifTrue:[ |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6258 |
self showStackInspectorFor:con |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6259 |
] ifFalse:[ |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6260 |
self hideStackInspector |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6261 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6262 |
|
7328 | 6263 |
homeContext := con methodHome. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6264 |
con canReturn ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6265 |
returnButton enable. restartButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6266 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6267 |
returnButton disable. restartButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6268 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6269 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6270 |
lineNrInMethod := con lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6271 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6272 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6273 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6274 |
homeContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6275 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6276 |
mhmh - an optimized block |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6277 |
should get the block here, and get the method from |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6278 |
that one ... |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6279 |
But in the current version, there is no easy way to get to the block |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6280 |
since that one is not in the context. |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6281 |
A future new block calling scheme will fix this |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6282 |
(passing the block instead of the home as block argument). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6283 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6284 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6285 |
"temporary kludge - peek into the sender context. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6286 |
If its a do-like method and there is a single block variable |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6287 |
in the args or temporaries, that must be the one. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6288 |
This helps in some cases. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6289 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6290 |
(sender := con sender) notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6291 |
tryVars := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6292 |
(selSender := sender selector) notNil ifTrue:[ |
3121
4cb4b3a3c1e2
allow accepting after a doesnot understand
Claus Gittinger <cg@exept.de>
parents:
3097
diff
changeset
|
6293 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6294 |
tryVars := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6295 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6296 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6297 |
tryVars ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6298 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6299 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6300 |
possibleBlocks size == 1 ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6301 |
method := possibleBlocks first method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6302 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6303 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6304 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6305 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6306 |
"fetch rec here - so we wont need context in doItAction" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6307 |
rec := homeContext receiver. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6308 |
sel := homeContext selector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6309 |
sel notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6310 |
canAccept := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6311 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6312 |
implementorClass := homeContext methodClass. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6313 |
implementorClass isNil ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
6314 |
Error handle:[:ex | |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
6315 |
ex signal == BreakPointInterrupt ifTrue:[ |
2397 | 6316 |
ex proceed. |
6317 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6318 |
code := 'error while asking method for its source'. |
2258 | 6319 |
code := code , Character cr , ex signal printString. |
6320 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6321 |
||
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6322 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6323 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6324 |
] do:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6325 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6326 |
special: look if this context was created by |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6327 |
valueWithReceiver kind of method invocation; |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6328 |
if so, grab the method from the sender and show it |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6329 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6330 |
((sender := homeContext sender) notNil |
4947 | 6331 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6332 |
and:[sender receiver isMethod]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6333 |
method := sender receiver. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6334 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6335 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6336 |
(method := con method) notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6337 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6338 |
] |
5664 | 6339 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6340 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6341 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6342 |
method := implementorClass compiledMethodAt:sel. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6343 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6344 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6345 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6346 |
code isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6347 |
errMsg := nil. |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6348 |
method isNil ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6349 |
"/ fall back heuristics |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6350 |
con isBlockContext ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6351 |
((sender := con sender) notNil |
4947 | 6352 |
and:[((sender selector ? '') startsWith:'value') |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6353 |
and:[sender receiver isBlock]]) ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6354 |
code := sender receiver source. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6355 |
] |
5170
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6356 |
] ifFalse:[ |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6357 |
((sender := con sender) notNil |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6358 |
and:[((sender selector ? '') startsWith:'valueWith') |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6359 |
and:[sender receiver isMethod]]) ifTrue:[ |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6360 |
method := sender receiver. |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6361 |
] |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6362 |
] |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6363 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6364 |
method notNil ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
6365 |
Error handle:[:ex | |
3431 | 6366 |
ex signal isControlInterrupt ifTrue:[ |
2397 | 6367 |
ex proceed. |
6368 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6369 |
code := 'error while asking method for its source'. |
2258 | 6370 |
code := code , Character cr , ex signal printString. |
6371 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6372 |
||
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6373 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6374 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6375 |
] do:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6376 |
self sensor shiftDown ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6377 |
code := method decompiledSource |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6378 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6379 |
code := method source. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6380 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6381 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6382 |
code isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6383 |
method sourceFilename notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6384 |
codeView contents:(resources |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6385 |
string:'** no sourcefile: %1 **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6386 |
with:method sourceFilename). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6387 |
codeView flash. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6388 |
codeSet := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6389 |
] ifFalse:[ |
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6390 |
[ |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6391 |
|src| |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6392 |
|
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6393 |
src := String streamContents:[:s | Decompiler decompile:method to:s]. |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6394 |
codeView contents:src. |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6395 |
codeSet := true. |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6396 |
] on: Error do:[ |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6397 |
errMsg := '** no source **' |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6398 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6399 |
] |
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6400 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6401 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6402 |
homeContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6403 |
errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6404 |
] ifFalse:[ |
3187 | 6405 |
errMsg := '** no method - no source **'. |
6406 |
canDefine := true. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6407 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6408 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6409 |
errMsg notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6410 |
self showError:errMsg. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6411 |
codeSet := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6412 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6413 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6414 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6415 |
code isNil ifTrue:[ |
3121
4cb4b3a3c1e2
allow accepting after a doesnot understand
Claus Gittinger <cg@exept.de>
parents:
3097
diff
changeset
|
6416 |
"/ canAccept := false. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6417 |
codeSet ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6418 |
codeView contents:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6419 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6420 |
] ifFalse:[ |
2177 | 6421 |
lineNrInMethod == 0 ifTrue:[ |
6422 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
6423 |
lineNrInMethod := method lineNumber |
|
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6424 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6425 |
"/ guess lineNumber from sent-messages selector |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6426 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6427 |
lineNrInMethod == 0 ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6428 |
|conIdx sentContext messages| |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6429 |
|
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6430 |
conIdx := contextArray identityIndexOf:con. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6431 |
conIdx > 1 ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6432 |
sentContext := contextArray at:conIdx-1. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6433 |
sentContext isBlockContext ifFalse:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6434 |
(method notNil and:[code notNil]) ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6435 |
messages := method messagesSent. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6436 |
messages size == 1 ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6437 |
sentContext selector == messages first ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6438 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6439 |
] |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6440 |
] |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6441 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6442 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6443 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6444 |
]. |
2177 | 6445 |
]. |
6446 |
||
1555 | 6447 |
UserPreferences current syntaxColoring ifTrue:[ |
2709
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6448 |
implementorClass isNil ifTrue:[ |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6449 |
(con isBlockContext |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6450 |
and:[con home isNil |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6451 |
and:[con guessedHome notNil]]) |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6452 |
ifTrue:[ |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6453 |
implementorClass := con guessedHome mclass |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6454 |
] |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6455 |
]. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6456 |
implementorClass notNil ifTrue:[ |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6457 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
5504 | 6458 |
code size < 100000 ifTrue:[ |
7481
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6459 |
Error handle:[:ex | |
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6460 |
] do:[ |
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6461 |
code := highlighter formatMethod:code in:implementorClass. |
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6462 |
] |
5504 | 6463 |
] |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6464 |
] |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6465 |
] |
1555 | 6466 |
]. |
6467 |
||
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6468 |
"/ code ~= (codeView contents) ifTrue:[ |
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6469 |
codeView setContents:code. |
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6470 |
"/ ]. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6471 |
(lineNrInMethod notNil |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6472 |
and:[lineNrInMethod ~~ 0 |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6473 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
7000 | 6474 |
lineNrInMethod == 255 ifFalse:[ |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6475 |
(lineNrInMethod == 255 |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6476 |
and:[method notNil |
1960 | 6477 |
and:[method hasCode not]]) ifTrue:[ |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6478 |
"/ means: do not really know in interpreted methods |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6479 |
codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0. |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6480 |
] ifFalse:[ |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6481 |
codeView selectLine:lineNrInMethod. |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6482 |
]. |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6483 |
codeView makeSelectionVisible |
7000 | 6484 |
]. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6485 |
] ifFalse:[ |
1694 | 6486 |
codeView unselect. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6487 |
codeView scrollToTop |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6488 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6489 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6490 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6491 |
codeView acceptEnabled:canAccept. |
1695 | 6492 |
canAccept ifTrue:[ |
6493 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
6494 |
] ifFalse:[ |
|
6046
81b2da24a0b6
Send #beep to window instead of device
Stefan Vogel <sv@exept.de>
parents:
6034
diff
changeset
|
6495 |
codeView acceptAction:[:code | self beep] |
1695 | 6496 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6497 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6498 |
receiverInspector inspect:rec. |
3427 | 6499 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6500 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6501 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6502 |
the one below is wrong: currently, the |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6503 |
evaluator cannot handle passed contexts. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6504 |
Once it does, pass con as in:-arg |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6505 |
" |
2790 | 6506 |
(rec isJavaObject |
6507 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
6508 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
6509 |
evaluatorClass := Parser |
|
6510 |
] ifFalse:[ |
|
7999
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6511 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6512 |
evaluatorClass := method mclass evaluatorClass. |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6513 |
] ifFalse:[ |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6514 |
evaluatorClass := rec class evaluatorClass. |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6515 |
]. |
2790 | 6516 |
]. |
6517 |
||
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6518 |
codeView doItAction:[:theCode | |
2790 | 6519 |
evaluatorClass |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6520 |
evaluate:theCode |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6521 |
in:actualContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6522 |
receiver:rec |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6523 |
notifying:codeView |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6524 |
logged:true |
4122 | 6525 |
ifFail:nil |
6526 |
]. |
|
8212 | 6527 |
self setCurrentMethod:method. |
4122 | 6528 |
|
6529 |
selectedContext := homeContext. |
|
6530 |
actualContext := con |
|
6531 |
]. |
|
6532 |
] ifFalse:[ |
|
6533 |
codeView contents:nil. |
|
6534 |
]. |
|
6535 |
codeView modified:false. |
|
6536 |
||
6537 |
con isContext ifFalse:[ |
|
6538 |
sendButton disable. |
|
6539 |
] ifTrue:[ |
|
6540 |
sendButton enable. |
|
6541 |
]. |
|
6542 |
||
6543 |
"clear out locals to prevent keeping around unneeded contexts |
|
6544 |
(due to the block held in codeView). |
|
6545 |
(not really needed, since stuff gets collected away sooner or later ... |
|
6546 |
... but this makes it a bit sooner) |
|
6547 |
" |
|
6548 |
con := nil. |
|
6549 |
homeContext := nil. |
|
6550 |
||
8595
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6551 |
(callee notNil |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6552 |
and:[callee method notNil |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6553 |
and:[callee method selector == #subclassResponsibility]] |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6554 |
) ifTrue:[ |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6555 |
canDefine := true. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6556 |
]. |
9ae7fccae337
allow \"define\" when in a subclassResponsibility method
Claus Gittinger <cg@exept.de>
parents:
8592
diff
changeset
|
6557 |
|
4122 | 6558 |
canDefine ifTrue:[ |
6559 |
defineButton beVisible. |
|
6560 |
] ifFalse:[ |
|
6561 |
defineButton beInvisible. |
|
6562 |
]. |
|
6563 |
||
6564 |
" |
|
6565 |
enable/disable some menu items |
|
6566 |
" |
|
6567 |
self updateMenuItems |
|
6568 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6569 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
7481
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6570 |
"Modified: / 27-10-2006 / 14:19:32 / cg" |
4122 | 6571 |
! |
6572 |
||
6573 |
updateMenuItems |
|
6574 |
|m mthd cls mCls rCls| |
|
6575 |
||
6576 |
" |
|
6577 |
enable/disable some menu items |
|
6578 |
" |
|
6579 |
m := contextView middleButtonMenu. |
|
6580 |
m notNil ifTrue:[ |
|
6581 |
m disable:#removeBreakpoint. |
|
6582 |
m disable:#addBreakpoint. |
|
6583 |
canShowMore ifFalse:[ |
|
6584 |
m disable:#showMore |
|
6585 |
]. |
|
6586 |
||
6587 |
selectedContext notNil ifTrue:[ |
|
6588 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
6589 |
||
6590 |
mthd := selectedContext method. |
|
6591 |
mthd notNil ifTrue:[ |
|
6592 |
cls := mCls := mthd containingClass. |
|
6593 |
mthd isBreakpointed ifTrue:[ |
|
6594 |
m enable:#removeBreakpoint. |
|
6595 |
] ifFalse:[ |
|
6596 |
m enable:#addBreakpoint. |
|
6597 |
] |
|
6598 |
]. |
|
6599 |
rCls := selectedContext receiver class. |
|
6600 |
cls isNil ifTrue:[ |
|
6601 |
cls := rCls |
|
6602 |
]. |
|
6603 |
cls notNil ifTrue:[ |
|
6604 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6605 |
rCls == mCls ifTrue:[ |
|
6606 |
m disable:#browseReceiversClass |
|
6607 |
]. |
|
6608 |
mCls isNil ifTrue:[ |
|
6609 |
m disable:#browseImplementingClass |
|
6610 |
] |
|
6611 |
||
6612 |
] ifFalse:[ |
|
6613 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6614 |
]. |
|
6615 |
] ifFalse:[ |
|
6616 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6617 |
] |
|
6618 |
] |
|
6619 |
! ! |
|
6620 |
||
8170 | 6621 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
6622 |
||
6623 |
ignoreCount:something |
|
6624 |
ignoreCount := something. |
|
6625 |
! |
|
6626 |
||
6627 |
ignoreEndTime:something |
|
6628 |
ignoreEndTime := something. |
|
6629 |
! |
|
6630 |
||
6631 |
method |
|
8171 | 6632 |
^ methodHolder at:1 |
8170 | 6633 |
! |
6634 |
||
6635 |
method:methodArg lineNumber:lineNumberArg |
|
8171 | 6636 |
methodHolder := WeakArray with:methodArg. |
8170 | 6637 |
lineNumber := lineNumberArg. |
6638 |
! ! |
|
6639 |
||
6640 |
!DebugView::IgnoredHalt methodsFor:'misc'! |
|
6641 |
||
6642 |
decrementIgnoreCount |
|
6643 |
ignoreCount notNil ifTrue:[ |
|
6644 |
ignoreCount > 0 ifTrue:[ |
|
6645 |
ignoreCount := ignoreCount - 1 |
|
6646 |
] |
|
6647 |
] |
|
6648 |
! ! |
|
6649 |
||
6650 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
|
6651 |
||
6652 |
isForMethod:aMethod line:line |
|
6653 |
line = lineNumber ifFalse:[^ false]. |
|
8171 | 6654 |
(methodHolder at:1) == aMethod ifFalse:[^ false]. |
8170 | 6655 |
|
6656 |
^ true |
|
6657 |
! |
|
6658 |
||
6659 |
isHaltIgnored |
|
6660 |
ignoreCount notNil ifTrue:[ |
|
6661 |
^ ignoreCount > 0 |
|
6662 |
]. |
|
6663 |
ignoreEndTime notNil ifTrue:[ |
|
6664 |
^ ignoreEndTime > Timestamp now |
|
6665 |
]. |
|
6666 |
||
6667 |
^ true |
|
6668 |
! |
|
6669 |
||
6670 |
isHaltIgnoredInMethod:aMethod line:line |
|
8180 | 6671 |
"/ Transcript showCR:'ign ',aMethod printString,' at ',lineNumber printString. |
8170 | 6672 |
line = lineNumber ifFalse:[^ false]. |
8171 | 6673 |
(methodHolder at:1) == aMethod ifFalse:[^ false]. |
8170 | 6674 |
|
6675 |
^ self isHaltIgnored |
|
6676 |
! ! |
|
6677 |
||
4122 | 6678 |
!DebugView class methodsFor:'documentation'! |
6679 |
||
6680 |
version |
|
8745 | 6681 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.470 2009-09-21 20:48:23 cg Exp $' |
4122 | 6682 |
! ! |
6683 |
||
6684 |
DebugView initialize! |