author | Claus Gittinger <cg@exept.de> |
Sat, 06 Sep 2008 13:16:08 +0200 | |
changeset 2402 | 5db801ca0e35 |
parent 2343 | 20eee34c4c8b |
child 2403 | 11c5c82a852c |
permissions | -rw-r--r-- |
2181 | 1 |
"{ Package: 'stx:libtool2' }" |
2 |
||
3 |
"{ NameSpace: Tools }" |
|
4 |
||
2184 | 5 |
ToolApplicationModel subclass:#ObjectModuleInformation |
6 |
instanceVariableNames:'readOnly listOfModuleNames selectedModuleIndexHolder allModules |
|
2183 | 7 |
objectHandles showOthers showCObjects showBuiltIn showMethods |
2253 | 8 |
showClassLibs table1VisibleHolder table2VisibleHolder |
9 |
selectedInfoIndexHolder canBrowseSelectedModule |
|
10 |
canUnloadSelectedModule classNamesShown classInfoShown |
|
11 |
vmInfoShown' |
|
2181 | 12 |
classVariableNames:'' |
13 |
poolDictionaries:'' |
|
14 |
category:'Monitors-ST/X' |
|
15 |
! |
|
16 |
||
17 |
Object subclass:#InfoRow |
|
2183 | 18 |
instanceVariableNames:'name version date value' |
2181 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
privateIn:ObjectModuleInformation |
|
22 |
! |
|
23 |
||
24 |
!ObjectModuleInformation class methodsFor:'documentation'! |
|
25 |
||
26 |
documentation |
|
27 |
" |
|
28 |
Shows the modules (dll's) of ST/X. |
|
29 |
Both builtIn modules, and dynamically loaded modules are listed. |
|
30 |
||
31 |
[author:] |
|
2253 | 32 |
Claus Gittinger |
2181 | 33 |
" |
34 |
! |
|
35 |
||
36 |
examples |
|
37 |
" |
|
38 |
Starting the application: |
|
39 |
[exBegin] |
|
40 |
ObjectModuleInformation open |
|
41 |
||
42 |
[exEnd] |
|
43 |
" |
|
44 |
! ! |
|
45 |
||
46 |
!ObjectModuleInformation class methodsFor:'info'! |
|
47 |
||
48 |
defaultLabel |
|
2183 | 49 |
^ 'Object Module Info' |
2181 | 50 |
|
51 |
"Created: / 05-10-2007 / 11:56:59 / cg" |
|
52 |
! ! |
|
53 |
||
54 |
!ObjectModuleInformation class methodsFor:'interface specs'! |
|
55 |
||
56 |
windowSpec |
|
57 |
"This resource specification was automatically generated |
|
58 |
by the UIPainter of ST/X." |
|
59 |
||
60 |
"Do not manually edit this!! If it is corrupted, |
|
61 |
the UIPainter may not be able to read the specification." |
|
62 |
||
63 |
" |
|
2183 | 64 |
UIPainter new openOnClass:Tools::ObjectModuleInformation andSelector:#windowSpec |
65 |
Tools::ObjectModuleInformation new openInterface:#windowSpec |
|
66 |
Tools::ObjectModuleInformation open |
|
2181 | 67 |
" |
68 |
||
69 |
<resource: #canvas> |
|
70 |
||
71 |
^ |
|
72 |
#(FullSpec |
|
73 |
name: windowSpec |
|
74 |
window: |
|
75 |
(WindowSpec |
|
76 |
label: 'ST/X Module & Version Information' |
|
77 |
name: 'ST/X Module & Version Information' |
|
78 |
min: (Point 0 0) |
|
79 |
bounds: (Rectangle 0 0 505 567) |
|
80 |
menu: mainMenu |
|
81 |
) |
|
82 |
component: |
|
83 |
(SpecCollection |
|
84 |
collection: ( |
|
85 |
(MenuPanelSpec |
|
86 |
name: 'ToolBar1' |
|
87 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
88 |
menu: toolbarMenu |
|
89 |
textDefault: true |
|
90 |
) |
|
91 |
(VariableVerticalPanelSpec |
|
92 |
name: 'VariableVerticalPanel1' |
|
93 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
94 |
component: |
|
95 |
(SpecCollection |
|
96 |
collection: ( |
|
97 |
(SequenceViewSpec |
|
98 |
name: 'List1' |
|
99 |
model: selectedModuleIndexHolder |
|
2253 | 100 |
menu: moduleMenu |
2181 | 101 |
hasHorizontalScrollBar: true |
102 |
hasVerticalScrollBar: true |
|
103 |
useIndex: true |
|
104 |
sequenceList: listOfModuleNames |
|
105 |
) |
|
106 |
(ViewSpec |
|
107 |
name: 'Box1' |
|
108 |
component: |
|
109 |
(SpecCollection |
|
110 |
collection: ( |
|
111 |
(LabelSpec |
|
112 |
name: 'Label1' |
|
113 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
114 |
translateLabel: true |
|
115 |
labelChannel: middleLabelHolder |
|
116 |
adjust: left |
|
117 |
) |
|
118 |
(DataSetSpec |
|
119 |
name: 'Table1' |
|
120 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
2183 | 121 |
visibilityChannel: table1VisibleHolder |
2181 | 122 |
model: selectedInfoIndexHolder |
2253 | 123 |
menu: moduleItemMenu |
2181 | 124 |
hasHorizontalScrollBar: true |
125 |
hasVerticalScrollBar: true |
|
2183 | 126 |
dataList: infoTable1ListHolder |
2181 | 127 |
columnHolder: tableColumns |
128 |
separatorOneDColor: (Color 66.999313344015 66.999313344015 66.999313344015) |
|
129 |
) |
|
2183 | 130 |
(DataSetSpec |
131 |
name: 'Table2' |
|
132 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
133 |
initiallyInvisible: true |
|
134 |
visibilityChannel: table2VisibleHolder |
|
135 |
model: selectedInfoIndexHolder |
|
136 |
hasHorizontalScrollBar: true |
|
137 |
hasVerticalScrollBar: true |
|
138 |
dataList: infoTable2ListHolder |
|
139 |
columnHolder: tableColumnsForSingleInfo |
|
140 |
separatorOneDColor: (Color 66.999313344015 66.999313344015 66.999313344015) |
|
141 |
) |
|
2181 | 142 |
) |
143 |
||
144 |
) |
|
145 |
) |
|
146 |
) |
|
147 |
||
148 |
) |
|
149 |
handles: (Any 0.35195530726257 1.0) |
|
150 |
) |
|
151 |
) |
|
152 |
||
153 |
) |
|
154 |
) |
|
155 |
! ! |
|
156 |
||
157 |
!ObjectModuleInformation class methodsFor:'menu specs'! |
|
158 |
||
159 |
mainMenu |
|
160 |
"This resource specification was automatically generated |
|
161 |
by the MenuEditor of ST/X." |
|
162 |
||
163 |
"Do not manually edit this!! If it is corrupted, |
|
164 |
the MenuEditor may not be able to read the specification." |
|
165 |
||
166 |
" |
|
2183 | 167 |
MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#mainMenu |
168 |
(Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation mainMenu)) startUp |
|
2181 | 169 |
" |
170 |
||
171 |
<resource: #menu> |
|
172 |
||
173 |
^ |
|
174 |
#(Menu |
|
175 |
( |
|
176 |
(MenuItem |
|
177 |
label: 'File' |
|
178 |
translateLabel: true |
|
179 |
submenu: |
|
180 |
(Menu |
|
181 |
( |
|
182 |
(MenuItem |
|
183 |
label: 'Exit' |
|
184 |
itemValue: closeRequest |
|
185 |
translateLabel: true |
|
186 |
) |
|
187 |
) |
|
188 |
nil |
|
189 |
nil |
|
190 |
) |
|
191 |
) |
|
192 |
(MenuItem |
|
193 |
label: 'View' |
|
194 |
translateLabel: true |
|
195 |
submenu: |
|
196 |
(Menu |
|
197 |
( |
|
198 |
(MenuItem |
|
199 |
label: 'Builtin' |
|
200 |
translateLabel: true |
|
2183 | 201 |
hideMenuOnActivated: false |
2181 | 202 |
indication: showBuiltIn |
203 |
) |
|
204 |
(MenuItem |
|
205 |
label: 'Class Libraries' |
|
206 |
translateLabel: true |
|
2183 | 207 |
hideMenuOnActivated: false |
2181 | 208 |
indication: showClassLibs |
209 |
) |
|
210 |
(MenuItem |
|
211 |
label: 'Methods' |
|
212 |
translateLabel: true |
|
2183 | 213 |
hideMenuOnActivated: false |
2181 | 214 |
indication: showMethods |
215 |
) |
|
216 |
(MenuItem |
|
217 |
label: 'C-Objects' |
|
218 |
translateLabel: true |
|
2183 | 219 |
hideMenuOnActivated: false |
2181 | 220 |
indication: showCObjects |
221 |
) |
|
222 |
(MenuItem |
|
223 |
label: 'Others' |
|
224 |
translateLabel: true |
|
2183 | 225 |
hideMenuOnActivated: false |
2181 | 226 |
indication: showOthers |
227 |
) |
|
228 |
) |
|
229 |
nil |
|
230 |
nil |
|
231 |
) |
|
232 |
) |
|
233 |
(MenuItem |
|
234 |
label: 'Module' |
|
235 |
translateLabel: true |
|
236 |
submenu: |
|
237 |
(Menu |
|
238 |
( |
|
2253 | 239 |
(MenuItem |
240 |
enabled: canBrowseSelectedModule |
|
241 |
label: 'Browse' |
|
242 |
itemValue: browseModule |
|
243 |
translateLabel: true |
|
244 |
) |
|
245 |
(MenuItem |
|
246 |
enabled: canCopyClassNameList |
|
247 |
label: 'Copy Version Info to Clipboard' |
|
248 |
itemValue: copyClassOrVMNameList |
|
249 |
translateLabel: true |
|
250 |
) |
|
2181 | 251 |
(MenuItem |
2253 | 252 |
label: '-' |
253 |
) |
|
254 |
(MenuItem |
|
255 |
enabled: canUnloadSelectedModule |
|
2181 | 256 |
label: 'Unload' |
257 |
translateLabel: true |
|
2253 | 258 |
itemValue: unloadSelectedModule |
2181 | 259 |
) |
2253 | 260 |
(MenuItem |
261 |
enabled: canUnloadSelectedModule |
|
262 |
label: 'Remove Classes && Unload' |
|
263 |
itemValue: unloadSelectedModuleAndRemoveClasses |
|
264 |
translateLabel: true |
|
265 |
) |
|
2181 | 266 |
) |
267 |
nil |
|
268 |
nil |
|
269 |
) |
|
270 |
) |
|
271 |
(MenuItem |
|
272 |
label: 'Help' |
|
273 |
translateLabel: true |
|
274 |
startGroup: conditionalRight |
|
275 |
submenu: |
|
276 |
(Menu |
|
277 |
( |
|
278 |
(MenuItem |
|
279 |
label: 'Documentation' |
|
280 |
itemValue: openDocumentation |
|
281 |
translateLabel: true |
|
282 |
) |
|
283 |
(MenuItem |
|
284 |
label: '-' |
|
285 |
) |
|
286 |
(MenuItem |
|
287 |
label: 'About this Application...' |
|
288 |
itemValue: openAboutThisApplication |
|
289 |
translateLabel: true |
|
290 |
) |
|
291 |
) |
|
292 |
nil |
|
293 |
nil |
|
294 |
) |
|
295 |
) |
|
296 |
) |
|
297 |
nil |
|
298 |
nil |
|
299 |
) |
|
2253 | 300 |
! |
301 |
||
302 |
moduleItemMenu |
|
303 |
"This resource specification was automatically generated |
|
304 |
by the MenuEditor of ST/X." |
|
305 |
||
306 |
"Do not manually edit this!! If it is corrupted, |
|
307 |
the MenuEditor may not be able to read the specification." |
|
308 |
||
309 |
" |
|
310 |
MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#moduleItemMenu |
|
311 |
(Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation moduleItemMenu)) startUp |
|
312 |
" |
|
313 |
||
314 |
<resource: #menu> |
|
315 |
||
316 |
^ |
|
317 |
#(Menu |
|
318 |
( |
|
319 |
(MenuItem |
|
320 |
enabled: canBrowseSelectedClass |
|
321 |
label: 'Browse' |
|
322 |
itemValue: browseClass |
|
323 |
translateLabel: true |
|
324 |
) |
|
325 |
(MenuItem |
|
326 |
label: '-' |
|
327 |
) |
|
328 |
(MenuItem |
|
329 |
enabled: canCopyClassNameList |
|
330 |
label: 'Copy Version Info to Clipboard' |
|
331 |
itemValue: copyClassOrVMNameList |
|
332 |
translateLabel: true |
|
333 |
) |
|
334 |
) |
|
335 |
nil |
|
336 |
nil |
|
337 |
) |
|
338 |
! |
|
339 |
||
340 |
moduleMenu |
|
341 |
"This resource specification was automatically generated |
|
342 |
by the MenuEditor of ST/X." |
|
343 |
||
344 |
"Do not manually edit this!! If it is corrupted, |
|
345 |
the MenuEditor may not be able to read the specification." |
|
346 |
||
347 |
" |
|
348 |
MenuEditor new openOnClass:Tools::ObjectModuleInformation andSelector:#moduleMenu |
|
349 |
(Menu new fromLiteralArrayEncoding:(Tools::ObjectModuleInformation moduleMenu)) startUp |
|
350 |
" |
|
351 |
||
352 |
<resource: #menu> |
|
353 |
||
354 |
^ |
|
355 |
#(Menu |
|
356 |
( |
|
357 |
(MenuItem |
|
358 |
enabled: canBrowseSelectedModule |
|
359 |
label: 'Browse' |
|
360 |
itemValue: browseModule |
|
361 |
translateLabel: true |
|
362 |
) |
|
363 |
(MenuItem |
|
364 |
enabled: canCopyClassNameList |
|
365 |
label: 'Copy Version Info to Clipboard' |
|
366 |
itemValue: copyClassOrVMNameList |
|
367 |
translateLabel: true |
|
368 |
) |
|
369 |
(MenuItem |
|
370 |
label: '-' |
|
371 |
) |
|
372 |
(MenuItem |
|
373 |
enabled: canUnloadSelectedModule |
|
374 |
label: 'Remove Classes && Unload' |
|
375 |
itemValue: unloadSelectedModuleAndRemoveClasses |
|
376 |
translateLabel: true |
|
377 |
) |
|
378 |
(MenuItem |
|
379 |
enabled: canUnloadSelectedModule |
|
380 |
label: 'Unload' |
|
381 |
itemValue: unloadSelectedModule |
|
382 |
translateLabel: true |
|
383 |
) |
|
384 |
) |
|
385 |
nil |
|
386 |
nil |
|
387 |
) |
|
2181 | 388 |
! ! |
389 |
||
390 |
!ObjectModuleInformation class methodsFor:'tableColumns specs'! |
|
391 |
||
392 |
tableColumns |
|
393 |
"This resource specification was automatically generated |
|
394 |
by the DataSetBuilder of ST/X." |
|
395 |
||
396 |
"Do not manually edit this!! If it is corrupted, |
|
397 |
the DataSetBuilder may not be able to read the specification." |
|
398 |
||
399 |
" |
|
400 |
DataSetBuilder new openOnClass:ObjectModuleInformation andSelector:#tableColumns |
|
401 |
" |
|
402 |
||
403 |
<resource: #tableColumns> |
|
404 |
||
405 |
^#( |
|
406 |
(DataSetColumnSpec |
|
407 |
label: 'Name' |
|
408 |
activeHelpKey: '' |
|
409 |
labelButtonType: Button |
|
410 |
width: 0.5 |
|
411 |
model: name |
|
412 |
canSelect: false |
|
413 |
) |
|
414 |
(DataSetColumnSpec |
|
415 |
label: 'Version' |
|
416 |
activeHelpKey: '' |
|
417 |
labelButtonType: Button |
|
418 |
model: version |
|
419 |
canSelect: false |
|
420 |
) |
|
421 |
(DataSetColumnSpec |
|
422 |
label: 'Date' |
|
423 |
activeHelpKey: '' |
|
424 |
labelButtonType: Button |
|
425 |
model: date |
|
426 |
canSelect: false |
|
427 |
) |
|
428 |
) |
|
429 |
||
2183 | 430 |
! |
431 |
||
432 |
tableColumnsForSingleInfo |
|
433 |
"This resource specification was automatically generated |
|
434 |
by the DataSetBuilder of ST/X." |
|
435 |
||
436 |
"Do not manually edit this!! If it is corrupted, |
|
437 |
the DataSetBuilder may not be able to read the specification." |
|
438 |
||
439 |
" |
|
440 |
DataSetBuilder new openOnClass:Tools::ObjectModuleInformation andSelector:#tableColumnsForSingleInfo |
|
441 |
" |
|
442 |
||
443 |
<resource: #tableColumns> |
|
444 |
||
445 |
^#( |
|
446 |
(DataSetColumnSpec |
|
447 |
label: '' |
|
448 |
activeHelpKey: '' |
|
449 |
labelButtonType: None |
|
450 |
width: 0.3 |
|
451 |
model: name |
|
452 |
canSelect: false |
|
453 |
) |
|
454 |
(DataSetColumnSpec |
|
455 |
label: '' |
|
456 |
activeHelpKey: '' |
|
457 |
labelButtonType: None |
|
458 |
model: value |
|
459 |
canSelect: false |
|
460 |
) |
|
461 |
) |
|
462 |
||
2181 | 463 |
! ! |
464 |
||
465 |
!ObjectModuleInformation methodsFor:'aspects'! |
|
466 |
||
2253 | 467 |
canBrowseSelectedClass |
468 |
^ [classNamesShown notEmptyOrNil |
|
469 |
and:[ self selectedInfoIndex notNil |
|
470 |
and:[ self selectedInfoIndex ~~ 0 ]]] |
|
471 |
||
472 |
"Modified: / 05-10-2007 / 10:51:39 / cg" |
|
473 |
! |
|
474 |
||
475 |
canBrowseSelectedModule |
|
476 |
canBrowseSelectedModule isNil ifTrue:[ |
|
477 |
canBrowseSelectedModule := false asValue |
|
478 |
]. |
|
479 |
^ canBrowseSelectedModule. |
|
480 |
||
481 |
"Modified: / 05-10-2007 / 10:51:39 / cg" |
|
482 |
! |
|
483 |
||
484 |
canCopyClassNameList |
|
485 |
^ [table1VisibleHolder value |
|
486 |
and:[classInfoShown notEmptyOrNil or:[vmInfoShown notEmptyOrNil] ]] |
|
487 |
||
488 |
"Modified: / 05-10-2007 / 10:51:39 / cg" |
|
489 |
! |
|
490 |
||
491 |
canUnloadSelectedModule |
|
492 |
canUnloadSelectedModule isNil ifTrue:[ |
|
493 |
canUnloadSelectedModule := false asValue |
|
494 |
]. |
|
495 |
^ canUnloadSelectedModule. |
|
496 |
||
497 |
"Modified: / 05-10-2007 / 10:51:39 / cg" |
|
498 |
! |
|
499 |
||
2183 | 500 |
infoTable1ListHolder |
501 |
^ builder valueAspectFor:#'infoTable1ListHolder' initialValue:#() |
|
2181 | 502 |
|
2183 | 503 |
"Created: / 05-10-2007 / 12:48:06 / cg" |
504 |
! |
|
505 |
||
506 |
infoTable2ListHolder |
|
507 |
^ builder valueAspectFor:#'infoTable2ListHolder' initialValue:#() |
|
508 |
||
509 |
"Created: / 05-10-2007 / 12:48:10 / cg" |
|
2181 | 510 |
! |
511 |
||
512 |
listOfModuleNames |
|
513 |
listOfModuleNames isNil ifTrue:[ |
|
514 |
listOfModuleNames := List new. |
|
515 |
]. |
|
516 |
^ listOfModuleNames. |
|
517 |
||
518 |
"Modified: / 05-10-2007 / 10:49:19 / cg" |
|
519 |
! |
|
520 |
||
521 |
middleLabelHolder |
|
522 |
^ builder valueAspectFor:#'middleLabelHolder' initialValue:'' |
|
523 |
||
524 |
"Created: / 05-10-2007 / 11:05:08 / cg" |
|
525 |
! |
|
526 |
||
2184 | 527 |
notReadOnly |
528 |
^ self readOnly not |
|
529 |
||
530 |
"Created: / 05-10-2007 / 13:06:00 / cg" |
|
531 |
! |
|
532 |
||
533 |
readOnly |
|
534 |
^ readOnly ? false |
|
535 |
||
536 |
"Created: / 05-10-2007 / 13:05:51 / cg" |
|
537 |
! |
|
538 |
||
2253 | 539 |
readOnly:aBoolean |
540 |
readOnly := aBoolean |
|
541 |
||
542 |
"Created: / 05-10-2007 / 13:05:51 / cg" |
|
543 |
! |
|
544 |
||
545 |
selectedInfoIndex |
|
546 |
|sel| |
|
547 |
||
548 |
sel := self selectedInfoIndexHolder value. |
|
549 |
^ sel |
|
550 |
! |
|
551 |
||
552 |
selectedInfoIndexHolder |
|
553 |
selectedInfoIndexHolder isNil ifTrue:[ |
|
554 |
selectedInfoIndexHolder := ValueHolder new. |
|
555 |
selectedInfoIndexHolder onChangeSend:#selectedInfoIndexChanged to:self. |
|
556 |
]. |
|
557 |
^ selectedInfoIndexHolder. |
|
558 |
||
559 |
"Modified: / 05-10-2007 / 10:51:39 / cg" |
|
560 |
! |
|
561 |
||
562 |
selectedModuleIndex |
|
563 |
|sel| |
|
564 |
||
565 |
sel := self selectedModuleIndexHolder value. |
|
566 |
^ sel |
|
567 |
! |
|
568 |
||
2181 | 569 |
selectedModuleIndexHolder |
570 |
selectedModuleIndexHolder isNil ifTrue:[ |
|
571 |
selectedModuleIndexHolder := ValueHolder new. |
|
572 |
selectedModuleIndexHolder onChangeSend:#selectedModuleIndexChanged to:self. |
|
573 |
]. |
|
574 |
^ selectedModuleIndexHolder. |
|
575 |
||
576 |
"Modified: / 05-10-2007 / 10:51:39 / cg" |
|
577 |
! |
|
578 |
||
579 |
showBuiltIn |
|
2183 | 580 |
showBuiltIn isNil ifTrue:[ |
581 |
showBuiltIn := true asValue. |
|
582 |
showBuiltIn onChangeSend:#filterChanged to:self. |
|
583 |
]. |
|
584 |
^ showBuiltIn |
|
2181 | 585 |
|
2183 | 586 |
"Modified: / 05-10-2007 / 12:43:23 / cg" |
2181 | 587 |
! |
588 |
||
589 |
showCObjects |
|
2183 | 590 |
showCObjects isNil ifTrue:[ |
591 |
showCObjects := true asValue. |
|
592 |
showCObjects onChangeSend:#filterChanged to:self. |
|
593 |
]. |
|
594 |
^ showCObjects |
|
2181 | 595 |
|
2183 | 596 |
"Modified: / 05-10-2007 / 12:43:16 / cg" |
2181 | 597 |
! |
598 |
||
599 |
showClassLibs |
|
2183 | 600 |
showClassLibs isNil ifTrue:[ |
601 |
showClassLibs := true asValue. |
|
602 |
showClassLibs onChangeSend:#filterChanged to:self. |
|
603 |
]. |
|
604 |
^ showClassLibs |
|
2181 | 605 |
|
2183 | 606 |
"Modified: / 05-10-2007 / 12:43:10 / cg" |
2181 | 607 |
! |
608 |
||
609 |
showMethods |
|
2183 | 610 |
showMethods isNil ifTrue:[ |
611 |
showMethods := true asValue. |
|
612 |
showMethods onChangeSend:#filterChanged to:self. |
|
613 |
]. |
|
614 |
^ showMethods |
|
2181 | 615 |
|
2183 | 616 |
"Modified: / 05-10-2007 / 12:43:02 / cg" |
2181 | 617 |
! |
618 |
||
619 |
showOthers |
|
2183 | 620 |
showOthers isNil ifTrue:[ |
621 |
showOthers := true asValue. |
|
622 |
showOthers onChangeSend:#filterChanged to:self. |
|
623 |
]. |
|
624 |
^ showOthers |
|
625 |
||
626 |
"Modified: / 05-10-2007 / 12:42:54 / cg" |
|
627 |
! |
|
2181 | 628 |
|
2183 | 629 |
table1VisibleHolder |
630 |
table1VisibleHolder isNil ifTrue:[ |
|
631 |
table1VisibleHolder := true asValue. |
|
632 |
]. |
|
633 |
^ table1VisibleHolder. |
|
634 |
||
635 |
"Modified: / 05-10-2007 / 12:53:05 / cg" |
|
636 |
! |
|
637 |
||
638 |
table2VisibleHolder |
|
639 |
table2VisibleHolder isNil ifTrue:[ |
|
640 |
table2VisibleHolder := false asValue. |
|
641 |
]. |
|
642 |
^ table2VisibleHolder. |
|
643 |
||
644 |
"Modified: / 05-10-2007 / 12:53:14 / cg" |
|
2181 | 645 |
! ! |
646 |
||
647 |
!ObjectModuleInformation methodsFor:'change & update'! |
|
648 |
||
2253 | 649 |
selectedInfoIndexChanged |
650 |
! |
|
651 |
||
652 |
selectedModule |
|
653 |
|sel| |
|
654 |
||
655 |
sel := self selectedModuleIndex. |
|
656 |
sel isNil ifTrue:[^ nil]. |
|
657 |
^ objectHandles at:sel. |
|
658 |
! |
|
2181 | 659 |
|
2253 | 660 |
selectedModuleIndexChanged |
661 |
|module info| |
|
662 |
||
663 |
info := self selectedModuleInfo. |
|
664 |
module := self selectedModule. |
|
665 |
||
666 |
self canBrowseSelectedModule value:(info notNil and:[info ~~ #VM and:[module notNil]]). |
|
2343
20eee34c4c8b
changed #selectedModuleIndexChanged
Claus Gittinger <cg@exept.de>
parents:
2254
diff
changeset
|
667 |
self canUnloadSelectedModule value:(self readOnly not and:[info ~~ #VM and:[info notNil and:[info dynamic]]]). |
2253 | 668 |
|
669 |
classNamesShown := nil. |
|
670 |
classInfoShown := nil. |
|
671 |
vmInfoShown := nil. |
|
2181 | 672 |
|
673 |
info isNil ifTrue:[ |
|
674 |
"/ selected a method, cObject or unknown |
|
2253 | 675 |
self showInfoForNonClassLib:(self selectedModuleIndex). |
2181 | 676 |
^ self. |
677 |
]. |
|
678 |
info == #VM ifTrue:[ |
|
679 |
"/ selected the pseudo entry for the VM itself |
|
680 |
self showInfoForVM. |
|
681 |
^ self. |
|
682 |
]. |
|
683 |
"/ selected a class-library package |
|
684 |
self showInfoForClassLib:info. |
|
685 |
||
2183 | 686 |
"Modified: / 05-10-2007 / 12:56:13 / cg" |
2181 | 687 |
! |
688 |
||
2253 | 689 |
selectedModuleInfo |
690 |
|sel info| |
|
691 |
||
692 |
sel := self selectedModuleIndex. |
|
693 |
sel notNil ifTrue:[ |
|
694 |
(self showClassLibs value or:[self showBuiltIn value]) ifTrue:[ |
|
695 |
info := allModules at:sel ifAbsent:nil. |
|
696 |
]. |
|
697 |
]. |
|
698 |
^ info |
|
699 |
! |
|
700 |
||
2181 | 701 |
showInfoForClassLib:info |
702 |
"/ selected a package; fill bottom list with class-info |
|
703 |
||
2402 | 704 |
|rows| |
2181 | 705 |
|
706 |
self middleLabelHolder value:'Contains Modules:'. |
|
707 |
||
2402 | 708 |
classNamesShown := self shownClassNamesFor:info. |
2181 | 709 |
|
2402 | 710 |
rows := classNamesShown collect:[:cName | |
2181 | 711 |
|cls entry rev listEntry revisionInfo| |
712 |
||
713 |
listEntry := InfoRow new. |
|
714 |
listEntry name:cName. |
|
715 |
||
716 |
cls := Smalltalk classNamed:cName. |
|
717 |
cls isNil ifTrue:[ |
|
2183 | 718 |
(cName endsWith:'_extensions') ifFalse:[ |
719 |
listEntry version:'(class removed)'. |
|
720 |
] |
|
2181 | 721 |
] ifFalse:[ |
722 |
rev := cls binaryRevision. |
|
723 |
rev notNil ifTrue:[ |
|
724 |
cls isLoaded ifFalse:[ |
|
725 |
entry := '(stub for: ' , rev. |
|
726 |
] ifTrue:[ |
|
727 |
entry :='(bin: ' , rev. |
|
728 |
]. |
|
729 |
cls revision ~= rev ifTrue:[ |
|
730 |
entry := entry , ' / src: ' , (cls revision printString) |
|
731 |
]. |
|
732 |
entry := entry , ')'. |
|
733 |
listEntry version:entry |
|
734 |
] ifFalse:[ |
|
735 |
cls revision notNil ifTrue:[ |
|
736 |
listEntry version:'(overloaded by: ' , cls revision , ')' |
|
737 |
] |
|
738 |
]. |
|
739 |
revisionInfo := cls revisionInfo. |
|
740 |
revisionInfo notNil ifTrue:[ |
|
741 |
listEntry date:(revisionInfo at:#date) |
|
742 |
]. |
|
743 |
]. |
|
744 |
listEntry |
|
745 |
]. |
|
746 |
||
2253 | 747 |
classInfoShown := rows. |
748 |
||
2183 | 749 |
self infoTable1ListHolder value:rows. |
750 |
self table1VisibleHolder value:true. |
|
751 |
self table2VisibleHolder value:false. |
|
2181 | 752 |
|
2183 | 753 |
"Modified: / 05-10-2007 / 13:03:56 / cg" |
2181 | 754 |
! |
755 |
||
756 |
showInfoForNonClassLib:sel |
|
757 |
"/ selected a method, cObject or unknown |
|
758 |
||
2183 | 759 |
|module fileName list entry| |
2181 | 760 |
|
2253 | 761 |
sel isNil ifTrue:[ |
762 |
self table1VisibleHolder value:false. |
|
763 |
self table2VisibleHolder value:false. |
|
764 |
^ self. |
|
765 |
]. |
|
766 |
||
2181 | 767 |
module := objectHandles at:sel. |
768 |
fileName := module pathName. |
|
769 |
||
770 |
module isMethodHandle ifTrue:[ |
|
771 |
|method nm entry1 entry2 entry3| |
|
772 |
||
2183 | 773 |
self middleLabelHolder value:'Compiled Method:'. |
2181 | 774 |
|
775 |
(method := module method) isNil ifTrue:[ |
|
776 |
nm := '** removed **'. |
|
777 |
] ifFalse:[ |
|
778 |
"/ menu := PopUpMenu |
|
779 |
"/ labels:#('Inspect' 'Browse') |
|
780 |
"/ selectors:#(inspect browse). |
|
781 |
"/ menu actionAt:#inspect put:[ method inspect ]. |
|
782 |
"/ menu actionAt:#browse put:[ |who| |
|
783 |
"/ who := method who. |
|
784 |
"/ UserPreferences systemBrowserClass |
|
785 |
"/ openInClass:(who methodClass) |
|
786 |
"/ selector:(who methodSelector) |
|
787 |
"/ ]. |
|
788 |
"/ listView1 middleButtonMenu:menu. |
|
789 |
||
790 |
nm := (method whoString) asText emphasizeAllWith:(#color->Color blue). |
|
791 |
]. |
|
792 |
entry1 := InfoRow new. |
|
2183 | 793 |
entry1 name:'Compiled method'; value:nm. |
2181 | 794 |
|
795 |
entry2 := InfoRow new. |
|
2183 | 796 |
entry2 name:'Path'; value:fileName. |
2181 | 797 |
|
798 |
entry3 := InfoRow new. |
|
2183 | 799 |
entry3 name:'Address'; value:('(16r) ' , (method code address hexPrintString leftPaddedTo:8 with:$0)). |
2181 | 800 |
|
2183 | 801 |
self infoTable2ListHolder value:(Array with:entry1 with:entry2 with:entry3). |
802 |
self table1VisibleHolder value:false. |
|
803 |
self table2VisibleHolder value:true. |
|
2181 | 804 |
^ self. |
805 |
]. |
|
806 |
||
807 |
(module isFunctionObjectHandle |
|
808 |
and:[module functions notEmpty]) ifTrue:[ |
|
2183 | 809 |
self middleLabelHolder value:'Functions:'. |
2181 | 810 |
|
811 |
"/ menu := PopUpMenu |
|
812 |
"/ labels:#('Inspect') |
|
813 |
"/ selectors:#(inspect). |
|
814 |
"/ menu actionAt:#inspect put:[ module functions inspect ]. |
|
815 |
"/ listView1 middleButtonMenu:menu. |
|
816 |
"/ |
|
817 |
list := (module functions select:[:f | f notNil]) |
|
818 |
collect:[:f | |entry| |
|
819 |
entry := InfoRow new. |
|
820 |
entry name:(f name asText emphasizeAllWith:(#color->Color blue)). |
|
2183 | 821 |
entry value:('address: (16r) ' , (f code address hexPrintString leftPaddedTo:8 with:$0)). |
2181 | 822 |
entry |
823 |
]. |
|
2183 | 824 |
self infoTable2ListHolder value:list. |
825 |
self table1VisibleHolder value:false. |
|
826 |
self table2VisibleHolder value:true. |
|
2181 | 827 |
^ self. |
828 |
]. |
|
829 |
||
830 |
entry := InfoRow new. |
|
831 |
entry name:'Unknown'. |
|
2183 | 832 |
self infoTable2ListHolder value:(Array with:entry). |
833 |
self table1VisibleHolder value:false. |
|
834 |
self table2VisibleHolder value:true. |
|
2181 | 835 |
|
2183 | 836 |
"Modified: / 05-10-2007 / 13:01:33 / cg" |
2181 | 837 |
! |
838 |
||
839 |
showInfoForVM |
|
840 |
"/ show file versions in lower view. |
|
841 |
||
842 |
|l| |
|
843 |
||
844 |
self middleLabelHolder value:'Contains Modules:'. |
|
845 |
||
846 |
l := (ObjectMemory getVMIdentificationStrings). |
|
847 |
l := l select:[:entry | entry includesString:'$Header']. |
|
848 |
l := l select:[:entry | entry includesString:',v']. |
|
849 |
l := l collect:[:entry | |
|
850 |
|i1 i2 file revision date listEntry| |
|
851 |
||
852 |
listEntry := InfoRow new. |
|
853 |
||
854 |
i1 := entry indexOfSubCollection:'librun'. |
|
855 |
i1 ~~ 0 ifTrue:[ |
|
856 |
i2 := entry indexOfSubCollection:',v' startingAt:i1. |
|
857 |
i2 ~~ 0 ifTrue:[ |
|
858 |
file := entry copyFrom:i1+7 to:(i2-1). |
|
859 |
listEntry name:file. |
|
860 |
||
861 |
i1 := i2+3. |
|
862 |
i2 := entry indexOfSeparatorStartingAt:i1. |
|
863 |
revision := entry copyFrom:i1 to:(i2-1). |
|
864 |
listEntry version:revision. |
|
865 |
||
866 |
i1 := i2+1. |
|
867 |
i2 := entry indexOfSeparatorStartingAt:i1. |
|
868 |
date := entry copyFrom:i1 to:(i2-1). |
|
869 |
listEntry date:date. |
|
870 |
]. |
|
871 |
]. |
|
872 |
listEntry. |
|
873 |
]. |
|
2253 | 874 |
|
875 |
vmInfoShown := l. |
|
2183 | 876 |
self infoTable1ListHolder value:l. |
877 |
self table1VisibleHolder value:true. |
|
878 |
self table2VisibleHolder value:false. |
|
2181 | 879 |
|
880 |
"/ readOnly ifFalse:[ |
|
881 |
"/ unloadButton disable. |
|
882 |
"/ unloadAndRemoveButton disable. |
|
883 |
"/ ] |
|
884 |
||
2183 | 885 |
"Modified: / 05-10-2007 / 12:53:44 / cg" |
2402 | 886 |
! |
887 |
||
888 |
shownClassNamesFor:info |
|
889 |
"/ selected a package; fill bottom list with class-info |
|
890 |
||
891 |
|classNames| |
|
892 |
||
893 |
classNames := info classNames asSortedCollection. |
|
894 |
^ classNames |
|
895 |
select:[:cName | |
|
896 |
|cls| |
|
897 |
||
898 |
cls := Smalltalk classNamed:cName. |
|
899 |
cls isNil ifTrue:[ |
|
900 |
true "a removed class" |
|
901 |
] ifFalse:[ |
|
902 |
cls isPrivate not |
|
903 |
]. |
|
904 |
]. |
|
2181 | 905 |
! ! |
906 |
||
907 |
!ObjectModuleInformation methodsFor:'initialization'! |
|
908 |
||
909 |
postBuildWith:aBuilder |
|
910 |
|canDoIt| |
|
911 |
||
912 |
super postBuildWith:aBuilder. |
|
913 |
||
914 |
canDoIt := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
915 |
self showBuiltIn value:canDoIt. |
|
916 |
self showCObjects value:canDoIt. |
|
917 |
self showClassLibs value:canDoIt. |
|
918 |
self showMethods value:canDoIt. |
|
919 |
self showOthers value:canDoIt. |
|
920 |
||
921 |
self updateModuleList |
|
922 |
||
923 |
"Created: / 05-10-2007 / 10:50:27 / cg" |
|
924 |
! ! |
|
925 |
||
926 |
!ObjectModuleInformation methodsFor:'menu actions'! |
|
927 |
||
2253 | 928 |
browseClass |
2402 | 929 |
|module info classNames selectedClassName selectedClass packageID methods| |
2253 | 930 |
|
931 |
module := self selectedModule. |
|
932 |
info := self selectedModuleInfo. |
|
2402 | 933 |
classNames := (self shownClassNamesFor:info) asSortedCollection. |
2253 | 934 |
selectedClassName := classNames at:(self selectedInfoIndex). |
935 |
selectedClass := Smalltalk classNamed:selectedClassName. |
|
936 |
||
2402 | 937 |
selectedClass notNil ifTrue:[ |
938 |
Smalltalk browseInClass:selectedClass. |
|
939 |
^ self. |
|
940 |
]. |
|
941 |
||
942 |
"/ clicked on an extensions-module ? |
|
943 |
(selectedClassName endsWith:'_extensions') ifTrue:[ |
|
944 |
packageID := (selectedClassName copyWithoutLast:('_extensions' size)) asSymbol. |
|
945 |
methods := Smalltalk allExtensionsForPackage:packageID. |
|
946 |
(UserPreferences browserClass) browseMethods:methods title:('Extensions for ',packageID). |
|
947 |
]. |
|
948 |
self halt. |
|
2253 | 949 |
! |
950 |
||
951 |
browseModule |
|
952 |
|module classes| |
|
953 |
||
954 |
module := self selectedModule. |
|
955 |
classes := module classNames collect:[:nm | Smalltalk classNamed:nm]. |
|
956 |
UserPreferences systemBrowserClass |
|
957 |
browseClasses:classes |
|
958 |
label:(resources string:'Classes in %1' with:module libraryName) |
|
959 |
! |
|
960 |
||
961 |
copyClassOrVMNameList |
|
962 |
|text| |
|
963 |
||
964 |
text := ((classInfoShown ? vmInfoShown)collect:[:eachRow | eachRow infoString]) asStringCollection asString. |
|
965 |
self window setClipboardText:text. |
|
966 |
! |
|
967 |
||
2181 | 968 |
openDocumentation |
2184 | 969 |
self openHTMLDocument: 'tools/misc/TOP.html#MODULEINFO' |
2181 | 970 |
|
2184 | 971 |
"Modified: / 05-10-2007 / 13:11:45 / cg" |
2253 | 972 |
! |
973 |
||
2254 | 974 |
unloadSelectedModule |
975 |
self unloadSelectedModuleRemoveClasses:false |
|
2253 | 976 |
! |
977 |
||
2254 | 978 |
unloadSelectedModuleAndRemoveClasses |
979 |
self unloadSelectedModuleRemoveClasses:true |
|
2253 | 980 |
! |
981 |
||
2254 | 982 |
unloadSelectedModuleRemoveClasses:doRemoveClasses |
2253 | 983 |
self withWaitCursorDo:[ |
984 |
|info idx handle pathName| |
|
985 |
||
986 |
info := self selectedModuleInfo. |
|
2254 | 987 |
handle := objectHandles at:(self selectedModuleIndex). |
2253 | 988 |
self selectedModuleIndexHolder value:nil. |
989 |
||
990 |
info isNil ifTrue:[ |
|
991 |
"/ selected a method |
|
992 |
"/ idx := idx - allModules size. |
|
993 |
pathName := handle pathName. |
|
994 |
] ifFalse:[ |
|
995 |
"/ selected a package |
|
996 |
pathName := info pathName. |
|
997 |
]. |
|
998 |
pathName notNil ifTrue:[ |
|
999 |
doRemoveClasses ifTrue:[ |
|
1000 |
ObjectFileLoader unloadObjectFileAndRemoveClasses:pathName. |
|
1001 |
] ifFalse:[ |
|
1002 |
ObjectFileLoader unloadObjectFile:pathName. |
|
1003 |
] |
|
1004 |
]. |
|
1005 |
self updateModuleList. |
|
1006 |
] |
|
2181 | 1007 |
! ! |
1008 |
||
1009 |
!ObjectModuleInformation methodsFor:'private'! |
|
1010 |
||
2183 | 1011 |
filterChanged |
1012 |
self updateModuleList |
|
1013 |
||
1014 |
"Created: / 05-10-2007 / 12:43:36 / cg" |
|
1015 |
! |
|
1016 |
||
2181 | 1017 |
updateModuleList |
1018 |
|showClassLibs showBuiltIn showMethods showCObjects showOthers |
|
1019 |
listOfModuleNames allObjects handles| |
|
1020 |
||
1021 |
showClassLibs := self showClassLibs value. |
|
1022 |
showBuiltIn := self showBuiltIn value. |
|
1023 |
showMethods := self showMethods value. |
|
1024 |
showCObjects := self showCObjects value. |
|
1025 |
showOthers := self showOthers value. |
|
1026 |
||
1027 |
listOfModuleNames := OrderedCollection new. |
|
1028 |
handles := OrderedCollection new. |
|
1029 |
||
1030 |
allObjects := ObjectFileLoader loadedObjectHandles. |
|
1031 |
||
1032 |
(showClassLibs or:[showBuiltIn]) ifTrue:[ |
|
1033 |
|moduleNames| |
|
1034 |
||
1035 |
allModules := ObjectMemory binaryModuleInfo asOrderedCollection. |
|
1036 |
(showBuiltIn and:[showClassLibs]) ifFalse:[ |
|
1037 |
allModules := allModules select: |
|
1038 |
[:i | |
|
1039 |
|wantToSee| |
|
1040 |
||
1041 |
wantToSee := i dynamic. |
|
1042 |
showBuiltIn ifTrue:[ |
|
1043 |
wantToSee := wantToSee not |
|
1044 |
]. |
|
1045 |
wantToSee |
|
1046 |
] |
|
1047 |
]. |
|
1048 |
||
1049 |
"/ sorting by reverse id brings newest ones to the top (a side effect) |
|
1050 |
allModules sort:[:a :b | (a id) > (b id)]. |
|
1051 |
moduleNames := allModules collect:[:entry | entry name]. |
|
1052 |
listOfModuleNames addAll:moduleNames. |
|
1053 |
handles addAll:allModules. |
|
1054 |
]. |
|
1055 |
||
1056 |
showMethods ifTrue:[ |
|
1057 |
|methodObjects methodNames| |
|
1058 |
||
1059 |
methodObjects := (allObjects select:[:h | h isMethodHandle]) asArray. |
|
1060 |
methodNames := methodObjects collect:[:mH | mH method isNil ifTrue:[ |
|
1061 |
'compiled method - removed' " , ' (in ' , mH pathName , ')' " |
|
1062 |
] ifFalse:[ |
|
1063 |
'compiled method ' , mH method whoString " , ' (in ' , mH pathName , ')' " |
|
1064 |
]. |
|
1065 |
]. |
|
1066 |
listOfModuleNames addAll:methodNames. |
|
1067 |
handles addAll:methodObjects. |
|
1068 |
]. |
|
1069 |
||
1070 |
showCObjects ifTrue:[ |
|
1071 |
|cObjects cObjectNames| |
|
1072 |
||
1073 |
cObjects := (allObjects select:[:h | h isFunctionObjectHandle]) asArray. |
|
1074 |
cObjectNames := cObjects collect:[:entry | entry pathName]. |
|
1075 |
listOfModuleNames addAll:cObjectNames. |
|
1076 |
handles addAll:cObjects. |
|
1077 |
]. |
|
1078 |
||
1079 |
showOthers ifTrue:[ |
|
1080 |
|otherObjects otherObjectNames| |
|
1081 |
||
1082 |
otherObjects := (allObjects select:[:h | (h isFunctionObjectHandle |
|
1083 |
or:[h isMethodHandle |
|
1084 |
or:[h isClassLibHandle]]) not]) asArray. |
|
1085 |
otherObjectNames := otherObjects collect:[:entry | entry pathName]. |
|
1086 |
listOfModuleNames addAll:otherObjectNames. |
|
1087 |
handles addAll:otherObjects. |
|
1088 |
]. |
|
1089 |
||
1090 |
showBuiltIn ifTrue:[ |
|
1091 |
listOfModuleNames addFirst:'VM'. |
|
1092 |
handles addFirst:#VM. |
|
1093 |
allModules addFirst:#VM. |
|
1094 |
]. |
|
1095 |
||
1096 |
self listOfModuleNames contents:listOfModuleNames. |
|
2183 | 1097 |
objectHandles := handles. |
2181 | 1098 |
|
2183 | 1099 |
"Modified: / 05-10-2007 / 12:45:37 / cg" |
2181 | 1100 |
! ! |
1101 |
||
1102 |
!ObjectModuleInformation::InfoRow methodsFor:'accessing'! |
|
1103 |
||
1104 |
date |
|
1105 |
^ date |
|
1106 |
! |
|
1107 |
||
1108 |
date:something |
|
1109 |
date := something. |
|
1110 |
! |
|
1111 |
||
1112 |
name |
|
1113 |
^ name |
|
1114 |
! |
|
1115 |
||
1116 |
name:something |
|
1117 |
name := something. |
|
1118 |
! |
|
1119 |
||
1120 |
name:nameArg version:versionArg date:dateArg |
|
1121 |
name := nameArg. |
|
1122 |
version := versionArg. |
|
1123 |
date := dateArg. |
|
1124 |
! |
|
1125 |
||
2183 | 1126 |
value |
1127 |
^ value |
|
1128 |
! |
|
1129 |
||
1130 |
value:something |
|
1131 |
value := something. |
|
1132 |
! |
|
1133 |
||
2181 | 1134 |
version |
1135 |
^ version |
|
1136 |
! |
|
1137 |
||
1138 |
version:something |
|
1139 |
version := something. |
|
1140 |
! ! |
|
1141 |
||
2253 | 1142 |
!ObjectModuleInformation::InfoRow methodsFor:'info'! |
1143 |
||
1144 |
infoString |
|
1145 |
^ name , ' ', (version ? '-') , ' ', (date ? '-') printString |
|
1146 |
! ! |
|
1147 |
||
2181 | 1148 |
!ObjectModuleInformation class methodsFor:'documentation'! |
1149 |
||
1150 |
version |
|
1151 |
^ '$Header$' |
|
1152 |
! ! |