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