--- a/Launcher.st Thu Jul 11 18:39:14 1996 +0200
+++ b/Launcher.st Fri Jul 12 23:43:00 1996 +0200
@@ -388,18 +388,30 @@
objectModuleDialog
|allModules moduleNames
allObjects methodObjects methodNames
- box l unloadButton
+ cObjects cObjectNames cFunctionNames
+ otherObjects otherObjectNames
+ box l handles unloadButton
list1 list2 listView1 listView2
- y panel showBuiltIn showModules showMethods moduleListUpdater check|
+ y panel
+ showBuiltIn showModules showMethods showCObjects showOthers
+ moduleListUpdater check canDoIt menu|
showBuiltIn := true asValue.
- showModules := ObjectFileLoader notNil asValue.
- showMethods := ObjectFileLoader notNil asValue.
+ canDoIt := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles].
+
+ showModules := canDoIt asValue.
+ showMethods := canDoIt asValue.
+ showCObjects := canDoIt asValue.
+ showOthers := canDoIt asValue.
moduleListUpdater := [
|l|
+ list2 list:nil.
+
l := Array new.
+ handles := Array new.
+
(showModules value or:[showBuiltIn value]) ifTrue:[
allModules := ObjectMemory binaryModuleInfo asOrderedCollection.
(showBuiltIn value and:[showModules value]) ifFalse:[
@@ -417,7 +429,9 @@
allModules sort:[:a :b | (a at:#id) > (b at:#id)].
moduleNames := allModules collect:[:entry | (entry at:#name)].
l := l , moduleNames.
+ handles := handles , allModules.
].
+
showMethods value ifTrue:[
allObjects := ObjectFileLoader loadedObjectHandles.
methodObjects := (allObjects select:[:h | h isMethodHandle]) asArray.
@@ -428,7 +442,27 @@
].
].
l := l , methodNames.
+ handles := handles , methodObjects.
].
+
+ showCObjects value ifTrue:[
+ allObjects := ObjectFileLoader loadedObjectHandles.
+ cObjects := (allObjects select:[:h | h isFunctionObjectHandle]) asArray.
+ cObjectNames := cObjects collect:[:entry | entry pathName].
+ l := l , cObjectNames.
+ handles := handles , cObjects.
+ ].
+
+ showOthers value ifTrue:[
+ allObjects := ObjectFileLoader loadedObjectHandles.
+ otherObjects := (allObjects select:[:h | (h isFunctionObjectHandle
+ or:[h isMethodHandle
+ or:[h isClassLibHandle]]) not]) asArray.
+ otherObjectNames := otherObjects collect:[:entry | entry pathName].
+ l := l , otherObjectNames.
+ handles := handles , otherObjects.
+ ].
+
list1 list:l.
unloadButton disable.
].
@@ -439,6 +473,8 @@
showBuiltIn onChangeSend:#value to:moduleListUpdater.
showModules onChangeSend:#value to:moduleListUpdater.
showMethods onChangeSend:#value to:moduleListUpdater.
+ showCObjects onChangeSend:#value to:moduleListUpdater.
+ showOthers onChangeSend:#value to:moduleListUpdater.
box := Dialog new.
box label:(resources string:'Module dialog').
@@ -447,21 +483,73 @@
listView1 model:list1.
listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2.
listView1 action:[:sel |
- |info classNames tabs|
+ |info classNames tabs module|
+
+ listView1 middleButtonMenu:nil.
box withWaitCursorDo:[
+ |nm fileName addr entry1 entry2 entry3 method|
+
+ tabs := TabulatorSpecification unit:#inch positions:#(0 2.6).
+
(showModules value or:[showBuiltIn value]) ifTrue:[
info := allModules at:sel ifAbsent:nil.
].
info isNil ifTrue:[
- "/ selected a method
- list2 list:#().
+ "/ selected a method, cObject or unknown
+
+ module := handles at:sel.
+ fileName := module pathName.
+
+ module isMethodHandle ifTrue:[
+
+ (method := module method) isNil ifTrue:[
+ nm := '** removed **'.
+ ] ifFalse:[
+ menu := PopUpMenu
+ labels:#('inspect' 'browse')
+ selectors:#(inspect browse).
+ menu actionAt:#inspect put:[ method inspect ].
+ menu actionAt:#browse put:[ SystemBrowser openInClass:(method who at:1) selector:(method who at:2) ].
+ listView1 middleButtonMenu:menu.
+
+ nm := (method whoString) asText emphasizeAllWith:(#color->Color blue).
+ ].
+ entry1 := MultiColListEntry new:2 tabulatorSpecification:tabs.
+ entry1 colAt:1 put:'compiled method'; colAt:2 put:nm.
+
+ entry2 := MultiColListEntry new:2 tabulatorSpecification:tabs.
+ entry2 colAt:1 put:'path'; colAt:2 put:fileName.
+
+ entry3 := MultiColListEntry new:2 tabulatorSpecification:tabs.
+ entry3 colAt:1 put:'address'; colAt:2 put:('(16r) ' , (method code hexPrintString leftPaddedTo:8 with:$0)).
+
+ list2 list:(Array with:entry1 with:entry2 with:entry3).
+ ] ifFalse:[
+ module isFunctionObjectHandle ifTrue:[
+
+ menu := PopUpMenu
+ labels:#('inspect')
+ selectors:#(inspect).
+ menu actionAt:#inspect put:[ module functions inspect ].
+ listView1 middleButtonMenu:menu.
+
+ list2 list:((module functions select:[:f | f notNil])
+ collect:[:f | |entry|
+ entry := MultiColListEntry new:2 tabulatorSpecification:tabs.
+ entry colAt:1 put:(f name asText emphasizeAllWith:(#color->Color blue)).
+ entry colAt:2 put:('address: (16r) ' , (f code hexPrintString leftPaddedTo:8 with:$0)).
+ entry
+ ]).
+ ] ifFalse:[
+ list2 list:#('nothing known about contents (no functions have been extracted)').
+ ]
+ ].
+
unloadButton enable.
] ifFalse:[
"/ selected a package
- tabs := TabulatorSpecification unit:#inch positions:#(0 2.6).
-
"/ fill bottom list with class-info
classNames := (info at:#classNames) asSortedCollection.
@@ -504,13 +592,14 @@
]
].
+
panel := HorizontalPanelView new.
- panel add:(l := Label label:'modules shown:').
+ panel add:(l := Label label:'show:').
l adjust:#left; borderWidth:0.
panel add:(check := CheckBox label:'builtin' model:showBuiltIn).
box makeTabable:check.
- panel add:(check := CheckBox label:'modules' model:showModules).
+ panel add:(check := CheckBox label:'classLibs' model:showModules).
ObjectFileLoader isNil ifTrue:[
check disable
] ifFalse:[
@@ -522,6 +611,18 @@
] ifFalse:[
box makeTabable:check.
].
+ panel add:(check := CheckBox label:'c-objects' model:showCObjects).
+ ObjectFileLoader isNil ifTrue:[
+ check disable
+ ] ifFalse:[
+ box makeTabable:check.
+ ].
+ panel add:(check := CheckBox label:'others' model:showOthers).
+ ObjectFileLoader isNil ifTrue:[
+ check disable
+ ] ifFalse:[
+ box makeTabable:check.
+ ].
panel horizontalLayout:#fitSpace.
"/ panel horizontalLayout:#leftSpace.
@@ -586,7 +687,7 @@
box destroy.
"Modified: 17.9.1995 / 16:47:50 / claus"
- "Modified: 31.5.1996 / 22:56:37 / cg"
+ "Modified: 12.7.1996 / 23:32:21 / cg"
!
snapshot
@@ -3194,5 +3295,5 @@
!NewLauncher class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.167 1996-07-11 16:39:14 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.168 1996-07-12 21:43:00 cg Exp $'
! !