author | Claus Gittinger <cg@exept.de> |
Mon, 27 Jan 1997 20:41:19 +0100 | |
changeset 1003 | 1cefd1d13089 |
parent 983 | e02eaa70dbd7 |
child 1007 | cf9bad620e24 |
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 |
||
982 | 13 |
SystemStatusMonitor subclass:#ProcessMonitor |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
14 |
instanceVariableNames:'processes hideDead runColor suspendedColor waitColor cpuUsages |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
15 |
showDetail' |
315
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
16 |
classVariableNames:'' |
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
17 |
poolDictionaries:'' |
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
18 |
category:'Interface-Tools' |
19 | 19 |
! |
20 |
||
771
5cd10b4845f3
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
682
diff
changeset
|
21 |
!ProcessMonitor class methodsFor:'documentation'! |
52 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
This view shows smalltalks (light-weight) processes, and also offers |
|
40 |
a popup menu for various useful operations on them. |
|
41 |
Especially 'debug' is useful, to see what a process is currently |
|
42 |
doing. |
|
85 | 43 |
|
52 | 44 |
The information shown is: |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
45 |
id - the numeric id of the process |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
46 |
name - the name (if any) of the process |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
47 |
(the name has no semantic meaning; it exists for the processMonitor only) |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
48 |
state - what is it doing; |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
49 |
wait - waiting on a semaphore |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
50 |
eventWait - waiting on a view-event semaphore |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
51 |
ioWait - waiting on an io-semaphore |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
52 |
timeWait - waiting for a time-semaphore |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
53 |
run - run, but currently not scheduled |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
54 |
active - really running (this info is useless, since at |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
55 |
update time, its always the update process which is |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
56 |
running) |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
57 |
suspended - suspended; not waiting on a semaphore |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
58 |
light - not yet started (i.e. has no stack yet) |
52 | 59 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
60 |
prio - the processes priority (1..30) |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
61 |
usedStack - the current stack use |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
62 |
totalStack - the stack currently allocated (i.e. the maximum ever needed) |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
63 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
64 |
[see also:] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
65 |
Process ProcessorScheduler |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
66 |
WindowGroup |
983 | 67 |
SemaphoreMonitor |
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 |
[author:] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
70 |
Claus Gittinger |
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 |
[start with:] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
73 |
ProcessMonitor open |
52 | 74 |
" |
75 |
! ! |
|
76 |
||
771
5cd10b4845f3
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
682
diff
changeset
|
77 |
!ProcessMonitor class methodsFor:'defaults'! |
19 | 78 |
|
56 | 79 |
defaultIcon |
80 |
|i| |
|
19 | 81 |
|
93 | 82 |
i := Image fromFile:'ProcMon.xbm'. |
56 | 83 |
i notNil ifTrue:[^ i]. |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
84 |
^ super defaultIcon |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
85 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
86 |
"Modified: 23.1.1997 / 02:52:31 / cg" |
208 | 87 |
! |
88 |
||
89 |
defaultLabel |
|
90 |
^ 'Process Monitor' |
|
85 | 91 |
! ! |
92 |
||
93 |
!ProcessMonitor methodsFor:'drawing'! |
|
94 |
||
95 |
titleLine |
|
109 | 96 |
showDetail ifTrue:[ |
682 | 97 |
^ 'id group name state prio usedStack totalStack current-segment switch where'. |
109 | 98 |
]. |
663
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
99 |
^ 'id group name state prio usedStack where'. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
100 |
|
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
101 |
"Modified: 3.7.1996 / 13:57:38 / stefan" |
682 | 102 |
"Modified: 24.7.1996 / 17:21:15 / cg" |
85 | 103 |
! |
104 |
||
105 |
updateList |
|
106 |
"update list of processes" |
|
107 |
||
108 |
|newList| |
|
109 |
||
110 |
shown ifTrue:[ |
|
208 | 111 |
showDetail ifTrue:[ |
112 |
newList := Process allInstances asOrderedCollection. |
|
113 |
] ifFalse:[ |
|
114 |
newList := ProcessorScheduler knownProcesses asOrderedCollection. |
|
115 |
]. |
|
85 | 116 |
|
208 | 117 |
"sort by id - take care of nil ids of dead processes" |
118 |
newList sort:[:p1 :p2 | |
|
119 |
|id1 id2| |
|
85 | 120 |
|
208 | 121 |
(p1 isNil or:[(id1 := p1 id) isNil]) |
122 |
ifTrue:[true] |
|
123 |
ifFalse:[ |
|
124 |
(p2 isNil or:[(id2 := p2 id) isNil]) |
|
125 |
ifTrue:[false] |
|
126 |
ifFalse:[id1 < id2] |
|
127 |
] |
|
128 |
]. |
|
129 |
newList ~= processes ifTrue:[ |
|
130 |
processes := WeakArray withAll:newList. |
|
131 |
self updateStatus |
|
132 |
]. |
|
85 | 133 |
]. |
134 |
updateBlock notNil ifTrue:[ |
|
208 | 135 |
Processor removeTimedBlock:listUpdateBlock. |
136 |
Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay |
|
85 | 137 |
]. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
138 |
|
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
139 |
"Modified: 3.7.1996 / 13:37:29 / stefan" |
85 | 140 |
! |
141 |
||
142 |
updateStatus |
|
143 |
"update status display of processes" |
|
144 |
||
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
145 |
|oldList list line dIndex interrupted |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
146 |
aProcess nm st n found running sel space| |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
147 |
|
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
148 |
space := Character space. |
85 | 149 |
|
150 |
shown ifTrue:[ |
|
208 | 151 |
oldList := listView list. |
152 |
processes notNil ifTrue:[ |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
153 |
list := OrderedCollection new:(processes size + 2). |
208 | 154 |
list add:self titleLine. |
155 |
list add:(String new:self titleLine size withAll:$-). |
|
85 | 156 |
|
208 | 157 |
interrupted := Processor interruptedProcess. |
85 | 158 |
|
208 | 159 |
dIndex := 1. |
160 |
1 to:processes size do:[:index | |
|
680 | 161 |
|con c totalStack sender id gId| |
85 | 162 |
|
208 | 163 |
aProcess := processes at:index. |
775
f741dc4afe19
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
771
diff
changeset
|
164 |
(aProcess notNil |
f741dc4afe19
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
771
diff
changeset
|
165 |
and:[aProcess ~~ 0]) ifTrue:[ |
680 | 166 |
((id := aProcess id) notNil or:[hideDead not]) ifTrue:[ |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
167 |
line := WriteStream on:(String new:200). |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
168 |
|
680 | 169 |
id printOn:line paddedTo:5. |
170 |
gId := aProcess processGroupId. |
|
171 |
gId == id ifTrue:[ |
|
172 |
"/ a group leader |
|
173 |
'- ' printOn:line. |
|
174 |
] ifFalse:[ |
|
175 |
gId printOn:line paddedTo:5. |
|
176 |
]. |
|
663
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
177 |
|
208 | 178 |
(nm := aProcess name) isNil ifFalse:[ |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
179 |
nm := nm printStringPaddedTo:28. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
180 |
nm size >= 29 ifTrue:[ |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
181 |
nm := (nm contractTo:28). |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
182 |
]. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
183 |
line nextPutAll:nm; nextPut:space. |
208 | 184 |
] ifTrue:[ |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
185 |
line next:29 put:space. |
208 | 186 |
]. |
680 | 187 |
"/ n := cpuUsages at:(id) ifAbsent:[0]. |
85 | 188 |
"/ n ~~ 0 ifTrue:[ |
189 |
"/ line := line , ((n * 4) printStringLeftPaddedTo:3) |
|
190 |
"/ ] ifFalse:[ |
|
191 |
"/ line := line , ' ' |
|
192 |
"/ ]. |
|
208 | 193 |
st := aProcess state. |
194 |
(st == #run |
|
195 |
and:[aProcess == interrupted]) ifTrue:[ |
|
196 |
c := ' *'. |
|
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
197 |
running := true. |
208 | 198 |
] ifFalse:[ |
199 |
c := ' '. |
|
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
200 |
running := false. |
208 | 201 |
]. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
202 |
line nextPutAll:c; nextPutAll:(st printStringPaddedTo:9). |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
203 |
line nextPutAll:(aProcess priority printStringLeftPaddedTo:3). |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
204 |
line nextPutAll:(aProcess usedStackSize printStringLeftPaddedTo:11). |
143 | 205 |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
206 |
con := aProcess suspendedContext. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
207 |
con isNil ifTrue:[ |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
208 |
aProcess == Processor activeProcess ifTrue:[ |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
209 |
con := thisContext |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
210 |
] |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
211 |
]. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
212 |
|
208 | 213 |
showDetail ifTrue:[ |
680 | 214 |
id == 0 ifTrue:[ |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
215 |
line nextPutAll:('unlimited' leftPaddedTo:13). |
208 | 216 |
] ifFalse:[ |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
217 |
n := aProcess numberOfStackSegments. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
218 |
line nextPutAll:(aProcess totalStackSize printStringLeftPaddedTo:10). |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
219 |
line nextPut:$( ; nextPutAll:n printString; nextPut:$). |
208 | 220 |
]. |
221 |
con notNil ifTrue:[ |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
222 |
line nextPutAll:' '. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
223 |
line nextPutAll:(((ObjectMemory addressOf:con) printStringRadix:16) leftPaddedTo:8 with:$0). |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
224 |
line nextPutAll:' .. '. |
208 | 225 |
c := con. |
226 |
[(sender := c sender) notNil] whileTrue:[ |
|
227 |
c := sender |
|
228 |
]. |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
229 |
line nextPutAll:(((ObjectMemory addressOf:c) printStringRadix:16) leftPaddedTo:8 with:$0). |
208 | 230 |
] ifFalse:[ |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
231 |
line next:20 put:space. |
208 | 232 |
]. |
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
233 |
line nextPut:space. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
234 |
line nextPutAll:(aProcess numberOfStackBoundaryHits printStringLeftPaddedTo:6). |
208 | 235 |
]. |
143 | 236 |
|
208 | 237 |
con notNil ifTrue:[ |
238 |
c := con. |
|
413
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
239 |
found := false. |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
240 |
running ifFalse:[ |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
241 |
"/ search for a semaphore-wait in the top 10 contexts |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
242 |
|
208 | 243 |
1 to:10 do:[:n | |
244 |
found ifFalse:[ |
|
245 |
c notNil ifTrue:[ |
|
409
86125c414826
dont send #isMemberOf: to the receiver (could be nil-subclass)
Claus Gittinger <cg@exept.de>
parents:
322
diff
changeset
|
246 |
(c receiver class == Semaphore) ifTrue:[ |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
247 |
c selector == #wait ifTrue:[ |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
248 |
found := true. |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
249 |
] |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
250 |
]. |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
251 |
c := c sender. |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
252 |
] |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
253 |
] |
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
254 |
]. |
413
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
255 |
]. |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
256 |
found ifFalse:[ |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
257 |
"/ search for a non-processor receiver in the top 10 contexts |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
258 |
|
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
259 |
c := con. |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
260 |
1 to:10 do:[:n | |
428
1c7406f57591
skip Process contexts in display
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
261 |
|r| |
1c7406f57591
skip Process contexts in display
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
262 |
|
413
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
263 |
found ifFalse:[ |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
264 |
c notNil ifTrue:[ |
428
1c7406f57591
skip Process contexts in display
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
265 |
((r := c receiver) ~~ Processor |
1c7406f57591
skip Process contexts in display
Claus Gittinger <cg@exept.de>
parents:
423
diff
changeset
|
266 |
and:[r class ~~ Process]) ifTrue:[ |
413
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
267 |
found := true. |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
268 |
] ifFalse:[ |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
269 |
c := c sender. |
208 | 270 |
] |
271 |
] |
|
272 |
] |
|
413
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
273 |
] |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
274 |
]. |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
275 |
found ifFalse:[ |
715a6a18f825
better display of running processes context
Claus Gittinger <cg@exept.de>
parents:
409
diff
changeset
|
276 |
c := con |
208 | 277 |
]. |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
278 |
|
208 | 279 |
[c notNil and:[c isBlockContext]] whileTrue:[ |
280 |
c := c home |
|
281 |
]. |
|
282 |
c notNil ifTrue:[ |
|
517 | 283 |
sel := c selector. |
284 |
sel isNil ifTrue:[ |
|
285 |
sel := '* unknown *' |
|
286 |
]. |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
287 |
line nextPutAll:' '. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
288 |
line nextPutAll:c receiver class name. |
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
289 |
line nextPutAll:'>>'; nextPutAll:sel. |
208 | 290 |
] |
291 |
]. |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
292 |
list add:line contents. |
208 | 293 |
processes at:dIndex put:aProcess. |
294 |
dIndex := dIndex + 1 |
|
295 |
] |
|
296 |
]. |
|
297 |
]. |
|
298 |
dIndex to:processes size do:[:index | |
|
299 |
processes at:index put:nil |
|
300 |
] |
|
301 |
]. |
|
302 |
"avoid flicker" |
|
303 |
(oldList notNil and:[oldList size == list size]) ifTrue:[ |
|
304 |
list keysAndValuesDo:[:idx :entry | |
|
305 |
(oldList at:idx) ~= entry ifTrue:[ |
|
306 |
listView at:idx put:entry |
|
307 |
] |
|
308 |
] |
|
309 |
] ifFalse:[ |
|
310 |
listView setList:list. |
|
311 |
"the first two entries cannot be selected" |
|
312 |
listView attributeAt:1 put:#disabled. |
|
313 |
listView attributeAt:2 put:#disabled. |
|
314
728eab568865
Flush output when updating display.
Stefan Vogel <sv@exept.de>
parents:
208
diff
changeset
|
314 |
]. |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
315 |
listView flush |
85 | 316 |
]. |
317 |
updateBlock notNil ifTrue:[ |
|
208 | 318 |
Processor removeTimedBlock:updateBlock. |
319 |
Processor addTimedBlock:updateBlock afterSeconds:updateDelay |
|
85 | 320 |
] |
322
e3ccd5e431df
fixed context display (dont search for suspending context in running processes)
Claus Gittinger <cg@exept.de>
parents:
315
diff
changeset
|
321 |
|
656
3a625e4aa73f
Use a Stream to construct lines.
Stefan Vogel <sv@exept.de>
parents:
619
diff
changeset
|
322 |
"Modified: 3.7.1996 / 13:56:01 / stefan" |
680 | 323 |
"Modified: 18.7.1996 / 20:19:59 / cg" |
143 | 324 |
! ! |
325 |
||
19 | 326 |
!ProcessMonitor methodsFor:'initialization'! |
327 |
||
328 |
initialize |
|
329 |
super initialize. |
|
330 |
||
45 | 331 |
hideDead := true. |
109 | 332 |
showDetail := Smalltalk at:#SystemDebugging ifAbsent:false. |
45 | 333 |
|
19 | 334 |
device hasColors ifTrue:[ |
315
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
335 |
runColor := Color green. |
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
336 |
suspendedColor := Color yellow. |
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
337 |
waitColor := Color red. |
19 | 338 |
] ifFalse:[ |
315
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
339 |
runColor := suspendedColor := waitColor := Color black |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
340 |
]. |
19 | 341 |
|
45 | 342 |
" |
343 |
ProcessMonitor open |
|
344 |
" |
|
315
8a86faf847d1
create a new updateProcess when restarted
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
345 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
346 |
"Modified: 23.1.1997 / 02:51:38 / cg" |
85 | 347 |
! |
348 |
||
208 | 349 |
realize |
350 |
waitColor := waitColor on:device. |
|
351 |
runColor := runColor on:device. |
|
352 |
suspendedColor := suspendedColor on:device. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
353 |
super realize. |
56 | 354 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
355 |
"Modified: 23.1.1997 / 02:30:37 / cg" |
19 | 356 |
! ! |
357 |
||
358 |
!ProcessMonitor methodsFor:'menu actions'! |
|
359 |
||
208 | 360 |
abortProcess |
361 |
"abort (raise AbortSignal in) the selected process" |
|
362 |
||
363 |
self selectedProcessesDo:[:p | |
|
364 |
p interruptWith:[AbortSignal raise] |
|
365 |
] |
|
366 |
! |
|
367 |
||
368 |
debugProcess |
|
369 |
"open a debugger on the selected process" |
|
370 |
||
371 |
self selectedProcessesDo:[:p | |
|
372 |
Debugger openOn:p |
|
373 |
] |
|
374 |
! |
|
375 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
376 |
hideDead:aBoolean |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
377 |
"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
|
378 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
379 |
hideDead := aBoolean |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
380 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
381 |
"Modified: 23.1.1997 / 02:34:01 / cg" |
208 | 382 |
! |
383 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
384 |
inspectSelection |
208 | 385 |
"open an inspector on the selected process" |
386 |
||
387 |
self selectedProcessesSend:#inspect |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
388 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
389 |
"Created: 23.1.1997 / 02:27:33 / cg" |
208 | 390 |
! |
391 |
||
392 |
lowerPrio |
|
393 |
"lower the selected processes priority" |
|
394 |
||
395 |
self selectedProcessesDo:[:p | |
|
396 |
p priority:(p priority - 1) |
|
397 |
] |
|
398 |
! |
|
399 |
||
400 |
raisePrio |
|
401 |
"raise the selected processes priority" |
|
143 | 402 |
|
403 |
self selectedProcessesDo:[:p | |
|
208 | 404 |
p priority:(p priority + 1) |
143 | 405 |
] |
406 |
! |
|
407 |
||
817 | 408 |
restartProcess |
409 |
"abort (raise AbortSignal in) the selected process" |
|
410 |
||
411 |
self selectedProcessesDo:[:p | |
|
412 |
p restart. |
|
413 |
] |
|
414 |
! |
|
415 |
||
143 | 416 |
resumeProcess |
417 |
"resume the selected process (i.e. let it run) " |
|
418 |
||
419 |
self selectedProcessesSend:#resume |
|
420 |
! |
|
421 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
422 |
statusMenu |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
423 |
"return a popUpMenu" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
424 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
425 |
|labels selectors m sel allRestartable| |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
426 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
427 |
device ctrlDown ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
428 |
labels := resources array:#( |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
429 |
'\c detail' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
430 |
). |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
431 |
selectors := #( |
1003 | 432 |
toggleDetail |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
433 |
). |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
434 |
] ifFalse:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
435 |
labels := resources array:#( |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
436 |
'inspect' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
437 |
'debug' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
438 |
'-' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
439 |
'resume' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
440 |
'suspend' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
441 |
'stop' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
442 |
'abort' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
443 |
'terminate' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
444 |
'terminate group' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
445 |
'restart' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
446 |
'-' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
447 |
'raise prio' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
448 |
'lower prio' |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
449 |
). |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
450 |
selectors := #( |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
451 |
inspectSelection |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
452 |
debugProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
453 |
nil |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
454 |
resumeProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
455 |
suspendProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
456 |
stopProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
457 |
abortProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
458 |
terminateProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
459 |
terminateProcessGroup |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
460 |
restartProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
461 |
nil |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
462 |
raisePrio |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
463 |
lowerPrio |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
464 |
). |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
465 |
updateProcess isNil ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
466 |
labels := (resources array:#('update' '-')) , labels. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
467 |
selectors := #(updateView nil) , selectors |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
468 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
469 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
470 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
471 |
m := PopUpMenu labels:labels |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
472 |
selectors:selectors. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
473 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
474 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
475 |
listView hasSelection ifFalse:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
476 |
m disableAll:#( |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
477 |
inspectSelection |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
478 |
debugProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
479 |
resumeProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
480 |
suspendProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
481 |
stopProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
482 |
restartProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
483 |
abortProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
484 |
terminateProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
485 |
terminateProcessGroup |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
486 |
raisePrio |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
487 |
lowerPrio |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
488 |
) |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
489 |
] ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
490 |
allRestartable := true. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
491 |
self selectedProcessesDo:[:p | |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
492 |
p isRestartable ifFalse:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
493 |
allRestartable := false |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
494 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
495 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
496 |
allRestartable ifFalse:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
497 |
m disable:#restartProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
498 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
499 |
]. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
500 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
501 |
m checkToggleAt:#toggleDetail put:showDetail. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
502 |
^ m |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
503 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
504 |
"Created: 23.1.1997 / 03:05:54 / cg" |
1003 | 505 |
"Modified: 27.1.1997 / 20:41:03 / cg" |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
506 |
! |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
507 |
|
92 | 508 |
stopProcess |
509 |
"stop the selected process - not even interrupts will wake it up" |
|
510 |
||
511 |
self selectedProcessesSend:#stop |
|
512 |
! |
|
513 |
||
19 | 514 |
suspendProcess |
92 | 515 |
"suspend the selected process - interrupts will let it run again" |
516 |
||
58 | 517 |
self selectedProcessesSend:#suspend |
85 | 518 |
! |
45 | 519 |
|
208 | 520 |
terminateProcess |
521 |
"terminate the selected process" |
|
92 | 522 |
|
208 | 523 |
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
|
524 |
! |
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
525 |
|
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
526 |
terminateProcessGroup |
817 | 527 |
"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
|
528 |
|
befe6a1d886f
show process group & added menu item to terminate a complete group
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
529 |
self selectedProcessesSend:#terminateGroup |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
530 |
! |
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 |
toggleDetail |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
533 |
"toggle detail" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
534 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
535 |
showDetail := showDetail not. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
536 |
self updateView |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
537 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
538 |
"Modified: 23.1.1997 / 02:33:03 / cg" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
539 |
"Created: 23.1.1997 / 02:33:30 / cg" |
19 | 540 |
! ! |
541 |
||
143 | 542 |
!ProcessMonitor methodsFor:'private'! |
543 |
||
544 |
selectedProcessesDo:aBlock |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
545 |
"evaluate aBlock on all selected processes" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
546 |
|
143 | 547 |
|p nr sel| |
85 | 548 |
|
143 | 549 |
sel := listView selection. |
550 |
sel isNil ifTrue:[^ self]. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
551 |
|
143 | 552 |
(sel isKindOf:Collection) ifTrue:[ |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
553 |
sel do:[:n | |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
554 |
nr := n - 2. "for headlines" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
555 |
nr notNil ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
556 |
nr > 0 ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
557 |
p := processes at:nr. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
558 |
(p notNil and:[p ~~ 0]) ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
559 |
aBlock value:p |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
560 |
] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
561 |
] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
562 |
] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
563 |
] |
85 | 564 |
] ifFalse:[ |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
565 |
nr := sel - 2. "for headlines" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
566 |
nr notNil ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
567 |
nr > 0 ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
568 |
p := processes at:nr. |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
569 |
(p notNil and:[p ~~ 0]) ifTrue:[ |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
570 |
aBlock value:p |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
571 |
] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
572 |
] |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
573 |
] |
85 | 574 |
]. |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
575 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
576 |
"Modified: 23.1.1997 / 03:10:53 / cg" |
143 | 577 |
! |
578 |
||
579 |
selectedProcessesSend:aSelector |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
580 |
"send a message to all selected processes" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
581 |
|
143 | 582 |
self selectedProcessesDo:[:p | |
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
583 |
p perform:aSelector |
143 | 584 |
]. |
585 |
self updateView. |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
586 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
587 |
"Modified: 23.1.1997 / 02:34:49 / cg" |
85 | 588 |
! ! |
589 |
||
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
590 |
!ProcessMonitor methodsFor:'user actions'! |
85 | 591 |
|
979
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
592 |
doubleClicked |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
593 |
"open a debugger on the selected process" |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
594 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
595 |
self debugProcess |
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
596 |
|
c1e318bee326
extracted common stuff into a superclass
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
597 |
"Created: 23.1.1997 / 03:21:30 / cg" |
85 | 598 |
! ! |
208 | 599 |
|
771
5cd10b4845f3
oops - catching the terminateSignal is no good idea
Claus Gittinger <cg@exept.de>
parents:
682
diff
changeset
|
600 |
!ProcessMonitor class methodsFor:'documentation'! |
208 | 601 |
|
602 |
version |
|
1003 | 603 |
^ '$Header: /cvs/stx/stx/libtool/Attic/ProcMonitor.st,v 1.47 1997-01-27 19:41:19 cg Exp $'! ! |