148 ]. |
149 ]. |
149 updateBlock notNil ifTrue:[ |
150 updateBlock notNil ifTrue:[ |
150 Processor removeTimedBlock:listUpdateBlock. |
151 Processor removeTimedBlock:listUpdateBlock. |
151 Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay |
152 Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay |
152 ]. |
153 ]. |
|
154 |
|
155 "Modified: 3.7.1996 / 13:37:29 / stefan" |
153 ! |
156 ! |
154 |
157 |
155 updateStatus |
158 updateStatus |
156 "update status display of processes" |
159 "update status display of processes" |
157 |
160 |
158 |oldList list line dIndex con interrupted plist |
161 |oldList list line dIndex interrupted |
159 aProcess nm st c c0 n found sender running sel| |
162 aProcess nm st n found running sel space| |
|
163 |
|
164 space := Character space. |
160 |
165 |
161 shown ifTrue:[ |
166 shown ifTrue:[ |
162 oldList := listView list. |
167 oldList := listView list. |
163 processes notNil ifTrue:[ |
168 processes notNil ifTrue:[ |
164 list := OrderedCollection new. |
169 list := OrderedCollection new:(processes size + 2). |
165 list add:self titleLine. |
170 list add:self titleLine. |
166 list add:(String new:self titleLine size withAll:$-). |
171 list add:(String new:self titleLine size withAll:$-). |
167 |
172 |
168 interrupted := Processor interruptedProcess. |
173 interrupted := Processor interruptedProcess. |
169 |
174 |
170 dIndex := 1. |
175 dIndex := 1. |
171 1 to:processes size do:[:index | |
176 1 to:processes size do:[:index | |
172 |totalStack| |
177 |con c totalStack sender| |
173 |
178 |
174 aProcess := processes at:index. |
179 aProcess := processes at:index. |
175 aProcess notNil ifTrue:[ |
180 aProcess notNil ifTrue:[ |
176 (aProcess id notNil or:[hideDead not]) ifTrue:[ |
181 (aProcess id notNil or:[hideDead not]) ifTrue:[ |
177 line := aProcess id printStringPaddedTo:5. |
182 line := WriteStream on:(String new:200). |
|
183 |
|
184 aProcess id printOn:line paddedTo:5. |
178 (nm := aProcess name) isNil ifFalse:[ |
185 (nm := aProcess name) isNil ifFalse:[ |
179 nm := nm printString |
186 nm := nm printStringPaddedTo:28. |
|
187 nm size >= 29 ifTrue:[ |
|
188 nm := (nm contractTo:28). |
|
189 ]. |
|
190 line nextPutAll:nm; nextPut:space. |
180 ] ifTrue:[ |
191 ] ifTrue:[ |
181 nm := ' ' |
192 line next:29 put:space. |
182 ]. |
193 ]. |
183 nm size >= 29 ifTrue:[ |
|
184 nm := (nm contractTo:28) , ' ' |
|
185 ] ifFalse:[ |
|
186 nm := (nm printStringPaddedTo:29). |
|
187 ]. |
|
188 line := line , nm. |
|
189 "/ n := cpuUsages at:(aProcess id) ifAbsent:[0]. |
194 "/ n := cpuUsages at:(aProcess id) ifAbsent:[0]. |
190 "/ n ~~ 0 ifTrue:[ |
195 "/ n ~~ 0 ifTrue:[ |
191 "/ line := line , ((n * 4) printStringLeftPaddedTo:3) |
196 "/ line := line , ((n * 4) printStringLeftPaddedTo:3) |
192 "/ ] ifFalse:[ |
197 "/ ] ifFalse:[ |
193 "/ line := line , ' ' |
198 "/ line := line , ' ' |
199 running := true. |
204 running := true. |
200 ] ifFalse:[ |
205 ] ifFalse:[ |
201 c := ' '. |
206 c := ' '. |
202 running := false. |
207 running := false. |
203 ]. |
208 ]. |
204 line := line , c , (st printStringPaddedTo:9). |
209 line nextPutAll:c; nextPutAll:(st printStringPaddedTo:9). |
205 line := line , (aProcess priority printStringLeftPaddedTo:3). |
210 line nextPutAll:(aProcess priority printStringLeftPaddedTo:3). |
206 line := line , (aProcess usedStackSize printStringLeftPaddedTo:11). |
211 line nextPutAll:(aProcess usedStackSize printStringLeftPaddedTo:11). |
207 |
212 |
208 n := aProcess numberOfStackSegments. |
213 con := aProcess suspendedContext. |
209 true "showDetail" ifTrue:[ |
214 con isNil ifTrue:[ |
210 con := aProcess suspendedContext. |
215 aProcess == Processor activeProcess ifTrue:[ |
211 con isNil ifTrue:[ |
216 con := thisContext |
212 aProcess == Processor activeProcess ifTrue:[ |
217 ] |
213 con := thisContext |
|
214 ] |
|
215 ]. |
|
216 ]. |
218 ]. |
|
219 |
217 showDetail ifTrue:[ |
220 showDetail ifTrue:[ |
218 aProcess id == 0 ifTrue:[ |
221 aProcess id == 0 ifTrue:[ |
219 line := line , ('unlimited' leftPaddedTo:13). |
222 line nextPutAll:('unlimited' leftPaddedTo:13). |
220 ] ifFalse:[ |
223 ] ifFalse:[ |
221 line := line , (aProcess totalStackSize printStringLeftPaddedTo:10). |
224 n := aProcess numberOfStackSegments. |
222 line := line , '(' , n printString , ')'. |
225 line nextPutAll:(aProcess totalStackSize printStringLeftPaddedTo:10). |
|
226 line nextPut:$( ; nextPutAll:n printString; nextPut:$). |
223 ]. |
227 ]. |
224 con notNil ifTrue:[ |
228 con notNil ifTrue:[ |
225 line := line , ' '. |
229 line nextPutAll:' '. |
226 line := line , (((ObjectMemory addressOf:con) printStringRadix:16) leftPaddedTo:8 with:$0). |
230 line nextPutAll:(((ObjectMemory addressOf:con) printStringRadix:16) leftPaddedTo:8 with:$0). |
227 line := line , ' .. '. |
231 line nextPutAll:' .. '. |
228 c := con. |
232 c := con. |
229 [(sender := c sender) notNil] whileTrue:[ |
233 [(sender := c sender) notNil] whileTrue:[ |
230 c := sender |
234 c := sender |
231 ]. |
235 ]. |
232 line := line , (((ObjectMemory addressOf:c) printStringRadix:16) leftPaddedTo:8 with:$0). |
236 line nextPutAll:(((ObjectMemory addressOf:c) printStringRadix:16) leftPaddedTo:8 with:$0). |
233 ] ifFalse:[ |
237 ] ifFalse:[ |
234 line := line , (String new:20) |
238 line next:20 put:space. |
235 ]. |
239 ]. |
236 line := line , ' '. |
240 line nextPut:space. |
237 line := line , (aProcess numberOfStackBoundaryHits printStringLeftPaddedTo:5). |
241 line nextPutAll:(aProcess numberOfStackBoundaryHits printStringLeftPaddedTo:6). |
238 ]. |
242 ]. |
239 |
243 |
240 con notNil ifTrue:[ |
244 con notNil ifTrue:[ |
241 c := con. |
245 c := con. |
242 found := false. |
246 found := false. |