author | Stefan Vogel <sv@exept.de> |
Mon, 14 Jul 2008 10:35:48 +0200 | |
changeset 8213 | bb9fd96f8e8c |
parent 8212 | 51f9ecb52ae8 |
child 8214 | 87b74dc47b98 |
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 |
1408
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
15 |
instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView |
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
16 |
receiverInspector contextInspector contextArray selectedContext |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
17 |
catchBlock grabber mayProceed traceView tracing bigStep |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
18 |
skipLineNr steppedContextAddress abortButton terminateButton |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
19 |
continueButton stepButton nextButton nextOverButton nextOutButton |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
20 |
sendButton returnButton restartButton exclusive inspecting |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
21 |
nChainShown inspectedProcess updateProcess stopButton |
3187 | 22 |
updateButton defineButton monitorToggle stepping |
23 |
steppedContextLineno stepForReturn actualContext inWrap |
|
24 |
stackInspector steppedContext wrapperContext verboseBacktrace |
|
25 |
firstContext stepHow cachable currentMethod ignoreBreakpoints |
|
26 |
stepUntilEntering lastStepUntilEntering |
|
3269 | 27 |
lastSelectionInReceiverInspector lastSelectionInContextInspector |
8170 | 28 |
canShowMore exitAbort reportButton setOfHiddenCallingSelectors |
29 |
isStoppedAtHaltOrBreakPoint' |
|
1408
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
30 |
classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail |
8148 | 31 |
DebuggingDebugger DefaultDebuggerBackgroundColor |
8170 | 32 |
InitialNChainShown IgnoredHalts' |
1408
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
33 |
poolDictionaries:'' |
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
34 |
category:'Interface-Debugger' |
0 | 35 |
! |
36 |
||
8170 | 37 |
Object subclass:#IgnoredHalt |
8171 | 38 |
instanceVariableNames:'methodHolder method lineNumber ignoreEndTime ignoreCount' |
8170 | 39 |
classVariableNames:'' |
40 |
poolDictionaries:'' |
|
41 |
privateIn:DebugView |
|
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 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
128 |
self enter:thisContext sender withMessage:'debugger entered' mayProceed:true. |
2421 | 129 |
! |
130 |
||
2355 | 131 |
enter:aContext withMessage:aString |
132 |
"enter a debugger" |
|
133 |
||
5455 | 134 |
<context: #return> |
135 |
||
2355 | 136 |
^ self |
137 |
enter:aContext |
|
138 |
withMessage:aString |
|
139 |
mayProceed:true |
|
140 |
! |
|
141 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
142 |
enter:aContext withMessage:aString mayProceed:mayProceed |
53 | 143 |
"enter a debugger; if this is a recursive invocation, enter |
144 |
a MiniDebugger instead. |
|
145 |
This is the standard way of entering the debugger; |
|
146 |
sent from error- and halt messages." |
|
0 | 147 |
|
3447 | 148 |
<context: #return> |
149 |
||
3702 | 150 |
|active| |
93 | 151 |
|
57 | 152 |
StepInterruptPending := nil. |
3998 | 153 |
ControlInterrupt handle:[:ex | |
4676
c809ebc38db9
more info on an ignored breakpoint
Claus Gittinger <cg@exept.de>
parents:
4644
diff
changeset
|
154 |
'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
|
155 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
3998 | 156 |
ex proceed |
157 |
] do:[ |
|
158 |
" |
|
159 |
well, it could be a stepping or sending debugger up there; |
|
160 |
in this case, return to it. This happens, when a stepping process |
|
161 |
runs into an error (for example, a halt). In this case, we want the |
|
162 |
stepping debugger to come up again instead of a new one. |
|
163 |
" |
|
164 |
OpenDebuggers notNil ifTrue:[ |
|
165 |
active := Processor activeProcess. |
|
166 |
OpenDebuggers do:[:aDebugger | |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
167 |
(aDebugger inspectedProcess == active) ifTrue:[ |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
168 |
aDebugger device isOpen ifTrue:[ |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
169 |
"/ 'entering stepping debugger again' printNL. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
170 |
aDebugger unstep. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
171 |
aDebugger setLabelFor:aString in:active. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
172 |
aDebugger mayProceed:mayProceed. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
173 |
^ aDebugger enter:aContext select:nil. |
2426 | 174 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
175 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
176 |
] |
3998 | 177 |
]. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
178 |
]. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
179 |
^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
526 | 180 |
|
3447 | 181 |
"Modified: / 18.11.2001 / 00:48:03 / cg" |
53 | 182 |
! |
183 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
184 |
enterUnconditional:aContext withMessage:aString mayProceed:mayProceed |
266 | 185 |
"enter a debugger - do not check for recursive invocation" |
186 |
||
5455 | 187 |
<context: #return> |
188 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
189 |
|aDebugger| |
266 | 190 |
|
191 |
StepInterruptPending := nil. |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
192 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
193 |
"/ ignore halts & breakpoints while setting up the debugger |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
194 |
"/ to avoid recursive debugging ... |
3447 | 195 |
ControlInterrupt handle:[:ex | |
196 |
'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
|
197 |
('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
198 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
199 |
] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
200 |
aDebugger := self new. |
3447 | 201 |
]. |
202 |
||
203 |
aDebugger isNil ifTrue:[ |
|
204 |
'DebugView [error]: cannot open debugger' errorPrintCR. |
|
205 |
'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR. |
|
206 |
mayProceed ifTrue:[ |
|
207 |
(Dialog confirm:'Error/Breakpoint cought.\\Press Continue or Abort.' withCRs |
|
208 |
yesLabel:'Continue' noLabel:'Abort') |
|
209 |
ifTrue:[ |
|
210 |
^ nil |
|
211 |
]. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
212 |
] ifFalse:[ |
3447 | 213 |
self information:'Error cought.\\Press OK to abort the operation.' withCRs. |
214 |
]. |
|
215 |
AbortOperationRequest raise. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
216 |
"not reached" |
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
217 |
]. |
3447 | 218 |
|
219 |
aDebugger mayProceed:mayProceed. |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
220 |
aDebugger setLabelFor:aString in:Processor activeProcess. |
3447 | 221 |
aDebugger enter:aContext select:nil. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
222 |
^ nil. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
223 |
|
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
224 |
" |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
225 |
nil halt |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
226 |
" |
1244
413709b30fd2
more care for breakpoints in debugger
Claus Gittinger <cg@exept.de>
parents:
1240
diff
changeset
|
227 |
|
3447 | 228 |
"Modified: / 18.11.2001 / 00:29:23 / cg" |
266 | 229 |
! |
230 |
||
6430 | 231 |
enterWithMessage:message |
232 |
"enter a debugger" |
|
233 |
||
234 |
<context: #return> |
|
235 |
||
236 |
self enter:(thisContext sender) withMessage:message mayProceed:true. |
|
237 |
! |
|
238 |
||
266 | 239 |
new |
2358 | 240 |
"return a new DebugView. |
241 |
- return a cached debugger if it already exists. |
|
242 |
Also, care for remote displays on which no debugger is wanted |
|
243 |
(ask with mayOpenDebugger) - if so, open on the default screen." |
|
244 |
||
245 |
|debugger currentScreen debuggerDevice| |
|
246 |
||
247 |
currentScreen := Screen current. |
|
14 | 248 |
|
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
249 |
currentScreen notNil ifTrue:[ |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
250 |
(currentScreen suppressDebugger) ifTrue:[ |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
251 |
"/ 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
|
252 |
^ nil. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
253 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
254 |
(currentScreen mayOpenDebugger) ifFalse:[ |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
255 |
"/ 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
|
256 |
currentScreen := Screen default. |
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
257 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
258 |
]. |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
259 |
|
266 | 260 |
" |
261 |
need a blocking debugger if no processes or |
|
262 |
or if its a timing/interrupt process |
|
263 |
(because otherwise we would not get any events here ... |
|
264 |
" |
|
265 |
Processor activeProcessIsSystemProcess ifTrue:[ |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
266 |
((debugger := CachedExclusive) isNil |
2426 | 267 |
or:[debugger device ~~ currentScreen |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
268 |
or:[currentScreen isNil |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
269 |
or:[currentScreen isOpen not]]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
270 |
debugger := self newExclusive |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
271 |
]. |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
272 |
CachedExclusive := nil. |
266 | 273 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
274 |
CachedDebugger notNil ifTrue:[ |
2358 | 275 |
(CachedDebugger device ~~ currentScreen |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
276 |
or:[currentScreen isNil |
7981
658dac13ed05
cache only my real instances (not sub-instances)
Claus Gittinger <cg@exept.de>
parents:
7971
diff
changeset
|
277 |
or:[currentScreen isOpen not |
658dac13ed05
cache only my real instances (not sub-instances)
Claus Gittinger <cg@exept.de>
parents:
7971
diff
changeset
|
278 |
or:[CachedDebugger class ~~ self]]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
279 |
CachedDebugger := nil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
280 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
281 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
282 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
283 |
(debugger := CachedDebugger) notNil ifTrue:[ |
2358 | 284 |
CachedDebugger := nil. |
285 |
] ifFalse:[ |
|
286 |
debuggerDevice := currentScreen. |
|
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
287 |
debuggerDevice isNil ifTrue:[ |
2352 | 288 |
"/ use the default display |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
289 |
debuggerDevice := Screen default. |
2358 | 290 |
]. |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
291 |
(debuggerDevice isNil |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
292 |
or:[debuggerDevice isOpen not |
3030
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
293 |
"/ or:[debuggerDevice mayOpenDebugger not] |
5adb33d5111d
fixed devices mayOpenDebugger / suppressDebugger handling.
Michael Beyl <mb@exept.de>
parents:
2963
diff
changeset
|
294 |
]) ifTrue:[ |
2554
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
295 |
"/ no debugger |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
296 |
^ nil. |
0e37316a8787
Do not try to use an unconnected display
Stefan Vogel <sv@exept.de>
parents:
2476
diff
changeset
|
297 |
]. |
2358 | 298 |
|
299 |
Screen currentScreenQuerySignal answer:debuggerDevice |
|
300 |
do:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
301 |
debugger := super new. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
302 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
303 |
debugger label:'Debugger'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
304 |
debugger icon:self defaultIcon. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
305 |
] |
266 | 306 |
]. |
73 | 307 |
^ debugger |
875 | 308 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
309 |
"Modified: 31.7.1997 / 21:20:27 / cg" |
73 | 310 |
! |
0 | 311 |
|
266 | 312 |
newExclusive |
313 |
"return a debugger for exclusive display access" |
|
314 |
||
315 |
|debugger| |
|
105 | 316 |
|
266 | 317 |
debugger := super new. |
318 |
debugger label:'Debugger'. |
|
875 | 319 |
debugger icon:self defaultIcon. |
266 | 320 |
debugger exclusive:true. |
321 |
^ debugger |
|
875 | 322 |
|
323 |
"Modified: 1.1.1970 / 23:27:06 / cg" |
|
105 | 324 |
! |
325 |
||
29 | 326 |
openOn:aProcess |
327 |
"start a debugger on aProcess |
|
328 |
(actually not more than a good-looking inspector)" |
|
15 | 329 |
|
52 | 330 |
|aDebugger label nm| |
15 | 331 |
|
332 |
aDebugger := super new. |
|
875 | 333 |
aDebugger icon:self defaultIcon. |
29 | 334 |
aProcess notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
335 |
nm := aProcess name. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
336 |
nm notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
337 |
nm := (nm contractTo:17) , '-' , aProcess id printString |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
338 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
339 |
nm := aProcess id printString |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
340 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
341 |
label := 'Debugger [' , nm , ']'. |
29 | 342 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
343 |
label := 'no process' |
29 | 344 |
]. |
1114 | 345 |
aDebugger label:label iconLabel:'Debugger'. |
15 | 346 |
aDebugger openOn:aProcess. |
347 |
^ nil |
|
875 | 348 |
|
1114 | 349 |
"Modified: 4.4.1997 / 16:22:36 / cg" |
126 | 350 |
! ! |
351 |
||
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
352 |
!DebugView class methodsFor:'cleanup'! |
485 | 353 |
|
354 |
lowSpaceCleanup |
|
355 |
"in low memory situations, give up cached debuggers" |
|
356 |
||
357 |
CachedDebugger := nil. |
|
358 |
CachedExclusive := nil. |
|
359 |
OpenDebuggers := nil. |
|
360 |
||
361 |
" |
|
362 |
DebugView lowSpaceCleanup |
|
363 |
" |
|
364 |
||
365 |
"Modified: 18.4.1996 / 16:48:03 / cg" |
|
366 |
! |
|
367 |
||
368 |
newDebugger |
|
2358 | 369 |
"force creation of a new debugger (give up cached debuggers)" |
485 | 370 |
|
371 |
CachedDebugger := nil. |
|
372 |
CachedExclusive := nil. |
|
373 |
OpenDebuggers := nil. |
|
374 |
||
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
375 |
(Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[ |
4356 | 376 |
Debugger := self |
377 |
]. |
|
378 |
||
485 | 379 |
" |
380 |
DebugView newDebugger |
|
381 |
" |
|
382 |
! ! |
|
383 |
||
875 | 384 |
!DebugView class methodsFor:'defaults'! |
385 |
||
386 |
defaultIcon |
|
7632
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
387 |
"return the browsers default window icon" |
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
388 |
|
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
389 |
<resource: #programImage> |
dec23bc52ab8
defaultIcon no longer uses a class variable
Stefan Vogel <sv@exept.de>
parents:
7628
diff
changeset
|
390 |
|
7647 | 391 |
^ ToolbarIconLibrary debug22x22Icon |
392 |
"/ ^ ToolbarIconLibrary debugIt20x20Icon |
|
393 |
||
394 |
"Modified: / 11-02-2007 / 11:47:20 / cg" |
|
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
395 |
! |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
396 |
|
8194 | 397 |
defaultIconForAboutBox |
398 |
<resource: #programImage> |
|
399 |
||
400 |
^ ToolbarIconLibrary debug22x22IconForBlackBackgound |
|
401 |
! |
|
402 |
||
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
403 |
defaultVerboseBacktrace |
8148 | 404 |
<resource: #obsolete> |
405 |
self obsoleteMethodWarning. |
|
406 |
^ UserPreferences current verboseBacktraceInDebugger |
|
937
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
407 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
408 |
"Created: 11.1.1997 / 12:14:35 / cg" |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
409 |
! |
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
410 |
|
e1520a0db57e
added VerboseBacktraceDefault classVar
Claus Gittinger <cg@exept.de>
parents:
936
diff
changeset
|
411 |
defaultVerboseBacktrace:aBoolean |
8148 | 412 |
<resource: #obsolete> |
413 |
self obsoleteMethodWarning. |
|
414 |
UserPreferences current verboseBacktraceInDebugger:aBoolean |
|
3441 | 415 |
! |
416 |
||
417 |
updateStyleCache |
|
6136 | 418 |
"extract values from the styleSheet and cache them in class variables" |
419 |
||
420 |
<resource: #style (#'debugView.viewBackgroundColor')> |
|
421 |
||
3441 | 422 |
DefaultDebuggerBackgroundColor := StyleSheet at:#'debugView.viewBackgroundColor' |
423 |
||
424 |
"Modified: / 17.11.2001 / 17:31:42 / cg" |
|
875 | 425 |
! ! |
426 |
||
8179 | 427 |
!DebugView class methodsFor:'ignoring halts'! |
428 |
||
429 |
hasIgnoredHalts |
|
430 |
^ IgnoredHalts notEmptyOrNil |
|
431 |
! |
|
432 |
||
433 |
stopIgnoringHalts |
|
434 |
IgnoredHalts := nil |
|
435 |
! ! |
|
436 |
||
3269 | 437 |
!DebugView class methodsFor:'menu specs'! |
438 |
||
439 |
menuSpec |
|
440 |
"This resource specification was automatically generated |
|
441 |
by the MenuEditor of ST/X." |
|
442 |
||
443 |
"Do not manually edit this!! If it is corrupted, |
|
444 |
the MenuEditor may not be able to read the specification." |
|
445 |
||
446 |
" |
|
447 |
MenuEditor new openOnClass:DebugView andSelector:#menuSpec |
|
448 |
(Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp |
|
449 |
" |
|
450 |
||
451 |
<resource: #menu> |
|
452 |
||
453 |
^ |
|
5875 | 454 |
#(Menu |
455 |
( |
|
456 |
(MenuItem |
|
457 |
label: 'View' |
|
458 |
translateLabel: true |
|
459 |
submenu: |
|
460 |
(Menu |
|
461 |
( |
|
462 |
(MenuItem |
|
463 |
enabled: canShowMore |
|
8142 | 464 |
label: 'Show More WalkBack' |
5875 | 465 |
itemValue: showMore |
466 |
translateLabel: true |
|
5110 | 467 |
) |
5875 | 468 |
(MenuItem |
8142 | 469 |
label: 'Show Verbose WalkBack' |
5875 | 470 |
itemValue: toggleVerboseWalkback |
471 |
translateLabel: true |
|
472 |
isVisible: showingDenseWalkback |
|
5110 | 473 |
) |
5875 | 474 |
(MenuItem |
8142 | 475 |
label: 'Show Dense WalkBack' |
5875 | 476 |
itemValue: toggleVerboseWalkback |
477 |
translateLabel: true |
|
478 |
isVisible: showingVerboseWalkback |
|
5110 | 479 |
) |
5875 | 480 |
(MenuItem |
481 |
label: '-' |
|
5110 | 482 |
) |
5875 | 483 |
(MenuItem |
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
484 |
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
|
485 |
itemValue: autoRaiseView: |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
486 |
translateLabel: true |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
487 |
indication: autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
488 |
) |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
489 |
(MenuItem |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
490 |
label: '-' |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
491 |
) |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
492 |
(MenuItem |
5875 | 493 |
label: 'Exit' |
494 |
itemValue: closeRequest |
|
495 |
translateLabel: true |
|
496 |
isVisible: isInspecting |
|
5110 | 497 |
) |
5875 | 498 |
(MenuItem |
499 |
label: 'Close Debugger and Abort' |
|
500 |
itemValue: closeRequest |
|
501 |
translateLabel: true |
|
502 |
isVisible: isNotInspecting |
|
5110 | 503 |
) |
504 |
) |
|
505 |
nil |
|
506 |
nil |
|
507 |
) |
|
508 |
) |
|
5875 | 509 |
(MenuItem |
510 |
label: 'Process' |
|
511 |
translateLabel: true |
|
512 |
submenu: |
|
513 |
(Menu |
|
514 |
( |
|
515 |
(MenuItem |
|
516 |
label: 'Continue' |
|
517 |
itemValue: doContinue |
|
518 |
translateLabel: true |
|
3269 | 519 |
) |
5875 | 520 |
(MenuItem |
521 |
label: '-' |
|
3269 | 522 |
) |
5875 | 523 |
(MenuItem |
524 |
label: 'Abort' |
|
525 |
itemValue: doAbort |
|
526 |
translateLabel: true |
|
3269 | 527 |
) |
5875 | 528 |
(MenuItem |
6487 | 529 |
enabled: abortAllIsHandled |
530 |
label: 'Abort All' |
|
531 |
itemValue: doAbortAll |
|
532 |
translateLabel: true |
|
533 |
) |
|
534 |
(MenuItem |
|
5875 | 535 |
label: '-' |
3269 | 536 |
) |
5875 | 537 |
(MenuItem |
538 |
label: 'Terminate' |
|
539 |
itemValue: doTerminate |
|
540 |
translateLabel: true |
|
3269 | 541 |
) |
542 |
) |
|
543 |
nil |
|
544 |
nil |
|
545 |
) |
|
546 |
) |
|
5875 | 547 |
(MenuItem |
548 |
label: 'Context' |
|
549 |
translateLabel: true |
|
550 |
submenu: |
|
551 |
(Menu |
|
552 |
( |
|
553 |
(MenuItem |
|
554 |
enabled: canReturn |
|
555 |
label: 'Return' |
|
556 |
itemValue: doReturn |
|
557 |
translateLabel: true |
|
558 |
) |
|
559 |
(MenuItem |
|
560 |
enabled: canRestart |
|
561 |
label: 'Restart' |
|
562 |
itemValue: doRestart |
|
563 |
translateLabel: true |
|
3447 | 564 |
) |
5875 | 565 |
(MenuItem |
566 |
label: '-' |
|
3447 | 567 |
) |
5875 | 568 |
(MenuItem |
569 |
enabled: hasContextSelected |
|
570 |
label: 'Inspect' |
|
571 |
itemValue: inspectContext |
|
572 |
translateLabel: true |
|
3447 | 573 |
) |
5875 | 574 |
(MenuItem |
575 |
label: 'Copy WalkBack Text' |
|
576 |
itemValue: copyWalkbackText |
|
577 |
translateLabel: true |
|
3447 | 578 |
) |
5875 | 579 |
(MenuItem |
580 |
label: 'Bookmark Method in SystemBrowser' |
|
581 |
itemValue: addBrowserBookmark |
|
582 |
translateLabel: true |
|
3447 | 583 |
) |
584 |
) |
|
585 |
nil |
|
586 |
nil |
|
587 |
) |
|
588 |
) |
|
5875 | 589 |
(MenuItem |
590 |
label: 'Class' |
|
591 |
translateLabel: true |
|
592 |
submenu: |
|
593 |
(Menu |
|
594 |
( |
|
595 |
(MenuItem |
|
596 |
enabled: canBrowseImplementingClass |
|
597 |
label: 'Browse Implementing Class' |
|
598 |
itemValue: browseImplementingClass |
|
599 |
translateLabel: true |
|
3269 | 600 |
) |
5875 | 601 |
(MenuItem |
602 |
enabled: canBrowseReceiversClass |
|
603 |
label: 'Browse Receivers Class' |
|
604 |
itemValue: browseReceiversClass |
|
605 |
translateLabel: true |
|
3269 | 606 |
) |
5875 | 607 |
(MenuItem |
608 |
label: '-' |
|
3269 | 609 |
) |
5875 | 610 |
(MenuItem |
611 |
enabled: canBrowseClassHierarchy |
|
612 |
label: 'Browse Receivers Class Hierarchy' |
|
613 |
itemValue: browseClassHierarchy |
|
614 |
translateLabel: true |
|
3269 | 615 |
) |
5875 | 616 |
(MenuItem |
617 |
enabled: canBrowseFullClassProtocol |
|
618 |
label: 'Browse Receivers Full Protocol' |
|
619 |
itemValue: browseFullClassProtocol |
|
620 |
translateLabel: true |
|
3269 | 621 |
) |
622 |
) |
|
623 |
nil |
|
624 |
nil |
|
625 |
) |
|
626 |
) |
|
5875 | 627 |
(MenuItem |
628 |
label: 'Selector' |
|
629 |
translateLabel: true |
|
630 |
submenu: |
|
631 |
(Menu |
|
632 |
( |
|
633 |
(MenuItem |
|
634 |
label: 'Browse Implementors...' |
|
635 |
itemValue: browseImplementorsOf |
|
636 |
translateLabel: true |
|
3269 | 637 |
) |
5875 | 638 |
(MenuItem |
639 |
label: 'Browse Senders...' |
|
640 |
itemValue: browseSendersOf |
|
641 |
translateLabel: true |
|
3269 | 642 |
) |
5875 | 643 |
(MenuItem |
644 |
label: '-' |
|
3269 | 645 |
) |
5875 | 646 |
(MenuItem |
647 |
enabled: canDefineMethod |
|
8142 | 648 |
label: 'Define Missing Method' |
5875 | 649 |
itemValue: doDefineMethod |
650 |
translateLabel: true |
|
3269 | 651 |
) |
652 |
) |
|
653 |
nil |
|
654 |
nil |
|
655 |
) |
|
656 |
) |
|
5875 | 657 |
(MenuItem |
658 |
label: 'Breakpoint' |
|
659 |
translateLabel: true |
|
660 |
submenu: |
|
661 |
(Menu |
|
662 |
( |
|
663 |
(MenuItem |
|
664 |
enabled: canRemoveBreakpoint |
|
8142 | 665 |
label: 'Remove Breakpoint' |
5875 | 666 |
itemValue: removeBreakpoint |
667 |
translateLabel: true |
|
3269 | 668 |
) |
5875 | 669 |
(MenuItem |
670 |
label: 'Remove all Breakpoints' |
|
671 |
itemValue: removeAllBreakpoints |
|
672 |
translateLabel: true |
|
3511 | 673 |
) |
5875 | 674 |
(MenuItem |
675 |
label: '-' |
|
3511 | 676 |
) |
5875 | 677 |
(MenuItem |
678 |
enabled: canAddBreakpoint |
|
8142 | 679 |
label: 'Add Breakpoint' |
5875 | 680 |
itemValue: addBreakpoint |
681 |
translateLabel: true |
|
3269 | 682 |
) |
5875 | 683 |
(MenuItem |
684 |
label: '-' |
|
3269 | 685 |
) |
5875 | 686 |
(MenuItem |
8179 | 687 |
label: 'Ignore this Halt/BreakPoint' |
8170 | 688 |
translateLabel: true |
689 |
submenu: |
|
690 |
(Menu |
|
691 |
( |
|
692 |
(MenuItem |
|
8171 | 693 |
enabled: isStoppedAtHaltOrBreakPoint |
8179 | 694 |
label: 'Forever (Until Ignoring is Stopped)' |
695 |
itemValue: ignoreHaltForever |
|
8170 | 696 |
translateLabel: true |
697 |
) |
|
698 |
(MenuItem |
|
8171 | 699 |
enabled: isStoppedAtHaltOrBreakPoint |
8170 | 700 |
label: 'For the Next N Times...' |
701 |
itemValue: openIgnoreHaltNTimesDialog |
|
702 |
translateLabel: true |
|
703 |
) |
|
8171 | 704 |
(MenuItem |
8179 | 705 |
enabled: isStoppedAtHaltOrBreakPoint |
706 |
label: 'For Some Time...' |
|
707 |
itemValue: openIgnoreHaltUntilTimeElapsedDialog |
|
8171 | 708 |
translateLabel: true |
709 |
) |
|
8170 | 710 |
) |
711 |
nil |
|
712 |
nil |
|
713 |
) |
|
714 |
) |
|
8179 | 715 |
(MenuItem |
716 |
enabled: hasHaltsToIgnore |
|
717 |
label: 'Stop Ignoring' |
|
718 |
itemValue: stopIgnoringHalts |
|
719 |
translateLabel: true |
|
720 |
) |
|
721 |
(MenuItem |
|
722 |
label: '-' |
|
723 |
) |
|
724 |
(MenuItem |
|
725 |
label: 'Allow Breakpoints in Debugger' |
|
726 |
itemValue: allowBreakPointsInDebugger: |
|
727 |
translateLabel: true |
|
728 |
indication: allowBreakPointsInDebugger |
|
729 |
) |
|
3269 | 730 |
) |
731 |
nil |
|
732 |
nil |
|
733 |
) |
|
734 |
) |
|
5875 | 735 |
(MenuItem |
736 |
label: 'Help' |
|
737 |
translateLabel: true |
|
738 |
startGroup: right |
|
739 |
submenu: |
|
740 |
(Menu |
|
741 |
( |
|
742 |
(MenuItem |
|
743 |
label: 'Debuggers Documentation' |
|
744 |
itemValue: openHTMLDocument: |
|
745 |
translateLabel: true |
|
8194 | 746 |
argument: 'tools/debugger/TOP.html' |
3269 | 747 |
) |
5875 | 748 |
(MenuItem |
749 |
label: '-' |
|
3269 | 750 |
) |
5875 | 751 |
(MenuItem |
752 |
label: 'About DebugView...' |
|
753 |
itemValue: openAboutThisApplication |
|
754 |
translateLabel: true |
|
3269 | 755 |
) |
756 |
) |
|
757 |
nil |
|
758 |
nil |
|
759 |
) |
|
760 |
) |
|
761 |
) |
|
762 |
nil |
|
763 |
nil |
|
764 |
) |
|
765 |
! ! |
|
766 |
||
913
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
767 |
!DebugView class methodsFor:'misc'! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
768 |
|
4121 | 769 |
interestingContextFrom:aContext |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
770 |
"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
|
771 |
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
|
772 |
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
|
773 |
actually occured. |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
774 |
Just for your convenience :-)" |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
775 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
776 |
|someContexts con idx| |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
777 |
|
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
778 |
someContexts := Array new:25. |
2042 | 779 |
con := aContext. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
780 |
idx := 1. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
781 |
[(idx <= someContexts size) and:[con notNil]] whileTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
782 |
someContexts at:idx put:con. |
2042 | 783 |
con := con sender. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
784 |
idx := idx + 1. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
785 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
786 |
idx := self interestingContextIndexIn:someContexts. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
787 |
^ someContexts at:idx. |
3447 | 788 |
! |
789 |
||
790 |
interestingContextIndexIn:aContextArray |
|
791 |
"return an interesting contexts offset, or nil. |
|
792 |
This is the context initially shown in the walkback. |
|
793 |
We move up the calling chain, skipping all intermediate Signal |
|
794 |
and Exception contexts, to present the context in which the error |
|
795 |
actually occured. |
|
796 |
Just for your convenience :-)" |
|
797 |
||
8152 | 798 |
|con found offset sel prev ex rcvr nMax idx| |
3447 | 799 |
|
7713 | 800 |
"/ Transcript showCR:aContextArray. |
7648 | 801 |
|
3447 | 802 |
nMax := aContextArray size. |
803 |
nMax <= 1 ifTrue:[^ 1]. |
|
804 |
con := aContextArray at:1. |
|
805 |
con isBlockContext ifTrue:[^ 1]. |
|
806 |
||
807 |
"/ somewhere, at the bottom, there must be a raise ... |
|
808 |
"/ find the exception |
|
809 |
||
810 |
1 to:5 do:[:i | |
|
811 |
con := aContextArray at:i ifAbsent:nil. |
|
812 |
con notNil ifTrue:[ |
|
813 |
sel := con selector. |
|
7823 | 814 |
(sel startsWith:'raise') ifTrue:[ |
3447 | 815 |
rcvr := con receiver. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
816 |
(rcvr isLazyValue not and:[rcvr isException]) ifTrue:[ |
3447 | 817 |
ex := rcvr. |
818 |
offset := i. |
|
819 |
found := con |
|
820 |
] ifFalse:[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
821 |
(rcvr isLazyValue not and:[rcvr isExceptionCreator]) ifTrue:[ |
3447 | 822 |
offset := i. |
823 |
found := con |
|
824 |
] |
|
825 |
] |
|
826 |
]. |
|
827 |
]. |
|
828 |
]. |
|
829 |
||
830 |
" |
|
831 |
if this is a noHandler exception, skip forward |
|
832 |
to the erronous context |
|
833 |
" |
|
834 |
ex notNil ifTrue:[ |
|
835 |
ex signal == Signal noHandlerSignal ifTrue:[ |
|
836 |
found := ex suspendedContext |
|
837 |
] |
|
838 |
]. |
|
839 |
||
840 |
found isNil ifTrue:[ |
|
841 |
"/ this is a kludge, but convenient. |
|
6579 | 842 |
"/ show the place where the error (divisionByZero...) happend, |
3447 | 843 |
"/ not where the signal was raised. |
7823 | 844 |
con := (aContextArray at:1). |
845 |
sel := con methodHome selector. |
|
3447 | 846 |
|
847 |
"/ typically a DivisionByZero - show caller of division |
|
848 |
(sel == #// |
|
849 |
or:[sel == #/ |
|
850 |
or:[sel == #\\]]) ifTrue:[ |
|
851 |
^ 2 |
|
852 |
]. |
|
853 |
||
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
854 |
"/ show the place of the bad message; not where the Signal was raised... |
3447 | 855 |
(sel == #doesNotUnderstand:) ifTrue:[ |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
856 |
nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
857 |
sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
858 |
sel == #doesNotUnderstand: ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
859 |
^ 4 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
860 |
]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
861 |
]. |
3447 | 862 |
^ 3 min:nMax |
863 |
]. |
|
864 |
||
865 |
"/ show the bad method; not where the Signal was raised... |
|
866 |
(sel == #noByteCode) ifTrue:[ |
|
867 |
^ 2 |
|
868 |
]. |
|
869 |
||
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
870 |
"/ "/ 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
|
871 |
"/ ((sel == #halt) or:[sel == #halt:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
872 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
873 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
874 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
875 |
"/ "/ 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
|
876 |
"/ (sel == #shouldImplement) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
877 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
878 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
879 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
880 |
"/ "/ 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
|
881 |
"/ ((sel == #error:mayProceed:) |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
882 |
"/ or:[ sel == #signalFailure:resumable:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
883 |
"/ nMax > 2 ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
884 |
"/ sel := (aContextArray at:2) selector. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
885 |
"/ sel == #mustBeBoolean ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
886 |
"/ ^ 3 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
887 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
888 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
889 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
890 |
"/ ]. |
7862 | 891 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
892 |
"/ 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
|
893 |
(sel == #signalInterrupt:) ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
894 |
^ 2 |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
895 |
]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
896 |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
897 |
"/ "/ 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
|
898 |
"/ ((sel == #error) or:[sel == #error:]) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
899 |
"/ con method mclass == Object ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
900 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
901 |
"/ ] |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
902 |
"/ ]. |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
903 |
|
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
904 |
"/ "/ 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
|
905 |
"/ (sel == #subclassResponsibility) ifTrue:[ |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
906 |
"/ ^ 2 |
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
907 |
"/ ]. |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
908 |
|
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
909 |
"/ 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
|
910 |
( #(#notIndexed |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
911 |
#indexNotIntegerOrOutOfBounds: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
912 |
#subscriptBoundsError: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
913 |
#elementBoundsError: |
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
914 |
"/ #subclassResponsibility |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
915 |
) includes:sel) ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
916 |
idx := 2. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
917 |
[ idx <= 3 |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
918 |
and:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
919 |
sel := (aContextArray at:idx) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
920 |
#(#notIndexed |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
921 |
#indexNotIntegerOrOutOfBounds: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
922 |
#subscriptBoundsError: |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
923 |
#elementBoundsError: ) includes:sel |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
924 |
] |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
925 |
] whileTrue:[ idx := idx + 1 ]. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
926 |
sel := (aContextArray at:idx) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
927 |
(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
|
928 |
ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
929 |
sel := (aContextArray at:idx+1) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
930 |
(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
|
931 |
ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
932 |
sel := (aContextArray at:idx+2) selector. |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
933 |
(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
|
934 |
ifTrue:[ |
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
935 |
^ idx+3 |
3447 | 936 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
937 |
^ idx+2 |
3447 | 938 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
939 |
^ idx+1 |
3447 | 940 |
]. |
5117
038af0448624
interrestingContextFrom - duplicated code removed
Claus Gittinger <cg@exept.de>
parents:
5114
diff
changeset
|
941 |
^ idx |
3447 | 942 |
]. |
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
943 |
offset := 1. |
8152 | 944 |
]. |
945 |
||
946 |
"/ the above is all too hard-coded; |
|
947 |
"/ ask the method, if it thinks it should be skipped in the walkback. |
|
948 |
"/ as more methods get flagged, remove code from above. |
|
949 |
con := aContextArray at:offset ifAbsent:nil. |
|
950 |
||
951 |
[ |
|
952 |
con notNil |
|
953 |
and:[ con methodHome notNil |
|
954 |
and:[ con methodHome method notNil |
|
955 |
and:[ con methodHome method shouldBeSkippedInDebuggersWalkBack ]]] |
|
956 |
] whileTrue:[ |
|
957 |
"/ Transcript showCR:con methodHome method. |
|
958 |
offset := offset + 1. |
|
8143
539df8f4f32e
interresting context search generalized
Claus Gittinger <cg@exept.de>
parents:
8142
diff
changeset
|
959 |
con := aContextArray at:offset ifAbsent:nil. |
8152 | 960 |
]. |
3447 | 961 |
|
962 |
" |
|
963 |
got it; move up, skipping all intermediate Signal and |
|
964 |
Exception contexts |
|
965 |
" |
|
966 |
prev := nil. |
|
967 |
rcvr := con receiver. |
|
968 |
[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
969 |
rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]] |
3447 | 970 |
] whileTrue:[ |
971 |
prev := con. |
|
972 |
nMax > offset ifFalse:[^ offset]. |
|
973 |
||
974 |
offset := offset + 1. |
|
975 |
con := aContextArray at:offset. |
|
976 |
rcvr := con receiver. |
|
977 |
]. |
|
978 |
||
979 |
" |
|
980 |
now, we are one above the raising context |
|
981 |
" |
|
982 |
||
983 |
" |
|
984 |
if the sender-method of the raise is one of objects error methods ... |
|
985 |
" |
|
986 |
( #( halt halt: |
|
987 |
error error: |
|
988 |
doesNotUnderstand: |
|
989 |
subclassResponsibility |
|
990 |
primitiveFailed) includes:con selector) |
|
991 |
ifTrue:[ |
|
992 |
con selector == #doesNotUnderstand: ifTrue:[ |
|
993 |
" |
|
994 |
one more up, to get to the originating context |
|
995 |
" |
|
996 |
con := aContextArray at:(offset + 1). |
|
997 |
con isNil ifTrue:[^ offset]. |
|
998 |
offset := offset + 1. |
|
999 |
]. |
|
1000 |
con := aContextArray at:(offset + 1). |
|
1001 |
con isNil ifTrue:[^ offset]. |
|
1002 |
offset := offset + 1. |
|
1003 |
] ifFalse:[ |
|
1004 |
" |
|
1005 |
ok, got the raise - if its a BreakPoint, look for the sender |
|
1006 |
" |
|
8154 | 1007 |
(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[ |
3447 | 1008 |
offset := offset + 1 |
1009 |
]. |
|
1010 |
]. |
|
1011 |
||
1012 |
^ offset |
|
1013 |
||
7713 | 1014 |
"Created: / 17-11-2001 / 20:37:49 / cg" |
7862 | 1015 |
"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
|
1016 |
! ! |
6460993f73a3
made interestingContextFrom: public - its useful in
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1017 |
|
73 | 1018 |
!DebugView methodsFor:'basic'! |
1019 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1020 |
enableDisableActions |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1021 |
|m| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1022 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1023 |
m := contextView middleButtonMenu. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1024 |
m notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1025 |
self updateMenuItems. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1026 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1027 |
(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1028 |
abortButton enable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1029 |
m enable:#doAbort. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1030 |
] ifFalse:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1031 |
abortButton disable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1032 |
m disable:#doAbort. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1033 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1034 |
exclusive ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1035 |
terminateButton disable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1036 |
m disable:#doTerminate. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1037 |
] ifFalse:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1038 |
terminateButton enable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1039 |
m enable:#doTerminate. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1040 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1041 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1042 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1043 |
mayProceed == false ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1044 |
continueButton disable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1045 |
m notNil ifTrue:[m disable:#doContinue]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1046 |
] ifFalse:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1047 |
continueButton enable. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1048 |
m notNil ifTrue:[m enable:#doContinue] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1049 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1050 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1051 |
"Created: / 16.11.2001 / 17:40:51 / cg" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1052 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1053 |
|
1364 | 1054 |
enter:aContext select:initialSelectionOrNil |
73 | 1055 |
"enter the debugger - get and display the context, then start an |
1056 |
exclusive event loop on top of eveything else" |
|
1057 |
||
3447 | 1058 |
<context: #return> |
1059 |
||
8170 | 1060 |
|con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext haltingMethod lineNrInHaltingMethod |
1061 |
c| |
|
3447 | 1062 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1063 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1064 |
'==> enter: (' print. aContext print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1065 |
') select: ' print. initialSelectionOrNil printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
1066 |
]. |
3447 | 1067 |
thisContext isRecursive ifTrue:[ |
1068 |
"/ care for the special case, were the Debugger was autoloaded. |
|
1069 |
"/ in this case, thisContext IS recursive, but thats no error |
|
1070 |
"/ condition. |
|
1071 |
foundNoByteCodeContext := false. |
|
6730 | 1072 |
foundExitContext := false. |
1073 |
||
1074 |
c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
|
1075 |
[ |
|
1076 |
foundNoByteCodeContext not |
|
1077 |
and:[ foundExitContext not |
|
3447 | 1078 |
and:[c notNil |
6730 | 1079 |
and:[c selector ~~ #enter:withMessage:mayProceed: |
1080 |
]]]] |
|
1081 |
whileTrue:[ |
|
1082 |
c selector == #exit_unwindThenDo: ifTrue:[ |
|
1083 |
foundExitContext := true |
|
1084 |
]. |
|
3447 | 1085 |
c selector == #noByteCode ifTrue:[ |
1086 |
foundNoByteCodeContext := true |
|
1087 |
]. |
|
6730 | 1088 |
c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:. |
3447 | 1089 |
]. |
1090 |
||
6730 | 1091 |
(foundNoByteCodeContext not |
1092 |
and:[ foundExitContext not]) ifFalse:[ |
|
3447 | 1093 |
('DebugView [warning]: reentered') errorPrintCR. |
1094 |
||
1095 |
^ MiniDebugger |
|
1096 |
enter:aContext |
|
1097 |
withMessage:'DebugView [error]: recursive error (in debugger)' |
|
1098 |
mayProceed:mayProceed. |
|
6730 | 1099 |
]. |
1100 |
foundExitContext ifTrue:[ |
|
1101 |
'DebugView [error]: recursive error (in debugger) ignored' printCR. |
|
1102 |
^ self. |
|
1103 |
]. |
|
3447 | 1104 |
]. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1105 |
|
2591
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1106 |
"/'entering: ' print. aContext printCR. |
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1107 |
"/'initial: ' print. initialSelectionOrNil printCR. |
8170 | 1108 |
thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s) |
1109 |
||
1110 |
"/ should a halt be ignored ? |
|
1111 |
IgnoredHalts notNil ifTrue:[ |
|
1112 |
c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil. |
|
8179 | 1113 |
c isNil ifTrue:[ |
1114 |
c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil. |
|
1115 |
]. |
|
8170 | 1116 |
c notNil ifTrue:[ |
1117 |
c := c sender. |
|
1118 |
haltingMethod := c method. |
|
1119 |
lineNrInHaltingMethod := c lineNumber. |
|
8180 | 1120 |
"/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString. |
8170 | 1121 |
IgnoredHalts do:[:ign | |
1122 |
(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) ifTrue:[ |
|
8181 | 1123 |
Transcript showCR:'Debugger: ignored halt in ', haltingMethod whoString. |
8170 | 1124 |
ign decrementIgnoreCount. |
1125 |
ign isHaltIgnored ifFalse:[ |
|
8181 | 1126 |
Transcript showCR:'Debugger: no longer ignore halt in ', haltingMethod whoString. |
8170 | 1127 |
IgnoredHalts remove:ign ifAbsent:[]. |
1128 |
]. |
|
1129 |
^ self. |
|
1130 |
]. |
|
1131 |
]. |
|
1132 |
IgnoredHalts do:[:ign | |
|
8171 | 1133 |
(ign method isNil |
1134 |
or:[ ign isForMethod:haltingMethod line:lineNrInHaltingMethod ]) ifTrue:[ |
|
8170 | 1135 |
IgnoredHalts remove:ign ifAbsent:[]. |
1136 |
]. |
|
1137 |
]. |
|
1138 |
] |
|
1139 |
]. |
|
1140 |
||
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1141 |
iAmNew := drawableId isNil. |
73 | 1142 |
|
8148 | 1143 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1144 |
|
1265
3db375412f5d
avoid caching a debugger which got destroyed
Claus Gittinger <cg@exept.de>
parents:
1263
diff
changeset
|
1145 |
busy := cachable := true. |
73 | 1146 |
inspecting := false. |
1147 |
inspectedProcess := Processor activeProcess. |
|
1148 |
stepping := false. |
|
1149 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1150 |
stepHow := nil. |
8148 | 1151 |
nChainShown := InitialNChainShown. |
73 | 1152 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1153 |
"/ if debugger is entered while a box has grabbed the |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1154 |
"/ 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
|
1155 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1156 |
"/ On a multiUser system, ungrab all of them ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1157 |
"/ 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
|
1158 |
"/ 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
|
1159 |
"/ 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
|
1160 |
Screen allScreens do:[:aScreen | |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1161 |
aScreen ungrabPointer. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1162 |
aScreen ungrabKeyboard. |
73 | 1163 |
]. |
1164 |
||
1004
cb182425a977
oops - dont disable terminateButton
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
1165 |
("inspectedProcess suspendedContext isNil |
1179
e927f0c09298
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1148
diff
changeset
|
1166 |
or:["inspectedProcess isSystemProcess"]") ifTrue:[ |
1004
cb182425a977
oops - dont disable terminateButton
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
1167 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1168 |
terminateButton disable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1169 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1170 |
terminateButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1171 |
abortButton enable. |
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1172 |
]. |
73 | 1173 |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1174 |
iAmNew ifFalse:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1175 |
"/ not the first time - disable buttons & menus |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1176 |
"/ from the previous life |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1177 |
self turnOffAllButtons. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1178 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1179 |
m := contextView middleButtonMenu. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1180 |
m notNil ifTrue:[ |
5195
5a2d612e1adb
oops - skip was always disabled
Claus Gittinger <cg@exept.de>
parents:
5170
diff
changeset
|
1181 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1182 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1183 |
verboseBacktrace |
3447 | 1184 |
ifTrue:[self showVerboseWalkback] |
1185 |
ifFalse:[self showDenseWalkback]. |
|
132 | 1186 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1187 |
self iconLabel:'Debugger'. |
132 | 1188 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1189 |
windowGroup isNil ifTrue:[ |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1190 |
self windowGroup: WindowGroup new. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1191 |
windowGroup addTopView:self. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1192 |
]. |
132 | 1193 |
exclusive ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1194 |
"/ create a (modal) windowGroup for myself |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1195 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1196 |
windowGroup setModal:true. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1197 |
] ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1198 |
"/ create a windowGroup with a synchronous sensor for me |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1199 |
|
3769 | 1200 |
windowGroup beSynchronous. |
73 | 1201 |
]. |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1202 |
windowGroup setProcess:Processor activeProcess. |
73 | 1203 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1204 |
get the walkback list; clear inspectors if we did not come here by single stepping) |
73 | 1205 |
" |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
1206 |
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
|
1207 |
"/'after setContext; first is ' print. |
613b7c72371c
fixed initial context selection, when entering via halt.
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1208 |
"/(contextArray at:1 ifAbsent:nil) printCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1209 |
self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext. |
73 | 1210 |
|
1211 |
m := contextView middleButtonMenu. |
|
1212 |
m notNil ifTrue:[ |
|
3269 | 1213 |
self updateMenuItems. |
1214 |
||
5821
a5ef70570c6c
Check for AbortOperationRequest in suspendedContext.
Stefan Vogel <sv@exept.de>
parents:
5798
diff
changeset
|
1215 |
(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1216 |
abortButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1217 |
m enable:#doAbort. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1218 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1219 |
abortButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1220 |
m disable:#doAbort. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1221 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1222 |
exclusive ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1223 |
terminateButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1224 |
m disable:#doTerminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1225 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1226 |
terminateButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1227 |
m enable:#doTerminate. |
3447 | 1228 |
]. |
1229 |
iAmNew ifFalse:[ |
|
5195
5a2d612e1adb
oops - skip was always disabled
Claus Gittinger <cg@exept.de>
parents:
5170
diff
changeset
|
1230 |
m disableAll:#(showMore "skip skipForReturn" inspectContext). |
3447 | 1231 |
]. |
73 | 1232 |
]. |
1233 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1234 |
mayProceed == false ifTrue:[ |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1235 |
continueButton disable. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1236 |
m notNil ifTrue:[m disable:#doContinue]. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1237 |
] ifFalse:[ |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1238 |
continueButton enable. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1239 |
m notNil ifTrue:[m enable:#doContinue] |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1240 |
]. |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
1241 |
|
73 | 1242 |
" |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1243 |
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
|
1244 |
Otherwise, its probably better to do a map, which shows the |
73 | 1245 |
view at the previous position, without a need for the user to set the |
1246 |
position again |
|
1247 |
" |
|
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1248 |
iAmNew ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1249 |
self remap. |
2360
cef61dce4358
avoid empty debugger if some subcomponent forces creation
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1250 |
] ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1251 |
self realize. |
73 | 1252 |
]. |
8193
9a4febdd8202
Raise debugger to the very top when entering
Stefan Vogel <sv@exept.de>
parents:
8181
diff
changeset
|
1253 |
self setForegroundWindow. |
73 | 1254 |
|
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1255 |
exclusive ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1256 |
self showError:' |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1257 |
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
|
1258 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1259 |
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
|
1260 |
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
|
1261 |
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
|
1262 |
|
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1263 |
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
|
1264 |
]. |
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1265 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1266 |
self autoRaiseView ifTrue:[ |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1267 |
"/ self raise. |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1268 |
self raiseDeiconified. |
7971 | 1269 |
self topView |
1270 |
activate; setForegroundWindow; activate. |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1271 |
]. |
1486
6ae442626f20
wait until visible before starting to draw
Claus Gittinger <cg@exept.de>
parents:
1484
diff
changeset
|
1272 |
|
73 | 1273 |
canContinue := true. |
1274 |
exitAction := nil. |
|
1275 |
||
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1276 |
"/ 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
|
1277 |
"/ 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
|
1278 |
"/ closedown of the debugger. |
3701
ef73aac8e8d5
Use #ifCurtailed: instead of #valueOnUnwindDo:
Stefan Vogel <sv@exept.de>
parents:
3694
diff
changeset
|
1279 |
[self controlLoop] ifCurtailed:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1280 |
windowGroup notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1281 |
windowGroup setProcess:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1282 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1283 |
self destroy |
132 | 1284 |
]. |
73 | 1285 |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1286 |
"/ release all context stuff. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1287 |
"/ 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
|
1288 |
"/ forever. (since the debugger is reused for faster startup next time) |
942 | 1289 |
contextView contents:nil. |
1290 |
||
73 | 1291 |
codeView acceptAction:nil. |
942 | 1292 |
codeView doItAction:nil. |
73 | 1293 |
|
4892 | 1294 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
1295 |
ObjectMemory stepInterruptHandler:nil. |
|
1296 |
]. |
|
1297 |
||
3447 | 1298 |
"/ not stepping - close window |
73 | 1299 |
(exitAction ~~ #step) ifTrue:[ |
3165
03d3c485e67d
remember selected entry in inspectors;
Claus Gittinger <cg@exept.de>
parents:
3140
diff
changeset
|
1300 |
lastSelectionInReceiverInspector := receiverInspector selectedKeyName. |
03d3c485e67d
remember selected entry in inspectors;
Claus Gittinger <cg@exept.de>
parents:
3140
diff
changeset
|
1301 |
lastSelectionInContextInspector := contextInspector selectedKeyName. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1302 |
receiverInspector release. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1303 |
contextInspector release. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1304 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1305 |
self unmap. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1306 |
device flush. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1307 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1308 |
(exitAction == #abort) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1309 |
self exit_abort. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1310 |
]. |
6487 | 1311 |
(exitAction == #abortAll) ifTrue:[ |
1312 |
self exit_abortAll. |
|
1313 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1314 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1315 |
(exitAction == #return) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1316 |
self exit_return. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1317 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1318 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1319 |
(exitAction == #restart) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1320 |
self exit_restart. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1321 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1322 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1323 |
(exitAction == #quickTerminate) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1324 |
self exit_quickTerminate. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1325 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1326 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1327 |
(exitAction == #terminate) ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1328 |
self exit_terminate. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1329 |
] |
73 | 1330 |
]. |
1331 |
||
3447 | 1332 |
"/ stepping - window stays open |
1333 |
||
940 | 1334 |
selectedContext := actualContext := firstContext := nil. |
73 | 1335 |
|
2472 | 1336 |
"/ restore the previous pointer grab |
73 | 1337 |
grabber notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1338 |
device grabPointerInView:grabber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1339 |
grabber := nil. |
61 | 1340 |
]. |
73 | 1341 |
|
1342 |
(exitAction == #step) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1343 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1344 |
schedule another stepInterrupt |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1345 |
- must enter myself into the collection of open debuggers, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1346 |
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
|
1347 |
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
|
1348 |
come up (instead of a new one) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1349 |
- must flush caches since optimized methods not always |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1350 |
look for pending interrupts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1351 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1352 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1353 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1354 |
"/ also must care for stepping into a return |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1355 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1356 |
steppedContext notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1357 |
Processor activeProcess forceInterruptOnReturnOf:steppedContext. |
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 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1360 |
OpenDebuggers isNil ifTrue:[ |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1361 |
OpenDebuggers := WeakIdentitySet new. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1362 |
]. |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1363 |
OpenDebuggers add:self. |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1364 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1365 |
self label:'single stepping - please wait ...'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1366 |
stepping := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1367 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1368 |
ObjectMemory stepInterruptHandler:self. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
1369 |
Processor activeProcess stepInterruptHandler:self. |
2963 | 1370 |
ObjectMemory flushCaches. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
1371 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1372 |
Context singleStepInterruptRequest isHandled ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1373 |
"bigStep" steppedContextLineno notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1374 |
Context singleStepInterruptRequest raiseWith:#next |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1375 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1376 |
Context singleStepInterruptRequest raiseWith:#step |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1377 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1378 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1379 |
"/ see if we came here through an interrupt-action |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1380 |
"/ (i.e. aProcess interruptWith:...) |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1381 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1382 |
enteredByInterrupt := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1383 |
con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1384 |
[enteredByInterrupt not |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1385 |
and:[con notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1386 |
and:[con ~~ aContext]]] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1387 |
((sel := con selector) == #timerInterrupt |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1388 |
or:[sel == #ioInterrupt]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1389 |
enteredByInterrupt := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1390 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1391 |
con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1392 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1393 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1394 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1395 |
ObjectMemory flushInlineCaches. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1396 |
|
1456 | 1397 |
DebuggingDebugger == true ifTrue:[ |
1398 |
enteredByInterrupt printCR. |
|
1399 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1400 |
enteredByInterrupt ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1401 |
"/ dont want to step through all intermediate |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1402 |
"/ (scheduler-) contexts; place a return-trap on the |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1403 |
"/ one right below the interesting one |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1404 |
|
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1405 |
"/ 'special unwind return' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1406 |
con unwindThenDo:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
1407 |
Processor activeProcess stepInterruptHandler:self. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1408 |
ObjectMemory stepInterruptHandler:self. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1409 |
InStepInterrupt := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1410 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1411 |
InterruptPending := 1]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1412 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1413 |
"/ 'normal step return' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1414 |
skipLineNr ~~ #return ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1415 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1416 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1417 |
] ifFalse:[ |
778
e0f6238c9dd5
better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
1418 |
"/ 'step for return' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1419 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1420 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1421 |
InStepInterrupt := nil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1422 |
] |
73 | 1423 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1424 |
OpenDebuggers notNil ifTrue:[ |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
1425 |
OpenDebuggers remove:self ifAbsent:[]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1426 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1427 |
self cacheMyself. |
73 | 1428 |
] |
210
947f9a23b06a
better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents:
193
diff
changeset
|
1429 |
|
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
1430 |
"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
|
1431 |
"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
|
1432 |
"Modified: / 13-10-1998 / 19:56:59 / ps" |
7830 | 1433 |
"Modified: / 28-07-2007 / 12:12:03 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1434 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1435 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1436 |
exit_abort |
5455 | 1437 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
1438 |
"/ that one would run on top of this context. |
|
1439 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1440 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1441 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
1442 |
"/ done in the #enter:select method. |
|
1443 |
"/ You are not expected to understand this. |
|
1444 |
||
6487 | 1445 |
self exit_unwindThenDo:[ AbortOperationRequest raise ] |
1446 |
! |
|
1447 |
||
1448 |
exit_abortAll |
|
1449 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1450 |
"/ that one would run on top of this context. |
|
1451 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1452 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1453 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
1454 |
"/ done in the #enter:select method. |
|
1455 |
"/ You are not expected to understand this. |
|
1456 |
||
1457 |
self exit_unwindThenDo:[ AbortAllOperationRequest raise ] |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1458 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1459 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1460 |
exit_quickTerminate |
3447 | 1461 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1462 |
Processor activeProcess terminateNoSignal |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1463 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1464 |
"Created: / 16.11.2001 / 17:23:51 / cg" |
3447 | 1465 |
"Modified: / 17.11.2001 / 23:20:07 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1466 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1467 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1468 |
exit_restart |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1469 |
|con| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1470 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1471 |
selectedContext notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1472 |
con := selectedContext. |
3447 | 1473 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1474 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1475 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1476 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1477 |
Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1478 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
4816 | 1479 |
ex description infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1480 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1481 |
] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1482 |
con unwindAndRestart. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1483 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1484 |
'DebugView [warning]: cannot restart selected context' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1485 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1486 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1487 |
"Created: / 16.11.2001 / 17:23:17 / cg" |
3447 | 1488 |
"Modified: / 17.11.2001 / 23:37:09 / cg" |
3434
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 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1491 |
exit_return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1492 |
|con retVal| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1493 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1494 |
selectedContext notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1495 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1496 |
if there is a selection in the codeView, |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1497 |
evaluate it and use the result as return value |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1498 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1499 |
"/ 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
|
1500 |
"/ and that is syntactically incorrect ... |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1501 |
"/ ... leading to a popup warning from the codeView |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1502 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1503 |
"/ codeView hasSelection ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1504 |
"/ Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1505 |
"/ 'DebugView [warning]: error - returning nil' errorPrintCR. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1506 |
"/ retVal := nil. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1507 |
"/ ex return |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1508 |
"/ ] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1509 |
"/ |s| |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1510 |
"/ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1511 |
"/ s := codeView selection asString. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1512 |
"/ retVal := codeView doItAction value:s. |
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 |
"/ ]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1515 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1516 |
con := selectedContext. |
3447 | 1517 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1518 |
" |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1519 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1520 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1521 |
Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1522 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
4816 | 1523 |
ex description infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1524 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1525 |
] do:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1526 |
con unwind:retVal. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1527 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1528 |
'DebugView [warning]: cannot return from selected context' errorPrintCR |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1529 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1530 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1531 |
"Created: / 16.11.2001 / 17:22:24 / cg" |
3447 | 1532 |
"Modified: / 17.11.2001 / 23:20:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1533 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1534 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1535 |
exit_terminate |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1536 |
|
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 |
have to catch errors occuring in unwind-blocks |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1539 |
" |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
1540 |
Error handle:[:ex | |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1541 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
4816 | 1542 |
ex description infoPrintCR. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1543 |
ex proceed |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1544 |
] do:[ |
3447 | 1545 |
self cacheMyself. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1546 |
Processor activeProcess terminate. |
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 |
'DebugView [warning]: cannot terminate process' errorPrintCR |
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 |
"Created: / 16.11.2001 / 17:24:20 / cg" |
3447 | 1551 |
"Modified: / 17.11.2001 / 23:20:27 / cg" |
1552 |
! |
|
1553 |
||
6487 | 1554 |
exit_unwindThenDo:aBlock |
1555 |
|con| |
|
1556 |
||
1557 |
"/ cannot simply raise an abort here, because if there is an abortHandler somewhere, |
|
1558 |
"/ that one would run on top of this context. |
|
1559 |
"/ Therefore, any controlInterrupt(i.e. halt) or reentering of the debugger from that handler |
|
1560 |
"/ would be interpreted as a recursive invocation (in #enter:select). |
|
1561 |
"/ To avoid this, we unwind all contexts and simulate the raise as if it was |
|
1562 |
"/ done in the #enter:select method. |
|
1563 |
"/ You are not expected to understand this. |
|
1564 |
||
1565 |
" |
|
1566 |
have to catch errors occuring in unwind-blocks |
|
1567 |
" |
|
1568 |
self cacheMyself. |
|
1569 |
||
1570 |
Error handle:[:ex | |
|
1571 |
'DebugView [info]: ignored error while unwinding: ' infoPrint. |
|
1572 |
ex description infoPrintCR. |
|
1573 |
||
1574 |
ex proceed |
|
1575 |
] do:[ |
|
1576 |
"/ find the enter:select context. |
|
1577 |
con := thisContext sender. |
|
1578 |
[ |
|
1579 |
(con selector == #enter:select:) |
|
1580 |
and:[con receiver == self] |
|
1581 |
] |
|
1582 |
whileFalse:[ con := con sender ]. |
|
1583 |
||
1584 |
"/ must skip over its caller (because this one has a ControlInterrupt handler too) |
|
1585 |
con sender receiver == self class ifTrue:[ |
|
1586 |
con := con sender. |
|
1587 |
con sender receiver == self class ifTrue:[ |
|
1588 |
con := con sender. |
|
1589 |
con isBlockContext ifTrue:[ |
|
1590 |
con := con methodHome. |
|
1591 |
] |
|
1592 |
]. |
|
1593 |
]. |
|
1594 |
||
1595 |
con unwindThenDo:aBlock. |
|
1596 |
]. |
|
1597 |
'DebugView [warning]: abort failed' errorPrintCR |
|
1598 |
||
1599 |
"Created: / 16.11.2001 / 17:20:45 / cg" |
|
1600 |
"Modified: / 18.11.2001 / 00:58:14 / cg" |
|
1601 |
! |
|
1602 |
||
3447 | 1603 |
initialSelectionOnEntry:initialSelectionOrNil context:aContext |
1604 |
|selection con1 con2 h| |
|
1605 |
||
1606 |
initialSelectionOrNil notNil ifTrue:[ |
|
1607 |
^ initialSelectionOrNil |
|
1608 |
]. |
|
1609 |
||
1610 |
" |
|
1611 |
and find the one context to show initially |
|
1612 |
- if we came here by a send (single step), its the top context; |
|
1613 |
- if we came here by a step (i.e. bigStep), its the top context |
|
1614 |
(for ifs and whiles) or the sender (for regular sends). |
|
1615 |
- otherwise, we came here by some signal raise, and we are interested |
|
1616 |
in the context where the raise actually occured. |
|
1617 |
" |
|
1618 |
con1 := (contextArray at:1 ifAbsent:nil). |
|
1619 |
con2 := (contextArray at:2 ifAbsent:nil). |
|
1620 |
||
1621 |
exitAction == #step ifTrue:[ |
|
1622 |
selection := 1. |
|
1623 |
steppedContext notNil ifTrue:[ |
|
1624 |
||
1625 |
" |
|
1626 |
if we came here by a big-step, show the method where we are |
|
1627 |
" |
|
1628 |
con1 == steppedContext ifTrue:[ |
|
1629 |
selection := 1 |
|
1630 |
] ifFalse:[ |
|
1631 |
con2 == steppedContext ifTrue:[ |
|
1632 |
selection := 2 |
|
1633 |
] |
|
1634 |
]. |
|
1635 |
" |
|
1636 |
for bigStep, we could also be in a block below the actual method ... |
|
1637 |
" |
|
1638 |
((h := con1 home) notNil |
|
1639 |
and:[h == steppedContext]) ifTrue:[ |
|
1640 |
selection := 1 |
|
1641 |
] ifFalse:[ |
|
1642 |
(con2 notNil |
|
1643 |
and:[(h := con2 home) notNil |
|
1644 |
and:[h == steppedContext]]) ifTrue:[ |
|
1645 |
selection := 2 |
|
1646 |
] |
|
1647 |
]. |
|
1648 |
h := nil. |
|
1649 |
] |
|
1650 |
] ifFalse:[ |
|
1651 |
steppedContext isNil ifTrue:[ |
|
1652 |
" |
|
1653 |
preselect a more interesting context, (where halt/raise was ...) |
|
1654 |
" |
|
1655 |
"/ selection := self class interestingContextIndexFrom:aContext. |
|
1656 |
selection := self class interestingContextIndexIn:contextArray. |
|
1657 |
selection := selection min:(contextArray size). |
|
1658 |
] ifFalse:[ |
|
1659 |
" |
|
1660 |
if we came here by a big-step, show the method where we are |
|
1661 |
" |
|
1662 |
con1 == steppedContext ifTrue:[ |
|
1663 |
selection := 1 |
|
1664 |
] ifFalse:[ |
|
1665 |
con2 == steppedContext ifTrue:[ |
|
1666 |
selection := 2. |
|
1667 |
] |
|
1668 |
] |
|
1669 |
] |
|
1670 |
]. |
|
1671 |
^ selection |
|
1672 |
||
1673 |
"Created: / 17.11.2001 / 20:26:26 / cg" |
|
1674 |
"Modified: / 17.11.2001 / 22:51:46 / cg" |
|
73 | 1675 |
! |
1676 |
||
5110 | 1677 |
isInspecting |
1678 |
^ inspecting |
|
1679 |
! |
|
1680 |
||
1681 |
isNotInspecting |
|
1682 |
^ inspecting not |
|
1683 |
! |
|
1684 |
||
73 | 1685 |
openOn:aProcess |
1686 |
"enter the debugger on a process - |
|
1687 |
in this case, we are just inspecting the context chain of the process, |
|
1688 |
not running on top of the debugged process, but as a separate |
|
1689 |
one. (think of it as an inspector showing more detail, and offering |
|
1690 |
some more control operations)" |
|
1691 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1692 |
|bpanel dummy w| |
73 | 1693 |
|
8148 | 1694 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
939 | 1695 |
|
73 | 1696 |
busy := true. |
1697 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
1698 |
stepHow := nil. |
73 | 1699 |
inspecting := true. |
1700 |
inspectedProcess := aProcess. |
|
8148 | 1701 |
nChainShown := InitialNChainShown. |
73 | 1702 |
|
1703 |
bpanel := abortButton superView. |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1704 |
bpanel ignoreInvisibleComponents:true. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1705 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1706 |
"/ get the max size & freeze button |
6647 | 1707 |
continueButton label:(resources string:'Continue'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1708 |
w := continueButton preferredWidth. |
6647 | 1709 |
continueButton label:(resources string:'Stop'). |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1710 |
w := w max:(continueButton preferredWidth). |
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1711 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1712 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1713 |
aProcess state == #run ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1714 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1715 |
continueButton foregroundColor:Color red darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1716 |
]. |
6647 | 1717 |
continueButton label:(resources string:'Stop'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1718 |
continueButton action:[self doStop]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1719 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1720 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1721 |
continueButton foregroundColor:Color green darkened darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1722 |
]. |
6647 | 1723 |
continueButton label:(resources string:'Continue'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1724 |
continueButton action:[self doContinue]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1725 |
]. |
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
1726 |
continueButton preferredExtent:(w @ continueButton preferredHeight). |
73 | 1727 |
|
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1728 |
returnButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1729 |
restartButton disable. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
1730 |
|
92 | 1731 |
dummy := View extent:(10 @ 5) in:bpanel. |
73 | 1732 |
dummy borderWidth:0; level:0. |
61 | 1733 |
|
73 | 1734 |
"/ stepButton destroy. |
1735 |
"/ sendButton destroy. |
|
1736 |
||
1737 |
updateButton := Button |
|
6647 | 1738 |
label:(resources string:'Update') |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1739 |
action:[self updateContext] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1740 |
in:bpanel. |
73 | 1741 |
monitorToggle := Toggle in:bpanel. |
6647 | 1742 |
monitorToggle label:(resources string:'Monitor'). |
73 | 1743 |
monitorToggle pressAction:[self autoUpdateOn]. |
1744 |
monitorToggle releaseAction:[self autoUpdateOff]. |
|
1745 |
||
1746 |
"can only look into process - context chain is not active" |
|
1747 |
canContinue := true. |
|
1748 |
||
1749 |
terminateButton enable. |
|
1750 |
abortButton enable. |
|
1751 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1752 |
sendButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1753 |
stepButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1754 |
nextButton disable; beInvisible. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1755 |
nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
1756 |
nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible]. |
73 | 1757 |
|
1758 |
aProcess isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1759 |
terminateButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1760 |
abortButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1761 |
continueButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1762 |
returnButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1763 |
restartButton disable. |
73 | 1764 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1765 |
(aProcess suspendedContext isNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1766 |
or:[aProcess isSystemProcess]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1767 |
terminateButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1768 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1769 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1770 |
self setContextSkippingInterruptContexts:aProcess suspendedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1771 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1772 |
catchBlock := [ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1773 |
catchBlock := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1774 |
contextArray := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1775 |
selectedContext := actualContext := firstContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1776 |
steppedContext := wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1777 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1778 |
(exitAction == #terminate) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1779 |
aProcess terminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1780 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1781 |
(exitAction == #quickTerminate) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1782 |
aProcess terminateNoSignal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1783 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1784 |
super destroy |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1785 |
]. |
73 | 1786 |
]. |
1787 |
self open |
|
316
7d529dfe8a99
disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents:
303
diff
changeset
|
1788 |
|
1092
059c29fac604
made the number of frames shown initially a
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1789 |
"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
|
1790 |
"Modified: 17.4.1997 / 13:01:57 / stefan" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1791 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1792 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1793 |
setInitialSelectionOnEntry:initialSelectionOrNil context:aContext |
3447 | 1794 |
|selection| |
1795 |
||
1796 |
selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext. |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1797 |
selection notNil ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1798 |
self showSelection:selection. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1799 |
contextView setSelection:selection. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1800 |
selection > 1 ifTrue:[ |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1801 |
contextView scrollToLine:(selection - 1) |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1802 |
] |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1803 |
]. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1804 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1805 |
"Created: / 16.11.2001 / 17:28:07 / cg" |
3447 | 1806 |
"Modified: / 17.11.2001 / 20:27:21 / cg" |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1807 |
! |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1808 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1809 |
turnOffAllButtons |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1810 |
terminateButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1811 |
continueButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1812 |
returnButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1813 |
restartButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1814 |
abortButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1815 |
nextButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1816 |
stepButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1817 |
sendButton turnOffWithoutRedraw. |
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1818 |
|
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
1819 |
"Created: / 16.11.2001 / 17:36:18 / cg" |
266 | 1820 |
! ! |
1821 |
||
1822 |
!DebugView methodsFor:'help'! |
|
1823 |
||
8212 | 1824 |
flyByHelpDependsOnPositionIn:aView |
1825 |
"subclasses where the help-text depends upon the pointer position might |
|
1826 |
want to redefine this" |
|
1827 |
||
1828 |
^ aView == codeView |
|
1829 |
! |
|
1830 |
||
3510 | 1831 |
flyByHelpTextFor:aComponent |
1832 |
|s| |
|
1833 |
||
1834 |
aComponent == abortButton ifTrue:[ |
|
1835 |
s := 'Abort (Unwind to EventLoop)' |
|
1836 |
]. |
|
1837 |
aComponent == terminateButton ifTrue:[ |
|
1838 |
s := 'Terminate Process (Close View)' |
|
1839 |
]. |
|
1840 |
aComponent == continueButton ifTrue:[ |
|
6647 | 1841 |
continueButton label = (resources string:'Stop') ifTrue:[ |
3510 | 1842 |
s := 'Stop' |
1843 |
] ifFalse:[ |
|
1844 |
s := 'Continue Execution' |
|
1845 |
] |
|
1846 |
]. |
|
1847 |
aComponent == stepButton ifTrue:[ |
|
1848 |
s := 'Step to Next Send' |
|
1849 |
]. |
|
1850 |
aComponent == nextButton ifTrue:[ |
|
1851 |
s := 'Step to Next Line' |
|
1852 |
]. |
|
1853 |
aComponent == nextOverButton ifTrue:[ |
|
1854 |
s := 'Step Over' |
|
1855 |
]. |
|
1856 |
aComponent == nextOutButton ifTrue:[ |
|
1857 |
s := 'Step Out' |
|
1858 |
]. |
|
1859 |
aComponent == sendButton ifTrue:[ |
|
1860 |
s := 'Send Next Message' |
|
1861 |
]. |
|
1862 |
aComponent == returnButton ifTrue:[ |
|
1863 |
s := 'Return from selected Method' |
|
1864 |
]. |
|
1865 |
aComponent == restartButton ifTrue:[ |
|
1866 |
s := 'Restart selected Method' |
|
1867 |
]. |
|
1868 |
aComponent == monitorToggle ifTrue:[ |
|
1869 |
s := 'Toggle Monitoring' |
|
1870 |
]. |
|
1871 |
aComponent == updateButton ifTrue:[ |
|
1872 |
s := 'Update' |
|
1873 |
]. |
|
1874 |
s notNil ifTrue:[ |
|
1875 |
^ resources string:s |
|
1876 |
]. |
|
1877 |
^ nil |
|
1878 |
||
1879 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1880 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
|
1881 |
! |
|
1882 |
||
8212 | 1883 |
flyByHelpTextFor:aComponent at:aPointOrNil |
1884 |
|s line col pos interval| |
|
1885 |
||
1886 |
aComponent == codeView ifFalse:[^ nil]. |
|
1887 |
aPointOrNil isNil ifTrue:[^ nil]. |
|
1888 |
||
1889 |
line := codeView visibleLineOfY:aPointOrNil y. |
|
1890 |
line := codeView visibleLineToAbsoluteLine:line. |
|
1891 |
col := codeView colOfX:aPointOrNil x inVisibleLine:line. |
|
1892 |
||
1893 |
pos := codeView characterPositionOfLine:line col:col. |
|
1894 |
interval := pos to:pos. |
|
1895 |
||
1896 |
self |
|
1897 |
withNodeValueAtInterval:interval |
|
1898 |
do:[:value | |
|
1899 |
s := value printString contractTo:80 |
|
1900 |
]. |
|
1901 |
||
1902 |
||
1903 |
s notNil ifTrue:[ |
|
1904 |
^ s |
|
1905 |
]. |
|
1906 |
^ nil |
|
1907 |
! |
|
1908 |
||
266 | 1909 |
helpTextFor:aComponent |
1910 |
|s| |
|
1911 |
||
1912 |
aComponent == abortButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1913 |
s := 'HELP_ABORT' |
266 | 1914 |
]. |
1915 |
aComponent == terminateButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1916 |
s := 'HELP_TERMINATE' |
266 | 1917 |
]. |
1918 |
aComponent == continueButton ifTrue:[ |
|
6647 | 1919 |
continueButton label = (resources string:'Stop') ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1920 |
s := 'HELP_STOP' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1921 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1922 |
s := 'HELP_CONTINUE' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1923 |
] |
266 | 1924 |
]. |
1925 |
aComponent == stepButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1926 |
s := 'HELP_STEP' |
266 | 1927 |
]. |
1928 |
aComponent == nextButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1929 |
s := 'HELP_NEXT' |
266 | 1930 |
]. |
1065 | 1931 |
aComponent == nextOverButton ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1932 |
s := 'HELP_NEXTOVER' |
1065 | 1933 |
]. |
1934 |
aComponent == nextOutButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1935 |
s := 'HELP_NEXTOUT' |
1065 | 1936 |
]. |
266 | 1937 |
aComponent == stepButton ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1938 |
s := 'HELP_STEP' |
266 | 1939 |
]. |
1940 |
aComponent == sendButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1941 |
s := 'HELP_SEND' |
266 | 1942 |
]. |
1943 |
aComponent == returnButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1944 |
s := 'HELP_RETURN' |
266 | 1945 |
]. |
1946 |
aComponent == restartButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1947 |
s := 'HELP_RESTART' |
266 | 1948 |
]. |
1949 |
aComponent == contextView ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1950 |
s := 'HELP_WALKBACK' |
266 | 1951 |
]. |
1952 |
aComponent == codeView ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1953 |
s := 'HELP_CODEVIEW' |
266 | 1954 |
]. |
1955 |
aComponent == monitorToggle ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1956 |
s := 'HELP_MONITOR' |
266 | 1957 |
]. |
1958 |
aComponent == updateButton ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1959 |
s := 'HELP_UPDATE' |
266 | 1960 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1961 |
"/ aComponent == stopButton ifTrue:[ |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1962 |
"/ s := 'HELP_STOP' |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
1963 |
"/ ]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1964 |
(aComponent isComponentOf:receiverInspector) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1965 |
s := 'HELP_REC_INSP' |
266 | 1966 |
]. |
612
986e371232a2
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
583
diff
changeset
|
1967 |
(aComponent isComponentOf:contextInspector) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1968 |
s := 'HELP_CON_INSP' |
266 | 1969 |
]. |
1970 |
||
1971 |
s notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
1972 |
^ resources string:s |
266 | 1973 |
]. |
1974 |
^ nil |
|
1975 |
||
1976 |
"Modified: 29.8.1995 / 23:38:54 / claus" |
|
1065 | 1977 |
"Modified: 4.3.1997 / 01:54:03 / cg" |
266 | 1978 |
! ! |
1979 |
||
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1980 |
!DebugView methodsFor:'initialization & release'! |
266 | 1981 |
|
1982 |
addToCurrentProject |
|
1983 |
"ignored here" |
|
1984 |
||
1985 |
^ self |
|
1986 |
! |
|
1987 |
||
2115 | 1988 |
destroy |
1989 |
"closing the debugger implies an abort or continue" |
|
1990 |
||
2404 | 1991 |
|m| |
1992 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
1993 |
self checkIfCodeIsReallyModified ifTrue:[ |
2115 | 1994 |
(self confirm:('Code modified - exit anyway ?')) |
1995 |
ifFalse:[ |
|
1996 |
^ self |
|
1997 |
] |
|
1998 |
]. |
|
1999 |
||
2172
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2000 |
self autoUpdateOff. |
dc9b1ed43f64
turn off autoUpdate when destroyed
Claus Gittinger <cg@exept.de>
parents:
2150
diff
changeset
|
2001 |
|
2404 | 2002 |
(m := contextView middleButtonMenu) notNil ifTrue:[m hide]. |
2115 | 2003 |
inspecting ifFalse:[ |
2004 |
"I am running on top of a process, abort or continue it" |
|
2005 |
||
2006 |
windowGroup notNil ifTrue:[ |
|
2007 |
windowGroup setProcess:nil. |
|
2008 |
]. |
|
2009 |
self uncacheMyself. |
|
2010 |
||
2011 |
"/ |
|
2012 |
"/ catch invalid return; |
|
2013 |
"/ this happens, when my process has somehow died (quickterminate) |
|
2014 |
"/ and I am a leftOver view, which gets terminated via the launchers |
|
2015 |
"/ #destroy-window function. |
|
2016 |
"/ |
|
3124
540feceebffa
invalidReturnSignal -> cannotReturnSignal
Claus Gittinger <cg@exept.de>
parents:
3121
diff
changeset
|
2017 |
Context cannotReturnSignal handle:[:ex | |
2115 | 2018 |
'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR. |
2019 |
self uncacheMyself. |
|
2020 |
Debugger newDebugger. |
|
2021 |
ex return. |
|
2022 |
] do:[ |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2023 |
AbortOperationRequest isHandled ifTrue:[ |
2115 | 2024 |
self doAbort. |
2025 |
] ifFalse:[ |
|
2026 |
self doContinue |
|
2027 |
] |
|
2028 |
]. |
|
2029 |
"/ We don't reach this point normally |
|
2030 |
'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR. |
|
2031 |
Debugger newDebugger. |
|
2032 |
self uncacheMyself. |
|
2033 |
]. |
|
2034 |
||
2299 | 2035 |
Debugger newDebugger. |
2115 | 2036 |
"/ since I am going to be destroyed, remove me from the cache |
2037 |
self uncacheMyself. |
|
2038 |
super destroy. |
|
2039 |
||
2040 |
"Modified: / 10.7.1997 / 17:15:41 / stefan" |
|
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
2041 |
"Modified: / 16.11.2001 / 17:38:15 / cg" |
2115 | 2042 |
! |
2043 |
||
266 | 2044 |
initialize |
8148 | 2045 |
|menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel |
2046 |
newLayout v| |
|
266 | 2047 |
|
2048 |
super initialize. |
|
2049 |
||
2340 | 2050 |
font := font onDevice:device. |
266 | 2051 |
|
8148 | 2052 |
verboseBacktrace := UserPreferences current verboseBacktraceInDebugger. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2053 |
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
|
2054 |
"/ the debugger |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
2055 |
|
266 | 2056 |
busy := false. |
2057 |
exclusive := false. |
|
2058 |
inspecting := false. |
|
2059 |
exitAction := nil. |
|
2060 |
bigStep := false. |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2061 |
stepHow := nil. |
266 | 2062 |
canContinue := false. |
2063 |
||
3269 | 2064 |
mH := 0. |
2065 |
||
3447 | 2066 |
menuPanel := MenuPanel in:self. |
8131 | 2067 |
menuPanel receiver:self. |
3447 | 2068 |
menuPanel verticalLayout:false. |
8131 | 2069 |
menu := self class menuSpec decodeAsLiteralArray. |
2070 |
menu findGuiResourcesIn:self. |
|
2071 |
menuPanel menu:menu. |
|
3447 | 2072 |
|
8161
c3a91c963a35
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
8154
diff
changeset
|
2073 |
mH := menuPanel preferredHeight. |
3447 | 2074 |
menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)). |
2075 |
||
8148 | 2076 |
newLayout := UserPreferences current useNewLayoutInDebugger. |
2077 |
newLayout ifFalse:[ |
|
3269 | 2078 |
bpanel := HorizontalPanelView in:self. |
3447 | 2079 |
|
3269 | 2080 |
self initializeButtonsIn:bpanel. |
2081 |
||
8194 | 2082 |
bH := bpanel preferredHeight + 5. |
3269 | 2083 |
bpanel origin:(0.0 @ mH) |
2084 |
extent:(1.0 @ bH). |
|
2085 |
panel := VariableVerticalPanel |
|
2086 |
origin:(0.0 @ (mH + bH)) |
|
2087 |
corner:(1.0 @ 1.0) |
|
2088 |
in:self. |
|
2089 |
||
2090 |
v := self initializeContextListViewIn:panel. |
|
2091 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2092 |
||
2093 |
codePanel := View in:panel. |
|
2094 |
v := self initializeCodeViewIn:codePanel. |
|
2095 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
2096 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2097 |
||
2098 |
v := self initializeInspectorViewsIn:panel. |
|
2099 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
2100 |
||
8148 | 2101 |
] ifTrue:[ |
3269 | 2102 |
bpanel1 := HorizontalPanelView in:self. |
2103 |
self initializeButtons1In:bpanel1. |
|
2104 |
||
8194 | 2105 |
bH1 := bpanel1 preferredHeight + 5. |
3269 | 2106 |
bpanel1 origin:(0.0 @ mH) |
2107 |
extent:(1.0 @ bH1). |
|
2108 |
panel := VariableVerticalPanel |
|
2109 |
origin:(0.0 @ (mH + bH1)) |
|
2110 |
corner:(1.0 @ 1.0) |
|
2111 |
in:self. |
|
8194 | 2112 |
"/ panel showHandle:true. |
2113 |
"/ panel handlePosition:#left. |
|
3269 | 2114 |
|
2115 |
v := self initializeContextListViewIn:panel. |
|
2116 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
|
2117 |
||
2118 |
codePanel := View in:panel. |
|
2119 |
bpanel2 := HorizontalPanelView in:codePanel. |
|
2120 |
self initializeButtons2In:bpanel2. |
|
2121 |
||
8194 | 2122 |
bH2 := bpanel2 preferredHeight + 5. |
3269 | 2123 |
bpanel2 origin:(0.0 @ 0.0) |
2124 |
extent:(1.0 @ bH2). |
|
2125 |
||
2126 |
v := self initializeCodeViewIn:codePanel. |
|
2127 |
v origin:(0.0 @ bH2) corner:(1.0 @ 1.0). |
|
2128 |
codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75). |
|
2129 |
||
2130 |
v := self initializeInspectorViewsIn:panel. |
|
2131 |
v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0). |
|
2132 |
]. |
|
2133 |
||
3387 | 2134 |
DefaultDebuggerBackgroundColor notNil ifTrue:[ |
2135 |
self allViewBackground:DefaultDebuggerBackgroundColor. |
|
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2136 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
2137 |
|
3387 | 2138 |
|
3269 | 2139 |
" |
2140 |
Debugger newDebugger |
|
2141 |
" |
|
3447 | 2142 |
|
2143 |
"Modified: / 17.11.2001 / 20:50:24 / cg" |
|
3269 | 2144 |
! |
2145 |
||
3447 | 2146 |
initializeAbortButtonIn:bpanel |
3269 | 2147 |
abortButton := Button |
6647 | 2148 |
label:(resources string:'Abort') |
3269 | 2149 |
action:[ |
2150 |
abortButton turnOffWithoutRedraw. |
|
2151 |
self doAbort |
|
2152 |
] |
|
2153 |
in:bpanel. |
|
3447 | 2154 |
|
2155 |
"Created: / 17.11.2001 / 20:56:47 / cg" |
|
2156 |
"Modified: / 17.11.2001 / 20:57:17 / cg" |
|
2157 |
! |
|
2158 |
||
2159 |
initializeButtons1In:bpanel |
|
2160 |
|separator| |
|
2161 |
||
2162 |
bpanel horizontalLayout:#leftMax. "was: #left. " |
|
2163 |
bpanel verticalLayout:#centerMax. |
|
2164 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2165 |
||
8194 | 2166 |
self initializeContinueButtonIn:bpanel. |
2167 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2168 |
separator borderWidth:0; level:0. |
|
3447 | 2169 |
self initializeAbortButtonIn:bpanel. |
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2170 |
|
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2171 |
separator := View extent:(10 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2172 |
separator borderWidth:0; level:0. |
3269 | 2173 |
|
3447 | 2174 |
self initializeTerminateButtonIn:bpanel. |
2175 |
||
2176 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2177 |
separator borderWidth:0; level:0. |
|
2178 |
||
2179 |
self initializeDefineButtonIn:bpanel. |
|
4356 | 2180 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
2181 |
self initializeReportButtonIn:bpanel. |
|
2182 |
]. |
|
3447 | 2183 |
"Modified: / 17.11.2001 / 21:02:59 / cg" |
3269 | 2184 |
! |
2185 |
||
2186 |
initializeButtons2In:bpanel |
|
2187 |
|separator| |
|
2188 |
||
3447 | 2189 |
bpanel horizontalLayout:#leftMax. "was: #left. " |
3269 | 2190 |
bpanel verticalLayout:#centerMax. |
2191 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2192 |
||
3447 | 2193 |
self initializeNextButtonIn:bpanel. |
2194 |
self initializeStepButtonIn:bpanel. |
|
2195 |
||
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2196 |
"/ cg: |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2197 |
"/ 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
|
2198 |
"/ 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
|
2199 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2200 |
|
3269 | 2201 |
|
2305
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2202 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2203 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2204 |
"/ img := (resources at:'next') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2205 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2206 |
"/ nextButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2207 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2208 |
"/ action:[stepButton turnOff. self doNext] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2209 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2210 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2211 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2212 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2213 |
"/ img := (resources at:'over') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2214 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2215 |
"/ nextOverButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2216 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2217 |
"/ action:[stepButton turnOff. self doNextOver] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2218 |
"/ in:bpanel. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2219 |
"/ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2220 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2221 |
"/ img isNil ifTrue:[ |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2222 |
"/ img := (resources at:'out') |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2223 |
"/ ]. |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2224 |
"/ nextOutButton := Button |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2225 |
"/ label:img |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2226 |
"/ action:[stepButton turnOff. self doNextOut] |
4df4dcd30c13
disabled the stepIn / stepOut buttons - for now
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
2227 |
"/ in:bpanel. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2228 |
|
3447 | 2229 |
self initializeSendButtonIn:bpanel. |
2230 |
||
1398
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2231 |
separator := View extent:(30 @ 5) in:bpanel. |
d3f02207f847
rearranged buttons (terminate was too exposed);
Claus Gittinger <cg@exept.de>
parents:
1394
diff
changeset
|
2232 |
separator borderWidth:0; level:0. |
3269 | 2233 |
|
3447 | 2234 |
self initializeReturnButtonIn:bpanel. |
2235 |
self initializeRestartButtonIn:bpanel. |
|
2236 |
||
2237 |
"Modified: / 17.11.2001 / 21:01:38 / cg" |
|
3269 | 2238 |
! |
2239 |
||
2240 |
initializeButtonsIn:bpanel |
|
2241 |
|separator| |
|
2242 |
||
2243 |
bpanel horizontalLayout:#left. |
|
2244 |
bpanel verticalLayout:#centerMax. |
|
2245 |
bpanel verticalSpace:ViewSpacing // 2. |
|
2246 |
||
3447 | 2247 |
self initializeAbortButtonIn:bpanel. |
2248 |
||
3269 | 2249 |
separator := View extent:(10 @ 5) in:bpanel. |
2250 |
separator borderWidth:0; level:0. |
|
2251 |
||
3447 | 2252 |
self initializeContinueButtonIn:bpanel. |
3269 | 2253 |
|
2254 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2255 |
separator borderWidth:0; level:0. |
|
2256 |
||
3447 | 2257 |
self initializeReturnButtonIn:bpanel. |
2258 |
self initializeRestartButtonIn:bpanel. |
|
3269 | 2259 |
|
2260 |
separator := View extent:(10 @ 5) in:bpanel. |
|
2261 |
separator borderWidth:0; level:0. |
|
2262 |
||
3447 | 2263 |
self initializeNextButtonIn:bpanel. |
2264 |
self initializeStepButtonIn:bpanel. |
|
2265 |
||
3269 | 2266 |
"/ cg: |
2267 |
"/ I disabled the stepIn / stepOut buttons - for now. |
|
2268 |
"/ they do not work relyable with inlined blocks yet. |
|
2269 |
"/ |
|
2270 |
||
2271 |
||
2272 |
"/ img := Image fromFile:'bitmaps/stepIn.xpm'. |
|
2273 |
"/ img isNil ifTrue:[ |
|
2274 |
"/ img := (resources at:'next') |
|
2275 |
"/ ]. |
|
2276 |
"/ nextButton := Button |
|
2277 |
"/ label:img |
|
2278 |
"/ action:[stepButton turnOff. self doNext] |
|
2279 |
"/ in:bpanel. |
|
2280 |
"/ |
|
2281 |
"/ img := Image fromFile:'bitmaps/stepOver.xpm'. |
|
2282 |
"/ img isNil ifTrue:[ |
|
2283 |
"/ img := (resources at:'over') |
|
2284 |
"/ ]. |
|
2285 |
"/ nextOverButton := Button |
|
2286 |
"/ label:img |
|
2287 |
"/ action:[stepButton turnOff. self doNextOver] |
|
2288 |
"/ in:bpanel. |
|
2289 |
"/ |
|
2290 |
"/ img := Image fromFile:'bitmaps/stepOut.xpm'. |
|
2291 |
"/ img isNil ifTrue:[ |
|
2292 |
"/ img := (resources at:'out') |
|
2293 |
"/ ]. |
|
2294 |
"/ nextOutButton := Button |
|
2295 |
"/ label:img |
|
2296 |
"/ action:[stepButton turnOff. self doNextOut] |
|
2297 |
"/ in:bpanel. |
|
2298 |
||
3447 | 2299 |
self initializeSendButtonIn:bpanel. |
2300 |
||
3187 | 2301 |
separator := View extent:(30 @ 5) in:bpanel. |
2302 |
separator borderWidth:0; level:0. |
|
3269 | 2303 |
|
3447 | 2304 |
self initializeTerminateButtonIn:bpanel. |
2305 |
||
3269 | 2306 |
separator := View extent:(30 @ 5) in:bpanel. |
2307 |
separator borderWidth:0; level:0. |
|
2308 |
||
3447 | 2309 |
self initializeDefineButtonIn:bpanel. |
4356 | 2310 |
(UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[ |
2311 |
self initializeReportButtonIn:bpanel. |
|
2312 |
]. |
|
2313 |
||
3447 | 2314 |
|
2315 |
"Created: / 17.11.2001 / 20:56:20 / cg" |
|
2316 |
"Modified: / 17.11.2001 / 21:03:18 / cg" |
|
3269 | 2317 |
! |
2318 |
||
2319 |
initializeCodeViewIn:panel |
|
2320 |
|v| |
|
2321 |
||
2322 |
v := HVScrollableView |
|
2323 |
for:CodeView |
|
2324 |
miniScrollerH:true |
|
2325 |
miniScrollerV:false |
|
2326 |
in:panel. |
|
2327 |
||
2328 |
"/ v autoHideScrollBars:true. |
|
2329 |
codeView := v scrolledView. |
|
8212 | 2330 |
codeView enableMotionEvents. "/ for active help |
3269 | 2331 |
|
2332 |
^ v |
|
2333 |
! |
|
2334 |
||
2335 |
initializeContextListViewIn:panel |
|
2336 |
|v| |
|
266 | 2337 |
|
3034
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2338 |
v := HVScrollableView |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2339 |
for:SelectionInListView |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2340 |
miniScrollerH:true |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2341 |
miniScrollerV:false |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2342 |
in:panel. |
fad21a9a02bd
context-list is horizontal scrollable
Claus Gittinger <cg@exept.de>
parents:
3033
diff
changeset
|
2343 |
v autoHideHorizontalScrollBar:true. |
266 | 2344 |
|
2345 |
contextView := v scrolledView. |
|
2346 |
contextView action:[:lineNr | self showSelection:lineNr]. |
|
3269 | 2347 |
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
|
2348 |
contextView selectConditionBlock:[:line | self checkSelectionChangeAllowed:line]. |
266 | 2349 |
|
5453 | 2350 |
contextView middleButtonMenu:(self middleButtonMenu). |
2351 |
||
3269 | 2352 |
^ v |
2353 |
! |
|
2354 |
||
5453 | 2355 |
initializeContextViewsMiddleButtonMenu |
2356 |
<resource: #programMenu > |
|
2357 |
||
2358 |
contextView middleButtonMenu:(self middleButtonMenu). |
|
2359 |
! |
|
2360 |
||
3447 | 2361 |
initializeContinueButtonIn:bpanel |
2362 |
continueButton := Button |
|
6647 | 2363 |
label:(resources string:'Continue') |
3447 | 2364 |
action:[ |
2365 |
continueButton turnOffWithoutRedraw. |
|
2366 |
self doContinue |
|
2367 |
] |
|
2368 |
in:bpanel. |
|
2369 |
||
2370 |
"Created: / 17.11.2001 / 20:57:34 / cg" |
|
2371 |
! |
|
2372 |
||
2373 |
initializeDefineButtonIn:bpanel |
|
2374 |
defineButton := Button |
|
6647 | 2375 |
label:(resources string:'Define') |
3447 | 2376 |
action:[ |
2377 |
defineButton turnOffWithoutRedraw. |
|
2378 |
self doDefine |
|
2379 |
] |
|
2380 |
in:bpanel. |
|
2381 |
defineButton beInvisible |
|
2382 |
||
2383 |
"Created: / 17.11.2001 / 21:02:48 / cg" |
|
2384 |
! |
|
2385 |
||
3269 | 2386 |
initializeInspectorViewsIn:panel |
2387 |
|hpanel| |
|
266 | 2388 |
|
2389 |
hpanel := VariableHorizontalPanel in:panel. |
|
2390 |
||
2391 |
receiverInspector := InspectorView |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2392 |
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
|
2393 |
in:hpanel. |
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2394 |
receiverInspector fieldListLabel:'Receiver'. |
266 | 2395 |
|
2396 |
contextInspector := ContextInspectorView |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2397 |
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
|
2398 |
in:hpanel. |
4103
6c0eb2985cee
label: -> fieldListLabel: in inspector
Claus Gittinger <cg@exept.de>
parents:
3998
diff
changeset
|
2399 |
contextInspector fieldListLabel:'Context'. |
646
04dafb2560bf
added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2400 |
|
3269 | 2401 |
^ hpanel |
266 | 2402 |
! |
2403 |
||
3447 | 2404 |
initializeNextButtonIn:bpanel |
2405 |
nextButton := Button |
|
6647 | 2406 |
label:(resources string:'Next') |
3447 | 2407 |
action:[ |
2408 |
stepButton turnOff. |
|
2409 |
self doNext |
|
2410 |
] |
|
2411 |
in:bpanel. |
|
2412 |
||
2413 |
"Created: / 17.11.2001 / 20:59:38 / cg" |
|
2414 |
! |
|
2415 |
||
4356 | 2416 |
initializeReportButtonIn:bpanel |
2417 |
reportButton := Button |
|
6647 | 2418 |
label:(resources string:'Report by Mail') |
4356 | 2419 |
action:[ |
2420 |
reportButton turnOffWithoutRedraw. |
|
2421 |
self doOpenReportMailApp. |
|
2422 |
] |
|
2423 |
in:bpanel. |
|
2424 |
||
2425 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
2426 |
! |
|
2427 |
||
3447 | 2428 |
initializeRestartButtonIn:bpanel |
2429 |
restartButton := Button |
|
6647 | 2430 |
label:(resources string:'Restart') |
3447 | 2431 |
action:[ |
2432 |
restartButton turnOff. |
|
2433 |
self doRestart |
|
2434 |
] |
|
2435 |
in:bpanel. |
|
2436 |
||
2437 |
"Created: / 17.11.2001 / 20:58:52 / cg" |
|
2438 |
! |
|
2439 |
||
2440 |
initializeReturnButtonIn:bpanel |
|
2441 |
returnButton := Button |
|
6647 | 2442 |
label:(resources string:'Return') |
3447 | 2443 |
action:[ |
2444 |
returnButton turnOff. |
|
2445 |
self doReturn |
|
2446 |
] |
|
2447 |
in:bpanel. |
|
2448 |
||
2449 |
"Created: / 17.11.2001 / 20:58:22 / cg" |
|
2450 |
! |
|
2451 |
||
2452 |
initializeSendButtonIn:bpanel |
|
2453 |
sendButton := Button |
|
6647 | 2454 |
label:(resources string:'Send') |
3447 | 2455 |
action:[ |
2456 |
sendButton turnOff. |
|
2457 |
self doSend |
|
2458 |
] |
|
2459 |
in:bpanel. |
|
2460 |
||
2461 |
"Created: / 17.11.2001 / 21:01:20 / cg" |
|
2462 |
! |
|
2463 |
||
2464 |
initializeStepButtonIn:bpanel |
|
2465 |
stepButton := Button |
|
6647 | 2466 |
label:(resources string:'Step') |
3447 | 2467 |
action:[ |
2468 |
stepButton turnOff. |
|
2469 |
self doStep |
|
2470 |
] |
|
2471 |
in:bpanel. |
|
2472 |
||
2473 |
"Created: / 17.11.2001 / 21:00:13 / cg" |
|
2474 |
! |
|
2475 |
||
2476 |
initializeTerminateButtonIn:bpanel |
|
2477 |
terminateButton := Button |
|
6647 | 2478 |
label:(resources string:'Terminate') |
3447 | 2479 |
action:[ |
2480 |
terminateButton turnOffWithoutRedraw. |
|
2481 |
self doTerminate |
|
2482 |
] |
|
2483 |
in:bpanel. |
|
2484 |
||
2485 |
"Created: / 17.11.2001 / 21:02:20 / cg" |
|
266 | 2486 |
! |
2487 |
||
1249 | 2488 |
postRealize |
2489 |
super postRealize. |
|
266 | 2490 |
|
2491 |
inspecting ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2492 |
inspectedProcess notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2493 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2494 |
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
|
2495 |
to run between mine and the debugged processes prio) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2496 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2497 |
Processor activeProcess |
6464 | 2498 |
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
|
2499 |
] |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2500 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2501 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2502 |
self sensor addEventListener:self. |
1249 | 2503 |
|
2504 |
"Created: 24.7.1997 / 18:17:44 / cg" |
|
266 | 2505 |
! |
2506 |
||
2150
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2507 |
reinitialize |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2508 |
"/ 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
|
2509 |
"/ 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
|
2510 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2511 |
drawableId notNil ifTrue:[ |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2512 |
^ self |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2513 |
]. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2514 |
"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
|
2515 |
self recreate. |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2516 |
|
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2517 |
! |
a3148483962e
do not re-realize a debugView after a snapshot-restart
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2518 |
|
266 | 2519 |
setLabelFor:aMessage in:aProcess |
6821 | 2520 |
|l lines nm| |
2521 |
||
2522 |
lines := aMessage asStringCollection. |
|
2523 |
lines size > 1 ifTrue:[ |
|
2524 |
l := lines first |
|
2525 |
] ifFalse:[ |
|
2526 |
l := aMessage. |
|
2527 |
]. |
|
2528 |
||
2529 |
l := l , ' ('. |
|
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
2530 |
Error handle:[:ex | |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2531 |
l := l , '???' |
1030 | 2532 |
] do:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2533 |
nm := aProcess name. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2534 |
nm notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2535 |
l := l , (nm contractTo:17) , ''. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2536 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2537 |
l := l , '[' , aProcess id printString , ']'. |
73 | 2538 |
]. |
1030 | 2539 |
l := l , ')'. |
266 | 2540 |
self label:l. |
6821 | 2541 |
|
2542 |
"Modified: / 06-07-2006 / 12:43:19 / cg" |
|
0 | 2543 |
! ! |
2544 |
||
2545 |
!DebugView methodsFor:'interrupt handling'! |
|
2546 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2547 |
contextInterrupt |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2548 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2549 |
'contextIRQ' printCR. |
2581 | 2550 |
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
|
2551 |
]. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2552 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2553 |
|
1364 | 2554 |
"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
|
2555 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2556 |
|
0 | 2557 |
stepInterrupt |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2558 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2559 |
'stepIRQ' printCR. |
2581 | 2560 |
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
|
2561 |
]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2562 |
Processor yield. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2563 |
self stepOrNext |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2564 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
2565 |
"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
|
2566 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2567 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2568 |
stepOrNext |
3055 | 2569 |
|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
|
2570 |
inBlock left ignore contextBelow lastWrappedContext |
3055 | 2571 |
leftWrap enteredWrap anyStepBlocks |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2572 |
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
|
2573 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2574 |
"/ DebuggingDebugger := true |
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
2575 |
"/ DebuggingDebugger := false |
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
2576 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2577 |
skipLineNr == #return ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2578 |
name := Processor activeProcess nameOrId. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2579 |
self label:('stepping context returned ' , ' (process: ' , name , ')'). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2580 |
here := thisContext sender sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2581 |
here setLineNumber:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2582 |
here := nil. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2583 |
con := thisContext sender sender sender. |
3435 | 2584 |
|
2585 |
BreakPointInterrupt handle:[:ex | |
|
2586 |
'DebugView [info]: breakpoint in debugger ignored [stepOrNext]' infoPrintCR. |
|
2587 |
ex proceed |
|
2588 |
] do:[ |
|
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2589 |
self enter:con select:nil. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2590 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
2591 |
con := nil. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2592 |
^ self |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2593 |
]. |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
2594 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2595 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2596 |
"/ "/ 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
|
2597 |
"/ "/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2598 |
"/ stepForReturn == true ifTrue:[ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2599 |
"/"/'stepForreturn' printCR. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2600 |
"/ 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
|
2601 |
"/ ^ self |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2602 |
"/ ]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2603 |
|
52 | 2604 |
Processor activeProcess ~~ inspectedProcess ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2605 |
'DebugView [info]: stray step interrupt' infoPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2606 |
^ self |
52 | 2607 |
]. |
2608 |
||
29 | 2609 |
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
|
2610 |
here := here sender. "the caller; step- or contextIRQ" |
29 | 2611 |
here := here sender. "the interrupted context" |
2612 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2613 |
DebuggingDebugger == true ifTrue:[ |
3055 | 2614 |
'*******' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2615 |
'here in ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2616 |
inWrap ifTrue:['(wrap) ' print.]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2617 |
((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print. |
3055 | 2618 |
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
|
2619 |
]. |
10 | 2620 |
|
2581 | 2621 |
"/ kludge an bug-workaround; |
2622 |
"/ I should not see those ... |
|
2623 |
||
2624 |
here selector == #ioInterrupt ifTrue:[ |
|
2625 |
DebuggingDebugger == true ifTrue:[ |
|
2626 |
'oops - should not get that one' printCR. |
|
2627 |
]. |
|
2628 |
Processor ioInterrupt. |
|
2629 |
StepInterruptPending := 1. |
|
2630 |
InterruptPending := 1. |
|
2631 |
where := nil. here := nil. |
|
2632 |
InStepInterrupt := nil. |
|
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2633 |
^ self |
2581 | 2634 |
]. |
2635 |
||
2636 |
stepUntilEntering notNil ifTrue:[ |
|
2637 |
DebuggingDebugger == true ifTrue:[ |
|
2638 |
'check if entering ' print. stepUntilEntering printCR. |
|
2639 |
]. |
|
2640 |
(stepUntilEntering match:here selector) ifTrue:[ |
|
2641 |
DebuggingDebugger == true ifTrue:[ |
|
2642 |
'entering...' printCR. |
|
2643 |
]. |
|
2644 |
name := Processor activeProcess nameOrId. |
|
2645 |
self label:('arrived at ' , stepUntilEntering , ' (process: ' , name , ')'). |
|
2646 |
||
2647 |
lastStepUntilEntering := stepUntilEntering. |
|
2648 |
stepUntilEntering := nil. |
|
2649 |
self enter:here select:nil. |
|
2650 |
con := nil. |
|
2651 |
^ self |
|
2652 |
]. |
|
2653 |
"/ see if stepping context is still active ... |
|
2654 |
||
2655 |
con := here. |
|
2656 |
||
2657 |
DebuggingDebugger == true ifTrue:[ |
|
2658 |
'start searching at: ' print. |
|
2659 |
con fullPrint. |
|
2660 |
]. |
|
2661 |
[con notNil and:[con ~~ steppedContext]] whileTrue:[ |
|
2662 |
con := con sender |
|
2663 |
]. |
|
2664 |
con notNil ifTrue:[ |
|
2665 |
DebuggingDebugger == true ifTrue:[ |
|
2666 |
'steppingContext still active - continue stepping' printCR. |
|
2667 |
]. |
|
2668 |
con := nil. |
|
2669 |
where := nil. here := nil. |
|
2670 |
StepInterruptPending := 1. |
|
2671 |
InterruptPending := 1. |
|
2672 |
InStepInterrupt := nil. |
|
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2673 |
^ self |
2581 | 2674 |
]. |
2675 |
stepUntilEntering := nil. |
|
2676 |
]. |
|
2677 |
||
781
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2678 |
" |
33e4d40fddbe
better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
2679 |
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
|
2680 |
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
|
2681 |
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
|
2682 |
" |
29 | 2683 |
isWrap := false. |
57 | 2684 |
left := false. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2685 |
leftWrap := enteredWrap := false. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2686 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2687 |
where := here. |
57 | 2688 |
inWrap ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2689 |
wrappedMethod := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2690 |
5 timesRepeat:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2691 |
(where notNil and:[where isBlockContext not]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2692 |
method := where method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2693 |
(method notNil and:[method isWrapped]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2694 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2695 |
in a wrapper method |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2696 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2697 |
wrappedMethod ~~ method ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2698 |
wrappedMethod := method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2699 |
lastWrappedContext := where. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2700 |
where sender receiver == method originalMethod ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2701 |
isWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2702 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2703 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2704 |
where == steppedContext ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2705 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2706 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2707 |
'change stepCon from: ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2708 |
steppedContext print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2709 |
' to lastWrapped: ' print. |
3055 | 2710 |
lastWrappedContext printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2711 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2712 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2713 |
inWrap := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2714 |
leftWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2715 |
wrapperContext := steppedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2716 |
steppedContext := lastWrappedContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2717 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2718 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2719 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2720 |
where := where sender |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2721 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2722 |
]. |
29 | 2723 |
]. |
2724 |
||
2725 |
isWrap ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2726 |
DebuggingDebugger == true ifTrue:[ |
3055 | 2727 |
'ignore wrap' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2728 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2729 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2730 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2731 |
"/ ignore, while in wrappers hidden setup |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2732 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2733 |
where := nil. here := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2734 |
ObjectMemory flushInlineCaches. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2735 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2736 |
skipLineNr == #return ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2737 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2738 |
'skipRet in wrap' printCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2739 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2740 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2741 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2742 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2743 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2744 |
InStepInterrupt := nil. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2745 |
^ self |
29 | 2746 |
]. |
2747 |
||
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2748 |
inBlock := inBlockBelow := anyStepBlocks := false. |
57 | 2749 |
|
2581 | 2750 |
DebuggingDebugger == true ifTrue:[ |
2751 |
'bigStep is: ' print. bigStep printCR. |
|
2752 |
'steppedContext is: ' print. steppedContext printCR. |
|
2753 |
]. |
|
2754 |
||
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2755 |
"/ |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
2756 |
"/ 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
|
2757 |
"/ |
787
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
2758 |
(bigStep |
dab2fdc4a811
care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents:
786
diff
changeset
|
2759 |
and:[steppedContext notNil]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2760 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2761 |
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
|
2762 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2763 |
where := here. "the interrupted context" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2764 |
contextBelow := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2765 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2766 |
where home notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2767 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2768 |
"/ in a block called by 'our' context ? |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2769 |
"/ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2770 |
where home == steppedContext ifTrue:[ |
3055 | 2771 |
"/ '*block*' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2772 |
inBlock := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2773 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2774 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2775 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2776 |
where == steppedContext ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2777 |
where := where sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2778 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2779 |
where notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2780 |
where home == steppedContext ifTrue:[ |
3055 | 2781 |
"/ '*block*' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2782 |
inBlock := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2783 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2784 |
]. |
57 | 2785 |
|
2786 |
"/ 'looking for ' print. |
|
3055 | 2787 |
"/ (steppedContextAddress printStringRadix:16)print. '' printCR. |
57 | 2788 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
2789 |
"/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
|
2790 |
"/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
|
2791 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2792 |
where == steppedContext ifFalse:[ |
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 |
"/ check if we are in a context below steppedContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2795 |
"/ (i.e. if steppedContext can be reached from |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2796 |
"/ interrupted context. Not using context-ref but its |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2797 |
"/ address to avoid creation of many useless contexts.) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2798 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2799 |
inBlock ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2800 |
[where notNil] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2801 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2802 |
"/ 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
|
2803 |
"/ is a block of the steppedContext, we must really |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2804 |
"/ do a single step. Otherwise, stepping through a |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2805 |
"/ 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
|
2806 |
receiver := where receiver. |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2807 |
(receiver isBlock |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2808 |
and:[(receiver isKindOf:Block) |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2809 |
and:[receiver home == steppedContext]]) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2810 |
ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2811 |
anyStepBlocks := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2812 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2813 |
where args do:[:arg | |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2814 |
(arg isBlock |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2815 |
and:[(arg isKindOf:Block) |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
2816 |
and:[arg home == steppedContext]]) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2817 |
ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2818 |
anyStepBlocks := true. |
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 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2823 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2824 |
((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print. |
3055 | 2825 |
where selector printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2826 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2827 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2828 |
where == steppedContext ifTrue:[ |
3055 | 2829 |
"/ 'found it - below; ignore' printCR. |
1399
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 |
found the interesting context somwehere up in the |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2832 |
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
|
2833 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2834 |
tracing == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2835 |
here printString printCR |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2836 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2837 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2838 |
yes, a context below |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2839 |
- continue and schedule another stepInterrupt. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2840 |
Must flush caches since optimized methods not always |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2841 |
look for pending interrupts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2842 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2843 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2844 |
contextBelow notNil ifTrue:[ |
3055 | 2845 |
"/ '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
|
2846 |
"/ 'con= ' print. contextBelow printCR. |
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2847 |
"/ contextBelow selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2848 |
"/ 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
|
2849 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2850 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2851 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2852 |
'below stepCon; continue until unwind of: ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2853 |
contextBelow printCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2854 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2855 |
Processor activeProcess forceInterruptOnReturnOf:contextBelow. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2856 |
StepInterruptPending := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2857 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2858 |
ObjectMemory flushInlineCaches. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2859 |
|
1613
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2860 |
"/ here selector notNil ifTrue:[ |
3590eeac968f
dont change the windowTitle while stepping (its too slow)
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
2861 |
"/ 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
|
2862 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2863 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2864 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2865 |
'in stepCon; continue single stepping' printCR. |
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 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2868 |
InterruptPending := 1. |
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 := nil. here := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2871 |
InStepInterrupt := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2872 |
|
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
2873 |
^ self |
1399
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 |
|
1537 | 2876 |
(steppedContext notNil and:[ |
2877 |
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
|
2878 |
inBlockBelow := true. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2879 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2880 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2881 |
anyStepBlocks ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2882 |
inBlock ifFalse:[ |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2883 |
"/ workaround a VM bug, |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2884 |
"/ 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
|
2885 |
"/ sigh |
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2886 |
where isBlockContext ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2887 |
contextBelow := where |
2633
41bd35e18e4e
line-stepping into blocks fixed.
Claus Gittinger <cg@exept.de>
parents:
2591
diff
changeset
|
2888 |
]. |
1399
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 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2891 |
where := where sender |
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 |
s := 'context returned'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2894 |
left := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2895 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2896 |
] ifTrue:[ |
3055 | 2897 |
"/ 'found it right in sender' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2898 |
s := 'after step' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2899 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2900 |
] ifTrue:[ |
3055 | 2901 |
"/ 'found it right away' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2902 |
s := 'after step' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2903 |
]. |
0 | 2904 |
] ifFalse:[ |
3055 | 2905 |
"/ ' send' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2906 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2907 |
a send |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2908 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2909 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2910 |
'clear steppedContext' printCR. |
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 |
steppedContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2913 |
s := 'after send' |
0 | 2914 |
]. |
7 | 2915 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2916 |
ignore := false. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2917 |
(inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2918 |
ignore := true. |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
2919 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2920 |
|
790 | 2921 |
"/ handle the case, when a subBlock leaves; |
2922 |
"/ continue stepping in the home context. |
|
2923 |
||
2924 |
left ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2925 |
steppedContext home notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2926 |
steppedContext := steppedContext home. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2927 |
s := 'after step'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2928 |
left := false. |
803
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
2929 |
"/ DebugView enterUnconditional:thisContext withMessage:'debug'. |
f8371812c789
fast next in subcontext of subblock
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
2930 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2931 |
] |
790 | 2932 |
]. |
2933 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2934 |
" |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2935 |
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
|
2936 |
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
|
2937 |
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
|
2938 |
" |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2939 |
(where isNil |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2940 |
and:[wrapperContext notNil]) |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2941 |
ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2942 |
"/ did not find our steppedContext along the chain; |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2943 |
"/ could be in a wrappedMethods exitBlock ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2944 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2945 |
leftWrap ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2946 |
where := here. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2947 |
wrappedMethod := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2948 |
5 timesRepeat:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2949 |
where notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2950 |
where isBlockContext ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2951 |
method := where method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2952 |
(method notNil and:[method isWrapped]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2953 |
where == wrapperContext ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2954 |
DebuggingDebugger == true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2955 |
'change stepCon fromWrapped: ' print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2956 |
steppedContext print. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2957 |
' to: ' print. |
3055 | 2958 |
wrapperContext printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2959 |
]. |
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 |
inWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2962 |
enteredWrap := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2963 |
steppedContext := wrapperContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2964 |
wrapperContext := nil. |
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 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2967 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2968 |
where := where sender |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2969 |
] |
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 |
enteredWrap ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2973 |
ignore := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2974 |
] |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2975 |
]. |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2976 |
|
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2977 |
"/ |
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
2978 |
|
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
2979 |
left ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2980 |
"/ special care for stepInterrupt in send, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2981 |
"/ when created a dummy context (lineNr == 1) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2982 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2983 |
steppedContext lineNumber isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2984 |
steppedContext selector == here sender selector ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2985 |
left := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2986 |
s := 'after step'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2987 |
steppedContext := here sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2988 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2989 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2990 |
oneMore := true |
786
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
2991 |
]. |
429c3146c03d
better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents:
781
diff
changeset
|
2992 |
|
57 | 2993 |
inBlock ifTrue:[ |
3055 | 2994 |
"/ 'inBlock' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
2995 |
s := 'in block'. |
57 | 2996 |
]. |
3593
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2997 |
inBlockBelow ifTrue:[ |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2998 |
ignore := true |
eb71fcdf0cfa
single stepping in blocks of a method (fixed - I hope)
Claus Gittinger <cg@exept.de>
parents:
3591
diff
changeset
|
2999 |
]. |
57 | 3000 |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3001 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3002 |
where notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3003 |
'(' print. steppedContextLineno print. ') ' print. |
3055 | 3004 |
where printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3005 |
]. |
654
dac2634ce5ec
better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents:
651
diff
changeset
|
3006 |
]. |
57 | 3007 |
|
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3008 |
ignore ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3009 |
(bigStep |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3010 |
and:[steppedContextLineno notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3011 |
and:[where notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3012 |
and:[where lineNumber == steppedContextLineno]]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3013 |
(here isBlockContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3014 |
and:[(here methodHome == steppedContext) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3015 |
or:[here home == steppedContext]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3016 |
DebuggingDebugger == true ifTrue:[ |
3055 | 3017 |
'same line but in block' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3018 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3019 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3020 |
steppedContext := actualContext := here. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3021 |
steppedContextLineno := here lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3022 |
] ifFalse:[ |
3063 | 3023 |
"/ kludge - I only have the info for up to 255 lines |
3024 |
steppedContextLineno ~~ 255 ifTrue:[ |
|
3025 |
DebuggingDebugger == true ifTrue:[ |
|
3026 |
'same line - ignored' printCR. |
|
3027 |
]. |
|
3028 |
ignore := true |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3029 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3030 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3031 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3032 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3033 |
(left not |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3034 |
and:[skipLineNr notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3035 |
and:[where notNil |
1764
e7aa6f50e766
care for nil-linenumber in stepOrNext.
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3036 |
and:[where lineNumber notNil |
e7aa6f50e766
care for nil-linenumber in stepOrNext.
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
3037 |
and:[where lineNumber < skipLineNr]]]]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3038 |
DebuggingDebugger == true ifTrue:[ |
3055 | 3039 |
'skip (' print. skipLineNr print. ' unreached - ignored' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3040 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3041 |
ignore := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3042 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3043 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3044 |
(steppedContextLineno isNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3045 |
and:[skipLineNr isNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3046 |
and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3047 |
DebuggingDebugger == true ifTrue:[ |
3055 | 3048 |
'same line2 (after conIRQ) - ignored' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3049 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3050 |
ignore := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3051 |
]. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3052 |
]. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3053 |
|
57 | 3054 |
ignore ifTrue:[ |
3055 | 3055 |
"/' ' printCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3056 |
where := nil. here := nil. |
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 |
yes, a context below |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3059 |
- continue and schedule another stepInterrupt. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3060 |
Must flush caches since optimized methods not always |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3061 |
look for pending interrupts |
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 |
ObjectMemory flushInlineCaches. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3064 |
StepInterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3065 |
InterruptPending := 1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3066 |
InStepInterrupt := nil. |
5340
8e2526806312
return value of stepInterrupt, contextInterrupt and stepOrNext
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
3067 |
^ self |
57 | 3068 |
]. |
3069 |
||
3055 | 3070 |
"/ ' ' printCR. |
57 | 3071 |
|
29 | 3072 |
name := Processor activeProcess nameOrId. |
7 | 3073 |
self label:(s , ' (process: ' , name , ')'). |
3074 |
||
57 | 3075 |
tracing := false. |
3076 |
bigStep := false. |
|
3077 |
||
0 | 3078 |
"release refs to context" |
3079 |
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
|
3080 |
"/'enter' printCR. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3081 |
|
1049
3223853742a4
fixed initial selection after stepping with non-verbose
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
3082 |
DebuggingDebugger == true ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3083 |
'==> 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
|
3084 |
]. |
1364 | 3085 |
|
3086 |
initiallyShown := nil. |
|
3087 |
(oneMore == true) ifTrue:[ |
|
1871
971fe3afd573
care for nil lineNumber in context (how can this happen ?)
Claus Gittinger <cg@exept.de>
parents:
1824
diff
changeset
|
3088 |
(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3089 |
initiallyShown := 2 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3090 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3091 |
initiallyShown := 1 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3092 |
] |
1364 | 3093 |
]. |
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3094 |
con := thisContext sender sender. |
3435 | 3095 |
|
3096 |
BreakPointInterrupt handle:[:ex | |
|
3447 | 3097 |
'DebugView [info]: breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR. |
3435 | 3098 |
ex proceed |
3099 |
] do:[ |
|
2060
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3100 |
self enter:con select:initiallyShown |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3101 |
]. |
0b1b4269aa75
care for breakPoints while entering debugger
Claus Gittinger <cg@exept.de>
parents:
2042
diff
changeset
|
3102 |
con := nil |
1364 | 3103 |
|
3104 |
"Created: / 14.10.1996 / 12:53:39 / cg" |
|
3447 | 3105 |
"Modified: / 18.11.2001 / 01:00:55 / cg" |
0 | 3106 |
! ! |
3107 |
||
4867 | 3108 |
!DebugView methodsFor:'menu & button actions'! |
266 | 3109 |
|
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3110 |
addBreakpoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3111 |
"add a breakpoint on the selected contexts method - if any" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3112 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3113 |
|implementorClass method| |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3114 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3115 |
selectedContext isNil ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3116 |
^ self showError:'** select a context first **' |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3117 |
]. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3118 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3119 |
^ self |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3120 |
]. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3121 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3122 |
implementorClass := selectedContext methodClass. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3123 |
implementorClass notNil ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3124 |
method := implementorClass compiledMethodAt:selectedContext selector. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3125 |
(method notNil and:[method isBreakpointed not]) ifTrue:[ |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3126 |
method setBreakPoint |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3127 |
] |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3128 |
]. |
3511 | 3129 |
contextView middleButtonMenu disable:#addBreakpoint. |
3482
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3130 |
contextView middleButtonMenu enable:#removeBreakpoint. |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3131 |
|
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3132 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3133 |
! |
6ba75681ea47
add breakpoint menu function
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
3134 |
|
5875 | 3135 |
addBrowserBookmark |
3136 |
"add a browser-bookmark for the selected contexts method" |
|
3137 |
||
3138 |
|cls sel| |
|
3139 |
||
3140 |
selectedContext isNil ifTrue:[^ self]. |
|
3141 |
||
3142 |
cls := selectedContext receiver class. |
|
3143 |
sel := selectedContext selector. |
|
3144 |
(cls includesSelector:sel) ifFalse:[ |
|
3145 |
sel := nil |
|
3146 |
]. |
|
3147 |
Tools::NewSystemBrowser addToBookMarks:cls selector:sel |
|
3148 |
! |
|
3149 |
||
3511 | 3150 |
allowBreakPointsInDebugger |
3151 |
^ ignoreBreakpoints not |
|
3152 |
! |
|
3153 |
||
3154 |
allowBreakPointsInDebugger:aBoolean |
|
3155 |
ignoreBreakpoints := aBoolean not. |
|
5798 | 3156 |
self initializeMiddleButtonMenu. |
3157 |
self initializeContextViewsMiddleButtonMenu. |
|
3511 | 3158 |
! |
3159 |
||
7796
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3160 |
autoRaiseView |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3161 |
^ UserPreferences current autoRaiseDebugger |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3162 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3163 |
"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
|
3164 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3165 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3166 |
autoRaiseView:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3167 |
UserPreferences current autoRaiseDebugger:aBoolean |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3168 |
|
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3169 |
"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
|
3170 |
! |
fe6f3d31c52a
autoRaise (above) other views (an option in the view-menu)
Claus Gittinger <cg@exept.de>
parents:
7713
diff
changeset
|
3171 |
|
266 | 3172 |
autoUpdateOff |
3173 |
"stop the update process" |
|
3174 |
||
3175 |
updateProcess notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3176 |
monitorToggle lampColor:(Color yellow). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3177 |
updateProcess terminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3178 |
updateProcess := nil |
266 | 3179 |
] |
3180 |
! |
|
3181 |
||
3182 |
autoUpdateOn |
|
3183 |
"fork a subprocess which updates the contextList in regular intervals" |
|
3184 |
||
3185 |
updateProcess isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3186 |
updateProcess := |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3187 |
[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3188 |
[true] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3189 |
monitorToggle showLamp ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3190 |
monitorToggle lampColor:(Color yellow). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3191 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3192 |
monitorToggle activeForegroundColor:Color black. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3193 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3194 |
(Delay forSeconds:0.25) wait. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3195 |
self updateContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3196 |
monitorToggle showLamp ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3197 |
monitorToggle lampColor:(Color red). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3198 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3199 |
monitorToggle activeForegroundColor:Color red. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3200 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3201 |
(Delay forSeconds:0.25) wait. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3202 |
self updateContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3203 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3204 |
] forkAt:(Processor activePriority - 1) |
266 | 3205 |
] |
3206 |
||
3207 |
! |
|
3208 |
||
3269 | 3209 |
browseClass |
3210 |
"browse the reveivers class (of the selected contexts message)" |
|
3211 |
||
3212 |
|cls sel| |
|
3213 |
||
3214 |
selectedContext isNil ifTrue:[^ self]. |
|
3215 |
||
3216 |
cls := selectedContext receiver class. |
|
3217 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3218 |
(cls includesSelector:sel) ifFalse:[ |
3269 | 3219 |
sel := nil |
3220 |
]. |
|
3221 |
cls browserClass openInClass:cls selector:sel. |
|
3222 |
||
3223 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3224 |
! |
|
3225 |
||
3226 |
browseClassHierarchy |
|
3227 |
"browse the reveivers classHierarchy (of the selected contexts message)" |
|
3228 |
||
3229 |
|cls mthd| |
|
3230 |
||
3231 |
selectedContext isNil ifTrue:[^ self]. |
|
3232 |
||
3233 |
mthd := selectedContext method. |
|
3447 | 3234 |
mthd notNil ifTrue:[ |
3235 |
cls := mthd containingClass. |
|
3236 |
"/ still nil if unbound - then use receivers class |
|
3237 |
]. |
|
3238 |
cls isNil ifTrue:[ |
|
3269 | 3239 |
cls := selectedContext receiver class |
3240 |
]. |
|
3241 |
cls browserClass browseClassHierarchy:cls. |
|
3242 |
||
3447 | 3243 |
"Modified: / 17.11.2001 / 19:43:06 / cg" |
3269 | 3244 |
! |
3245 |
||
3246 |
browseFullClassProtocol |
|
3247 |
"browse the reveivers full protocol (of the selected contexts message)" |
|
3248 |
||
3249 |
|cls mthd| |
|
3250 |
||
3251 |
selectedContext isNil ifTrue:[^ self]. |
|
3252 |
||
3253 |
mthd := selectedContext method. |
|
3447 | 3254 |
mthd notNil ifTrue:[ |
3255 |
cls := mthd containingClass. |
|
3256 |
"/ still nil if unbound - then use receivers class |
|
3257 |
]. |
|
3258 |
cls isNil ifTrue:[ |
|
3269 | 3259 |
cls := selectedContext receiver class |
3260 |
]. |
|
3261 |
cls browserClass browseFullClassProtocol:cls. |
|
3262 |
||
3447 | 3263 |
"Modified: / 17.11.2001 / 19:43:43 / cg" |
3269 | 3264 |
! |
3265 |
||
3266 |
browseImplementingClass |
|
3267 |
"browse the implementing class (of the selected contexts message)" |
|
3268 |
||
824
099fa90db8aa
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
804
diff
changeset
|
3269 |
|mthd who sel cls| |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3270 |
|
1452 | 3271 |
selectedContext isNil ifTrue:[^ self]. |
3272 |
||
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3273 |
mthd := selectedContext method. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3274 |
mthd notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3275 |
who := selectedContext method who. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3276 |
who notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3277 |
cls := who methodClass. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3278 |
sel := who methodSelector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3279 |
] |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3280 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3281 |
cls isNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3282 |
"/ class not found - try receiver |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3283 |
cls := selectedContext receiver class |
651
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3284 |
]. |
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3285 |
|
b8a14e281c24
fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents:
646
diff
changeset
|
3286 |
cls browserClass openInClass:cls selector:sel. |
266 | 3287 |
|
1452 | 3288 |
"Created: / 22.11.1995 / 21:27:01 / cg" |
3289 |
"Modified: / 3.2.1998 / 19:46:40 / cg" |
|
266 | 3290 |
! |
3291 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3292 |
browseImplementors |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3293 |
"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
|
3294 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3295 |
selectedContext isNil ifTrue:[ |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3296 |
^ self showError:'** select a context first **' |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3297 |
]. |
4153 | 3298 |
"/ selectedContext receiver class browserClass |
3299 |
UserPreferences systemBrowserClass |
|
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2678
diff
changeset
|
3300 |
browseImplementorsOf:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3301 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3302 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3303 |
browseImplementorsOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3304 |
"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
|
3305 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3306 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3307 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3308 |
(sel := codeView selection) notNil ifTrue:[ |
2812 | 3309 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3310 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3311 |
initial isNil ifTrue:[ |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3312 |
initial := selectedContext isNil |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3313 |
ifTrue:[nil] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3314 |
ifFalse:[selectedContext selector]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3315 |
]. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3316 |
selector := Dialog |
3320 | 3317 |
requestSelector:'Selector to browse implementors of:' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3318 |
initialAnswer:initial. |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3319 |
selector size == 0 ifFalse:[ |
3140 | 3320 |
UserPreferences systemBrowserClass |
4153 | 3321 |
browseImplementorsMatching:selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3322 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3323 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3324 |
"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
|
3325 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3326 |
|
3269 | 3327 |
browseReceiversClass |
3328 |
"browse the reveivers class (of the selected contexts message)" |
|
3329 |
||
3330 |
|cls sel| |
|
3331 |
||
3332 |
selectedContext isNil ifTrue:[^ self]. |
|
3333 |
||
3334 |
cls := selectedContext receiver class. |
|
3335 |
sel := selectedContext selector. |
|
3591
754970803c0f
#implements: -> #includesSelector:
Claus Gittinger <cg@exept.de>
parents:
3580
diff
changeset
|
3336 |
(cls includesSelector:sel) ifFalse:[ |
3269 | 3337 |
sel := nil |
3338 |
]. |
|
3339 |
cls browserClass openInClass:cls selector:sel. |
|
3340 |
||
3341 |
"Modified: / 3.2.1998 / 20:23:36 / cg" |
|
3342 |
! |
|
3343 |
||
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3344 |
browseSenders |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3345 |
"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
|
3346 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3347 |
selectedContext isNil ifTrue:[ |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3348 |
^ self showError:'** select a context first **' |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3349 |
]. |
3140 | 3350 |
UserPreferences systemBrowserClass |
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2678
diff
changeset
|
3351 |
browseAllCallsOn:selectedContext selector. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3352 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3353 |
|
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3354 |
browseSendersOf |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3355 |
"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
|
3356 |
|
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3357 |
|initial selector sel| |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3358 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3359 |
(sel := codeView selection) notNil ifTrue:[ |
2812 | 3360 |
initial := SystemBrowser extractSelectorFrom:sel |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3361 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3362 |
initial isNil ifTrue:[ |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3363 |
initial := selectedContext isNil |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3364 |
ifTrue:[nil] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3365 |
ifFalse:[selectedContext selector]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3366 |
]. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3367 |
selector := Dialog |
3333 | 3368 |
requestSelector:'Selector to browse senders of:' |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3369 |
initialAnswer:initial. |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3370 |
selector size == 0 ifFalse:[ |
3140 | 3371 |
UserPreferences systemBrowserClass |
2697
b4f4e431b71e
browserClass from preferences
Claus Gittinger <cg@exept.de>
parents:
2678
diff
changeset
|
3372 |
browseAllCallsOn:selector asSymbol. |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3373 |
] |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3374 |
|
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3375 |
"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
|
3376 |
! |
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
3377 |
|
266 | 3378 |
copyWalkbackText |
3379 |
"place the contents of the walkback view into the copy-paste buffer. |
|
3380 |
This allows pasting it into some other view for printing ..." |
|
3381 |
||
6034 | 3382 |
self setClipboardText:(contextArray collect:[:con | con fullPrintString]) asStringCollection |
266 | 3383 |
|
3384 |
"Modified: 28.8.1995 / 15:31:59 / claus" |
|
3385 |
! |
|
3386 |
||
3387 |
doAbort |
|
1187 | 3388 |
"abort - send Object>>abortSignal, which is usually caught |
266 | 3389 |
at save places (for example: in the event loop) and returns back |
3390 |
from whatever the process is doing, but does not terminate it." |
|
3391 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3392 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3393 |
(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
|
3394 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3395 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3396 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3397 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3398 |
|
266 | 3399 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3400 |
inspectedProcess isDead ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3401 |
self showTerminated. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3402 |
^ self |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3403 |
]. |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
3404 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3405 |
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
|
3406 |
] ifTrue:[ |
3434
05bfb9406e06
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
3432
diff
changeset
|
3407 |
self interruptProcessWith:[AbortOperationRequest raise]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3408 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3409 |
^ self |
266 | 3410 |
]. |
3411 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3412 |
steppedContext := wrapperContext := nil. |
266 | 3413 |
haveControl := false. |
3414 |
exitAction := #abort. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3415 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3416 |
"exit private event-loop" |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3417 |
catchBlock notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3418 |
abortButton turnOff. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3419 |
catchBlock value. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3420 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3421 |
"/ not reached |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3422 |
'DebugView [warning]: abort failed' errorPrintCR. |
266 | 3423 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3424 |
|
266 | 3425 |
^ self. |
3426 |
||
3447 | 3427 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
266 | 3428 |
! |
3429 |
||
6487 | 3430 |
doAbortAll |
3431 |
"abortAll - send Object>>abortAllSignal, which is usually caught |
|
3432 |
at save places (for example: in the event loop) and returns back |
|
3433 |
from whatever the process is doing, but does not terminate it." |
|
3434 |
||
3435 |
self checkIfCodeIsReallyModified ifTrue:[ |
|
3436 |
(self confirm:('Code modified - abort anyway ?')) |
|
3437 |
ifFalse:[ |
|
3438 |
^ self |
|
3439 |
] |
|
3440 |
]. |
|
3441 |
||
3442 |
inspecting ifTrue:[ |
|
3443 |
inspectedProcess isDead ifTrue:[ |
|
3444 |
self showTerminated. |
|
3445 |
^ self |
|
3446 |
]. |
|
3447 |
(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[ |
|
3448 |
self showError:'** the process does not handle the abort signal **' |
|
3449 |
] ifTrue:[ |
|
3450 |
self interruptProcessWith:[AbortAllOperationRequest raise]. |
|
3451 |
]. |
|
3452 |
^ self |
|
3453 |
]. |
|
3454 |
||
3455 |
steppedContext := wrapperContext := nil. |
|
3456 |
haveControl := false. |
|
3457 |
exitAction := #abortAll. |
|
3458 |
||
3459 |
"exit private event-loop" |
|
3460 |
catchBlock notNil ifTrue:[ |
|
3461 |
abortButton turnOff. |
|
3462 |
catchBlock value. |
|
3463 |
||
3464 |
"/ not reached |
|
3465 |
'DebugView [warning]: abort failed' errorPrintCR. |
|
3466 |
]. |
|
3467 |
||
3468 |
^ self. |
|
3469 |
||
3470 |
"Modified: / 17.11.2001 / 22:53:22 / cg" |
|
3471 |
! |
|
3472 |
||
266 | 3473 |
doContinue |
3474 |
"continue from menu" |
|
3475 |
||
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3476 |
|proc exContext ex answer| |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3477 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3478 |
self checkIfCodeIsReallyModified ifTrue:[ |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3479 |
(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
|
3480 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3481 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3482 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3483 |
|
266 | 3484 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3485 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3486 |
continueButton foregroundColor:Color red darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3487 |
]. |
6647 | 3488 |
continueButton label:(resources string:'Stop'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3489 |
continueButton action:[self doStop]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3490 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3491 |
self processPerform:#resume. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3492 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3493 |
^ self |
266 | 3494 |
]. |
3495 |
canContinue ifTrue:[ |
|
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3496 |
exContext := thisContext findSpecialHandle:false raise:true. |
1725 | 3497 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3498 |
(exContext notNil |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
3499 |
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
|
3500 |
and:[ ex isException |
5911
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3501 |
and:[ ex signal == NoHandlerError |
a1444e8c5061
#enter:... returns the value for proceed
Stefan Vogel <sv@exept.de>
parents:
5904
diff
changeset
|
3502 |
and:[ ex parameter signal == RecursionError]]]]) |
1719
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3503 |
ifTrue:[ |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3504 |
"/ debug due to unhandled recursionInterrupt. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3505 |
"/ ask if we should proceed with more stack. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3506 |
|
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3507 |
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
|
3508 |
answer == true ifTrue:[ |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3509 |
proc := Processor activeProcess. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3510 |
proc setMaximumStackSize:(proc maximumStackSize * 2). |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3511 |
]. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3512 |
]. |
4f99e8100bb5
when continuing after a stack-overflow,
Claus Gittinger <cg@exept.de>
parents:
1699
diff
changeset
|
3513 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3514 |
steppedContext := wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3515 |
tracing := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3516 |
haveControl := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3517 |
exitAction := #continue. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3518 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3519 |
"exit private event-loop" |
6365 | 3520 |
catchBlock value. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3521 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3522 |
"/ not reached. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3523 |
'DebugView [warning]: continue failed' errorPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3524 |
continueButton turnOff. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3525 |
|
266 | 3526 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3527 |
inspecting ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3528 |
'DebugView [info]: resuming top context' infoPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3529 |
self showSelection:1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3530 |
self doReturn |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3531 |
] |
266 | 3532 |
] |
477 | 3533 |
|
1917
200617958f79
continue with more stack fixed
Claus Gittinger <cg@exept.de>
parents:
1906
diff
changeset
|
3534 |
"Modified: / 5.10.1998 / 13:03:47 / cg" |
2308 | 3535 |
"Modified: / 26.7.1999 / 15:38:45 / stefan" |
266 | 3536 |
! |
3537 |
||
3187 | 3538 |
doDefine |
5955 | 3539 |
|selectionIndex selector argNames receiversClass proto haltStmtDef haltStmtFix code cat |
3540 |
bagOfClassNames bagOfUsedClassNames| |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3541 |
|
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3542 |
selectionIndex := contextView selection. |
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3543 |
|
3283 | 3544 |
selector := actualContext selector. |
5955 | 3545 |
|
3546 |
"generate nice argument names" |
|
3547 |
bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag. |
|
3548 |
bagOfUsedClassNames := Bag new. |
|
3549 |
argNames := actualContext args |
|
3550 |
collect: |
|
3551 |
[:eachArg | |
|
3552 |
|nm| |
|
3553 |
||
3554 |
nm := eachArg class name. |
|
3555 |
(bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[ |
|
3556 |
nm article , nm |
|
3557 |
] ifFalse:[ |
|
3558 |
bagOfUsedClassNames add:nm. |
|
3559 |
nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString |
|
3560 |
]. |
|
3561 |
]. |
|
3562 |
||
3563 |
proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames. |
|
3269 | 3564 |
|
3447 | 3565 |
haltStmtDef := ' self halt:''please define %2 here''.'. |
3566 |
haltStmtFix := ' self halt:''please change %2 as required''.'. |
|
3567 |
||
3568 |
actualContext receiver isNil ifTrue:[ |
|
3569 |
(self confirm:'Are you sure you want to add this method (to UndefinedObject) ?') |
|
3570 |
ifFalse:[ |
|
3571 |
^ self |
|
3572 |
] |
|
3573 |
]. |
|
3574 |
||
3575 |
receiversClass := actualContext receiver class. |
|
3576 |
||
3577 |
(receiversClass instVarNames includes:selector) ifTrue:[ |
|
3578 |
code := '%1\' , haltStmtFix , '\ ^ %2'. |
|
3579 |
cat := 'accessing'. |
|
3580 |
]. |
|
3581 |
(selector numArgs == 1 |
|
3582 |
and:[(selector endsWith:':') |
|
3583 |
and:[receiversClass instVarNames includes:(selector copyWithoutLast:1)]]) |
|
3584 |
ifTrue:[ |
|
3585 |
code := '%1\' , haltStmtFix , '\ %2 := arg.'. |
|
3586 |
cat := 'accessing'. |
|
3587 |
]. |
|
3588 |
||
3589 |
"/ actualContext receiver isClass ifTrue:[ |
|
3590 |
"/ selector == #new ifTrue:[ |
|
3591 |
"/ code := '%1\' , haltStmt , '\ ^ self basicNew initialize' |
|
3592 |
"/ ]. |
|
3593 |
"/ selector == #'new:' ifTrue:[ |
|
3594 |
"/ code := '%1\' , haltStmt , '\ ^ (self basicNew:arg) initialize' |
|
3595 |
"/ ]. |
|
3596 |
"/ ]. |
|
3597 |
code isNil ifTrue:[ |
|
3598 |
code := '%1\' , haltStmtDef |
|
3599 |
]. |
|
3600 |
||
3187 | 3601 |
self |
3447 | 3602 |
codeAccept:(code bindWith:proto with:selector) withCRs |
3427 | 3603 |
unwind:false |
3447 | 3604 |
category:cat |
3427 | 3605 |
onCancel:[^ self]. |
3269 | 3606 |
|
3270
cd3562cffc61
fixed define-method for numArgs>0
Claus Gittinger <cg@exept.de>
parents:
3269
diff
changeset
|
3607 |
self doShowSelection:selectionIndex. |
3269 | 3608 |
self doRestart |
3427 | 3609 |
|
3447 | 3610 |
"Modified: / 17.11.2001 / 23:43:54 / cg" |
3187 | 3611 |
! |
3612 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3613 |
doIgnoreBreakpoints |
3511 | 3614 |
self allowBreakPointsInDebugger:false |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3615 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3616 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3617 |
doMicroSend |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3618 |
"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
|
3619 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3620 |
inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3621 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3622 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3623 |
(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
|
3624 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3625 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3626 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3627 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3628 |
|
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3629 |
canContinue ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3630 |
steppedContext := wrapperContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3631 |
haveControl := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3632 |
exitAction := #step. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3633 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3634 |
"exit private event-loop" |
6365 | 3635 |
catchBlock value. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3636 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3637 |
"/ not reached |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3638 |
'DebugView [warning]: send failed' errorPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3639 |
sendButton turnOff. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3640 |
] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3641 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3642 |
"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
|
3643 |
"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
|
3644 |
! |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3645 |
|
266 | 3646 |
doNext |
1072 | 3647 |
"skip for next source-code line; entering blocks" |
266 | 3648 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3649 |
stepHow := #nextIn. |
266 | 3650 |
self doStep:nil |
790 | 3651 |
|
1072 | 3652 |
"Modified: 7.3.1997 / 18:38:41 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3653 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3654 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3655 |
doNextOut |
1072 | 3656 |
"skip for next source-code line; leaving blocks" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3657 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3658 |
stepHow := #nextOut. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3659 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3660 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3661 |
"Created: 3.3.1997 / 21:31:22 / cg" |
1072 | 3662 |
"Modified: 7.3.1997 / 18:38:49 / cg" |
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3663 |
! |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3664 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3665 |
doNextOver |
1072 | 3666 |
"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
|
3667 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3668 |
stepHow := #nextOver. |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3669 |
self doStep:nil |
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3670 |
|
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3671 |
"Created: 3.3.1997 / 20:50:38 / cg" |
1072 | 3672 |
"Modified: 7.3.1997 / 18:39:00 / cg" |
266 | 3673 |
! |
3674 |
||
3675 |
doNoTrace |
|
3676 |
traceView notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3677 |
traceView topView destroy. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3678 |
traceView := nil. |
266 | 3679 |
]. |
3680 |
tracing := false |
|
3681 |
! |
|
3682 |
||
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3683 |
doNotIgnoreBreakpoints |
3511 | 3684 |
self allowBreakPointsInDebugger:true |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3685 |
! |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
3686 |
|
4356 | 3687 |
doOpenReportMailApp |
3688 |
"open a mail report tool" |
|
3689 |
||
3690 |
| str | |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3691 |
|
4356 | 3692 |
str := '' writeStream. |
3693 |
||
3694 |
str nextPutLine:('Error notification from ' |
|
3695 |
, OperatingSystem getLoginName |
|
3696 |
, '@' |
|
3697 |
, OperatingSystem getHostName). |
|
3698 |
str cr. |
|
3699 |
||
5779
f2f987342b81
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
5664
diff
changeset
|
3700 |
str nextPutLine:('Time: ' , Timestamp now printString). |
4356 | 3701 |
str nextPutLine:('STX Version: ' , Smalltalk versionString). |
3702 |
str nextPutLine:('Description: ' , self label). |
|
3703 |
"/ str nextPutLine:('Error: ', printedException description). |
|
3704 |
"/ str nextPutLine:('Signal: ', printedException signal printString). |
|
3705 |
"/ str nextPutLine:('Parameter: ', printedException parameter printString). |
|
3706 |
str nextPutLine:'Backtrace:'. |
|
3707 |
str cr. |
|
3708 |
||
3709 |
firstContext notNil ifTrue:[ |
|
3710 |
firstContext fullPrintAllOn:str. |
|
3711 |
]. |
|
3712 |
str cr;cr. |
|
7844
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3713 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3714 |
SendMailTool |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3715 |
openForMessage:(str contents) |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3716 |
withSubject:('STX Error:[', self label, ']') |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3717 |
preOpenBlock:[:inst| |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3718 |
inst recipientEntryField value:'error@exept.de' |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3719 |
]. |
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3720 |
|
cf6ca4e657fb
changed #doOpenReportMailApp
Claus Gittinger <cg@exept.de>
parents:
7843
diff
changeset
|
3721 |
"Modified: / 20-09-2007 / 12:40:40 / cg" |
4356 | 3722 |
! |
3723 |
||
266 | 3724 |
doRestart |
3725 |
"restart - the selected context will be restarted" |
|
6365 | 3726 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3727 |
self checkIfCodeIsReallyModified ifTrue:[ |
6365 | 3728 |
(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
|
3729 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3730 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3731 |
]. |
266 | 3732 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3733 |
selectedContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3734 |
^ self showError:'** select a context first **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3735 |
]. |
6365 | 3736 |
self interruptProcessWith:[ selectedContext unwindAndRestart ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3737 |
^ self |
266 | 3738 |
]. |
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3739 |
steppedContext := wrapperContext := nil. |
266 | 3740 |
haveControl := false. |
6365 | 3741 |
exitAction := #restart. "exit private event-loop" |
3742 |
||
3743 |
catchBlock value. |
|
3744 |
||
3745 |
"/ normally not reached |
|
3746 |
||
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3747 |
'DebugView [warning]: restart failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3748 |
restartButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3749 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3750 |
"Modified: / 29.7.1998 / 21:49:53 / cg" |
266 | 3751 |
! |
3752 |
||
3753 |
doReturn |
|
3754 |
"return - the selected context will do a ^nil" |
|
3755 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3756 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3757 |
(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
|
3758 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3759 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3760 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3761 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3762 |
|
266 | 3763 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3764 |
selectedContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3765 |
^ self showError:'** select a context first **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3766 |
]. |
2313 | 3767 |
self interruptProcessWith:[selectedContext unwind:nil]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3768 |
^ self |
266 | 3769 |
]. |
3770 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3771 |
steppedContext := wrapperContext := nil. |
266 | 3772 |
haveControl := false. |
3773 |
exitAction := #return. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3774 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3775 |
"exit private event-loop" |
6365 | 3776 |
catchBlock value. |
477 | 3777 |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3778 |
"/ not reached |
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
3779 |
'DebugView [warning]: return failed' errorPrintCR. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3780 |
returnButton turnOff. |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3781 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3782 |
"Modified: / 29.7.1998 / 21:50:03 / cg" |
266 | 3783 |
! |
3784 |
||
3785 |
doSend |
|
3786 |
"single send; reenter with next message send" |
|
3787 |
||
1072 | 3788 |
stepHow := #send. |
1067
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3789 |
self doStep:-1 |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3790 |
|
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3791 |
"/ inspecting ifTrue:[^ self]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3792 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3793 |
"/ canContinue ifTrue:[ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3794 |
"/ steppedContext := wrapperContext := nil. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3795 |
"/ haveControl := false. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3796 |
"/ exitAction := #step. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3797 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3798 |
"/ "exit private event-loop" |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3799 |
"/ catchBlock notNil ifTrue:[catchBlock value]. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3800 |
"/ |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3801 |
"/ "/ not reached |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3802 |
"/ 'DebugView [warning]: send failed' errorPrintCR. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3803 |
"/ sendButton turnOff. |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3804 |
"/ ] |
e6d52091b3af
old: SEND executed debuggee up to the next send
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
3805 |
|
1072 | 3806 |
"Modified: 7.3.1997 / 18:41:26 / cg" |
266 | 3807 |
! |
3808 |
||
3809 |
doStep |
|
3810 |
"skip for next send in selected method" |
|
3811 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
3812 |
stepHow := #step. |
790 | 3813 |
self doStep:-1 |
3814 |
||
1072 | 3815 |
"Modified: 7.3.1997 / 18:46:49 / cg" |
266 | 3816 |
! |
3817 |
||
3818 |
doStep:lineNr |
|
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3819 |
"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
|
3820 |
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
|
3821 |
or to next line (if nil) or to next send (if -1)" |
266 | 3822 |
|
3823 |
|con method| |
|
3824 |
||
3825 |
inspecting ifTrue:[^ self]. |
|
3826 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3827 |
self checkIfCodeIsReallyModified ifTrue:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3828 |
(self confirm:('Code modified - step anyway ?')) |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3829 |
ifFalse:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3830 |
^ self |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3831 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3832 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3833 |
|
266 | 3834 |
canContinue ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3835 |
selectedContext notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3836 |
con := actualContext. "/ selectedContext. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3837 |
steppedContextLineno := actualContext lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3838 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3839 |
con := contextArray at:2. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3840 |
steppedContextLineno := con lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3841 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3842 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3843 |
skipLineNr := lineNr. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3844 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3845 |
lineNr == -1 ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3846 |
steppedContextLineno := skipLineNr := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3847 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3848 |
|
2581 | 3849 |
(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3850 |
steppedContext := contextArray at:1. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3851 |
stepHow := #nextIn. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3852 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3853 |
stepHow == #nextOut ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3854 |
steppedContext := con home. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3855 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3856 |
steppedContext := con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3857 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3858 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3859 |
wrapperContext := nil. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
3860 |
|
789
a9595b71a8fa
improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
3861 |
"/ ' 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
|
3862 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3863 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3864 |
if we step in a wrapped method, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3865 |
prepare to skip the prolog ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3866 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3867 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3868 |
inWrap := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3869 |
method := con method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3870 |
(method notNil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3871 |
and:[method isWrapped |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3872 |
and:[method originalMethod ~~ method]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3873 |
inWrap := true |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3874 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3875 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3876 |
lineNr == #return ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3877 |
Processor activeProcess forceInterruptOnReturnOf:con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3878 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3879 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3880 |
con := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3881 |
bigStep := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3882 |
haveControl := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3883 |
exitAction := #step. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3884 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3885 |
"exit private event-loop" |
6365 | 3886 |
catchBlock value. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3887 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3888 |
"/ not reached |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3889 |
'DebugView [warning]: step failed' errorPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3890 |
stepButton turnOff. nextButton turnOff. sendButton turnOff. |
266 | 3891 |
] |
477 | 3892 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3893 |
"Modified: / 29.7.1998 / 21:50:16 / cg" |
266 | 3894 |
! |
3895 |
||
3896 |
doStop |
|
3897 |
"stop the process (if its running, otherwise this is a no-op)" |
|
3898 |
||
3899 |
inspecting ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3900 |
device hasColors ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3901 |
continueButton foregroundColor:Color green darkened darkened. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3902 |
]. |
6647 | 3903 |
continueButton label:(resources string:'Continue'). |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3904 |
continueButton action:[self doContinue]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3905 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3906 |
self processPerform:#stop. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3907 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3908 |
^ self |
266 | 3909 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
3910 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
3911 |
"Modified: 20.10.1996 / 18:30:48 / cg" |
266 | 3912 |
! |
3913 |
||
3914 |
doTerminate |
|
3915 |
"terminate - the process has a chance for cleanup" |
|
3916 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
3917 |
self checkIfCodeIsReallyModified ifTrue:[ |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3918 |
(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
|
3919 |
ifFalse:[ |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3920 |
^ self |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3921 |
] |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3922 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3923 |
|
266 | 3924 |
inspecting ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3925 |
self processPerform:#terminate. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3926 |
^ self |
266 | 3927 |
]. |
3928 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
3929 |
steppedContext := wrapperContext := nil. |
266 | 3930 |
haveControl := false. |
3931 |
exitAction := #terminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3932 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3933 |
"exit private event-loop" |
6365 | 3934 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3935 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3936 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3937 |
inspecting ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3938 |
'DebugView [warning]: terminate failed' errorPrintCR. |
5884 | 3939 |
(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[ |
3940 |
Debugger newDebugger. |
|
3941 |
Processor activeProcess terminate. |
|
3942 |
] |
|
266 | 3943 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
3944 |
terminateButton turnOff. |
477 | 3945 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
3946 |
"Modified: / 29.7.1998 / 21:50:35 / cg" |
266 | 3947 |
! |
3948 |
||
3949 |
doTrace |
|
3950 |
"tracing - not really implemented ..." |
|
3951 |
||
3952 |
self warn:'this function is not yet implemented'. |
|
3953 |
||
3954 |
"/ |v b| |
|
3955 |
"/ |
|
3956 |
"/ traceView isNil ifTrue:[ |
|
3957 |
"/ v := StandardSystemView on:Display. |
|
3958 |
"/ v label:'Debugger-Trace'. |
|
3959 |
"/ v icon:icon. |
|
3960 |
"/ |
|
3961 |
"/ b := Button label:'untrace' in:v. |
|
3962 |
"/ b origin:(0 @ 0) extent:(1.0 @ (b height)). |
|
3963 |
"/ b action:[ |
|
3964 |
"/ StepInterruptPending := nil. |
|
3965 |
"/ tracing := false. |
|
3966 |
"/ v unrealize. |
|
3967 |
"/ traceView := nil |
|
3968 |
"/ ]. |
|
3969 |
"/ traceView := ScrollableView for:TextCollector in:v. |
|
3970 |
"/ traceView origin:(0 @ (b height)) |
|
3971 |
"/ extent:[v width @ (v height - b height)] |
|
3972 |
"/ ]. |
|
3973 |
"/ v realize. |
|
3974 |
"/ |
|
3975 |
"/ tracing := true. |
|
3976 |
! |
|
3977 |
||
3978 |
doTraceStep |
|
3979 |
"tracestep - not implemented yet" |
|
3980 |
||
3981 |
canContinue ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3982 |
tracing := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
3983 |
self doStep |
266 | 3984 |
] |
3985 |
! |
|
3986 |
||
3987 |
exit |
|
3988 |
"exit from menu: immediate exit from smalltalk" |
|
3989 |
||
3990 |
OperatingSystem exit |
|
3991 |
! |
|
3992 |
||
8170 | 3993 |
hasHaltsToIgnore |
3994 |
^ IgnoredHalts notEmptyOrNil |
|
3995 |
! |
|
3996 |
||
8179 | 3997 |
ignoreHaltForever |
3998 |
self addIgnoredHaltForCount:-1 orTimeDuration:nil. |
|
3999 |
! |
|
4000 |
||
266 | 4001 |
inspectContext |
4002 |
"launch an inspector on the currently selected context" |
|
4003 |
||
4004 |
contextView selection notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4005 |
(contextView selectionValue startsWith:'**') ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4006 |
(contextArray at:(contextView selection)) inspect. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4007 |
] |
266 | 4008 |
] |
4009 |
! |
|
4010 |
||
8170 | 4011 |
isStoppedAtHaltOrBreakPoint |
4012 |
^ isStoppedAtHaltOrBreakPoint |
|
4013 |
! |
|
4014 |
||
8142 | 4015 |
middleButtonMenu |
4016 |
<resource: #programMenu > |
|
4017 |
||
4018 |
|items m| |
|
4019 |
||
4020 |
exclusive ifTrue:[ |
|
4021 |
items := #( |
|
4022 |
('Show More WalkBack' showMore ) |
|
4023 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4024 |
('-' ) |
|
4025 |
('Add Breakpoint' addBreakpoint ) |
|
4026 |
('Remove Breakpoint' removeBreakpoint ) |
|
4027 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4028 |
('-' ) |
|
4029 |
('Copy WalkBack Text' copyWalkbackText ) |
|
4030 |
('-' ) |
|
4031 |
('QuickTerminate' quickTerminate ) |
|
4032 |
('=' ) |
|
4033 |
('Exit Smalltalk (No Confirmation)' exit ) |
|
4034 |
). |
|
4035 |
] ifFalse:[ |
|
4036 |
items := #( |
|
4037 |
('Show More WalkBack' showMore ) |
|
4038 |
('Show Verbose WalkBack' showVerboseWalkback ) |
|
4039 |
('-' ) |
|
4040 |
('Skip' skip ) |
|
4041 |
('Step Out' skipForReturn ) |
|
4042 |
('Skip until Entering...' skipUntilEntering ) |
|
4043 |
('-' ) |
|
4044 |
" |
|
4045 |
('Continue' doContinue ) |
|
4046 |
('Terminate' doTerminate ) |
|
4047 |
('Abort' doAbort ) |
|
4048 |
('-' ) |
|
4049 |
('Step' doStep ) |
|
4050 |
('Send' doSend ) |
|
4051 |
('-' ) |
|
4052 |
('Return' doReturn ) |
|
4053 |
('Restart' doRestart ) |
|
4054 |
('-' ) |
|
4055 |
" |
|
4056 |
('Add Breakpoint' addBreakpoint ) |
|
4057 |
('Remove Breakpoint' removeBreakpoint ) |
|
4058 |
('Remove all Break- && Tracepoints' removeAllBreakpoints ) |
|
4059 |
). |
|
4060 |
||
4061 |
self allowBreakPointsInDebugger ifFalse:[ |
|
4062 |
items := items , #( |
|
4063 |
('Allow Breakpoints && halt in Debugger' doNotIgnoreBreakpoints ) |
|
4064 |
). |
|
4065 |
] ifTrue:[ |
|
4066 |
items := items , #( |
|
4067 |
('Ignore Breakpoints && halt in Debugger' doIgnoreBreakpoints ) |
|
4068 |
). |
|
4069 |
]. |
|
4070 |
||
4071 |
items := items , #( |
|
4072 |
('-' ) |
|
4073 |
('Browse Implementing Class' browseImplementingClass ) |
|
4074 |
('Browse Receivers Class' browseReceiversClass ) |
|
4075 |
('Browse Receivers Class Hierarchy' browseClassHierarchy ) |
|
4076 |
('Browse Receivers Full Protocol' browseFullClassProtocol ) |
|
4077 |
('Implementors' browseImplementors ) |
|
4078 |
('Implementors Of...' browseImplementorsOf ) |
|
4079 |
('Senders' browseSenders ) |
|
4080 |
('Senders Of...' browseSendersOf ) |
|
4081 |
('-' ) |
|
4082 |
('Inspect Context' inspectContext ) |
|
4083 |
('Copy WalkBack Text' copyWalkbackText ) |
|
4084 |
('-' ) |
|
4085 |
('QuickTerminate' quickTerminate ) |
|
4086 |
('=' ) |
|
4087 |
('Exit Smalltalk (No Confirmation)' exit ) |
|
4088 |
). |
|
4089 |
]. |
|
4090 |
||
4091 |
||
4092 |
m := PopUpMenu |
|
4093 |
itemList:items |
|
4094 |
resources:resources |
|
4095 |
receiver:self |
|
4096 |
for:contextView. |
|
4097 |
||
4098 |
verboseBacktrace ifTrue:[ |
|
4099 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
|
4100 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback |
|
4101 |
]. |
|
4102 |
||
4103 |
inspecting ifTrue:[ |
|
4104 |
m notNil ifTrue:[ |
|
4105 |
m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass |
|
4106 |
browseClassHierarchy browseFullClassProtocol |
|
4107 |
browseImplementors browseSenders inspectContext skip doStepOut). |
|
4108 |
]. |
|
4109 |
]. |
|
4110 |
self updateMenuItems. |
|
4111 |
||
4112 |
^ m. |
|
4113 |
! |
|
4114 |
||
3447 | 4115 |
openAboutThisApplication |
4116 |
"opens an about box for this application." |
|
4117 |
||
7112 | 4118 |
Dialog aboutClass:self class. |
4119 |
||
4120 |
"Modified: / 12-09-2006 / 17:20:38 / cg" |
|
3447 | 4121 |
! |
4122 |
||
8170 | 4123 |
openIgnoreHaltNTimesDialog |
8179 | 4124 |
|answer n| |
4125 |
||
4126 |
[ |
|
4127 |
answer := Dialog request:'How often should this halt be ignored ?'. |
|
4128 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4129 |
||
4130 |
n := Integer readFrom:answer onError:nil. |
|
4131 |
n notNil ifTrue:[ |
|
4132 |
self addIgnoredHaltForCount:n orTimeDuration:nil. |
|
4133 |
^ self. |
|
8170 | 4134 |
]. |
8179 | 4135 |
] loop. |
4136 |
! |
|
4137 |
||
4138 |
openIgnoreHaltUntilTimeElapsedDialog |
|
4139 |
|answer dT| |
|
4140 |
||
4141 |
[ |
|
4142 |
answer := Dialog request:'How long should this halt/breakpoint be ignored (s/m/h) ?'. |
|
4143 |
answer isEmptyOrNil ifTrue:[^ self]. |
|
4144 |
||
4145 |
dT := TimeDuration readFrom:answer onError:nil. |
|
4146 |
dT notNil ifTrue:[ |
|
4147 |
self addIgnoredHaltForCount:nil orTimeDuration:dT. |
|
4148 |
^ self. |
|
4149 |
]. |
|
4150 |
] loop |
|
8170 | 4151 |
! |
4152 |
||
266 | 4153 |
quickTerminate |
4154 |
"quick terminate - the process will get no chance for cleanup actions" |
|
4155 |
||
4156 |
inspecting ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4157 |
self processPerform:#terminateNoSignal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4158 |
^ self |
266 | 4159 |
]. |
4160 |
||
788
26d452e40e52
care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
4161 |
steppedContext := wrapperContext := nil. |
266 | 4162 |
haveControl := false. |
4163 |
exitAction := #quickTerminate. |
|
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4164 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4165 |
"exit private event-loop" |
6365 | 4166 |
catchBlock value. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4167 |
|
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4168 |
"/ not reached (normally) |
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4169 |
inspecting ifFalse:[ |
5884 | 4170 |
'DebugView [warning]: quick terminate failed' errorPrintCR. |
4171 |
(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[ |
|
4172 |
Debugger newDebugger. |
|
4173 |
Processor activeProcess terminateNoSignal. |
|
4174 |
] |
|
266 | 4175 |
]. |
581
d1a1ae9d49e4
removed old non-thread support
Claus Gittinger <cg@exept.de>
parents:
579
diff
changeset
|
4176 |
terminateButton turnOff. |
477 | 4177 |
|
935
7c75379de9ec
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
4178 |
"Modified: 10.1.1997 / 17:42:10 / cg" |
266 | 4179 |
! |
4180 |
||
4181 |
removeAllBreakpoints |
|
4182 |
"remove all trace & breakpoints - if any" |
|
4183 |
||
1327 | 4184 |
(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[ |
1661 | 4185 |
self withExecuteCursorDo:[ |
4186 |
MessageTracer unwrapAllMethods |
|
4187 |
] |
|
1319 | 4188 |
] |
1327 | 4189 |
|
1661 | 4190 |
"Modified: / 21.5.1998 / 01:44:43 / cg" |
266 | 4191 |
! |
4192 |
||
4193 |
removeBreakpoint |
|
4194 |
"remove breakpoint on the selected contexts method - if any" |
|
4195 |
||
4196 |
|implementorClass method| |
|
4197 |
||
4198 |
selectedContext isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4199 |
^ self showError:'** select a context first **' |
266 | 4200 |
]. |
1327 | 4201 |
(MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4202 |
^ self |
1319 | 4203 |
]. |
266 | 4204 |
|
4205 |
implementorClass := selectedContext methodClass. |
|
4206 |
implementorClass notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4207 |
method := implementorClass compiledMethodAt:selectedContext selector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4208 |
(method notNil and:[method isBreakpointed]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4209 |
method clearBreakPoint |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4210 |
] |
266 | 4211 |
]. |
4212 |
contextView middleButtonMenu disable:#removeBreakpoint. |
|
3511 | 4213 |
contextView middleButtonMenu enable:#addBreakpoint. |
1327 | 4214 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4215 |
"Modified: / 13.1.1998 / 00:24:47 / cg" |
266 | 4216 |
! |
4217 |
||
3447 | 4218 |
showDenseWalkback |
3427 | 4219 |
|m| |
4220 |
||
4221 |
m := contextView middleButtonMenu. |
|
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4222 |
verboseBacktrace := false. |
3694 | 4223 |
m labelAt:#showDenseWalkback put:(resources string:'Show Verbose WalkBack'). |
3447 | 4224 |
m selectorAt:#showDenseWalkback put:#showVerboseWalkback. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4225 |
self redisplayBacktrace. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4226 |
|
3447 | 4227 |
"Created: / 17.11.2001 / 20:08:08 / cg" |
4228 |
"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
|
4229 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4230 |
|
266 | 4231 |
showMore |
3447 | 4232 |
"double the number of contexts shown" |
266 | 4233 |
|
4234 |
contextArray notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4235 |
nChainShown := nChainShown * 2. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4236 |
self redisplayBacktrace. |
266 | 4237 |
] |
563 | 4238 |
|
3447 | 4239 |
"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
|
4240 |
! |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
4241 |
|
3447 | 4242 |
showVerboseWalkback |
4243 |
|m| |
|
4244 |
||
4245 |
verboseBacktrace := true. |
|
4246 |
m := contextView middleButtonMenu. |
|
3694 | 4247 |
m labelAt:#showVerboseWalkback put:(resources string:'Show Dense WalkBack'). |
3447 | 4248 |
m selectorAt:#showVerboseWalkback put:#showDenseWalkback. |
4249 |
||
4250 |
self redisplayBacktrace. |
|
4251 |
||
4252 |
"Created: / 17.11.2001 / 20:07:57 / cg" |
|
4253 |
"Modified: / 17.11.2001 / 22:39:41 / cg" |
|
4254 |
! |
|
4255 |
||
4256 |
showingDenseWalkback |
|
4257 |
^ verboseBacktrace == false. |
|
4258 |
||
4259 |
"Created: / 17.11.2001 / 20:13:53 / cg" |
|
4260 |
! |
|
4261 |
||
4262 |
showingVerboseWalkback |
|
4263 |
^ verboseBacktrace == true. |
|
4264 |
||
4265 |
"Created: / 17.11.2001 / 20:13:46 / cg" |
|
4266 |
! |
|
4267 |
||
266 | 4268 |
skip |
4269 |
"skip for cursor line in selected method" |
|
4270 |
||
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4271 |
stepHow := #skip. |
266 | 4272 |
self doStep:codeView cursorLine. |
790 | 4273 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4274 |
"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
|
4275 |
! |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4276 |
|
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4277 |
skipForReturn |
2581 | 4278 |
"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
|
4279 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4280 |
stepHow := #skipReturn. |
754
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4281 |
self doStep:#return. |
1848d4e89bc4
much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents:
745
diff
changeset
|
4282 |
|
1063
cc4f9a5d49ac
added stepIn, stepOver and stepOut;
Claus Gittinger <cg@exept.de>
parents:
1049
diff
changeset
|
4283 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
2581 | 4284 |
! |
4285 |
||
4286 |
skipUntilEntering |
|
4287 |
"skip until some particular method is invoked." |
|
4288 |
||
4289 |
|selector| |
|
4290 |
||
4291 |
selector := Dialog |
|
4292 |
request:'Skip until entering what (matchpattern):' |
|
4293 |
initialAnswer:self goodSkipUntilSelector. |
|
4294 |
selector size == 0 ifTrue:[^ self]. |
|
4295 |
||
4296 |
stepUntilEntering := selector asSymbol. |
|
4297 |
stepHow := #send. |
|
4298 |
self doStep:-1. |
|
4299 |
||
4300 |
"Modified: 3.3.1997 / 20:56:32 / cg" |
|
3447 | 4301 |
! |
4302 |
||
8170 | 4303 |
stopIgnoringHalts |
8179 | 4304 |
self class stopIgnoringHalts |
8170 | 4305 |
! |
4306 |
||
3447 | 4307 |
toggleVerboseWalkback |
4308 |
verboseBacktrace ifFalse:[ |
|
4309 |
self showVerboseWalkback |
|
4310 |
] ifTrue:[ |
|
4311 |
self showDenseWalkback |
|
4312 |
]. |
|
4313 |
||
4314 |
"Modified: / 17.11.2001 / 20:07:45 / cg" |
|
266 | 4315 |
! ! |
4316 |
||
4317 |
!DebugView methodsFor:'private'! |
|
4318 |
||
6487 | 4319 |
abortAllIsHandled |
4320 |
^ AbortAllOperationRequest isHandled |
|
4321 |
! |
|
4322 |
||
8179 | 4323 |
addIgnoredHaltForCount:countOrNil orTimeDuration:dTOrNil |
4324 |
|haltingContext haltingMethod lineNrOfHalt |
|
4325 |
oldEntry ign| |
|
4326 |
||
4327 |
haltingContext := self findHaltingContext. |
|
4328 |
haltingMethod := haltingContext method. |
|
4329 |
lineNrOfHalt := haltingContext lineNumber. |
|
4330 |
||
4331 |
IgnoredHalts notNil ifTrue:[ |
|
4332 |
oldEntry := IgnoredHalts |
|
4333 |
detect:[:ign | ign isForMethod:haltingMethod line:lineNrOfHalt] |
|
4334 |
ifNone:nil. |
|
4335 |
IgnoredHalts remove:oldEntry ifAbsent:[]. |
|
4336 |
]. |
|
4337 |
||
4338 |
(countOrNil notNil or:[dTOrNil notNil]) ifTrue:[ |
|
4339 |
IgnoredHalts isNil ifTrue:[ |
|
4340 |
IgnoredHalts := OrderedCollection new. |
|
4341 |
]. |
|
4342 |
ign := IgnoredHalt new method:haltingMethod lineNumber:lineNrOfHalt. |
|
4343 |
||
4344 |
(countOrNil notNil and:[countOrNil > 0]) ifTrue:[ |
|
4345 |
ign ignoreCount:countOrNil. |
|
4346 |
]. |
|
4347 |
||
4348 |
(dTOrNil notNil) ifTrue:[ |
|
4349 |
ign ignoreEndTime:(Timestamp now + dTOrNil). |
|
4350 |
]. |
|
4351 |
IgnoredHalts add:ign. |
|
4352 |
]. |
|
4353 |
! |
|
4354 |
||
266 | 4355 |
busy |
4356 |
^ busy |
|
4357 |
! |
|
4358 |
||
3511 | 4359 |
canAddBreakpoint |
4360 |
|m| |
|
4361 |
||
4362 |
m := contextView middleButtonMenu. |
|
4363 |
^ m notNil and:[m isEnabled:#addBreakpoint] |
|
4364 |
! |
|
4365 |
||
3269 | 4366 |
canBrowseClassHierarchy |
4367 |
|m| |
|
4368 |
||
4369 |
m := contextView middleButtonMenu. |
|
4370 |
^ m notNil and:[m isEnabled:#browseClassHierarchy] |
|
4371 |
! |
|
4372 |
||
4373 |
canBrowseFullClassProtocol |
|
4374 |
|m| |
|
4375 |
||
4376 |
m := contextView middleButtonMenu. |
|
4377 |
^ m notNil and:[m isEnabled:#browseFullClassProtocol] |
|
4378 |
! |
|
4379 |
||
4380 |
canBrowseImplementingClass |
|
4381 |
|m| |
|
4382 |
||
4383 |
m := contextView middleButtonMenu. |
|
4384 |
^ m notNil and:[m isEnabled:#browseImplementingClass] |
|
4385 |
! |
|
4386 |
||
4387 |
canBrowseReceiversClass |
|
4388 |
|m| |
|
4389 |
||
4390 |
m := contextView middleButtonMenu. |
|
4391 |
^ m notNil and:[m isEnabled:#browseReceiversClass] |
|
4392 |
! |
|
4393 |
||
4394 |
canDefineMethod |
|
4395 |
^ defineButton isVisible |
|
4396 |
! |
|
4397 |
||
4398 |
canRemoveBreakpoint |
|
4399 |
|m| |
|
4400 |
||
4401 |
m := contextView middleButtonMenu. |
|
4402 |
^ m notNil and:[m isEnabled:#removeBreakpoint] |
|
4403 |
! |
|
4404 |
||
3447 | 4405 |
canRestart |
4406 |
^ restartButton isEnabled |
|
4407 |
||
4408 |
"Modified: / 17.11.2001 / 19:59:49 / cg" |
|
4409 |
! |
|
4410 |
||
4411 |
canReturn |
|
4412 |
^ returnButton isEnabled |
|
4413 |
||
4414 |
"Modified: / 17.11.2001 / 19:59:18 / cg" |
|
4415 |
! |
|
4416 |
||
3269 | 4417 |
canShowMore |
4418 |
^ canShowMore |
|
4419 |
! |
|
4420 |
||
7797 | 4421 |
contextListEntryFor:aContext |
4422 |
|s| |
|
4423 |
||
4424 |
aContext selector == #doIt ifTrue:[ |
|
4425 |
aContext receiver isNil ifTrue:[ |
|
4426 |
^ 'doIt' asText allBold |
|
4427 |
] |
|
4428 |
]. |
|
4429 |
||
4430 |
s := Text new writeStream. |
|
4431 |
aContext printOn:s. |
|
4432 |
^ s contents |
|
4433 |
||
4434 |
"Created: / 21-05-2007 / 13:30:24 / cg" |
|
4435 |
! |
|
4436 |
||
266 | 4437 |
exclusive:aBoolean |
4438 |
exclusive := aBoolean |
|
4439 |
! |
|
4440 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4441 |
explainSelection |
8212 | 4442 |
|interval crsrPos| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4443 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4444 |
interval := self selectedInterval. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4445 |
interval isEmpty ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4446 |
crsrPos := codeView characterPositionOfCursor. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4447 |
codeView characterUnderCursor isSeparator ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4448 |
crsrPos := (crsrPos - 1) max:1 |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4449 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4450 |
interval := crsrPos to:crsrPos. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4451 |
]. |
8212 | 4452 |
self |
4453 |
withNodeValueAtInterval:interval |
|
4454 |
do:[:value | |
|
4455 |
self showValue:value |
|
4456 |
]. |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4457 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4458 |
|
8179 | 4459 |
findHaltingContext |
4460 |
|haltSelectors| |
|
4461 |
||
4462 |
haltSelectors := self haltSelectors. |
|
4463 |
||
4464 |
contextArray keysAndValuesDo:[:idx :con | |
|
4465 |
|sel con2 sel2| |
|
4466 |
||
4467 |
sel := con selector. |
|
4468 |
(haltSelectors includes:sel) ifTrue:[ |
|
4469 |
con method mclass == Object ifTrue:[ |
|
4470 |
con2 := contextArray at:idx+1. |
|
4471 |
sel2 := con2 selector. |
|
4472 |
(haltSelectors includes:sel2) ifTrue:[ |
|
4473 |
con2 method mclass == Object ifTrue:[ |
|
4474 |
^ contextArray at:idx+2. |
|
4475 |
] |
|
4476 |
]. |
|
4477 |
^ contextArray at:idx+1 |
|
4478 |
]. |
|
4479 |
]. |
|
4480 |
]. |
|
4481 |
^ nil |
|
4482 |
! |
|
4483 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4484 |
findNodeForInterval:interval |
8212 | 4485 |
|source| |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4486 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4487 |
interval isEmpty ifTrue: [^ nil]. |
6622
cf89940b5d30
configurable set of hidden selectors
Claus Gittinger <cg@exept.de>
parents:
6616
diff
changeset
|
4488 |
RBParser isNil ifTrue:[^ nil]. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4489 |
|
8212 | 4490 |
"/ source := codeView contents asString. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4491 |
source := currentMethod source. |
8212 | 4492 |
^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string) allowErrors:true. |
4493 |
"/ ^ DoWhatIMeanSupport findNodeForInterval:interval in:(source string). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4494 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4495 |
|
7912 | 4496 |
findNodeIn:tree forInterval:interval |
4497 |
<resource: #obsolete> |
|
4498 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4499 |
|node| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4500 |
|
7912 | 4501 |
self obsoleteMethodWarning. |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4502 |
node := nil. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4503 |
tree nodesDo:[:each | |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4504 |
(each intersectsInterval:interval) ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4505 |
(node isNil or:[node == each parent]) ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4506 |
node := each |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4507 |
] ifFalse:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4508 |
(node parent notNil |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4509 |
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
|
4510 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4511 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4512 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4513 |
^ node |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4514 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4515 |
|
2581 | 4516 |
goodSkipUntilSelector |
4517 |
|current| |
|
4518 |
||
4519 |
lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering]. |
|
4520 |
selectedContext isNil ifTrue:[^ nil]. |
|
4521 |
current := selectedContext selector. |
|
4522 |
current isNil ifTrue:[^ nil]. |
|
4523 |
('change:*' match:current) ifTrue:[ |
|
4524 |
^ 'update:*' |
|
4525 |
]. |
|
4526 |
^ nil |
|
4527 |
! |
|
4528 |
||
8179 | 4529 |
haltSelectors |
4530 |
^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:'). |
|
4531 |
! |
|
4532 |
||
3447 | 4533 |
hasContextSelected |
4534 |
^ contextView hasSelection |
|
4535 |
||
4536 |
"Created: / 17.11.2001 / 19:57:03 / cg" |
|
4537 |
! |
|
4538 |
||
4539 |
ignoreBreakpoints |
|
4540 |
^ ignoreBreakpoints |
|
4541 |
||
4542 |
"Created: / 17.11.2001 / 18:20:16 / cg" |
|
4543 |
! |
|
4544 |
||
266 | 4545 |
inspectedProcess |
4546 |
^ inspectedProcess |
|
4547 |
! |
|
4548 |
||
4549 |
interruptProcessWith:aBlock |
|
4550 |
"let inspected process do something, then update the context list" |
|
4551 |
||
4552 |
inspectedProcess isDead ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4553 |
self showTerminated. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4554 |
^ self |
266 | 4555 |
]. |
4556 |
inspectedProcess interruptWith:aBlock. |
|
4557 |
" |
|
4558 |
give the process a chance to run, then update |
|
4559 |
" |
|
4560 |
(Delay forSeconds:0.2) wait. |
|
4561 |
self setContext:(inspectedProcess suspendedContext). |
|
4562 |
! |
|
4563 |
||
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4564 |
mayProceed:aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4565 |
mayProceed := aBoolean |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4566 |
! |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
4567 |
|
8194 | 4568 |
openHTMLDocument: anHTMLFilename |
4569 |
"open a HTMLDocumentView on anHTMLFilename" |
|
4570 |
||
4571 |
HTMLDocumentView openFullOnDocumentationFile: anHTMLFilename |
|
4572 |
! |
|
4573 |
||
266 | 4574 |
processPerform:aMessage |
4575 |
"do something, then update the context list" |
|
4576 |
||
4577 |
inspectedProcess isDead ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4578 |
self showTerminated. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4579 |
^ self |
266 | 4580 |
]. |
4581 |
inspectedProcess perform:aMessage. |
|
4582 |
" |
|
4583 |
give the process a chance to run, then update |
|
4584 |
" |
|
4585 |
(Delay forSeconds:0.2) wait. |
|
4586 |
self setContext:(inspectedProcess suspendedContext). |
|
4587 |
! |
|
4588 |
||
939 | 4589 |
redisplayBacktrace |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4590 |
"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
|
4591 |
verbose-flag setting is changed" |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4592 |
|
939 | 4593 |
|oldSelection oldContext con idx| |
4594 |
||
4595 |
contextArray notNil ifTrue:[ |
|
1661 | 4596 |
self withExecuteCursorDo:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4597 |
oldSelection := contextView selection. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4598 |
oldSelection notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4599 |
oldContext := contextArray at:oldSelection ifAbsent:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4600 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4601 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4602 |
con := firstContext. |
950 | 4603 |
"/ con := contextArray at:1. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4604 |
"/ 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
|
4605 |
contextArray size > 0 ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4606 |
contextArray at:1 put:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4607 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4608 |
self setContext:con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4609 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4610 |
oldContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4611 |
idx := oldSelection |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4612 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4613 |
idx := contextArray identityIndexOf:oldContext ifAbsent:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4614 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4615 |
contextView setSelection:idx. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4616 |
idx notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4617 |
self showSelection:idx |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4618 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4619 |
] |
939 | 4620 |
] |
4621 |
||
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4622 |
"Created: / 10.1.1997 / 21:36:46 / cg" |
1661 | 4623 |
"Modified: / 21.5.1998 / 01:47:07 / cg" |
939 | 4624 |
! |
4625 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4626 |
selectedInterval |
7912 | 4627 |
^ codeView selectedInterval |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4628 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4629 |
|
7823 | 4630 |
showError:message |
4631 |
codeView contents:(resources string:message). |
|
4632 |
shown ifTrue:[ |
|
4633 |
exclusive ifTrue:[ |
|
4634 |
"/ consider this a kludge: |
|
4635 |
"/ if exclusive, cannot use flash, since it suspends |
|
4636 |
"/ (but we cannot suspend here ...) |
|
4637 |
codeView redrawInverted. device flush. |
|
4638 |
OperatingSystem millisecondDelay:200. |
|
4639 |
codeView redraw |
|
4640 |
] ifFalse:[ |
|
4641 |
codeView flash |
|
4642 |
] |
|
4643 |
] |
|
4644 |
||
4645 |
"Modified: / 18.11.2001 / 00:01:13 / cg" |
|
4646 |
! |
|
4647 |
||
4648 |
showTerminated |
|
4649 |
self showError:'** the process has terminated **' |
|
4650 |
! |
|
4651 |
||
4652 |
showValue:aValue |
|
4653 |
"/ TODO: show value in info field |
|
4654 |
"/ Transcript showCR:aValue printString |
|
4655 |
! |
|
4656 |
||
4657 |
stepping |
|
4658 |
^ stepping |
|
4659 |
! |
|
4660 |
||
4661 |
unstep |
|
4662 |
stepping := false. |
|
4663 |
bigStep := false. |
|
4664 |
steppedContext := wrapperContext := nil. |
|
4665 |
exitAction := nil |
|
4666 |
||
4667 |
"Modified: 22.10.1996 / 11:59:57 / cg" |
|
4668 |
! |
|
4669 |
||
4670 |
updateContext |
|
4671 |
|oldContext idx| |
|
4672 |
||
4673 |
inspectedProcess state == #dead ifTrue:[ |
|
4674 |
self showTerminated. |
|
4675 |
^ self |
|
4676 |
]. |
|
4677 |
||
4678 |
oldContext := selectedContext. |
|
4679 |
[ |
|
4680 |
(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[ |
|
4681 |
oldContext notNil ifTrue:[ |
|
4682 |
contextArray notNil ifTrue:[ |
|
4683 |
idx := contextArray identityIndexOf:oldContext. |
|
4684 |
idx ~~ 0 ifTrue:[ |
|
4685 |
self showSelection:idx |
|
4686 |
] ifFalse:[ |
|
4687 |
codeView contents:('** context returned **') |
|
4688 |
] |
|
4689 |
] |
|
4690 |
] |
|
4691 |
]. |
|
4692 |
] valueUninterruptably. |
|
4693 |
||
4694 |
"Modified: 20.10.1996 / 18:11:24 / cg" |
|
8212 | 4695 |
! |
4696 |
||
4697 |
withNodeValueAtInterval:interval do:aBlock |
|
4698 |
|node definingNode nm varIdx parentNode| |
|
4699 |
||
4700 |
"/interval printCR. |
|
4701 |
node := self findNodeForInterval:interval. |
|
4702 |
"/node printCR. |
|
4703 |
node isNil ifTrue:[ ^ self ]. |
|
4704 |
node isVariable ifFalse:[ ^ self ]. |
|
4705 |
||
4706 |
nm := node name. |
|
4707 |
||
4708 |
(nm = 'self') ifTrue:[ |
|
4709 |
aBlock value:(actualContext methodHome receiver). |
|
4710 |
^ self |
|
4711 |
]. |
|
4712 |
(nm = 'super') ifTrue:[ |
|
4713 |
aBlock value:(actualContext methodHome receiver). |
|
4714 |
^ self |
|
4715 |
]. |
|
4716 |
(nm = 'thisContext') ifTrue:[ |
|
4717 |
aBlock value:actualContext. |
|
4718 |
^ self |
|
4719 |
]. |
|
4720 |
||
4721 |
definingNode := node whoDefines:nm. |
|
4722 |
definingNode isNil ifTrue:[ |
|
4723 |
(currentMethod mclass allInstVarNames includes:nm) ifTrue:[ |
|
4724 |
"/aBlock value:'xIII'. |
|
4725 |
^ self |
|
4726 |
]. |
|
4727 |
"/aBlock value:'x1'. |
|
4728 |
^ self |
|
4729 |
]. |
|
4730 |
"/definingNode printCR. |
|
4731 |
||
4732 |
definingNode isMethod ifTrue:[ |
|
4733 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
|
4734 |
varIdx ~~ 0 ifTrue:[ |
|
4735 |
aBlock value:(actualContext methodHome argAt:varIdx). |
|
4736 |
^ self |
|
4737 |
] |
|
4738 |
]. |
|
4739 |
||
4740 |
definingNode isBlock ifTrue:[ |
|
4741 |
varIdx := definingNode arguments findFirst:[:arg | arg name = nm]. |
|
4742 |
(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[ |
|
4743 |
varIdx ~~ 0 ifTrue:[ |
|
4744 |
"/aBlock value:'x2'. |
|
4745 |
^ self |
|
4746 |
] |
|
4747 |
]. |
|
4748 |
]. |
|
4749 |
||
4750 |
parentNode := definingNode parent. |
|
4751 |
||
4752 |
[parentNode notNil] whileTrue:[ |
|
4753 |
"/'isMethod ' print. parentNode isMethod printCR. |
|
4754 |
parentNode isMethod ifTrue:[ |
|
4755 |
varIdx := parentNode temporaries findFirst:[:arg | arg name = nm]. |
|
4756 |
varIdx ~~ 0 ifTrue:[ |
|
4757 |
actualContext methodHome numVars >= varIdx ifTrue:[ |
|
4758 |
aBlock value:(actualContext methodHome varAt:varIdx). |
|
4759 |
^ self |
|
4760 |
] |
|
4761 |
]. |
|
4762 |
]. |
|
4763 |
"/'isBlock ' print. parentNode isBlock printCR. |
|
4764 |
parentNode isBlock ifTrue:[ |
|
4765 |
varIdx := parentNode arguments findFirst:[:arg | arg name = nm]. |
|
4766 |
varIdx ~~ 0 ifTrue:[ |
|
4767 |
aBlock value:(actualContext argAt:varIdx). |
|
4768 |
^ self |
|
4769 |
]. |
|
4770 |
varIdx := parentNode body temporaries findFirst:[:arg | arg name = nm]. |
|
4771 |
varIdx ~~ 0 ifTrue:[ |
|
4772 |
aBlock value:(actualContext varAt:varIdx). |
|
4773 |
^ self |
|
4774 |
]. |
|
4775 |
]. |
|
4776 |
parentNode := parentNode parent. |
|
4777 |
]. |
|
4778 |
"/aBlock value:'x4'. |
|
7823 | 4779 |
! ! |
4780 |
||
4781 |
!DebugView methodsFor:'private queries'! |
|
4782 |
||
4783 |
isAborting |
|
4784 |
^ exitAction == #abort |
|
4785 |
! |
|
4786 |
||
4787 |
setOfHiddenCallingSelectors |
|
4788 |
^ setOfHiddenCallingSelectors ? #( #'doIt' #'doIt:' ) |
|
4789 |
! |
|
4790 |
||
4791 |
setOfHiddenCallingSelectors:aCollectionOfSymbols |
|
4792 |
setOfHiddenCallingSelectors := aCollectionOfSymbols |
|
4793 |
! ! |
|
4794 |
||
4795 |
!DebugView methodsFor:'private-cache handling'! |
|
4796 |
||
4797 |
cacheMyself |
|
4798 |
"remember myself for next debug session" |
|
4799 |
||
4800 |
"caching the last debugger will make the next debugger appear |
|
4801 |
faster, since no resources have to be allocated in the display. |
|
4802 |
We have to be careful to release all refs to the debuggee, though. |
|
4803 |
Otherwise, the GC will not be able to release it." |
|
4804 |
||
4805 |
windowGroup notNil ifTrue:[ |
|
4806 |
windowGroup setProcess:nil. |
|
4807 |
]. |
|
4808 |
||
4809 |
self releaseDebuggee. |
|
4810 |
||
4811 |
cachable ~~ true ifTrue:[^ self]. |
|
4812 |
||
4813 |
"/ |
|
4814 |
"/ only cache if I am on the Display |
|
4815 |
"/ |
|
4816 |
device == Display ifTrue:[ |
|
4817 |
exclusive ifTrue:[ |
|
4818 |
CachedExclusive := self |
|
4819 |
] ifFalse:[ |
|
4820 |
CachedDebugger := self |
|
4821 |
]. |
|
4822 |
]. |
|
4823 |
||
4824 |
ObjectMemory stepInterruptHandler == self ifTrue:[ |
|
4825 |
ObjectMemory stepInterruptHandler:nil |
|
4826 |
]. |
|
4827 |
||
4828 |
"Modified: 10.7.1997 / 15:50:46 / stefan" |
|
4829 |
"Modified: 31.7.1997 / 21:20:14 / cg" |
|
4830 |
! |
|
4831 |
||
4832 |
isCached |
|
4833 |
"tell wether we are a cached debugger" |
|
4834 |
||
4835 |
CachedExclusive == self ifTrue:[ |
|
4836 |
^ true. |
|
4837 |
]. |
|
4838 |
CachedDebugger == self ifTrue:[ |
|
4839 |
^ true. |
|
4840 |
]. |
|
4841 |
||
4842 |
^ false. |
|
4843 |
||
4844 |
"Created: 10.7.1997 / 15:22:43 / stefan" |
|
4845 |
! |
|
4846 |
||
4847 |
releaseDebuggee |
|
4848 |
"We have to be careful to release all refs to the debuggee, |
|
4849 |
because we may be in the cache. |
|
4850 |
Otherwise, the GC will not be able to release it" |
|
4851 |
||
4852 |
busy := false. |
|
4853 |
||
4854 |
codeView acceptAction:nil. |
|
4855 |
codeView doItAction:nil. |
|
4856 |
codeView contents:nil. |
|
4857 |
||
4858 |
receiverInspector release. |
|
4859 |
contextInspector release. |
|
4860 |
inspectedProcess := nil. |
|
4861 |
contextArray := nil. |
|
4862 |
selectedContext := actualContext := firstContext := nil. |
|
4863 |
steppedContext := wrapperContext := nil. |
|
4864 |
catchBlock := nil. |
|
4865 |
grabber := nil. |
|
4866 |
self autoUpdateOff. |
|
4867 |
||
4868 |
"Created: / 10.7.1997 / 14:57:51 / stefan" |
|
4869 |
"Modified: / 10.7.1997 / 15:50:38 / stefan" |
|
4870 |
"Modified: / 17.11.2001 / 22:58:17 / cg" |
|
4871 |
! |
|
4872 |
||
4873 |
uncacheMyself |
|
4874 |
"do not remember myself any longer for next debug session" |
|
4875 |
||
4876 |
cachable := false. |
|
4877 |
||
4878 |
CachedExclusive == self ifTrue:[ |
|
4879 |
CachedExclusive := nil. |
|
4880 |
]. |
|
4881 |
CachedDebugger == self ifTrue:[ |
|
4882 |
CachedDebugger := nil. |
|
4883 |
]. |
|
4884 |
OpenDebuggers notNil ifTrue:[ |
|
4885 |
OpenDebuggers remove:self ifAbsent:[]. |
|
4886 |
]. |
|
4887 |
||
4888 |
"Modified: 31.7.1997 / 21:20:11 / cg" |
|
4889 |
! ! |
|
4890 |
||
4891 |
!DebugView methodsFor:'private-context handling'! |
|
4892 |
||
266 | 4893 |
setContext:aContext |
4894 |
"show calling chain from aContext in the walk-back listview" |
|
4895 |
||
641 | 4896 |
^ 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
|
4897 |
|
641 | 4898 |
"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
|
4899 |
! |
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
4900 |
|
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
4901 |
setContext:aContext releaseInspectors:releaseInspectors |
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4902 |
"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
|
4903 |
Most complications here arise from filtering less-interesting contexts |
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4904 |
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
|
4905 |
|
3702 | 4906 |
|con text method caller caller2 called called2 m count c cc |
3447 | 4907 |
suspendContext calledBySuspendContext nm h calledContext| |
266 | 4908 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
4909 |
(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
|
4910 |
"no change" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4911 |
^ false |
266 | 4912 |
]. |
4913 |
||
8170 | 4914 |
isStoppedAtHaltOrBreakPoint := false. |
939 | 4915 |
firstContext := aContext. |
4916 |
||
266 | 4917 |
m := contextView middleButtonMenu. |
4918 |
m notNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4919 |
m disable:#showMore. |
266 | 4920 |
]. |
3269 | 4921 |
canShowMore := false. |
266 | 4922 |
|
4923 |
aContext isNil ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4924 |
text := Array with:'** no context **'. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4925 |
contextArray := nil. |
266 | 4926 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4927 |
text := OrderedCollection new:nChainShown. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4928 |
contextArray := OrderedCollection new:nChainShown. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4929 |
con := aContext. |
3447 | 4930 |
calledContext := nil. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4931 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4932 |
verboseBacktrace ~~ true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4933 |
"/ with dense backtrace, hide the ProcessorScheduler |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4934 |
"/ contexts at the top; look for a Process>>suspend* |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4935 |
"/ context within the first 10 contexts |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4936 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4937 |
suspendContext := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4938 |
c := con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4939 |
1 to:10 do:[:i | |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4940 |
|sel| |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4941 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4942 |
c notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4943 |
(sel := c selector) notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4944 |
((sel isSymbol and:[sel startsWith:'suspend']) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4945 |
and:[c receiver isMemberOf:Process]) ifTrue:[ |
3447 | 4946 |
suspendContext := c. |
4947 |
calledBySuspendContext := cc. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4948 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4949 |
]. |
3447 | 4950 |
cc := c. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4951 |
c := c sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4952 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4953 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4954 |
suspendContext notNil ifTrue:[ |
3447 | 4955 |
con := suspendContext. |
4956 |
calledContext := calledBySuspendContext. |
|
4957 |
suspendContext := nil |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4958 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4959 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4960 |
|
8170 | 4961 |
con notNil ifTrue:[ |
4962 |
"/ hide the halt implementation |
|
8179 | 4963 |
(self haltSelectors includes:con selector) ifTrue:[ |
8170 | 4964 |
(con method notNil and:[con method mclass == Object]) ifTrue:[ |
4965 |
isStoppedAtHaltOrBreakPoint := true. |
|
4966 |
verboseBacktrace ~~ true ifTrue:[ |
|
3447 | 4967 |
calledContext := con. |
3427 | 4968 |
con := con sender. |
4969 |
] |
|
7823 | 4970 |
]. |
3427 | 4971 |
] |
4972 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4973 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4974 |
get them all |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4975 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4976 |
count := 0. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
4977 |
[con notNil and:[count <= nChainShown]] whileTrue:[ |
8179 | 4978 |
(self haltSelectors includes:con selector) ifTrue:[ |
8170 | 4979 |
(con method notNil and:[con method mclass == Object]) ifTrue:[ |
4980 |
isStoppedAtHaltOrBreakPoint := true. |
|
4981 |
] |
|
4982 |
]. |
|
4983 |
||
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4984 |
[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4985 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4986 |
'showingContext1: (' print. con print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4987 |
') --> ' print. (self showingContext1:con calling:calledContext) printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4988 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4989 |
self showingContext1:con calling:calledContext |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4990 |
] whileFalse:[ |
3447 | 4991 |
calledContext := con. |
4992 |
con := con sender. |
|
2720
a756bd875d02
more filtering of uninteresting contexts
Claus Gittinger <cg@exept.de>
parents:
2709
diff
changeset
|
4993 |
]. |
3447 | 4994 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4995 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4996 |
'showingContext2: (' print. con print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4997 |
') --> ' print. (self showingContext2:con nesting:count) printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4998 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
4999 |
|
3447 | 5000 |
(self showingContext2:con nesting:count) ifTrue:[ |
1646 | 5001 |
"/ ignore it, if its in the same |
5002 |
"/ method as the previous context |
|
3447 | 5003 |
"/ (verboseBacktrace ~~ true |
5004 |
"/ and:[count > 0 |
|
5005 |
"/ and:[contextArray last method == con method |
|
5006 |
"/ and:[(contextArray last isBlockContext not |
|
5007 |
"/ & con isBlockContext not) not ]]]) ifTrue:[ |
|
5008 |
"/ "/ skip it, if its in the same method |
|
5009 |
"/ "/ as the called context. |
|
5010 |
"/ ] ifFalse:[ |
|
1646 | 5011 |
contextArray add:con. |
5012 |
||
5013 |
(MoreDebuggingDetail == true) ifTrue:[ |
|
5014 |
nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString). |
|
5015 |
] ifFalse:[ |
|
7797 | 5016 |
Error |
5017 |
handle:[:ex | nm := '???' ] |
|
5018 |
do:[ |
|
5019 |
nm := self contextListEntryFor:con. |
|
5020 |
]. |
|
1646 | 5021 |
]. |
5022 |
text add:nm. |
|
5023 |
count := count + 1. |
|
3447 | 5024 |
"/ ]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5025 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5026 |
|
3447 | 5027 |
"/ |
5028 |
"/ kludge: if its a wrapped method, then hide the wrap-call |
|
5029 |
"/ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5030 |
method := con method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5031 |
(method notNil and:[method isWrapped]) ifTrue:[ |
3447 | 5032 |
called := con. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5033 |
caller := con sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5034 |
(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[ |
3447 | 5035 |
called2 := caller. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5036 |
caller2 := caller sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5037 |
(caller2 notNil and:[caller2 method == method]) ifTrue:[ |
3447 | 5038 |
calledContext := called2. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5039 |
con := caller2 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5040 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5041 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5042 |
caller := caller2 := nil |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5043 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5044 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5045 |
"/ with dense backtrace, skip the doIt methods context |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5046 |
"/ (its dummy anyway) and fake that contexts name |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5047 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5048 |
verboseBacktrace ~~ true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5049 |
(con isBlockContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5050 |
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
|
5051 |
and:[h notNil |
6622
cf89940b5d30
configurable set of hidden selectors
Claus Gittinger <cg@exept.de>
parents:
6616
diff
changeset
|
5052 |
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
|
5053 |
and:[h method who isNil]]]]) ifTrue:[ |
3447 | 5054 |
calledContext := con. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5055 |
con := con sender. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5056 |
text removeLast. |
7797 | 5057 |
|
5058 |
text add:(self contextListEntryFor:con methodHome). |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5059 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5060 |
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
|
5061 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5062 |
|
3427 | 5063 |
"/ with dense backtrace, dont show below the doIt |
5064 |
( verboseBacktrace ~~ true |
|
6622
cf89940b5d30
configurable set of hidden selectors
Claus Gittinger <cg@exept.de>
parents:
6616
diff
changeset
|
5065 |
and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[ |
3427 | 5066 |
con := nil. |
5067 |
] ifFalse:[ |
|
3447 | 5068 |
calledContext := con. |
3427 | 5069 |
con := con sender |
5070 |
] |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5071 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5072 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5073 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5074 |
did we reach the end ? |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5075 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5076 |
(con isNil or:[con sender isNil]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5077 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5078 |
"/ the very last one is the startup context |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5079 |
"/ (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
|
5080 |
|
1906
58200b8df8f7
check for empty contextArray
Claus Gittinger <cg@exept.de>
parents:
1871
diff
changeset
|
5081 |
(contextArray notEmpty |
58200b8df8f7
check for empty contextArray
Claus Gittinger <cg@exept.de>
parents:
1871
diff
changeset
|
5082 |
and:[contextArray last selector isNil]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5083 |
contextArray removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5084 |
text removeLast |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5085 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5086 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5087 |
verboseBacktrace ~~ true ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5088 |
"/ in dense mode, remove the process startup |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5089 |
"/ contexts (if any) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5090 |
|
2299 | 5091 |
(contextArray size > 0 |
5092 |
and:[(con := contextArray last) methodClass == Process]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5093 |
con selector == #start ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5094 |
contextArray removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5095 |
text removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5096 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5097 |
[contextArray size > 0 |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5098 |
and:[contextArray last methodHome == con]] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5099 |
contextArray removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5100 |
text removeLast. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5101 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5102 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5103 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5104 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5105 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5106 |
m notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5107 |
m enable:#showMore. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5108 |
]. |
3269 | 5109 |
canShowMore := true. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5110 |
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
|
5111 |
]. |
266 | 5112 |
]. |
5113 |
||
5114 |
contextView setList:text. |
|
944 | 5115 |
|
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5116 |
releaseInspectors ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5117 |
receiverInspector release. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5118 |
contextInspector release. |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5119 |
]. |
266 | 5120 |
|
5121 |
m notNil ifTrue:[ |
|
6275 | 5122 |
m disableAll:#(addBreakpoint removeBreakpoint browseImplementors browseSenders browseReceiversClass). |
266 | 5123 |
]. |
3511 | 5124 |
self updateMenuItems. |
266 | 5125 |
^ true |
300
027ffcadd12d
keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents:
299
diff
changeset
|
5126 |
|
7797 | 5127 |
"Created: / 14-12-1995 / 19:10:31 / cg" |
5128 |
"Modified: / 21-05-2007 / 13:31:02 / cg" |
|
266 | 5129 |
! |
5130 |
||
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5131 |
setContextSkippingInterruptContexts:aContext |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5132 |
"show calling chain from aContext in the walk-back listview. |
1213 | 5133 |
Ignore any non-interesting interrupt-context." |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5134 |
|
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5135 |
|con| |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5136 |
|
8152 | 5137 |
con := aContext. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5138 |
verboseBacktrace ifFalse:[ |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5139 |
(con notNil and:[con selector == #threadSwitch:]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5140 |
con := con sender. |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5141 |
(con notNil and:[con selector == #timerInterrupt]) ifTrue:[ |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5142 |
con := con sender. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5143 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5144 |
]. |
779
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5145 |
]. |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5146 |
^ self setContext:con releaseInspectors:true |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5147 |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5148 |
"Created: / 20.10.1996 / 18:10:21 / cg" |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5149 |
"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
|
5150 |
! |
0486301b79a1
use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
5151 |
|
3447 | 5152 |
showingContext1:aContext calling:calledContext |
7823 | 5153 |
"return false, if this (top) context is to be skipped. |
5154 |
Here, we hide some well known methods, which are usually not too interesting; |
|
5155 |
the set of methods which are suppressed is my (claus's) own choice." |
|
5156 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5157 |
|recIsException sel rec senderRec mthd mthdClass calledSel calledRec| |
3447 | 5158 |
|
5159 |
verboseBacktrace == true ifTrue:[ ^true ]. |
|
5160 |
aContext isNil ifTrue:[ ^true ]. |
|
5161 |
||
5162 |
sel := aContext selector. |
|
5163 |
rec := aContext receiver. |
|
5164 |
mthd := aContext method. |
|
5165 |
mthd notNil ifTrue:[ mthdClass := mthd mclass ]. |
|
5166 |
||
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5167 |
"/ 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
|
5168 |
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
|
5169 |
aContext sender notNil ifTrue:[ |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5170 |
senderRec := aContext sender receiver |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5171 |
]. |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5172 |
|
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5173 |
DebuggingDebugger == true ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5174 |
'showingContext1: (' print. aContext print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5175 |
') calling: (' print. calledContext print. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5176 |
')' printCR. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5177 |
]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5178 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5179 |
(#(doCallHandler: doRaise |
3447 | 5180 |
) includes:sel) |
5181 |
ifTrue:[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5182 |
recIsException ifTrue:[ ^ false]. |
3447 | 5183 |
]. |
5184 |
||
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5185 |
(#(raise raiseRequest |
3447 | 5186 |
) includes:sel) |
5187 |
ifTrue:[ |
|
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5188 |
recIsException ifTrue:[ |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5189 |
(senderRec isLazyValue not |
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5190 |
and:[ senderRec isExceptionCreator]) ifTrue:[^ false]. |
3447 | 5191 |
]. |
5192 |
]. |
|
5193 |
||
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5194 |
(#(doWhile: |
3447 | 5195 |
) includes:sel) |
5196 |
ifTrue:[ |
|
5197 |
rec isBlock ifTrue:[ |
|
5198 |
aContext sender isBlockContext ifTrue:[^ false]. |
|
5199 |
]. |
|
5200 |
]. |
|
5201 |
||
5349
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5202 |
"/ calledContext notNil ifTrue:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5203 |
"/ calledSel := calledContext selector. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5204 |
"/ calledRec := calledContext receiver. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5205 |
"/ calledRec isLazyValue ifFalse:[ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5206 |
"/ ((calledSel == #doWhile:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5207 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5208 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5209 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5210 |
"/ ((#(ensure: ifCurtailed: valueNowOrOnUnwindDo: valueOnUnwindDo: |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5211 |
"/ ) includes:calledSel) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5212 |
"/ and:[calledRec isBlock]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5213 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5214 |
"/ |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5215 |
"/ ((calledSel == #handle:do:) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5216 |
"/ and:[calledRec isExceptionHandler]) |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5217 |
"/ ifTrue:[^ false]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5218 |
"/ ]. |
64e779c7b08b
fixed stepping through ensure: blocks
Claus Gittinger <cg@exept.de>
parents:
5340
diff
changeset
|
5219 |
"/ ]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5220 |
|
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5221 |
(#(handleDo:) includes:sel) |
3447 | 5222 |
ifTrue:[ |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5223 |
(calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false]. |
3447 | 5224 |
]. |
5225 |
(#( |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5226 |
withCursor:do: |
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5227 |
withWaitCursorDo: |
3447 | 5228 |
) includes:sel) |
5229 |
ifTrue:[ |
|
5230 |
(mthdClass == TopView) ifTrue:[^ false]. |
|
5231 |
(mthdClass == ApplicationModel) ifTrue:[^ false]. |
|
5232 |
(mthdClass == WindowGroup) ifTrue:[^ false]. |
|
5233 |
]. |
|
5234 |
||
5235 |
(#( |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5236 |
wait |
3447 | 5237 |
) includes:sel) |
5238 |
ifTrue:[ |
|
5239 |
(mthdClass == Semaphore) ifTrue:[^ false]. |
|
5240 |
(mthdClass == SemaphoreSet) ifTrue:[^ false]. |
|
5241 |
]. |
|
5242 |
||
5243 |
^ true |
|
5244 |
||
5245 |
"Created: / 17.11.2001 / 22:24:06 / cg" |
|
5246 |
"Modified: / 17.11.2001 / 22:41:42 / cg" |
|
5247 |
! |
|
5248 |
||
5249 |
showingContext2:aContext nesting:nesting |
|
7823 | 5250 |
"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
|
5251 |
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
|
5252 |
not too interesting; |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5253 |
the set of methods which are suppressed is my (claus's) own choice." |
939 | 5254 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5255 |
|sel rec mClass |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5256 |
sender senderReceiver senderSelector senderReceiverClass| |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5257 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5258 |
verboseBacktrace ifTrue:[^ true]. |
3447 | 5259 |
aContext isNil ifTrue:[^ true]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5260 |
|
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5261 |
rec := aContext receiver. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5262 |
sel := aContext selector. |
939 | 5263 |
mClass := aContext methodClass. |
5264 |
||
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5265 |
sender := aContext sender. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5266 |
sender notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5267 |
senderSelector := sender selector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5268 |
senderReceiver := sender receiver. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5269 |
senderReceiverClass := senderReceiver class. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5270 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5271 |
|
939 | 5272 |
sel == #withCursor:do: ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5273 |
(mClass == WindowGroup) ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5274 |
(mClass == TopView) ifTrue:[^ false]. |
939 | 5275 |
]. |
5276 |
(sel == #withExecuteCursorDo: |
|
5277 |
or:[sel == #withWaitCursorDo:]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5278 |
(mClass == DisplaySurface) ifTrue:[^ false]. |
939 | 5279 |
]. |
5280 |
||
1484
1e1e56b84b11
in compact-stack-mode, also hide from:to:do: contexts.
Claus Gittinger <cg@exept.de>
parents:
1456
diff
changeset
|
5281 |
(sel == #do: |
6600 | 5282 |
or:[sel == #from:to:do: |
6601 | 5283 |
or:[sel == #keysAndValuesDo: |
5284 |
or:[sel == #doWithIndex:]]]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5285 |
mClass == Array ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5286 |
mClass == OrderedCollection ifTrue:[^ false]. |
6601 | 5287 |
mClass == Set ifTrue:[^ false]. |
5288 |
mClass == Dictionary ifTrue:[^ false]. |
|
5289 |
mClass == Interval ifTrue:[^ false]. |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5290 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5291 |
(sel == #perform: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5292 |
or:[sel == #perform:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5293 |
or:[sel == #perform:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5294 |
or:[sel == #perform:with:with:with: |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5295 |
or:[sel == #perform:with:with:with:with:]]]]) |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5296 |
ifTrue:[ |
1499
6ed7024b9929
show a perform: context, if its the top-one.
Claus Gittinger <cg@exept.de>
parents:
1486
diff
changeset
|
5297 |
nesting == 0 ifTrue:[^ true]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5298 |
mClass == Array ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5299 |
mClass == OrderedCollection ifTrue:[^ false]. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5300 |
]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5301 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5302 |
sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false]. |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5303 |
|
939 | 5304 |
(mClass == Object) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5305 |
(sel startsWith:'perform:') ifTrue:[^ false] |
939 | 5306 |
]. |
5307 |
||
5308 |
(mClass == Method) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5309 |
(sel startsWith:'valueWithReceiver:') ifTrue:[^ false] |
939 | 5310 |
]. |
5311 |
||
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5312 |
(mClass == SmallInteger) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5313 |
(sel == #to:do:) ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5314 |
(sel == #to:by:do:) ifTrue:[^ false]. |
952
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5315 |
]. |
9f203aab32a4
skip intermediate lazyMethod loading contexts
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5316 |
|
939 | 5317 |
(mClass == Block) ifTrue:[ |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5318 |
sel == #ensure: ifTrue:[^ false]. |
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5319 |
sel == #ifCurtailed: ifTrue:[^ false]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5320 |
sel == #valueNowOrOnUnwindDo: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5321 |
sel == #valueOnUnwindDo: ifTrue:[^ false]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5322 |
sel == #on:do: ifTrue:[^ false]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5323 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5324 |
sel == #value ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5325 |
sel == #value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5326 |
sel == #value:value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5327 |
sel == #value:value:value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5328 |
sel == #value:value:value:value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5329 |
sel == #value:value:value:value:Value: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5330 |
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
|
5331 |
]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5332 |
|
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5333 |
aContext isBlockContext ifTrue:[ |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5334 |
"/ sel == #value ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5335 |
"/ sel == #value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5336 |
"/ sel == #value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5337 |
"/ sel == #value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5338 |
"/ sel == #value:value:value:value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5339 |
"/ sel == #value:value:value:value:Value: ifTrue:[^ false]. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5340 |
"/ 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
|
5341 |
|
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5342 |
"/ (senderSelector == #answer:do:) ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5343 |
"/ senderReceiverClass == QuerySignal ifTrue:[ |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5344 |
"/ ^ false |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5345 |
"/ ] |
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5346 |
"/ ] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5347 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5348 |
aContext home notNil ifTrue:[ |
5271
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5349 |
aContext home receiver isLazyValue ifFalse:[ |
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5350 |
(aContext home receiver isMemberOf:Semaphore) ifTrue:[ |
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5351 |
(aContext home selector == #wait) ifTrue:[^ false] |
d7800a8994b7
avoid triggering lazy values
Claus Gittinger <cg@exept.de>
parents:
5269
diff
changeset
|
5352 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5353 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5354 |
] |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5355 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5356 |
|
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5357 |
(rec isExceptionHandler) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5358 |
sel == #handle:do: ifTrue:[^ false]. |
3723
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5359 |
sel == #handleDo: ifTrue:[^ false]. |
250da8f1a968
Treat new #ensure, #ifCurtailed, #on:do:
Stefan Vogel <sv@exept.de>
parents:
3702
diff
changeset
|
5360 |
(sel startsWith:#raise) ifTrue:[^ false]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5361 |
sel == #answer:do: ifTrue:[^ false]. |
1388
d127d4379a60
more contexts suppressed in dense-backtrace
Claus Gittinger <cg@exept.de>
parents:
1386
diff
changeset
|
5362 |
]. |
5269
a8be1af4cd35
avoid triggering lazy and future values when showing the context.
Claus Gittinger <cg@exept.de>
parents:
5195
diff
changeset
|
5363 |
(rec isLazyValue not and:[ rec isException] ) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5364 |
sel == #doRaise ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5365 |
sel == #doCallHandler: ifTrue:[^ false]. |
2312 | 5366 |
(sel == #raise or:[sel == #raiseRequest]) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5367 |
senderReceiverClass == Signal ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5368 |
] |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5369 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5370 |
(mClass == Context) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5371 |
sel == #unwind ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5372 |
sel == #unwind: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5373 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5374 |
(mClass == ProcessorScheduler) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5375 |
sel == #interruptActive ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5376 |
sel == #threadSwitch: ifTrue:[^ false]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5377 |
sel == #suspend: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5378 |
]. |
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5379 |
mClass == Process ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5380 |
sel == #suspendWithState: ifTrue:[^ false]. |
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5381 |
]. |
936
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5382 |
^ true. |
34f8d67c4932
allow dense & verbose context-chain display.
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
5383 |
|
1394
7765db9114ff
more context hiding in dense-walkback mode
Claus Gittinger <cg@exept.de>
parents:
1388
diff
changeset
|
5384 |
"Modified: / 15.1.1998 / 19:47:36 / cg" |
3447 | 5385 |
"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
|
5386 |
! ! |
ff3fdaa72df6
In #destroy CodeView>>contents: has been called and caused a
Stefan Vogel <sv@exept.de>
parents:
1213
diff
changeset
|
5387 |
|
4859 | 5388 |
!DebugView methodsFor:'private-control loop'! |
266 | 5389 |
|
5390 |
controlLoop |
|
5391 |
"this is a kludge: |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5392 |
start a dispatchloop which exits when |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5393 |
either continue, return or step is pressed |
266 | 5394 |
" |
5395 |
||
5396 |
haveControl := true. |
|
664 | 5397 |
[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5398 |
[haveControl] whileTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5399 |
self controlLoopCatchingErrors |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5400 |
]. |
3597
2e7fc0ae28c9
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3593
diff
changeset
|
5401 |
] ensure:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5402 |
catchBlock := nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5403 |
haveControl := false |
266 | 5404 |
]. |
664 | 5405 |
|
5406 |
"Modified: 9.7.1996 / 18:29:09 / cg" |
|
266 | 5407 |
! |
5408 |
||
5409 |
controlLoopCatchingErrors |
|
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
5410 |
"this is the debuggers own private event handling loop; |
1187 | 5411 |
errors are caught, to prevent recursive debugger-invocations." |
328
bdfe5bbd376d
ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents:
317
diff
changeset
|
5412 |
|
266 | 5413 |
"setup a self removing catch-block" |
5414 |
catchBlock := [catchBlock := nil. ^ nil]. |
|
5415 |
||
5416 |
(exclusive or:[windowGroup isNil]) ifTrue:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5417 |
"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
|
5418 |
we start another dispatch loop, which exits when |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5419 |
either continue, return or step is pressed |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5420 |
or (via the catchBlock) if an error occurs. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5421 |
Since our display is an extra exclusive one, |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5422 |
all processing for normal views stops here ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5423 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5424 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5425 |
WindowGroup setActiveGroup:windowGroup. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5426 |
SignalSet anySignal handle:[:ex | |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5427 |
|signal| |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5428 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5429 |
signal := ex signal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5430 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5431 |
self showError:'*** Error in modal debugger: |
266 | 5432 |
|
334 | 5433 |
>>>> Signal: ' , signal printString , ' |
266 | 5434 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 5435 |
>>>> From: ' , ex suspendedContext sender printString , ' |
5436 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
5437 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
5438 |
>>>> : ' , 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
|
5439 |
>>>> : ' , 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
|
5440 |
>>>> : ' , 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
|
5441 |
>>>> : ' , 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
|
5442 |
>>>> : ' , 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
|
5443 |
>>>> : ' , 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
|
5444 |
>>>> : ' , 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
|
5445 |
>>>> : ' , 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
|
5446 |
>>>> : ' , 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
|
5447 |
>>>> : ' , 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
|
5448 |
>>>> : ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , ' |
4816 | 5449 |
>>>> Message: ' , ex description , ' |
266 | 5450 |
|
1187 | 5451 |
caught & ignored.'. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5452 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5453 |
] do:[ |
4816 | 5454 |
UserNotification handle:[:ex | |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5455 |
(ex signal == ActivityNotificationSignal) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5456 |
ex proceed |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5457 |
]. |
6361
d1145c85e0fb
oops - must proceed after catching a UserNotification
Claus Gittinger <cg@exept.de>
parents:
6275
diff
changeset
|
5458 |
self showError:ex description. |
d1145c85e0fb
oops - must proceed after catching a UserNotification
Claus Gittinger <cg@exept.de>
parents:
6275
diff
changeset
|
5459 |
ex proceed. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5460 |
] do:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5461 |
device dispatchModalWhile:[Processor activeProcess state:#debug. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5462 |
haveControl]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5463 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5464 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5465 |
WindowGroup setActiveGroup:nil. |
266 | 5466 |
] ifFalse:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5467 |
"we do have multiple processes - |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5468 |
simply enter the DebugViews-Windowgroup event loop. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5469 |
effectively suspending event processing for the currently |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5470 |
active group. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5471 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5472 |
SignalSet anySignal handle:[:ex | |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
5473 |
|answer signal eMsg| |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5474 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5475 |
signal := ex signal. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5476 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5477 |
DebuggingDebugger ~~ true ifTrue:[ |
6172 | 5478 |
(signal == ActivityNotification) ifTrue:[ |
5479 |
ex proceed |
|
5480 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5481 |
"/ |
7888 | 5482 |
"/ ignore exceptions which say they explicitly have to be ignored |
5483 |
"/ |
|
5484 |
ex catchInDebugger ifTrue:[ |
|
5485 |
'DebugView [info]: ',signal printString,'-signal in debugger cought for close' infoPrintCR. |
|
5486 |
self destroy. |
|
5487 |
ex reject |
|
5488 |
]. |
|
5489 |
||
5490 |
"/ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5491 |
"/ ignore recursive breakpoints |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5492 |
"/ |
3431 | 5493 |
(signal isControlInterrupt) ifTrue:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5494 |
ignoreBreakpoints == true ifTrue:[ |
3447 | 5495 |
'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR. |
8181 | 5496 |
('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
|
5497 |
ex proceed |
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5498 |
]. |
1762
cd2bec8238fa
ignare halts while handling my own events.
Claus Gittinger <cg@exept.de>
parents:
1753
diff
changeset
|
5499 |
]. |
3447 | 5500 |
(signal == TerminateProcessRequest) ifTrue:[ |
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5501 |
"/ mhm - someone wants to shoot me down while debugging ... |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5502 |
answer := Dialog |
3447 | 5503 |
choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs |
5504 |
labels:#( 'Ignore' 'Close & terminate' ) |
|
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5505 |
values:#( #proceed #close ) |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5506 |
default:#close. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5507 |
answer == #close ifTrue:[ |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5508 |
self destroy. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5509 |
ex reject |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5510 |
]. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5511 |
ex return. |
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5512 |
]. |
3447 | 5513 |
signal == RecursiveExceptionError ifTrue:[ |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
5514 |
(ex parameter signal == BreakPointInterrupt) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5515 |
ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5516 |
'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5517 |
ex proceed. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5518 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5519 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5520 |
self showError:'*** Recursive error in debugger: |
266 | 5521 |
|
5522 |
>>>> Signal: ' , ex signal printString , ' |
|
448 | 5523 |
>>>> ' , ex parameter signal printString , ' |
266 | 5524 |
>>>> In: ' , ex suspendedContext printString , ' |
1016 | 5525 |
>>>> From: ' , ex suspendedContext sender printString , ' |
5526 |
>>>> : ' , ex suspendedContext sender sender printString , ' |
|
5527 |
>>>> : ' , ex suspendedContext sender sender sender printString , ' |
|
5528 |
>>>> : ' , ex suspendedContext sender sender sender sender printString , ' |
|
4816 | 5529 |
>>>> Message: ' , ex description , ' |
266 | 5530 |
|
1187 | 5531 |
caught & ignored.'. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5532 |
ex return |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5533 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5534 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5535 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5536 |
self topView raiseDeiconified. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5537 |
|
4816 | 5538 |
eMsg := ex description. |
3431 | 5539 |
(ex signal isControlInterrupt) ifTrue:[ |
2589
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
5540 |
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
|
5541 |
]. |
2342403139a7
extract selector from selection (as in browser)
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
5542 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5543 |
answer := Dialog |
3447 | 5544 |
choose:('Error in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs) |
5545 |
labels:#( 'Proceed' 'Cancel' 'Debug' ) |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5546 |
values:#( #proceed #cancel #debug ) |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5547 |
default:#cancel. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5548 |
answer == #debug ifTrue:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5549 |
'DebugView [info]: cought exception - debugging' infoPrintCR. |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
5550 |
Debugger |
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
5551 |
enterUnconditional:(ex suspendedContext) |
3447 | 5552 |
withMessage:'Error in debugger: ' , eMsg |
2317
c2000833c86d
care mayProceed information.
Claus Gittinger <cg@exept.de>
parents:
2313
diff
changeset
|
5553 |
mayProceed:true. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5554 |
ex proceed. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5555 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5556 |
answer == #proceed ifTrue:[ |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5557 |
'DebugView [info]: ignored exception - proceeding' infoPrintCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5558 |
ex proceed. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5559 |
]. |
2445
acd747458906
allow for breaks/halts in doIts to be optionally
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
5560 |
'DebugView [info]: cought exception - returning' infoPrintCR. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5561 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5562 |
] do:[ |
2358 | 5563 |
"/ make certain that sub-debuggers, inspectors etc. |
5564 |
"/ come up on my device. |
|
5565 |
Screen currentScreenQuerySignal answer:device |
|
5566 |
do:[ |
|
3447 | 5567 |
windowGroup |
5568 |
eventLoopWhile:[Processor activeProcess state:#debug. |
|
5569 |
true] |
|
5570 |
onLeave:[] |
|
2358 | 5571 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5572 |
]. |
266 | 5573 |
]. |
5574 |
catchBlock := nil. |
|
5575 |
||
1409
2ea39caf7f00
handle process termination gracefully
Claus Gittinger <cg@exept.de>
parents:
1408
diff
changeset
|
5576 |
"Created: / 24.11.1995 / 20:33:45 / cg" |
3447 | 5577 |
"Modified: / 18.11.2001 / 01:04:17 / cg" |
266 | 5578 |
! ! |
5579 |
||
0 | 5580 |
!DebugView methodsFor:'user interaction'! |
5581 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5582 |
checkIfCodeIsReallyModified |
6616 | 5583 |
|source| |
5584 |
||
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5585 |
codeView modified ifFalse:[^ false]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5586 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5587 |
currentMethod isNil ifTrue:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5588 |
^ false |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5589 |
]. |
6616 | 5590 |
source := currentMethod source. |
5591 |
source notNil ifTrue:[ |
|
5592 |
source string = codeView contents string ifTrue:[ |
|
5593 |
^ false |
|
5594 |
]. |
|
5595 |
(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[ |
|
5596 |
^ false |
|
5597 |
]. |
|
5598 |
]. |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5599 |
^ true |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5600 |
! |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5601 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5602 |
checkSelectionChangeAllowed |
2678
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5603 |
^ self checkSelectionChangeAllowed:nil |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5604 |
! |
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5605 |
|
90eb8be47ac4
avoid annoying modified-code dialog when reselecting the same
Claus Gittinger <cg@exept.de>
parents:
2633
diff
changeset
|
5606 |
checkSelectionChangeAllowed:newSelection |
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5607 |
self checkIfCodeIsReallyModified ifFalse:[^ true]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5608 |
|
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5609 |
(newSelection notNil |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5610 |
and:[newSelection = contextView selection]) ifTrue:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5611 |
^ true |
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5612 |
]. |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5613 |
|
3097
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5614 |
(self confirm:('Code modified - change selection anyway ?')) ifFalse:[ |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5615 |
^ false |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5616 |
]. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5617 |
codeView modified:false. |
dada585e916d
really modfified test (in step, ...)
Claus Gittinger <cg@exept.de>
parents:
3094
diff
changeset
|
5618 |
|
1765
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5619 |
^ true |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5620 |
! |
a704122c92dc
confirm close/selection change if codeView was modified without
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
5621 |
|
266 | 5622 |
codeAccept:someCode |
5623 |
"user wants some code to be recompiled - must unwind stack since everything above |
|
5624 |
and including selected method cannot be continued." |
|
5625 |
||
7553
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
5626 |
^ 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
|
5627 |
|
83cbd8707d1e
do not unwind after an accept.
Claus Gittinger <cg@exept.de>
parents:
7481
diff
changeset
|
5628 |
"Modified: / 28-11-2006 / 19:49:04 / cg" |
266 | 5629 |
! |
5630 |
||
3447 | 5631 |
codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction |
3427 | 5632 |
"user wants some code to be recompiled - must unwind stack since everything above |
5633 |
and including selected method cannot be continued." |
|
5634 |
||
5635 |
" |
|
5636 |
actually, this is not true, since the active methods will still be |
|
5637 |
executed correctly - however, the code shown in the debugger is no |
|
5638 |
longer in sync (showing the new code) with the executed code. |
|
5639 |
Therefore, we hide those contexts to avoid confusion .... |
|
5640 |
If you dont like this behavior, remove the 'inspecting ifFalse:' check below" |
|
5641 |
||
5642 |
"walk up context chain and find highest context which is either the selected context, |
|
5643 |
or - if its a block-context - whose home is the selected context" |
|
5644 |
||
5645 |
|con top sel implementorClass method newMethod category| |
|
5646 |
||
5647 |
codeView withWaitCursorDo:[ |
|
5648 |
" |
|
5649 |
find the method-home context for this one |
|
5650 |
" |
|
5651 |
con := selectedContext. |
|
5652 |
top := con. |
|
5653 |
[con notNil] whileTrue:[ |
|
5654 |
(con methodHome == selectedContext) ifTrue:[ |
|
5655 |
top := con |
|
5656 |
]. |
|
5657 |
con := con sender |
|
5658 |
]. |
|
3447 | 5659 |
|
3427 | 5660 |
" |
5661 |
use class&selector to find the method for the compilation |
|
5662 |
and compile. |
|
5663 |
" |
|
3447 | 5664 |
category := givenCategoryOrNil. |
3427 | 5665 |
sel := selectedContext selector. |
5666 |
implementorClass := selectedContext methodClass. |
|
5667 |
implementorClass notNil ifTrue:[ |
|
3447 | 5668 |
category isNil ifTrue:[ |
5669 |
method := implementorClass compiledMethodAt:sel. |
|
5670 |
category := method category |
|
5671 |
] |
|
3427 | 5672 |
] ifFalse:[ |
5673 |
implementorClass := selectedContext receiver class. |
|
5674 |
implementorClass ~~ Object ifTrue:[ |
|
5675 |
implementorClass := Dialog |
|
3447 | 5676 |
request:('Define ''%1'' in class:' bindWith:sel allBold) |
3427 | 5677 |
initialAnswer:implementorClass name |
5678 |
list:(implementorClass withAllSuperclasses collect:[:each| each name]). |
|
5679 |
implementorClass size == 0 ifTrue:[ |
|
5680 |
^ cancelAction value "/ cancelled |
|
5681 |
]. |
|
3928 | 5682 |
implementorClass := Smalltalk classNamed:implementorClass. |
3427 | 5683 |
implementorClass isNil ifTrue:[ |
3447 | 5684 |
Dialog warn:'No such class'. |
3427 | 5685 |
^ cancelAction value "/ cancelled |
5686 |
]. |
|
5687 |
]. |
|
5688 |
]. |
|
5689 |
||
5690 |
"/ |
|
5691 |
"/ provide the classes nameSpace on a query; |
|
5692 |
"/ in case we accept while in another nameSpace context, |
|
5693 |
"/ (but for a class which is somewhere else) |
|
5694 |
"/ |
|
6818
8f6c68046792
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
6815
diff
changeset
|
5695 |
(Class updateChangeFileQuerySignal, |
8f6c68046792
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
6815
diff
changeset
|
5696 |
Class updateChangeListQuerySignal, |
8f6c68046792
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
6815
diff
changeset
|
5697 |
Class updateHistoryLineQuerySignal) answer:true |
3427 | 5698 |
do:[ |
6171
5ea312ba7d88
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
6136
diff
changeset
|
5699 |
Class nameSpaceQuerySignal |
5ea312ba7d88
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
6136
diff
changeset
|
5700 |
answer:(implementorClass nameSpace) |
3427 | 5701 |
do:[ |
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5702 |
Class packageQuerySignal |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5703 |
answer:(implementorClass package ? Project noProjectID) |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5704 |
do:[ |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5705 |
codeView contents:someCode. |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5706 |
newMethod := implementorClass compilerClass |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5707 |
compile:someCode |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5708 |
forClass:implementorClass |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5709 |
inCategory:category |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5710 |
notifying:codeView. |
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5711 |
]. |
3427 | 5712 |
]. |
5713 |
]. |
|
5714 |
||
5715 |
inspecting ifFalse:[ |
|
5716 |
" |
|
5717 |
if it worked, remove everything up to and including top |
|
5718 |
from context chain |
|
5719 |
" |
|
5720 |
(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[ |
|
5721 |
codeView modified:false. |
|
5722 |
||
5723 |
doUnwind ifTrue:[ |
|
3447 | 5724 |
selectedContext canReturn ifTrue:[ |
5725 |
self setContext:(top "sender"). |
|
5726 |
exitAction := #restart. |
|
5727 |
selectedContext setLineNumber:1. |
|
5728 |
self doRestart. |
|
5729 |
] ifFalse:[ |
|
5730 |
self setContext:(top sender). |
|
5731 |
exitAction := #return. |
|
5732 |
]. |
|
3427 | 5733 |
|
5734 |
" |
|
5735 |
continue/step is no longer possible |
|
5736 |
" |
|
4120 | 5737 |
"/ continueButton disable. |
5738 |
"/ canContinue := false. |
|
3427 | 5739 |
]. |
3447 | 5740 |
|
5741 |
contextView selection:1. |
|
5742 |
"/ self showSelection:1. |
|
5743 |
"/ contextView makeSelectionVisible. "/ scrollToLine:(selection - 1) |
|
3427 | 5744 |
] ifFalse:[ |
5745 |
^ cancelAction value |
|
5746 |
] |
|
5747 |
]. |
|
5748 |
]. |
|
5749 |
||
7065
a6e34a47f7fb
accept in the debugger always assignes the classes'
Claus Gittinger <cg@exept.de>
parents:
7000
diff
changeset
|
5750 |
"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
|
5751 |
"Modified: / 29-08-2006 / 14:22:22 / cg" |
3427 | 5752 |
! |
5753 |
||
7912 | 5754 |
codeCompletion |
5755 |
|cls| |
|
5756 |
||
8212 | 5757 |
currentMethod isNil ifTrue:[ ^ self ]. |
7912 | 5758 |
cls := currentMethod mclass. |
8212 | 5759 |
cls isNil ifTrue:[ ^ self ]. |
5760 |
||
7912 | 5761 |
UserInformation handle:[:ex | |
5762 |
ex proceed. |
|
5763 |
] do:[ |
|
5764 |
DoWhatIMeanSupport codeCompletionForClass:cls codeView:codeView. |
|
5765 |
]. |
|
5766 |
! |
|
5767 |
||
3570
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5768 |
confirm:aString |
6971 | 5769 |
"open a modal yes-no dialog. |
5770 |
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
|
5771 |
|
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5772 |
(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
|
5773 |
^ true |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5774 |
]. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5775 |
^ super confirm:aString. |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5776 |
! |
da6d661593d8
Exclusive debugger (on top of scheduler process) is working again.
Stefan Vogel <sv@exept.de>
parents:
3542
diff
changeset
|
5777 |
|
1284
091454814297
try to catch more errors when showing sourceCode
Claus Gittinger <cg@exept.de>
parents:
1281
diff
changeset
|
5778 |
doShowSelection:lineNr |
301
cd15cb77e4b6
show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
5779 |
"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
|
5780 |
Also sent to autoselect an interesting context on entry." |
0 | 5781 |
|
3447 | 5782 |
BreakPointInterrupt handle:[:ex | |
6215 | 5783 |
ignoreBreakpoints ifFalse:[ex reject]. |
3447 | 5784 |
'DebugView [info]: breakpoint in debugger ignored [doShowSelection.]' infoPrintCR. |
5785 |
ex proceed |
|
5786 |
] do:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5787 |
self updateForContext:lineNr |
3269 | 5788 |
]. |
5789 |
self updateMenuItems |
|
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
5790 |
|
3447 | 5791 |
"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
|
5792 |
! |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
5793 |
|
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5794 |
hideStackInspector |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5795 |
stackInspector notNil ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5796 |
stackInspector destroy. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5797 |
stackInspector := nil. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5798 |
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
|
5799 |
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
|
5800 |
] |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5801 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5802 |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5803 |
processEvent:anEvent |
6129 | 5804 |
"filter keyboard events for popUp variable value display. |
5805 |
Return true, if I have eaten the event" |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5806 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5807 |
|evView focusView key rawKey inCodeView| |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5808 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5809 |
evView := anEvent view. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5810 |
evView notNil ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5811 |
focusView := evView windowGroup focusView. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5812 |
focusView isNil ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5813 |
focusView := evView. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5814 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5815 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5816 |
anEvent isKeyPressEvent ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5817 |
key := anEvent key. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5818 |
rawKey := anEvent rawKey. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5819 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5820 |
inCodeView := (focusView == codeView |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5821 |
or:[focusView isComponentOf:codeView]). |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5822 |
inCodeView ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5823 |
key == #CodeCompletion ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5824 |
"/ complete the word before/under the cursor. |
7912 | 5825 |
self sensor |
5826 |
pushUserEvent:#codeCompletion |
|
5827 |
for:self |
|
5828 |
withArguments:#(). |
|
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5829 |
^ true |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5830 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5831 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5832 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5833 |
|
3602 | 5834 |
false ifTrue:[ |
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5835 |
anEvent isButtonReleaseEvent ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5836 |
anEvent view == codeView ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5837 |
(RBParser notNil and:[RBParser isLoaded]) |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5838 |
ifTrue:[ |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5839 |
self sensor |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5840 |
pushEvent:anEvent. "/ must be first in queue |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5841 |
|
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5842 |
self sensor |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5843 |
pushUserEvent:#explainSelection |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5844 |
for:self |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5845 |
withArguments:nil. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5846 |
^ true "/ eaten |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5847 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5848 |
] |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5849 |
]. |
3602 | 5850 |
]. |
5851 |
||
3517
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5852 |
]. |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5853 |
^ false |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5854 |
! |
df36801b26b7
preps for flyBy-value-display
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5855 |
|
8212 | 5856 |
setCurrentMethod:aMethodOrNil |
5857 |
currentMethod := aMethodOrNil. |
|
5858 |
! |
|
5859 |
||
1327 | 5860 |
showSelection:lineNr |
5861 |
"user clicked on a header line - show selected code in textView. |
|
5862 |
Also sent to autoselect an interesting context on entry." |
|
5863 |
||
5842 | 5864 |
Notification |
5865 |
handle: |
|
5866 |
[:ex | |
|
5879 | 5867 |
"/ ex suspendedContext fullPrintAll. |
5868 |
Transcript showCR:ex description. |
|
5869 |
"/ Transcript showCR:ex parameter. |
|
5842 | 5870 |
ex proceed |
5871 |
] |
|
5872 |
do: |
|
5873 |
[ |
|
5874 |
Error |
|
5875 |
handle: |
|
5876 |
[:ex | |
|
5877 |
|s con| |
|
5878 |
||
5879 |
ex signal isControlInterrupt |
|
5880 |
ifTrue: |
|
5881 |
[ |
|
5882 |
'DebugView [info]: halt/break ignored - while showing selection in debugger' infoPrintCR. |
|
5883 |
ex proceed |
|
5884 |
]. |
|
5885 |
||
5886 |
'DebugView [info]: error when showing selection in debugger ignored' infoPrintCR. |
|
5887 |
||
5888 |
s := '' writeStream. |
|
5889 |
s nextPutLine:'**** error in debugger, while extracting source'. |
|
5890 |
s nextPutLine:'****'. |
|
6815 | 5891 |
s nextPutAll: '**** '; nextPutLine:(ex description "withCRs"). |
5842 | 5892 |
s nextPutLine:'****'. |
5893 |
con := ex suspendedContext. |
|
5894 |
s nextPutAll: '**** '; nextPutLine:(con printString). |
|
5895 |
con := con sender. |
|
5896 |
||
5897 |
con fullPrintAllOn:s. |
|
5898 |
||
5899 |
"/ [con notNil] whileTrue:[ |
|
5900 |
"/ Error catch:[:ex | |
|
5901 |
"/ s nextPutAll: '**** '; nextPutLine:(con printString). |
|
5902 |
"/ ]. |
|
4947 | 5903 |
"/ |
5842 | 5904 |
"/ (con receiver == self and:[con selector == #'enter:select:']) ifTrue:[ |
5905 |
"/ con := nil |
|
5906 |
"/ ] ifFalse:[ |
|
5907 |
"/ con := con sender. |
|
5908 |
"/ ] |
|
5909 |
"/ ]. |
|
5910 |
codeView contents:(s contents). |
|
5911 |
ex return. |
|
5912 |
] |
|
5913 |
do: |
|
5914 |
[ |
|
5915 |
self doShowSelection:lineNr |
|
5916 |
] |
|
5917 |
] |
|
1327 | 5918 |
|
6815 | 5919 |
"Modified: / 04-07-2006 / 14:50:06 / cg" |
1327 | 5920 |
! |
5921 |
||
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5922 |
showStackInspectorFor:con |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5923 |
stackInspector isNil ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5924 |
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
|
5925 |
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
|
5926 |
stackInspector := InspectorView |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5927 |
origin:(0.6 @ 0.0) |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5928 |
corner:(1.0 @ 1.0) |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5929 |
in:contextInspector superView. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5930 |
stackInspector realize. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5931 |
stackInspector fieldListLabel:'Stack'. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5932 |
stackInspector hideReceiver:true |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5933 |
]. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5934 |
stackInspector inspect:(con stackFrame asArray). |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5935 |
stackInspector showLast |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5936 |
! |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5937 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
5938 |
updateForContext:lineNr |
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
5939 |
"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
|
5940 |
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
|
5941 |
|
56 | 5942 |
|con homeContext sel method code canAccept |
105 | 5943 |
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
|
5944 |
sender selSender tryVars possibleBlocks errMsg |
3269 | 5945 |
codeSet highlighter evaluatorClass |
3187 | 5946 |
canDefine| |
5947 |
||
5948 |
canDefine := false. |
|
8212 | 5949 |
self setCurrentMethod:nil. |
1804
dcb4f893ce7d
remember current method - only ask for modification
Claus Gittinger <cg@exept.de>
parents:
1776
diff
changeset
|
5950 |
|
1309
f13dd58a3943
dont break if MessageTracer is not present
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
5951 |
contextArray notNil ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5952 |
lineNr <= contextArray size ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5953 |
con := contextArray at:lineNr. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5954 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5955 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5956 |
clicking on the '** ...'-line shows more ... |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5957 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5958 |
con isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5959 |
line := contextView list at:lineNr. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5960 |
(line startsWith:'**') ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5961 |
self showMore. |
1408
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
5962 |
lineNr >= contextArray size ifTrue:[ |
e96cd72d100a
oops - care for non-existing line after showMore
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
5963 |
contextView setSelection:lineNr. |
2299 | 5964 |
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
|
5965 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5966 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5967 |
con isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5968 |
codeView contents:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5969 |
^ self |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5970 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5971 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5972 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5973 |
selectedContext := con. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5974 |
m := contextView middleButtonMenu. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5975 |
(m notNil and:[selectedContext notNil]) ifTrue:[ |
2577
14b7cc070a6b
added implementorsOf and sendersOf menu functions
Claus Gittinger <cg@exept.de>
parents:
2554
diff
changeset
|
5976 |
m enableAll:#(browseImplementors browseSenders inspectContext) |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5977 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5978 |
|
1661 | 5979 |
self withExecuteCursorDo:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5980 |
codeSet := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5981 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5982 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5983 |
give it to the (lower right) inspector |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5984 |
" |
6247 | 5985 |
Error handle:[:ex | |
5986 |
'DebugView [warning]: error while accessing context' errorPrintCR. |
|
5987 |
contextInspector inspect:nil. |
|
5988 |
ex reject. |
|
5989 |
] do:[ |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5990 |
contextInspector inspect:con. |
3427 | 5991 |
contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector. |
6247 | 5992 |
]. |
1386
55632b45ced2
more skipping in dense backtrace
Claus Gittinger <cg@exept.de>
parents:
1372
diff
changeset
|
5993 |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5994 |
"/ show a stack inspector sometimes |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5995 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5996 |
con hasStackToShow ifTrue:[ |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5997 |
self showStackInspectorFor:con |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
5998 |
] ifFalse:[ |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
5999 |
self hideStackInspector |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6000 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6001 |
|
7328 | 6002 |
homeContext := con methodHome. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6003 |
con canReturn ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6004 |
returnButton enable. restartButton enable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6005 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6006 |
returnButton disable. restartButton disable. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6007 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6008 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6009 |
lineNrInMethod := con lineNumber. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6010 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6011 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6012 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6013 |
homeContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6014 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6015 |
mhmh - an optimized block |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6016 |
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
|
6017 |
that one ... |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6018 |
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
|
6019 |
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
|
6020 |
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
|
6021 |
(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
|
6022 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6023 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6024 |
"temporary kludge - peek into the sender context. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6025 |
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
|
6026 |
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
|
6027 |
This helps in some cases. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6028 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6029 |
(sender := con sender) notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6030 |
tryVars := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6031 |
(selSender := sender selector) notNil ifTrue:[ |
3121
4cb4b3a3c1e2
allow accepting after a doesnot understand
Claus Gittinger <cg@exept.de>
parents:
3097
diff
changeset
|
6032 |
((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[ |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6033 |
tryVars := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6034 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6035 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6036 |
tryVars ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6037 |
possibleBlocks := sender argsAndVars select:[:v | v isBlock]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6038 |
possibleBlocks := possibleBlocks select:[:b | b home isNil]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6039 |
possibleBlocks size == 1 ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6040 |
method := possibleBlocks first method. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6041 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6042 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6043 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6044 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6045 |
"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
|
6046 |
rec := homeContext receiver. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6047 |
sel := homeContext selector. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6048 |
sel notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6049 |
canAccept := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6050 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6051 |
implementorClass := homeContext methodClass. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6052 |
implementorClass isNil ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
6053 |
Error handle:[:ex | |
3432
087493c18c74
class based exceptions - no longer need to send #breakPointSÃgnal
Claus Gittinger <cg@exept.de>
parents:
3431
diff
changeset
|
6054 |
ex signal == BreakPointInterrupt ifTrue:[ |
2397 | 6055 |
ex proceed. |
6056 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6057 |
code := 'error while asking method for its source'. |
2258 | 6058 |
code := code , Character cr , ex signal printString. |
6059 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6060 |
||
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6061 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6062 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6063 |
] do:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6064 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6065 |
special: look if this context was created by |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6066 |
valueWithReceiver kind of method invocation; |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6067 |
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
|
6068 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6069 |
((sender := homeContext sender) notNil |
4947 | 6070 |
and:[((sender selector ? '') startsWith:'valueWithReceiver:') |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6071 |
and:[sender receiver isMethod]]) ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6072 |
method := sender receiver. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6073 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6074 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6075 |
(method := con method) notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6076 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6077 |
] |
5664 | 6078 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6079 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6080 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6081 |
method := implementorClass compiledMethodAt:sel. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6082 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6083 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6084 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6085 |
code isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6086 |
errMsg := nil. |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6087 |
method isNil ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6088 |
"/ fall back heuristics |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6089 |
con isBlockContext ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6090 |
((sender := con sender) notNil |
4947 | 6091 |
and:[((sender selector ? '') startsWith:'value') |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6092 |
and:[sender receiver isBlock]]) ifTrue:[ |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6093 |
code := sender receiver source. |
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6094 |
] |
5170
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6095 |
] ifFalse:[ |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6096 |
((sender := con sender) notNil |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6097 |
and:[((sender selector ? '') startsWith:'valueWith') |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6098 |
and:[sender receiver isMethod]]) ifTrue:[ |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6099 |
method := sender receiver. |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6100 |
] |
ff0a0819503d
showing the source of a called method
Claus Gittinger <cg@exept.de>
parents:
5117
diff
changeset
|
6101 |
] |
4932
0758cd0b8ce9
show source of blocks if possible
Claus Gittinger <cg@exept.de>
parents:
4892
diff
changeset
|
6102 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6103 |
method notNil ifTrue:[ |
4644
e6dd5c21b9c0
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
4356
diff
changeset
|
6104 |
Error handle:[:ex | |
3431 | 6105 |
ex signal isControlInterrupt ifTrue:[ |
2397 | 6106 |
ex proceed. |
6107 |
]. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6108 |
code := 'error while asking method for its source'. |
2258 | 6109 |
code := code , Character cr , ex signal printString. |
6110 |
code := code , Character cr , 'in: ' , ex suspendedContext printString. |
|
6111 |
||
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6112 |
canAccept := false. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6113 |
ex return. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6114 |
] do:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6115 |
self sensor shiftDown ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6116 |
code := method decompiledSource |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6117 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6118 |
code := method source. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6119 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6120 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6121 |
code isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6122 |
method sourceFilename notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6123 |
codeView contents:(resources |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6124 |
string:'** no sourcefile: %1 **' |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6125 |
with:method sourceFilename). |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6126 |
codeView flash. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6127 |
codeSet := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6128 |
] ifFalse:[ |
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6129 |
[ |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6130 |
|src| |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6131 |
|
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6132 |
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
|
6133 |
codeView contents:src. |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6134 |
codeSet := true. |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6135 |
] on: Error do:[ |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6136 |
errMsg := '** no source **' |
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6137 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6138 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6139 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6140 |
] ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6141 |
homeContext isNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6142 |
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
|
6143 |
] ifFalse:[ |
3187 | 6144 |
errMsg := '** no method - no source **'. |
6145 |
canDefine := true. |
|
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6146 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6147 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6148 |
errMsg notNil ifTrue:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6149 |
self showError:errMsg. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6150 |
codeSet := true. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6151 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6152 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6153 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6154 |
code isNil ifTrue:[ |
3121
4cb4b3a3c1e2
allow accepting after a doesnot understand
Claus Gittinger <cg@exept.de>
parents:
3097
diff
changeset
|
6155 |
"/ canAccept := false. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6156 |
codeSet ifFalse:[ |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6157 |
codeView contents:nil. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6158 |
] |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6159 |
] ifFalse:[ |
2177 | 6160 |
lineNrInMethod == 0 ifTrue:[ |
6161 |
(method notNil and:[method isJavaMethod]) ifTrue:[ |
|
6162 |
lineNrInMethod := method lineNumber |
|
6132
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6163 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6164 |
"/ guess lineNumber from sent-messages selector |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6165 |
"/ kludge to fix lineNr-display of shared subclassResponsibility methods. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6166 |
lineNrInMethod == 0 ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6167 |
|conIdx sentContext messages| |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6168 |
|
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6169 |
conIdx := contextArray identityIndexOf:con. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6170 |
conIdx > 1 ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6171 |
sentContext := contextArray at:conIdx-1. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6172 |
sentContext isBlockContext ifFalse:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6173 |
(method notNil and:[code notNil]) ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6174 |
messages := method messagesSent. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6175 |
messages size == 1 ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6176 |
sentContext selector == messages first ifTrue:[ |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6177 |
lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6178 |
] |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6179 |
] |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6180 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6181 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6182 |
]. |
ca1f04f5232b
lineNumber display of shared subclassResponsibilityMethods
Claus Gittinger <cg@exept.de>
parents:
6129
diff
changeset
|
6183 |
]. |
2177 | 6184 |
]. |
6185 |
||
1555 | 6186 |
UserPreferences current syntaxColoring ifTrue:[ |
2709
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6187 |
implementorClass isNil ifTrue:[ |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6188 |
(con isBlockContext |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6189 |
and:[con home isNil |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6190 |
and:[con guessedHome notNil]]) |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6191 |
ifTrue:[ |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6192 |
implementorClass := con guessedHome mclass |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6193 |
] |
0c8564f828c2
syntax coloring of optimized block contexts
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
6194 |
]. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6195 |
implementorClass notNil ifTrue:[ |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6196 |
(highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[ |
5504 | 6197 |
code size < 100000 ifTrue:[ |
7481
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6198 |
Error handle:[:ex | |
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6199 |
] do:[ |
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6200 |
code := highlighter formatMethod:code in:implementorClass. |
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6201 |
] |
5504 | 6202 |
] |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6203 |
] |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6204 |
] |
1555 | 6205 |
]. |
6206 |
||
6178
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6207 |
"/ code ~= (codeView contents) ifTrue:[ |
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6208 |
codeView setContents:code. |
2944e95c6eda
faster updateFromContext (avoid Text)
Claus Gittinger <cg@exept.de>
parents:
6172
diff
changeset
|
6209 |
"/ ]. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6210 |
(lineNrInMethod notNil |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6211 |
and:[lineNrInMethod ~~ 0 |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6212 |
and:[lineNrInMethod <= codeView list size]]) ifTrue:[ |
7000 | 6213 |
lineNrInMethod == 255 ifFalse:[ |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6214 |
(lineNrInMethod == 255 |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6215 |
and:[method notNil |
1960 | 6216 |
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
|
6217 |
"/ 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
|
6218 |
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
|
6219 |
] ifFalse:[ |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6220 |
codeView selectLine:lineNrInMethod. |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6221 |
]. |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6222 |
codeView makeSelectionVisible |
7000 | 6223 |
]. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6224 |
] ifFalse:[ |
1694 | 6225 |
codeView unselect. |
1624
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6226 |
codeView scrollToTop |
5bec63471d4d
ask class for syntaxHighligter (do not format java code ...)
Claus Gittinger <cg@exept.de>
parents:
1613
diff
changeset
|
6227 |
] |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6228 |
]. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6229 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6230 |
codeView acceptEnabled:canAccept. |
1695 | 6231 |
canAccept ifTrue:[ |
6232 |
codeView acceptAction:[:code | self codeAccept:code asString] |
|
6233 |
] ifFalse:[ |
|
6046
81b2da24a0b6
Send #beep to window instead of device
Stefan Vogel <sv@exept.de>
parents:
6034
diff
changeset
|
6234 |
codeView acceptAction:[:code | self beep] |
1695 | 6235 |
]. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6236 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6237 |
receiverInspector inspect:rec. |
3427 | 6238 |
receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector. |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6239 |
|
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6240 |
" |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6241 |
the one below is wrong: currently, the |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6242 |
evaluator cannot handle passed contexts. |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6243 |
Once it does, pass con as in:-arg |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6244 |
" |
2790 | 6245 |
(rec isJavaObject |
6246 |
and:[method isNil or:[method isJavaMethod not]]) ifTrue:[ |
|
6247 |
"/ although a java object, use the smalltalk parser here for doIts. |
|
6248 |
evaluatorClass := Parser |
|
6249 |
] ifFalse:[ |
|
7999
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6250 |
(method notNil and:[method mclass notNil]) ifTrue:[ |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6251 |
evaluatorClass := method mclass evaluatorClass. |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6252 |
] ifFalse:[ |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6253 |
evaluatorClass := rec class evaluatorClass. |
557bcfac0ce5
determine compilerClass from method - not receiver
Claus Gittinger <cg@exept.de>
parents:
7981
diff
changeset
|
6254 |
]. |
2790 | 6255 |
]. |
6256 |
||
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6257 |
codeView doItAction:[:theCode | |
2790 | 6258 |
evaluatorClass |
1399
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6259 |
evaluate:theCode |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6260 |
in:actualContext |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6261 |
receiver:rec |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6262 |
notifying:codeView |
35674d7ac5bc
handle contextVars in codeViews doIt.
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
6263 |
logged:true |
4122 | 6264 |
ifFail:nil |
6265 |
]. |
|
8212 | 6266 |
self setCurrentMethod:method. |
4122 | 6267 |
|
6268 |
selectedContext := homeContext. |
|
6269 |
actualContext := con |
|
6270 |
]. |
|
6271 |
] ifFalse:[ |
|
6272 |
codeView contents:nil. |
|
6273 |
]. |
|
6274 |
codeView modified:false. |
|
6275 |
||
6276 |
con isContext ifFalse:[ |
|
6277 |
sendButton disable. |
|
6278 |
] ifTrue:[ |
|
6279 |
sendButton enable. |
|
6280 |
]. |
|
6281 |
||
6282 |
"clear out locals to prevent keeping around unneeded contexts |
|
6283 |
(due to the block held in codeView). |
|
6284 |
(not really needed, since stuff gets collected away sooner or later ... |
|
6285 |
... but this makes it a bit sooner) |
|
6286 |
" |
|
6287 |
con := nil. |
|
6288 |
homeContext := nil. |
|
6289 |
||
6290 |
canDefine ifTrue:[ |
|
6291 |
defineButton beVisible. |
|
6292 |
] ifFalse:[ |
|
6293 |
defineButton beInvisible. |
|
6294 |
]. |
|
6295 |
||
6296 |
" |
|
6297 |
enable/disable some menu items |
|
6298 |
" |
|
6299 |
self updateMenuItems |
|
6300 |
||
6849
e95621a873be
try to decompile if no source
Claus Gittinger <cg@exept.de>
parents:
6821
diff
changeset
|
6301 |
"Created: / 14-08-1997 / 20:15:00 / cg" |
7481
11c16a700dcf
ignore syntaxHighlighter errors
Claus Gittinger <cg@exept.de>
parents:
7328
diff
changeset
|
6302 |
"Modified: / 27-10-2006 / 14:19:32 / cg" |
4122 | 6303 |
! |
6304 |
||
6305 |
updateMenuItems |
|
6306 |
|m mthd cls mCls rCls| |
|
6307 |
||
6308 |
" |
|
6309 |
enable/disable some menu items |
|
6310 |
" |
|
6311 |
m := contextView middleButtonMenu. |
|
6312 |
m notNil ifTrue:[ |
|
6313 |
m disable:#removeBreakpoint. |
|
6314 |
m disable:#addBreakpoint. |
|
6315 |
canShowMore ifFalse:[ |
|
6316 |
m disable:#showMore |
|
6317 |
]. |
|
6318 |
||
6319 |
selectedContext notNil ifTrue:[ |
|
6320 |
m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn). |
|
6321 |
||
6322 |
mthd := selectedContext method. |
|
6323 |
mthd notNil ifTrue:[ |
|
6324 |
cls := mCls := mthd containingClass. |
|
6325 |
mthd isBreakpointed ifTrue:[ |
|
6326 |
m enable:#removeBreakpoint. |
|
6327 |
] ifFalse:[ |
|
6328 |
m enable:#addBreakpoint. |
|
6329 |
] |
|
6330 |
]. |
|
6331 |
rCls := selectedContext receiver class. |
|
6332 |
cls isNil ifTrue:[ |
|
6333 |
cls := rCls |
|
6334 |
]. |
|
6335 |
cls notNil ifTrue:[ |
|
6336 |
m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6337 |
rCls == mCls ifTrue:[ |
|
6338 |
m disable:#browseReceiversClass |
|
6339 |
]. |
|
6340 |
mCls isNil ifTrue:[ |
|
6341 |
m disable:#browseImplementingClass |
|
6342 |
] |
|
6343 |
||
6344 |
] ifFalse:[ |
|
6345 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6346 |
]. |
|
6347 |
] ifFalse:[ |
|
6348 |
m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol). |
|
6349 |
] |
|
6350 |
] |
|
6351 |
! ! |
|
6352 |
||
8170 | 6353 |
!DebugView::IgnoredHalt methodsFor:'accessing'! |
6354 |
||
6355 |
ignoreCount:something |
|
6356 |
ignoreCount := something. |
|
6357 |
! |
|
6358 |
||
6359 |
ignoreEndTime:something |
|
6360 |
ignoreEndTime := something. |
|
6361 |
! |
|
6362 |
||
6363 |
method |
|
8171 | 6364 |
^ methodHolder at:1 |
8170 | 6365 |
! |
6366 |
||
6367 |
method:methodArg lineNumber:lineNumberArg |
|
8171 | 6368 |
methodHolder := WeakArray with:methodArg. |
8170 | 6369 |
lineNumber := lineNumberArg. |
6370 |
! ! |
|
6371 |
||
6372 |
!DebugView::IgnoredHalt methodsFor:'misc'! |
|
6373 |
||
6374 |
decrementIgnoreCount |
|
6375 |
ignoreCount notNil ifTrue:[ |
|
6376 |
ignoreCount > 0 ifTrue:[ |
|
6377 |
ignoreCount := ignoreCount - 1 |
|
6378 |
] |
|
6379 |
] |
|
6380 |
! ! |
|
6381 |
||
6382 |
!DebugView::IgnoredHalt methodsFor:'queries'! |
|
6383 |
||
6384 |
isForMethod:aMethod line:line |
|
6385 |
line = lineNumber ifFalse:[^ false]. |
|
8171 | 6386 |
(methodHolder at:1) == aMethod ifFalse:[^ false]. |
8170 | 6387 |
|
6388 |
^ true |
|
6389 |
! |
|
6390 |
||
6391 |
isHaltIgnored |
|
6392 |
ignoreCount notNil ifTrue:[ |
|
6393 |
^ ignoreCount > 0 |
|
6394 |
]. |
|
6395 |
ignoreEndTime notNil ifTrue:[ |
|
6396 |
^ ignoreEndTime > Timestamp now |
|
6397 |
]. |
|
6398 |
||
6399 |
^ true |
|
6400 |
! |
|
6401 |
||
6402 |
isHaltIgnoredInMethod:aMethod line:line |
|
8180 | 6403 |
"/ Transcript showCR:'ign ',aMethod printString,' at ',lineNumber printString. |
8170 | 6404 |
line = lineNumber ifFalse:[^ false]. |
8171 | 6405 |
(methodHolder at:1) == aMethod ifFalse:[^ false]. |
8170 | 6406 |
|
6407 |
^ self isHaltIgnored |
|
6408 |
! ! |
|
6409 |
||
4122 | 6410 |
!DebugView class methodsFor:'documentation'! |
6411 |
||
6412 |
version |
|
8213
bb9fd96f8e8c
Fix assignment to undefined (and unused) instvar.
Stefan Vogel <sv@exept.de>
parents:
8212
diff
changeset
|
6413 |
^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.443 2008-07-14 08:35:48 stefan Exp $' |
4122 | 6414 |
! ! |
6415 |
||
6416 |
DebugView initialize! |