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