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