17227
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 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 |
"{ Package: 'stx:libtool' }"
|
|
13 |
|
|
14 |
"{ NameSpace: Smalltalk }"
|
|
15 |
|
|
16 |
SystemStatusMonitor subclass:#ExternalStreamMonitor
|
19113
|
17 |
instanceVariableNames:'showTime streams filterOpenStreamsOnlyHolder
|
|
18 |
filterPipesOnlyHolder filterSocketsOnlyHolder
|
|
19 |
filterConnectedSocketsOnlyHolder'
|
17227
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'Monitors-ST/X'
|
|
23 |
!
|
|
24 |
|
|
25 |
!ExternalStreamMonitor class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 1997 by Claus Gittinger
|
|
30 |
All Rights Reserved
|
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
|
|
40 |
|
|
41 |
!
|
|
42 |
|
|
43 |
documentation
|
|
44 |
"
|
17228
|
45 |
This view shows smalltalk's external stream instances - a debugging tool.
|
17227
|
46 |
|
|
47 |
[disclaimer:]
|
17228
|
48 |
this is based on one of the oldest tools in the system, written in the early 90's.
|
17227
|
49 |
It does in no way reflect the way GUIs are designed/written these days.
|
19113
|
50 |
However, after all those years, they are still very very useful (and not found in many other systems)
|
17227
|
51 |
|
|
52 |
[see also:]
|
17228
|
53 |
Stream ExternalStream
|
17227
|
54 |
WindowGroup
|
|
55 |
ProcessMonitor
|
19045
|
56 |
SemaphoreMonitor OSProcessMonitor
|
17227
|
57 |
|
|
58 |
[author:]
|
|
59 |
Claus Gittinger
|
|
60 |
|
|
61 |
[start with:]
|
17228
|
62 |
ExternalStreamMonitor open
|
17227
|
63 |
"
|
|
64 |
! !
|
|
65 |
|
|
66 |
!ExternalStreamMonitor class methodsFor:'defaults'!
|
|
67 |
|
|
68 |
defaultLabel
|
|
69 |
^ 'External Streams Monitor'
|
|
70 |
|
|
71 |
"Created: 23.1.1997 / 02:52:53 / cg"
|
|
72 |
! !
|
|
73 |
|
|
74 |
!ExternalStreamMonitor class methodsFor:'menu specs'!
|
|
75 |
|
|
76 |
filterMenu
|
|
77 |
"This resource specification was automatically generated
|
|
78 |
by the MenuEditor of ST/X."
|
|
79 |
|
|
80 |
"Do not manually edit this!! If it is corrupted,
|
|
81 |
the MenuEditor may not be able to read the specification."
|
|
82 |
|
|
83 |
|
|
84 |
"
|
|
85 |
MenuEditor new openOnClass:ExternalStreamMonitor andSelector:#filterMenu
|
|
86 |
(Menu new fromLiteralArrayEncoding:(ExternalStreamMonitor filterMenu)) startUp
|
|
87 |
"
|
|
88 |
|
|
89 |
<resource: #menu>
|
|
90 |
|
|
91 |
^
|
|
92 |
#(Menu
|
|
93 |
(
|
|
94 |
(MenuItem
|
|
95 |
label: 'Open Streams Only'
|
18505
|
96 |
indication: filterOpenStreamsOnlyHolder
|
17227
|
97 |
hideMenuOnActivated: false
|
18505
|
98 |
)
|
|
99 |
(MenuItem
|
|
100 |
label: '-'
|
|
101 |
)
|
|
102 |
(MenuItem
|
|
103 |
label: 'Pipes Only'
|
|
104 |
indication: filterPipesOnlyHolder
|
|
105 |
hideMenuOnActivated: false
|
17227
|
106 |
)
|
|
107 |
(MenuItem
|
|
108 |
label: '-'
|
|
109 |
)
|
|
110 |
(MenuItem
|
|
111 |
label: 'Sockets Only'
|
18505
|
112 |
indication: filterSocketsOnlyHolder
|
17227
|
113 |
hideMenuOnActivated: false
|
|
114 |
)
|
|
115 |
(MenuItem
|
|
116 |
label: 'Connected Sockets Only'
|
18505
|
117 |
indication: filterConnectedSocketsOnlyHolder
|
17227
|
118 |
hideMenuOnActivated: false
|
|
119 |
)
|
|
120 |
)
|
|
121 |
nil
|
|
122 |
nil
|
|
123 |
)
|
|
124 |
!
|
|
125 |
|
|
126 |
mainMenu
|
|
127 |
"This resource specification was automatically generated
|
|
128 |
by the MenuEditor of ST/X."
|
|
129 |
|
|
130 |
"Do not manually edit this!! If it is corrupted,
|
|
131 |
the MenuEditor may not be able to read the specification."
|
|
132 |
|
|
133 |
|
|
134 |
"
|
|
135 |
MenuEditor new openOnClass:ExternalStreamMonitor andSelector:#mainMenu
|
|
136 |
(Menu new fromLiteralArrayEncoding:(ExternalStreamMonitor mainMenu)) startUp
|
|
137 |
"
|
|
138 |
|
|
139 |
<resource: #menu>
|
|
140 |
|
|
141 |
^
|
|
142 |
#(Menu
|
|
143 |
(
|
|
144 |
(MenuItem
|
|
145 |
label: 'File'
|
18502
|
146 |
submenuChannel: fileMenu
|
|
147 |
)
|
|
148 |
(MenuItem
|
|
149 |
label: 'View'
|
|
150 |
submenuChannel: viewMenu
|
17227
|
151 |
)
|
|
152 |
(MenuItem
|
|
153 |
label: 'Filter'
|
|
154 |
submenuChannel: filterMenu
|
|
155 |
)
|
17487
|
156 |
(MenuItem
|
|
157 |
label: 'Operations'
|
|
158 |
submenuChannel: operationsMenu
|
|
159 |
)
|
17227
|
160 |
)
|
|
161 |
nil
|
|
162 |
nil
|
|
163 |
)
|
17487
|
164 |
!
|
|
165 |
|
|
166 |
operationsMenu
|
|
167 |
"This resource specification was automatically generated
|
|
168 |
by the MenuEditor of ST/X."
|
|
169 |
|
|
170 |
"Do not manually edit this!! If it is corrupted,
|
|
171 |
the MenuEditor may not be able to read the specification."
|
|
172 |
|
|
173 |
|
|
174 |
"
|
18506
|
175 |
MenuEditor new openOnClass:ExternalStreamMonitor andSelector:#operationsMenu
|
|
176 |
(Menu new fromLiteralArrayEncoding:(ExternalStreamMonitor operationsMenu)) startUp
|
17487
|
177 |
"
|
|
178 |
|
|
179 |
<resource: #menu>
|
|
180 |
|
|
181 |
^
|
|
182 |
#(Menu
|
|
183 |
(
|
|
184 |
(MenuItem
|
|
185 |
label: 'Close'
|
|
186 |
itemValue: menuCloseSelected
|
19344
|
187 |
enabled: hasSelection
|
17487
|
188 |
)
|
|
189 |
(MenuItem
|
|
190 |
label: '-'
|
|
191 |
)
|
|
192 |
(MenuItem
|
|
193 |
label: 'Inspect'
|
|
194 |
itemValue: inspectStream
|
19344
|
195 |
enabled: hasSelection
|
17487
|
196 |
)
|
18506
|
197 |
(MenuItem
|
19109
|
198 |
label: 'Debug Processes Blocked on It'
|
|
199 |
itemValue: menuDebugProcessesBlockedOnIt
|
19344
|
200 |
enabled: hasSelection
|
19109
|
201 |
)
|
|
202 |
(MenuItem
|
|
203 |
label: 'References'
|
|
204 |
itemValue: menuReferences
|
19344
|
205 |
enabled: hasSelection
|
18506
|
206 |
)
|
17487
|
207 |
)
|
|
208 |
nil
|
|
209 |
nil
|
|
210 |
)
|
17227
|
211 |
! !
|
|
212 |
|
|
213 |
!ExternalStreamMonitor methodsFor:'aspects'!
|
|
214 |
|
|
215 |
filterConnectedSocketsOnlyHolder
|
|
216 |
filterConnectedSocketsOnlyHolder isNil ifTrue:[
|
|
217 |
filterConnectedSocketsOnlyHolder := false asValue.
|
|
218 |
filterConnectedSocketsOnlyHolder onChangeSend:#filterConnectedSocketsOnlyHolderChanged to:self.
|
|
219 |
].
|
|
220 |
^ filterConnectedSocketsOnlyHolder
|
|
221 |
!
|
|
222 |
|
|
223 |
filterOpenStreamsOnlyHolder
|
|
224 |
filterOpenStreamsOnlyHolder isNil ifTrue:[
|
18447
|
225 |
filterOpenStreamsOnlyHolder := true asValue.
|
18505
|
226 |
filterOpenStreamsOnlyHolder onChangeSend:#filterOpenStreamsOnlyHolderChanged to:self.
|
17227
|
227 |
].
|
|
228 |
^ filterOpenStreamsOnlyHolder
|
18447
|
229 |
|
18505
|
230 |
"Modified: / 29-10-2018 / 15:44:11 / Claus Gittinger"
|
|
231 |
!
|
|
232 |
|
|
233 |
filterPipesOnlyHolder
|
|
234 |
filterPipesOnlyHolder isNil ifTrue:[
|
|
235 |
filterPipesOnlyHolder := false asValue.
|
|
236 |
filterPipesOnlyHolder onChangeSend:#filterPipesOnlyHolderChanged to:self.
|
|
237 |
].
|
|
238 |
^ filterPipesOnlyHolder
|
|
239 |
|
|
240 |
"Created: / 29-10-2018 / 15:36:07 / Claus Gittinger"
|
17227
|
241 |
!
|
|
242 |
|
|
243 |
filterSocketsOnlyHolder
|
|
244 |
filterSocketsOnlyHolder isNil ifTrue:[
|
|
245 |
filterSocketsOnlyHolder := false asValue.
|
|
246 |
filterSocketsOnlyHolder onChangeSend:#filterSocketsOnlyHolderChanged to:self.
|
|
247 |
].
|
|
248 |
^ filterSocketsOnlyHolder
|
|
249 |
! !
|
|
250 |
|
|
251 |
!ExternalStreamMonitor methodsFor:'drawing'!
|
|
252 |
|
|
253 |
titleLine
|
|
254 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
18504
|
255 |
^ 'Type Global Handle Detail'.
|
17227
|
256 |
] ifFalse:[
|
18504
|
257 |
^ 'Type Global FD Detail'.
|
17227
|
258 |
].
|
|
259 |
|
|
260 |
"
|
|
261 |
ExternalStreamMonitor open
|
|
262 |
"
|
|
263 |
|
18504
|
264 |
"Modified: / 17-06-1998 / 14:52:48 / cg"
|
|
265 |
"Modified: / 29-10-2018 / 15:28:22 / Claus Gittinger"
|
17227
|
266 |
!
|
|
267 |
|
|
268 |
updateList
|
19045
|
269 |
"update list of streams"
|
17227
|
270 |
|
|
271 |
|newList|
|
|
272 |
|
|
273 |
shown ifTrue:[
|
|
274 |
newList := ExternalStream allSubInstances.
|
18138
|
275 |
newList := newList reject:#isExecutor.
|
|
276 |
|
17227
|
277 |
self filterOpenStreamsOnlyHolder value ifTrue:[
|
|
278 |
newList := newList select:[:eachStream | eachStream isOpen].
|
|
279 |
].
|
18505
|
280 |
|
|
281 |
self filterPipesOnlyHolder value ifTrue:[
|
|
282 |
newList := newList select:[:eachStream | eachStream isPipeStream].
|
|
283 |
] ifFalse:[
|
|
284 |
self filterSocketsOnlyHolder value ifTrue:[
|
|
285 |
newList := newList select:[:eachStream | eachStream isSocket].
|
|
286 |
].
|
|
287 |
self filterConnectedSocketsOnlyHolder value ifTrue:[
|
|
288 |
newList := newList select:[:eachStream | eachStream isSocket and:[eachStream isConnected]].
|
|
289 |
].
|
17227
|
290 |
].
|
|
291 |
|
|
292 |
newList sort:[:s1 :s2 |
|
|
293 |
s1 className < s2 className
|
|
294 |
or:[ s1 className = s2 className
|
|
295 |
and:[false]]
|
|
296 |
].
|
|
297 |
|
|
298 |
newList ~= streams ifTrue:[
|
|
299 |
self updateStatus:newList
|
|
300 |
].
|
|
301 |
].
|
|
302 |
self installDelayedUpdate.
|
18504
|
303 |
|
18505
|
304 |
"Modified: / 29-10-2018 / 15:39:43 / Claus Gittinger"
|
17227
|
305 |
!
|
|
306 |
|
|
307 |
updateStatus:newStreamsList
|
19045
|
308 |
"update status display of streams"
|
17227
|
309 |
|
19054
|
310 |
|numberOfHeadlines oldList list oldSelection newSelection|
|
17227
|
311 |
|
|
312 |
shown ifTrue:[
|
19054
|
313 |
numberOfHeadlines := self numberOfHeadlines.
|
17227
|
314 |
oldList := listView list.
|
|
315 |
oldSelection := listView selection.
|
|
316 |
oldSelection notNil ifTrue:[
|
18591
|
317 |
oldSelection := oldSelection
|
19054
|
318 |
select:[:lNr | lNr > numberOfHeadlines]
|
|
319 |
thenCollect:[:lineNr |
|
|
320 |
streams at:(lineNr - numberOfHeadlines) ifAbsent:nil
|
18591
|
321 |
].
|
17227
|
322 |
newSelection := OrderedCollection new.
|
|
323 |
].
|
|
324 |
|
|
325 |
newStreamsList notNil ifTrue:[
|
|
326 |
streams := WeakArray withAll:newStreamsList.
|
|
327 |
].
|
|
328 |
streams notNil ifTrue:[
|
19054
|
329 |
list := OrderedCollection new:(streams size + numberOfHeadlines).
|
19113
|
330 |
(showTime == true) ifTrue:[
|
|
331 |
list add:'Time: ',(Time now printString).
|
|
332 |
].
|
17227
|
333 |
list add:self titleLine.
|
18504
|
334 |
list add:(String new:(self titleLine size+20) withAll:$-).
|
17227
|
335 |
|
|
336 |
streams validElementsDo:[:aStream |
|
|
337 |
|waiters waitersNames type globalNameOrNil handleString
|
|
338 |
isOpen handle detail color line|
|
|
339 |
|
|
340 |
type := aStream className.
|
18504
|
341 |
"/ beware of aliases...
|
|
342 |
aStream = Stdin ifTrue:[
|
|
343 |
globalNameOrNil := 'Stdin'.
|
|
344 |
] ifFalse:[
|
|
345 |
aStream = Stdout ifTrue:[
|
|
346 |
globalNameOrNil := 'Stdout'.
|
|
347 |
] ifFalse:[
|
|
348 |
aStream = Stderr ifTrue:[
|
|
349 |
globalNameOrNil := 'Stderr'.
|
|
350 |
] ifFalse:[
|
|
351 |
globalNameOrNil := Smalltalk keyAtValue:aStream.
|
|
352 |
]
|
|
353 |
]
|
|
354 |
].
|
17227
|
355 |
aStream isFileStream ifTrue:[
|
|
356 |
detail := aStream pathName.
|
|
357 |
] ifFalse:[
|
|
358 |
aStream isSocket ifTrue:[
|
17707
|
359 |
detail := ''.
|
17227
|
360 |
aStream getPeer notNil ifTrue:[
|
18504
|
361 |
detail := detail,(aStream getPeerName printString),'[',(aStream getPeer printString),']'.
|
17707
|
362 |
].
|
|
363 |
aStream port notNil ifTrue:[
|
|
364 |
detail := detail,':',aStream port printString
|
|
365 |
].
|
19108
|
366 |
aStream isListening notNil ifTrue:[
|
|
367 |
detail := detail,' (listening)'
|
|
368 |
].
|
17227
|
369 |
] ifFalse:[
|
18138
|
370 |
aStream isPipeStream ifTrue:[
|
|
371 |
detail := aStream commandString.
|
|
372 |
].
|
17227
|
373 |
].
|
|
374 |
].
|
|
375 |
|
|
376 |
OperatingSystem isMSWINDOWSlike ifTrue:[
|
|
377 |
aStream isOpen ifTrue:[
|
|
378 |
handle := aStream fileHandle.
|
17616
|
379 |
handle isInteger ifTrue:[
|
|
380 |
handleString := handle printString
|
|
381 |
] ifFalse:[
|
|
382 |
handleString := (handle address ? 0) hexPrintString
|
|
383 |
].
|
17227
|
384 |
].
|
|
385 |
handleString := (handleString ? '') leftPaddedTo:7
|
|
386 |
] ifFalse:[
|
|
387 |
aStream isOpen ifTrue:[
|
17622
|
388 |
[
|
18504
|
389 |
handleString := aStream fileDescriptor printString
|
17622
|
390 |
] on:StreamError do:[
|
|
391 |
].
|
17227
|
392 |
].
|
|
393 |
handleString := (handleString ? '') leftPaddedTo:3
|
|
394 |
].
|
|
395 |
|
18504
|
396 |
line := (type contractTo:30) paddedTo:30.
|
|
397 |
line := line , ' ' , (((globalNameOrNil ? '') contractTo:30) paddedTo:30).
|
17227
|
398 |
line := line , ' ' , handleString.
|
|
399 |
line := line , ' ' , (detail ? '').
|
|
400 |
|
|
401 |
isOpen := aStream isOpen.
|
|
402 |
|
|
403 |
"/ line := line
|
|
404 |
"/ , ' '
|
|
405 |
"/ , ((nm contractTo:25) paddedTo:25)
|
|
406 |
"/ , ' '
|
|
407 |
"/ , (count printStringLeftPaddedTo:3)
|
|
408 |
"/ , ' '
|
|
409 |
"/ , owner printString
|
|
410 |
"/ , ' '
|
|
411 |
"/ , (waiters size printStringLeftPaddedTo:3)
|
|
412 |
"/ , ' '
|
|
413 |
"/ , waitersNames.
|
|
414 |
|
|
415 |
isOpen ifFalse:[
|
|
416 |
color := Color red.
|
|
417 |
] ifTrue:[
|
|
418 |
color := Color blue.
|
|
419 |
].
|
18818
|
420 |
line := line withColor:color.
|
17227
|
421 |
|
|
422 |
list add:line.
|
|
423 |
oldSelection notNil ifTrue:[
|
|
424 |
(oldSelection includesIdentical:aStream) ifTrue:[
|
|
425 |
newSelection add:list size.
|
|
426 |
]
|
|
427 |
]
|
|
428 |
].
|
|
429 |
].
|
|
430 |
"avoid flicker"
|
|
431 |
(oldList notNil and:[oldList size == list size]) ifTrue:[
|
|
432 |
list keysAndValuesDo:[:idx :entry |
|
|
433 |
(oldList at:idx) ~= entry ifTrue:[
|
|
434 |
listView at:idx put:entry
|
|
435 |
]
|
|
436 |
]
|
|
437 |
] ifFalse:[
|
|
438 |
listView setList:list.
|
19054
|
439 |
"the first few entries cannot be selected"
|
|
440 |
1 to:numberOfHeadlines do:[:lNr | listView attributeAt:lNr put:#disabled].
|
17227
|
441 |
].
|
|
442 |
newSelection notNil ifTrue:[
|
|
443 |
listView selectWithoutScroll:newSelection
|
|
444 |
].
|
|
445 |
listView flush
|
|
446 |
].
|
|
447 |
self installDelayedUpdate.
|
17622
|
448 |
|
17707
|
449 |
"Modified: / 11-10-2017 / 13:56:14 / cg"
|
18818
|
450 |
"Modified: / 07-06-2019 / 22:10:36 / Claus Gittinger"
|
17227
|
451 |
! !
|
|
452 |
|
|
453 |
!ExternalStreamMonitor methodsFor:'menu'!
|
|
454 |
|
18506
|
455 |
selectedStreams
|
|
456 |
"return all selected streams"
|
|
457 |
|
|
458 |
^ Array streamContents:[:s |
|
|
459 |
self selectedStreamsDo:[:each | s nextPut:each]
|
|
460 |
].
|
|
461 |
|
|
462 |
"Created: / 29-10-2018 / 17:00:35 / Claus Gittinger"
|
|
463 |
!
|
|
464 |
|
17227
|
465 |
selectedStreamsDo:aBlock
|
|
466 |
"evaluate aBlock on all selected streams"
|
|
467 |
|
|
468 |
self selectionIndicesDo:[:n |
|
|
469 |
|nr stream|
|
|
470 |
|
|
471 |
nr := n - self numberOfHeadlines.
|
|
472 |
nr notNil ifTrue:[
|
|
473 |
nr > 0 ifTrue:[
|
|
474 |
stream := streams at:nr.
|
|
475 |
(stream notNil and:[stream ~~ 0]) ifTrue:[
|
|
476 |
aBlock value:stream
|
|
477 |
]
|
|
478 |
]
|
|
479 |
]
|
|
480 |
].
|
|
481 |
!
|
|
482 |
|
|
483 |
statusMenu
|
|
484 |
"return a popUpMenu"
|
|
485 |
|
|
486 |
<resource: #programMenu>
|
|
487 |
|
|
488 |
|labels selectors m|
|
|
489 |
|
|
490 |
labels := resources array:#(
|
17487
|
491 |
'Close'
|
|
492 |
'-'
|
17227
|
493 |
'Inspect'
|
19109
|
494 |
'Debug waiting Process(es)'
|
18138
|
495 |
'References'
|
17227
|
496 |
).
|
|
497 |
selectors := #(
|
17487
|
498 |
menuCloseSelected
|
|
499 |
nil
|
17227
|
500 |
inspectStream
|
19109
|
501 |
menuDebugProcessesBlockedOnIt
|
18138
|
502 |
menuReferences
|
17227
|
503 |
).
|
|
504 |
|
|
505 |
updateProcess isNil ifTrue:[
|
17622
|
506 |
labels := labels,(resources array:#('-' 'Update' )).
|
|
507 |
selectors := selectors , #(nil updateView).
|
17227
|
508 |
].
|
|
509 |
|
|
510 |
m := PopUpMenu labels:labels
|
|
511 |
selectors:selectors.
|
|
512 |
|
|
513 |
|
|
514 |
listView hasSelection ifFalse:[
|
|
515 |
m disableAll:#(
|
17487
|
516 |
menuCloseSelected
|
17227
|
517 |
inspectStream
|
|
518 |
)
|
|
519 |
].
|
|
520 |
^ m
|
|
521 |
|
17622
|
522 |
"Modified: / 18-08-2017 / 14:34:12 / cg"
|
17227
|
523 |
! !
|
|
524 |
|
|
525 |
!ExternalStreamMonitor methodsFor:'queries'!
|
|
526 |
|
|
527 |
numberOfHeadlines
|
19113
|
528 |
^ 2 + (showTime == true ifTrue:1 ifFalse:0)
|
18504
|
529 |
|
|
530 |
"Modified: / 29-10-2018 / 15:24:14 / Claus Gittinger"
|
17227
|
531 |
! !
|
|
532 |
|
|
533 |
!ExternalStreamMonitor methodsFor:'user actions'!
|
|
534 |
|
|
535 |
doubleClicked
|
17487
|
536 |
"open an inspector on the selected stream"
|
17227
|
537 |
|
|
538 |
self inspectStream
|
|
539 |
|
17487
|
540 |
"Created: / 23-01-1997 / 03:22:04 / cg"
|
|
541 |
"Modified: / 31-01-1997 / 22:33:27 / cg"
|
|
542 |
"Modified (comment): / 07-04-2017 / 14:28:01 / cg"
|
17227
|
543 |
!
|
|
544 |
|
|
545 |
filterConnectedSocketsOnlyHolderChanged
|
18505
|
546 |
self filterConnectedSocketsOnlyHolder value ifTrue:[
|
|
547 |
self filterPipesOnlyHolder value:false.
|
|
548 |
].
|
17227
|
549 |
self sensor pushUserEvent:#updateList for:self
|
18505
|
550 |
|
|
551 |
"Modified: / 29-10-2018 / 15:48:44 / Claus Gittinger"
|
17227
|
552 |
!
|
|
553 |
|
|
554 |
filterOpenStreamsOnlyHolderChanged
|
|
555 |
self sensor pushUserEvent:#updateList for:self
|
|
556 |
!
|
|
557 |
|
18505
|
558 |
filterPipesOnlyHolderChanged
|
|
559 |
self filterPipesOnlyHolder value ifTrue:[
|
|
560 |
self filterSocketsOnlyHolder value:false.
|
|
561 |
self filterConnectedSocketsOnlyHolder value:false.
|
|
562 |
].
|
|
563 |
self sensor pushUserEvent:#updateList for:self
|
|
564 |
|
|
565 |
"Created: / 29-10-2018 / 15:36:45 / Claus Gittinger"
|
|
566 |
!
|
|
567 |
|
17227
|
568 |
filterSocketsOnlyHolderChanged
|
18505
|
569 |
self filterSocketsOnlyHolder value ifTrue:[
|
|
570 |
self filterPipesOnlyHolder value:false.
|
|
571 |
].
|
17227
|
572 |
self sensor pushUserEvent:#updateList for:self
|
18505
|
573 |
|
|
574 |
"Modified: / 29-10-2018 / 15:48:40 / Claus Gittinger"
|
17487
|
575 |
!
|
|
576 |
|
|
577 |
inspectStream
|
|
578 |
"open an inspector on the selected stream(s)"
|
|
579 |
|
|
580 |
self selectedStreamsDo:[:eachStream | eachStream inspect]
|
|
581 |
|
|
582 |
"Modified (format): / 07-04-2017 / 14:27:45 / cg"
|
|
583 |
!
|
|
584 |
|
|
585 |
menuCloseSelected
|
|
586 |
"close the selected stream(s)"
|
|
587 |
|
18138
|
588 |
self selectedStreamsDo:[:eachStream | eachStream close].
|
|
589 |
self updateList.
|
17487
|
590 |
|
|
591 |
"Created: / 07-04-2017 / 14:26:04 / cg"
|
18138
|
592 |
!
|
|
593 |
|
19109
|
594 |
menuDebugProcessesBlockedOnIt
|
|
595 |
"open a debugger on processes which are blocked reding, writing or listening"
|
|
596 |
|
|
597 |
self processesBlockedOnItDo:[:each | Debugger openOn:each].
|
|
598 |
|
|
599 |
"Modified (format): / 07-04-2017 / 14:27:45 / cg"
|
|
600 |
"Modified: / 29-10-2018 / 17:01:00 / Claus Gittinger"
|
|
601 |
!
|
|
602 |
|
|
603 |
menuInspectProcessesUsingIt
|
|
604 |
"inspect processes which are blocked reding, writing or listening"
|
|
605 |
|
|
606 |
self processesBlockedOnItDo:[:each | each inspect].
|
|
607 |
|
|
608 |
!
|
|
609 |
|
18138
|
610 |
menuReferences
|
|
611 |
"show references to the selected stream"
|
|
612 |
|
18506
|
613 |
ObjectMemory displayRefChainToAny:(self selectedStreams) limitNumberOfSearchedReferences:100.
|
18138
|
614 |
|
|
615 |
"Modified (format): / 07-04-2017 / 14:27:45 / cg"
|
18506
|
616 |
"Modified: / 29-10-2018 / 17:01:00 / Claus Gittinger"
|
19109
|
617 |
!
|
|
618 |
|
|
619 |
processesBlockedOnIt
|
|
620 |
"return processes which are blocked reding, writing or listening"
|
|
621 |
|
|
622 |
|selected processes|
|
|
623 |
|
|
624 |
processes := OrderedCollection new.
|
|
625 |
selected := self selectedStreams.
|
|
626 |
Process allInstancesDo:[:p |
|
|
627 |
|con|
|
|
628 |
|
|
629 |
p isDead ifFalse:[
|
|
630 |
(con := p suspendedContext) notNil ifTrue:[
|
|
631 |
[con notNil and:[(selected includesIdentical:con receiver) not]] whileTrue:[
|
|
632 |
con := con sender.
|
|
633 |
].
|
|
634 |
con notNil ifTrue:[
|
|
635 |
processes add:p.
|
|
636 |
]
|
|
637 |
]
|
|
638 |
]
|
|
639 |
].
|
|
640 |
^ processes
|
|
641 |
|
|
642 |
"Modified (format): / 07-04-2017 / 14:27:45 / cg"
|
|
643 |
"Modified: / 29-10-2018 / 17:01:00 / Claus Gittinger"
|
|
644 |
!
|
|
645 |
|
|
646 |
processesBlockedOnItDo:aBlock
|
|
647 |
"open a debugger on processes which are blocked reding, writing or listening"
|
|
648 |
|
|
649 |
|processes|
|
|
650 |
|
|
651 |
processes := self processesBlockedOnIt.
|
|
652 |
processes notEmpty ifTrue:[
|
|
653 |
processes do:[:each |
|
|
654 |
aBlock value:each.
|
|
655 |
].
|
|
656 |
^ self
|
|
657 |
].
|
|
658 |
Dialog information:'No process is blocked on '
|
|
659 |
,(self selectedStreams size == 1 ifTrue:['this'] ifFalse:['any selected'])
|
|
660 |
,' process'.
|
|
661 |
|
|
662 |
"Modified (format): / 07-04-2017 / 14:27:45 / cg"
|
|
663 |
"Modified: / 29-10-2018 / 17:01:00 / Claus Gittinger"
|
17227
|
664 |
! !
|
|
665 |
|
|
666 |
!ExternalStreamMonitor class methodsFor:'documentation'!
|
|
667 |
|
|
668 |
version
|
|
669 |
^ '$Header$'
|
|
670 |
!
|
|
671 |
|
|
672 |
version_CVS
|
|
673 |
^ '$Header$'
|
|
674 |
! !
|
|
675 |
|