author | Claus Gittinger <cg@exept.de> |
Tue, 12 Jun 2001 11:57:08 +0200 | |
changeset 3023 | abe1daf204c3 |
parent 3000 | e794a357d7cb |
child 3233 | 7ee8f7099595 |
permissions | -rw-r--r-- |
52 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2768 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
982 | 15 |
SystemStatusMonitor subclass:#ProcessMonitor |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
16 |
instanceVariableNames:'processes hideDead runColor suspendedColor waitColor cpuUsages |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
17 |
showDetail' |
315
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
18 |
classVariableNames:'' |
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
19 |
poolDictionaries:'' |
1053 | 20 |
category:'Monitors-ST/X' |
19 | 21 |
! |
22 |
||
771
5cd10b4845f3
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
682
diff
changeset
|
23 |
!ProcessMonitor class methodsFor:'documentation'! |
52 | 24 |
|
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
This view shows smalltalks (light-weight) processes, and also offers |
|
42 |
a popup menu for various useful operations on them. |
|
43 |
Especially 'debug' is useful, to see what a process is currently |
|
44 |
doing. |
|
85 | 45 |
|
52 | 46 |
The information shown is: |
1896 | 47 |
id - the numeric id of the process |
48 |
name - the name (if any) of the process |
|
49 |
(the name has no semantic meaning; it exists for the processMonitor only) |
|
50 |
state - what is it doing; |
|
51 |
wait - waiting on a semaphore |
|
52 |
eventWait - waiting on a view-event semaphore |
|
53 |
ioWait - waiting on an io-semaphore |
|
54 |
timeWait - waiting for a time-semaphore |
|
55 |
run - run, but currently not scheduled |
|
56 |
active - really running (this info is useless, since at |
|
57 |
update time, its always the update process which is |
|
58 |
running) |
|
59 |
suspended - suspended; not waiting on a semaphore |
|
60 |
light - not yet started (i.e. has no stack yet) |
|
52 | 61 |
|
1896 | 62 |
prio - the processes priority (1..30) |
63 |
usedStack - the current stack use |
|
64 |
totalStack - the stack currently allocated (i.e. the maximum ever needed) |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
65 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
66 |
[see also:] |
1896 | 67 |
Process ProcessorScheduler |
68 |
WindowGroup |
|
69 |
SemaphoreMonitor |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
70 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
71 |
[author:] |
1896 | 72 |
Claus Gittinger |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
73 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
74 |
[start with:] |
1896 | 75 |
ProcessMonitor open |
52 | 76 |
" |
77 |
! ! |
|
78 |
||
771
5cd10b4845f3
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
682
diff
changeset
|
79 |
!ProcessMonitor class methodsFor:'defaults'! |
19 | 80 |
|
56 | 81 |
defaultIcon |
82 |
|i| |
|
19 | 83 |
|
93 | 84 |
i := Image fromFile:'ProcMon.xbm'. |
56 | 85 |
i notNil ifTrue:[^ i]. |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
86 |
^ super defaultIcon |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
87 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
88 |
"Modified: 23.1.1997 / 02:52:31 / cg" |
208 | 89 |
! |
90 |
||
91 |
defaultLabel |
|
92 |
^ 'Process Monitor' |
|
1300 | 93 |
! |
94 |
||
95 |
nameLengthInList |
|
96 |
^ 30 |
|
97 |
||
98 |
"Created: 21.8.1997 / 15:42:05 / cg" |
|
85 | 99 |
! ! |
100 |
||
101 |
!ProcessMonitor methodsFor:'drawing'! |
|
102 |
||
103 |
titleLine |
|
109 | 104 |
showDetail ifTrue:[ |
3000 | 105 |
Processor supportDynamicPriorities ifTrue:[ |
106 |
^ |
|
107 |
'id group name state prio usedStack totalStack current-segment switch where'. |
|
108 |
]. |
|
109 |
^ |
|
110 |
'id group name state prio usedStack totalStack current-segment switch where'. |
|
109 | 111 |
]. |
3000 | 112 |
^ |
113 |
'id group name state prio where '. |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
114 |
|
1504 | 115 |
"Modified: / 3.7.1996 / 13:57:38 / stefan" |
1792 | 116 |
"Modified: / 3.8.1998 / 23:20:24 / cg" |
85 | 117 |
! |
118 |
||
119 |
updateList |
|
120 |
"update list of processes" |
|
121 |
||
122 |
|newList| |
|
123 |
||
124 |
shown ifTrue:[ |
|
2084
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
125 |
newList := self getProcessList. |
85 | 126 |
|
2084
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
127 |
"sort by id - take care of nil ids of dead processes" |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
128 |
newList sort:[:p1 :p2 | |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
129 |
|id1 id2| |
85 | 130 |
|
2084
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
131 |
(p1 isNil or:[(id1 := p1 id) isNil]) |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
132 |
ifTrue:[true] |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
133 |
ifFalse:[ |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
134 |
(p2 isNil or:[(id2 := p2 id) isNil]) |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
135 |
ifTrue:[false] |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
136 |
ifFalse:[id1 < id2] |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
137 |
] |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
138 |
]. |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
139 |
newList ~= processes ifTrue:[ |
2487
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
140 |
self updateStatus:newList |
2084
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
141 |
]. |
85 | 142 |
]. |
143 |
updateBlock notNil ifTrue:[ |
|
2084
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
144 |
Processor removeTimedBlock:listUpdateBlock. |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
145 |
Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay |
85 | 146 |
]. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
147 |
|
2487
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
148 |
"Modified: / 3.7.1996 / 13:37:29 / stefan" |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
149 |
"Modified: / 14.12.1999 / 20:50:14 / cg" |
85 | 150 |
! |
151 |
||
2487
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
152 |
updateStatus:newProcessList |
85 | 153 |
"update status display of processes" |
154 |
||
1009 | 155 |
|oldList list line dIndex interrupted contextCount |
1103
c70ece0e331a
keep selection when list changes
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
156 |
aProcess nm st n found running sel space oldSelection |
1301 | 157 |
newSelection numHeaderLines nameLength index |
3023 | 158 |
con c totalStack sender id gId r skipping startTime endTime deltaT| |
159 |
||
160 |
startTime := AbsoluteTime now. |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
161 |
|
1103
c70ece0e331a
keep selection when list changes
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
162 |
numHeaderLines := 2. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
163 |
space := Character space. |
1300 | 164 |
nameLength := self class nameLengthInList. |
85 | 165 |
|
166 |
shown ifTrue:[ |
|
2176 | 167 |
oldList := listView list. |
2487
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
168 |
|
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
169 |
oldSelection := listView selection. |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
170 |
oldSelection notNil ifTrue:[ |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
171 |
oldSelection := oldSelection collect:[:idx | |pI| |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
172 |
pI := idx-numHeaderLines. |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
173 |
(pI > processes size or:[pI < 1]) ifTrue:[ |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
174 |
nil |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
175 |
] ifFalse:[ |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
176 |
processes at:pI |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
177 |
] |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
178 |
]. |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
179 |
newSelection := OrderedCollection new. |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
180 |
]. |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
181 |
|
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
182 |
newProcessList notNil ifTrue:[ |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
183 |
processes := WeakArray withAll:newProcessList. |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
184 |
]. |
2176 | 185 |
processes notNil ifTrue:[ |
1103
c70ece0e331a
keep selection when list changes
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
186 |
|
2176 | 187 |
list := OrderedCollection new:(processes size + numHeaderLines). |
188 |
list add:self titleLine. |
|
189 |
list add:(String new:self titleLine size withAll:$-). |
|
85 | 190 |
|
2176 | 191 |
interrupted := Processor interruptedProcess. |
85 | 192 |
|
2176 | 193 |
dIndex := 1. |
194 |
index := 1. |
|
1301 | 195 |
|
2176 | 196 |
"/ use while-loop; |
197 |
"/ processList may change size .... |
|
85 | 198 |
|
2176 | 199 |
[index <= processes size] whileTrue:[ |
200 |
aProcess := processes at:index. |
|
201 |
index := index + 1. |
|
1301 | 202 |
|
2176 | 203 |
(aProcess notNil |
204 |
and:[aProcess ~~ 0]) ifTrue:[ |
|
205 |
((id := aProcess id) notNil or:[hideDead not]) ifTrue:[ |
|
206 |
line := WriteStream on:(String new:200). |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
207 |
|
3000 | 208 |
id printOn:line paddedTo:7. |
2176 | 209 |
gId := aProcess processGroupId. |
2473 | 210 |
((gId == id) or:[gId isNil]) ifTrue:[ |
2176 | 211 |
"/ a group leader |
3000 | 212 |
'- ' printOn:line. |
2176 | 213 |
] ifFalse:[ |
3000 | 214 |
gId printOn:line paddedTo:7. |
2176 | 215 |
]. |
663
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
216 |
|
2176 | 217 |
(nm := aProcess name) isNil ifFalse:[ |
218 |
nm := nm printStringPaddedTo:(nameLength-1). |
|
219 |
nm size >= nameLength ifTrue:[ |
|
220 |
nm := (nm contractTo:(nameLength-1)). |
|
221 |
]. |
|
222 |
line nextPutAll:nm; nextPut:space. |
|
223 |
] ifTrue:[ |
|
224 |
line next:(nameLength) put:space. |
|
225 |
]. |
|
680 | 226 |
"/ n := cpuUsages at:(id) ifAbsent:[0]. |
85 | 227 |
"/ n ~~ 0 ifTrue:[ |
228 |
"/ line := line , ((n * 4) printStringLeftPaddedTo:3) |
|
229 |
"/ ] ifFalse:[ |
|
230 |
"/ line := line , ' ' |
|
231 |
"/ ]. |
|
2176 | 232 |
st := aProcess state. |
233 |
(st == #run |
|
234 |
and:[aProcess == interrupted]) ifTrue:[ |
|
235 |
c := ' *'. |
|
236 |
running := true. |
|
237 |
] ifFalse:[ |
|
238 |
[ |
|
239 |
(Processor scheduledProcesses includes:aProcess) ifTrue:[ |
|
240 |
c := ' +' |
|
241 |
] ifFalse:[ |
|
242 |
c := ' '. |
|
243 |
]. |
|
244 |
] valueUninterruptably. |
|
245 |
running := false. |
|
246 |
]. |
|
247 |
line nextPutAll:c; nextPutAll:(st printStringPaddedTo:9). |
|
248 |
line nextPutAll:(aProcess priority printStringLeftPaddedTo:3). |
|
143 | 249 |
|
2176 | 250 |
(showDetail |
251 |
and:[Processor supportDynamicPriorities]) ifTrue:[ |
|
252 |
(r := aProcess priorityRange) isNil ifTrue:[ |
|
253 |
line nextPutAll:' '. |
|
254 |
] ifFalse:[ |
|
255 |
line nextPutAll:(( |
|
256 |
' [' |
|
257 |
, (r start printString) |
|
258 |
, '..' |
|
259 |
, (r stop printString) |
|
260 |
, ']') paddedTo:7). |
|
261 |
]. |
|
262 |
]. |
|
1896 | 263 |
|
2176 | 264 |
con := aProcess suspendedContext. |
265 |
con isNil ifTrue:[ |
|
266 |
aProcess == Processor activeProcess ifTrue:[ |
|
267 |
con := thisContext |
|
268 |
] |
|
269 |
]. |
|
1896 | 270 |
|
2176 | 271 |
showDetail ifTrue:[ |
272 |
line nextPutAll:(aProcess usedStackSize printStringLeftPaddedTo:11). |
|
1791 | 273 |
|
2176 | 274 |
id == 0 ifTrue:[ |
275 |
line nextPutAll:('unlimited' leftPaddedTo:14). |
|
276 |
] ifFalse:[ |
|
277 |
n := aProcess numberOfStackSegments. |
|
278 |
line nextPutAll:(aProcess totalStackSize printStringLeftPaddedTo:10). |
|
279 |
line nextPutAll:(('(' , n printString , ')') paddedTo:4). |
|
280 |
]. |
|
281 |
con notNil ifTrue:[ |
|
282 |
line nextPutAll:' '. |
|
283 |
line nextPutAll:(((ObjectMemory addressOf:con) printStringRadix:16) leftPaddedTo:8 with:$0). |
|
284 |
line nextPutAll:' .. '. |
|
285 |
||
286 |
contextCount := 1. |
|
287 |
c := con. |
|
288 |
[(sender := c sender) notNil] whileTrue:[ |
|
289 |
c := sender. |
|
290 |
contextCount := contextCount + 1. |
|
291 |
]. |
|
292 |
line nextPutAll:(((ObjectMemory addressOf:c) printStringRadix:16) leftPaddedTo:8 with:$0). |
|
293 |
] ifFalse:[ |
|
294 |
line next:20 put:space. |
|
295 |
]. |
|
296 |
line nextPut:space. |
|
297 |
line nextPutAll:(aProcess numberOfStackBoundaryHits printStringLeftPaddedTo:6). |
|
298 |
]. |
|
1103
c70ece0e331a
keep selection when list changes
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
299 |
|
2176 | 300 |
con notNil ifTrue:[ |
301 |
c := con. |
|
302 |
found := false. |
|
303 |
running ifFalse:[ |
|
304 |
"/ search for a semaphore-wait in the top 10 contexts |
|
1009 | 305 |
|
2176 | 306 |
1 to:10 do:[:n | |
307 |
found ifFalse:[ |
|
308 |
c notNil ifTrue:[ |
|
309 |
(c receiver class == Semaphore) ifTrue:[ |
|
310 |
c selector == #wait ifTrue:[ |
|
311 |
found := true. |
|
312 |
] |
|
313 |
]. |
|
314 |
c := c sender. |
|
315 |
] |
|
316 |
] |
|
317 |
]. |
|
318 |
]. |
|
319 |
found ifFalse:[ |
|
320 |
"/ search for a non-processor, non-process |
|
321 |
"/ receiver in the top 10 contexts |
|
143 | 322 |
|
2176 | 323 |
c := con. |
324 |
1 to:10 do:[:n | |
|
325 |
|r| |
|
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
326 |
|
2176 | 327 |
found ifFalse:[ |
328 |
c notNil ifTrue:[ |
|
329 |
((r := c receiver) ~~ Processor |
|
330 |
and:[r class ~~ Process]) ifTrue:[ |
|
331 |
found := true. |
|
332 |
] ifFalse:[ |
|
333 |
c := c sender. |
|
334 |
] |
|
335 |
] |
|
336 |
] |
|
337 |
] |
|
338 |
]. |
|
339 |
found ifFalse:[ |
|
340 |
c := con |
|
341 |
]. |
|
413
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
342 |
|
2176 | 343 |
"/ skip, until an interesting context is |
344 |
"/ found. |
|
345 |
"/ this skips intermediate contexts, which lead |
|
346 |
"/ to the sema-wait (for example, unwind blocks, |
|
347 |
"/ delay-stuff etc.) |
|
428
1c7406f57591
skip Process contexts in display
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
348 |
|
2176 | 349 |
skipping := true. |
350 |
[skipping] whileTrue:[ |
|
351 |
skipping := false. |
|
352 |
(c notNil |
|
353 |
and:[c receiver == Delay |
|
354 |
or:[c receiver class == Delay]]) ifTrue:[ |
|
355 |
c := c sender. |
|
356 |
skipping := true. |
|
357 |
]. |
|
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
358 |
|
2176 | 359 |
[c notNil |
360 |
and:[c receiver isBlock |
|
361 |
and:[c selector startsWith:'value']]] whileTrue:[ |
|
362 |
c := c sender. |
|
363 |
skipping := true. |
|
364 |
]. |
|
1896 | 365 |
|
2176 | 366 |
[c notNil |
367 |
and:[c receiver == OperatingSystem |
|
368 |
and:[c selector == #unblockInterrupts]]] whileTrue:[ |
|
369 |
c := c sender. |
|
370 |
skipping := true. |
|
371 |
]. |
|
1807
b98ad1474686
skip uninterresting contexts in the where list;
Claus Gittinger <cg@exept.de>
parents:
1792
diff
changeset
|
372 |
|
2176 | 373 |
[c notNil and:[c isBlockContext]] whileTrue:[ |
374 |
c := c home. |
|
375 |
skipping := true. |
|
376 |
]. |
|
377 |
]. |
|
1807
b98ad1474686
skip uninterresting contexts in the where list;
Claus Gittinger <cg@exept.de>
parents:
1792
diff
changeset
|
378 |
|
2176 | 379 |
c notNil ifTrue:[ |
380 |
sel := c selector. |
|
381 |
sel isNil ifTrue:[ |
|
382 |
sel := '* unknown *' |
|
383 |
]. |
|
384 |
line nextPutAll:' '. |
|
385 |
line nextPutAll:c receiver class name. |
|
386 |
line nextPutAll:'>>'; nextPutAll:sel. |
|
387 |
] |
|
388 |
]. |
|
389 |
list add:line contents. |
|
390 |
processes at:dIndex put:aProcess. |
|
391 |
(oldSelection notNil and:[oldSelection includesIdentical:aProcess]) ifTrue:[ |
|
392 |
newSelection add:dIndex+numHeaderLines. |
|
393 |
]. |
|
1807
b98ad1474686
skip uninterresting contexts in the where list;
Claus Gittinger <cg@exept.de>
parents:
1792
diff
changeset
|
394 |
|
2176 | 395 |
dIndex := dIndex + 1 |
396 |
] |
|
397 |
]. |
|
398 |
]. |
|
399 |
dIndex to:processes size do:[:index | |
|
400 |
processes at:index put:nil |
|
401 |
] |
|
402 |
]. |
|
1103
c70ece0e331a
keep selection when list changes
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
403 |
|
2176 | 404 |
"avoid flicker" |
405 |
(oldList notNil and:[oldList size == list size]) ifTrue:[ |
|
406 |
list keysAndValuesDo:[:idx :entry | |
|
407 |
(oldList at:idx) ~= entry ifTrue:[ |
|
408 |
listView at:idx put:entry |
|
409 |
] |
|
410 |
] |
|
411 |
] ifFalse:[ |
|
412 |
listView setList:list. |
|
413 |
"the first two entries cannot be selected" |
|
414 |
listView attributeAt:1 put:#disabled. |
|
415 |
listView attributeAt:2 put:#disabled. |
|
1103
c70ece0e331a
keep selection when list changes
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
416 |
|
2176 | 417 |
oldSelection notNil ifTrue:[ |
418 |
listView selection:newSelection. |
|
419 |
] |
|
420 |
]. |
|
2473 | 421 |
"/ cg: must flush here - drawing is done by a background process; |
422 |
"/ without the flush, the output may look ugly (delayed) |
|
423 |
listView flush |
|
85 | 424 |
]. |
3023 | 425 |
|
426 |
endTime := AbsoluteTime now. |
|
427 |
deltaT := (endTime millisecondDeltaFrom:startTime) / 1000.0. |
|
428 |
"/ Transcript show:deltaT; show:' ' ; showCR:(updateDelay / 10.0). |
|
429 |
deltaT > (updateDelay / 5) ifTrue:[ |
|
430 |
"/ the update took longer than 20% - make delay longer, to reduce cpu load. |
|
431 |
updateDelay := updateDelay * 2. |
|
432 |
"/ Transcript show:'+++ '; showCR:updateDelay. |
|
433 |
] ifFalse:[ |
|
434 |
updateDelay > 0.5 ifTrue:[ |
|
435 |
deltaT < (updateDelay / 20) ifTrue:[ |
|
436 |
"/ the update took less than 5% - make delay smaller for better animation. |
|
437 |
updateDelay := (updateDelay / 2) max:0.5. |
|
438 |
"/ Transcript show:'--- ';showCR:updateDelay. |
|
439 |
]. |
|
440 |
]. |
|
441 |
]. |
|
442 |
||
85 | 443 |
updateBlock notNil ifTrue:[ |
2176 | 444 |
Processor removeTimedBlock:updateBlock. |
445 |
Processor addTimedBlock:updateBlock afterSeconds:updateDelay |
|
85 | 446 |
] |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
447 |
|
1504 | 448 |
"Modified: / 3.7.1996 / 13:56:01 / stefan" |
2487
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
449 |
"Created: / 14.12.1999 / 20:47:12 / cg" |
4ac80975b91d
avoid loosing the selection when the list is updated
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
450 |
"Modified: / 14.12.1999 / 20:50:59 / cg" |
143 | 451 |
! ! |
452 |
||
19 | 453 |
!ProcessMonitor methodsFor:'initialization'! |
454 |
||
455 |
initialize |
|
456 |
super initialize. |
|
457 |
||
45 | 458 |
hideDead := true. |
109 | 459 |
showDetail := Smalltalk at:#SystemDebugging ifAbsent:false. |
45 | 460 |
|
19 | 461 |
device hasColors ifTrue:[ |
1896 | 462 |
runColor := Color green. |
463 |
suspendedColor := Color yellow. |
|
464 |
waitColor := Color red. |
|
19 | 465 |
] ifFalse:[ |
1896 | 466 |
runColor := suspendedColor := waitColor := Color black |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
467 |
]. |
19 | 468 |
|
45 | 469 |
" |
470 |
ProcessMonitor open |
|
471 |
" |
|
315
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
472 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
473 |
"Modified: 23.1.1997 / 02:51:38 / cg" |
85 | 474 |
! |
475 |
||
208 | 476 |
realize |
477 |
waitColor := waitColor on:device. |
|
478 |
runColor := runColor on:device. |
|
479 |
suspendedColor := suspendedColor on:device. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
480 |
super realize. |
56 | 481 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
482 |
"Modified: 23.1.1997 / 02:30:37 / cg" |
19 | 483 |
! ! |
484 |
||
485 |
!ProcessMonitor methodsFor:'menu actions'! |
|
486 |
||
208 | 487 |
abortProcess |
488 |
"abort (raise AbortSignal in) the selected process" |
|
489 |
||
490 |
self selectedProcessesDo:[:p | |
|
2768 | 491 |
p abort |
208 | 492 |
] |
493 |
! |
|
494 |
||
495 |
debugProcess |
|
496 |
"open a debugger on the selected process" |
|
497 |
||
498 |
self selectedProcessesDo:[:p | |
|
499 |
Debugger openOn:p |
|
500 |
] |
|
501 |
! |
|
502 |
||
1932 | 503 |
debugProcessWhenResumed |
504 |
self selectedProcessesDo:[:p | |
|
505 |
p onResumeDo:[:con | Debugger enter:con] |
|
506 |
] |
|
507 |
||
508 |
"Created: / 14.10.1998 / 15:50:07 / cg" |
|
509 |
"Modified: / 14.10.1998 / 16:06:08 / cg" |
|
510 |
! |
|
511 |
||
512 |
debugWhenResumed |
|
513 |
self selectedProcessesDo:[:p | |
|
514 |
p addInterruptAction:[Debugger enter] |
|
515 |
] |
|
516 |
||
517 |
"Created: / 14.10.1998 / 15:48:04 / cg" |
|
518 |
"Modified: / 14.10.1998 / 15:48:40 / cg" |
|
519 |
! |
|
520 |
||
1301 | 521 |
hardTerminateProcess |
522 |
"hard terminate the selected process" |
|
523 |
||
524 |
self selectedProcessesSend:#terminateNoSignal |
|
525 |
||
526 |
"Created: 22.8.1997 / 02:06:51 / cg" |
|
527 |
! |
|
528 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
529 |
hideDead:aBoolean |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
530 |
"turn on/off hiding of dead (already terminated) processes" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
531 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
532 |
hideDead := aBoolean |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
533 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
534 |
"Modified: 23.1.1997 / 02:34:01 / cg" |
208 | 535 |
! |
536 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
537 |
inspectSelection |
208 | 538 |
"open an inspector on the selected process" |
539 |
||
540 |
self selectedProcessesSend:#inspect |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
541 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
542 |
"Created: 23.1.1997 / 02:27:33 / cg" |
208 | 543 |
! |
544 |
||
545 |
lowerPrio |
|
546 |
"lower the selected processes priority" |
|
547 |
||
548 |
self selectedProcessesDo:[:p | |
|
549 |
p priority:(p priority - 1) |
|
550 |
] |
|
551 |
! |
|
552 |
||
553 |
raisePrio |
|
554 |
"raise the selected processes priority" |
|
143 | 555 |
|
556 |
self selectedProcessesDo:[:p | |
|
208 | 557 |
p priority:(p priority + 1) |
143 | 558 |
] |
559 |
! |
|
560 |
||
817 | 561 |
restartProcess |
562 |
"abort (raise AbortSignal in) the selected process" |
|
563 |
||
564 |
self selectedProcessesDo:[:p | |
|
1896 | 565 |
p restart. |
817 | 566 |
] |
567 |
! |
|
568 |
||
143 | 569 |
resumeProcess |
570 |
"resume the selected process (i.e. let it run) " |
|
571 |
||
572 |
self selectedProcessesSend:#resume |
|
573 |
! |
|
574 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
575 |
statusMenu |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
576 |
"return a popUpMenu" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
577 |
|
1620 | 578 |
<resource: #programMenu> |
579 |
||
1932 | 580 |
|items labels selectors m sel allRestartable| |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
581 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
582 |
device ctrlDown ifTrue:[ |
1932 | 583 |
items := #( |
584 |
('\c detail' toggleDetail) |
|
2981 | 585 |
('-') |
586 |
('hard terminate' hardTerminateProcess) |
|
1932 | 587 |
). |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
588 |
] ifFalse:[ |
1932 | 589 |
items := #( |
590 |
('inspect' inspectSelection) |
|
591 |
('debug' debugProcess) |
|
592 |
"/ ('debug when resumed' debugProcessWhenResumed) |
|
593 |
('-') |
|
594 |
('resume' resumeProcess) |
|
595 |
('suspend' suspendProcess) |
|
596 |
('stop' stopProcess) |
|
597 |
('-') |
|
598 |
('abort' abortProcess) |
|
599 |
('terminate' terminateProcess) |
|
600 |
('terminate group' terminateProcessGroup) |
|
601 |
('restart' restartProcess) |
|
602 |
('-') |
|
603 |
('raise prio' raisePrio) |
|
604 |
('lower prio' lowerPrio) |
|
605 |
). |
|
606 |
||
607 |
updateProcess isNil ifTrue:[ |
|
608 |
items := #( |
|
609 |
('update' updateView) |
|
610 |
('-') |
|
611 |
) , items. |
|
612 |
]. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
613 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
614 |
|
1932 | 615 |
m := PopUpMenu |
616 |
itemList:items |
|
617 |
resources:resources |
|
618 |
performer:self. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
619 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
620 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
621 |
listView hasSelection ifFalse:[ |
1932 | 622 |
m disableAll:#( |
623 |
inspectSelection |
|
624 |
debugProcess |
|
625 |
debugProcessWhenResumed |
|
626 |
resumeProcess |
|
627 |
suspendProcess |
|
628 |
stopProcess |
|
629 |
restartProcess |
|
630 |
abortProcess |
|
631 |
terminateProcess |
|
632 |
terminateProcessGroup |
|
633 |
raisePrio |
|
634 |
lowerPrio |
|
635 |
) |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
636 |
] ifTrue:[ |
1932 | 637 |
allRestartable := true. |
638 |
self selectedProcessesDo:[:p | |
|
639 |
p isRestartable ifFalse:[ |
|
640 |
allRestartable := false |
|
641 |
]. |
|
642 |
]. |
|
643 |
allRestartable ifFalse:[ |
|
644 |
m disable:#restartProcess |
|
645 |
]. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
646 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
647 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
648 |
m checkToggleAt:#toggleDetail put:showDetail. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
649 |
^ m |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
650 |
|
1932 | 651 |
"Created: / 23.1.1997 / 03:05:54 / cg" |
652 |
"Modified: / 14.10.1998 / 17:15:43 / cg" |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
653 |
! |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
654 |
|
92 | 655 |
stopProcess |
656 |
"stop the selected process - not even interrupts will wake it up" |
|
657 |
||
658 |
self selectedProcessesSend:#stop |
|
659 |
! |
|
660 |
||
19 | 661 |
suspendProcess |
92 | 662 |
"suspend the selected process - interrupts will let it run again" |
663 |
||
58 | 664 |
self selectedProcessesSend:#suspend |
85 | 665 |
! |
45 | 666 |
|
208 | 667 |
terminateProcess |
668 |
"terminate the selected process" |
|
92 | 669 |
|
208 | 670 |
self selectedProcessesSend:#terminate |
663
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
671 |
! |
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
672 |
|
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
673 |
terminateProcessGroup |
817 | 674 |
"terminate the selected process with all of its subprocesses" |
663
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
675 |
|
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
676 |
self selectedProcessesSend:#terminateGroup |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
677 |
! |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
678 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
679 |
toggleDetail |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
680 |
"toggle detail" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
681 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
682 |
showDetail := showDetail not. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
683 |
self updateView |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
684 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
685 |
"Modified: 23.1.1997 / 02:33:03 / cg" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
686 |
"Created: 23.1.1997 / 02:33:30 / cg" |
19 | 687 |
! ! |
688 |
||
143 | 689 |
!ProcessMonitor methodsFor:'private'! |
690 |
||
691 |
selectedProcessesDo:aBlock |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
692 |
"evaluate aBlock on all selected processes" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
693 |
|
143 | 694 |
|p nr sel| |
85 | 695 |
|
143 | 696 |
sel := listView selection. |
697 |
sel isNil ifTrue:[^ self]. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
698 |
|
143 | 699 |
(sel isKindOf:Collection) ifTrue:[ |
1896 | 700 |
sel do:[:n | |
701 |
nr := n - 2. "for headlines" |
|
702 |
nr notNil ifTrue:[ |
|
703 |
nr > 0 ifTrue:[ |
|
704 |
p := processes at:nr. |
|
705 |
(p notNil and:[p ~~ 0]) ifTrue:[ |
|
706 |
aBlock value:p |
|
707 |
] |
|
708 |
] |
|
709 |
] |
|
710 |
] |
|
85 | 711 |
] ifFalse:[ |
1896 | 712 |
nr := sel - 2. "for headlines" |
713 |
nr notNil ifTrue:[ |
|
714 |
nr > 0 ifTrue:[ |
|
715 |
p := processes at:nr. |
|
716 |
(p notNil and:[p ~~ 0]) ifTrue:[ |
|
717 |
aBlock value:p |
|
718 |
] |
|
719 |
] |
|
720 |
] |
|
85 | 721 |
]. |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
722 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
723 |
"Modified: 23.1.1997 / 03:10:53 / cg" |
143 | 724 |
! |
725 |
||
726 |
selectedProcessesSend:aSelector |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
727 |
"send a message to all selected processes" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
728 |
|
143 | 729 |
self selectedProcessesDo:[:p | |
1896 | 730 |
p perform:aSelector |
143 | 731 |
]. |
732 |
self updateView. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
733 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
734 |
"Modified: 23.1.1997 / 02:34:49 / cg" |
85 | 735 |
! ! |
736 |
||
2084
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
737 |
!ProcessMonitor methodsFor:'process selection'! |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
738 |
|
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
739 |
getProcessList |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
740 |
"select processes to display. |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
741 |
Subclasses may redefine this" |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
742 |
|
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
743 |
|coll| |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
744 |
|
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
745 |
showDetail ifTrue:[ |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
746 |
coll := Process allSubInstances asOrderedCollection. |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
747 |
] ifFalse:[ |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
748 |
coll := ProcessorScheduler knownProcesses asOrderedCollection. |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
749 |
]. |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
750 |
^ coll |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
751 |
! ! |
0445a6a61d45
Extract #getProcessList to support easy subclasses.
Stefan Vogel <sv@exept.de>
parents:
2013
diff
changeset
|
752 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
753 |
!ProcessMonitor methodsFor:'user actions'! |
85 | 754 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
755 |
doubleClicked |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
756 |
"open a debugger on the selected process" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
757 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
758 |
self debugProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
759 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
760 |
"Created: 23.1.1997 / 03:21:30 / cg" |
85 | 761 |
! ! |
208 | 762 |
|
771
5cd10b4845f3
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
682
diff
changeset
|
763 |
!ProcessMonitor class methodsFor:'documentation'! |
208 | 764 |
|
765 |
version |
|
3023 | 766 |
^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.76 2001-06-12 09:57:08 cg Exp $' |
1053 | 767 |
! ! |