care for unloadable libs
authorClaus Gittinger <cg@exept.de>
Fri, 12 Jul 1996 17:38:21 +0200
changeset 306 3e2f45a18d3b
parent 305 d5e07cd0fe2b
child 307 2552fd5e8592
care for unloadable libs
ObjFLoader.st
ObjectFileLoader.st
--- a/ObjFLoader.st	Fri Jul 12 17:29:54 1996 +0200
+++ b/ObjFLoader.st	Fri Jul 12 17:38:21 1996 +0200
@@ -2074,7 +2074,8 @@
                         where := oldDummyMethod who.
                         newHandle := self loadMethodObjectFile:fileName.
                         newHandle isNil ifTrue:[
-                            ('OBJFLOADER: failed to reload method in ' , fileName , ' ...') infoPrintNL.
+                            ('OBJFLOADER: failed to reload method in ' , fileName , ' ...') errorPrintNL.
+                            handle moduleID:nil.
                         ] ifFalse:[
                             m := newHandle method.
                             m source:(oldDummyMethod source).
@@ -2096,24 +2097,29 @@
                         functions isEmpty ifTrue:[
                             ('OBJFLOADER: ignore obsolete (unreferenced) functions in ' , fileName) infoPrintNL
                         ] ifFalse:[
-                            ('OBJFLOADER: reloading ' , fileName , ' ...') infoPrintNL.
                             newHandle := self loadDynamicObject:fileName.
-                            functions do:[:oldFunction |
-                                newFunction := newHandle getFunction:(oldFunction name).
-                                newFunction isNil ifTrue:[
-                                    ('OBJFLOADER: function: ''' , oldFunction name , ''' no longer present.') infoPrintNL.
-                                    oldFunction code:nil.
-                                    oldFunction setName:oldFunction name moduleHandle:nil.
-                                ] ifFalse:[
-                                    oldFunction code:(newFunction code).
-                                    oldFunction setName:oldFunction name moduleHandle:newHandle.
-                                    ('OBJFLOADER: rebound function: ''' , oldFunction name , '''.') infoPrintNL.
-                                ]
-                            ].
-                            handle becomeSameAs:newHandle.      "/ the old handle is now void
+                            newHandle isNil ifTrue:[
+                                ('OBJFLOADER: failed to reload ' , fileName , ' ...') errorPrintNL.
+                                handle moduleID:nil.
+                            ] ifFalse:[
+                                ('OBJFLOADER: reloading ' , fileName , ' ...') infoPrintNL.
+                                functions do:[:oldFunction |
+                                    newFunction := newHandle getFunction:(oldFunction name).
+                                    newFunction isNil ifTrue:[
+                                        ('OBJFLOADER: function: ''' , oldFunction name , ''' no longer present.') errorPrintNL.
+                                        oldFunction code:nil.
+                                        oldFunction setName:oldFunction name moduleHandle:nil.
+                                    ] ifFalse:[
+                                        oldFunction code:(newFunction code).
+                                        oldFunction setName:oldFunction name moduleHandle:newHandle.
+                                        ('OBJFLOADER: rebound function: ''' , oldFunction name , '''.') infoPrintNL.
+                                    ]
+                                ].
+                                handle becomeSameAs:newHandle.      "/ the old handle is now void
+                            ]
                         ]
                     ] ifFalse:[
-                        ('OBJFLOADER: oops - invalid (obsolete) objectFile handle: ' , handle printString) infoPrintNL.
+                        ('OBJFLOADER: ignored invalid (obsolete) objectFile handle: ' , handle printString) infoPrintNL.
                     ]
                 ]
             ]
@@ -2121,7 +2127,7 @@
         PreviouslyLoadedObjects := nil
     ]
 
-    "Modified: 12.7.1996 / 17:28:41 / cg"
+    "Modified: 12.7.1996 / 17:37:48 / cg"
 !
 
 rememberAllObjectFiles
@@ -3284,6 +3290,6 @@
 !ObjectFileLoader  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.101 1996-07-12 15:29:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.102 1996-07-12 15:38:21 cg Exp $'
 ! !
 ObjectFileLoader initialize!
--- a/ObjectFileLoader.st	Fri Jul 12 17:29:54 1996 +0200
+++ b/ObjectFileLoader.st	Fri Jul 12 17:38:21 1996 +0200
@@ -2074,7 +2074,8 @@
                         where := oldDummyMethod who.
                         newHandle := self loadMethodObjectFile:fileName.
                         newHandle isNil ifTrue:[
-                            ('OBJFLOADER: failed to reload method in ' , fileName , ' ...') infoPrintNL.
+                            ('OBJFLOADER: failed to reload method in ' , fileName , ' ...') errorPrintNL.
+                            handle moduleID:nil.
                         ] ifFalse:[
                             m := newHandle method.
                             m source:(oldDummyMethod source).
@@ -2096,24 +2097,29 @@
                         functions isEmpty ifTrue:[
                             ('OBJFLOADER: ignore obsolete (unreferenced) functions in ' , fileName) infoPrintNL
                         ] ifFalse:[
-                            ('OBJFLOADER: reloading ' , fileName , ' ...') infoPrintNL.
                             newHandle := self loadDynamicObject:fileName.
-                            functions do:[:oldFunction |
-                                newFunction := newHandle getFunction:(oldFunction name).
-                                newFunction isNil ifTrue:[
-                                    ('OBJFLOADER: function: ''' , oldFunction name , ''' no longer present.') infoPrintNL.
-                                    oldFunction code:nil.
-                                    oldFunction setName:oldFunction name moduleHandle:nil.
-                                ] ifFalse:[
-                                    oldFunction code:(newFunction code).
-                                    oldFunction setName:oldFunction name moduleHandle:newHandle.
-                                    ('OBJFLOADER: rebound function: ''' , oldFunction name , '''.') infoPrintNL.
-                                ]
-                            ].
-                            handle becomeSameAs:newHandle.      "/ the old handle is now void
+                            newHandle isNil ifTrue:[
+                                ('OBJFLOADER: failed to reload ' , fileName , ' ...') errorPrintNL.
+                                handle moduleID:nil.
+                            ] ifFalse:[
+                                ('OBJFLOADER: reloading ' , fileName , ' ...') infoPrintNL.
+                                functions do:[:oldFunction |
+                                    newFunction := newHandle getFunction:(oldFunction name).
+                                    newFunction isNil ifTrue:[
+                                        ('OBJFLOADER: function: ''' , oldFunction name , ''' no longer present.') errorPrintNL.
+                                        oldFunction code:nil.
+                                        oldFunction setName:oldFunction name moduleHandle:nil.
+                                    ] ifFalse:[
+                                        oldFunction code:(newFunction code).
+                                        oldFunction setName:oldFunction name moduleHandle:newHandle.
+                                        ('OBJFLOADER: rebound function: ''' , oldFunction name , '''.') infoPrintNL.
+                                    ]
+                                ].
+                                handle becomeSameAs:newHandle.      "/ the old handle is now void
+                            ]
                         ]
                     ] ifFalse:[
-                        ('OBJFLOADER: oops - invalid (obsolete) objectFile handle: ' , handle printString) infoPrintNL.
+                        ('OBJFLOADER: ignored invalid (obsolete) objectFile handle: ' , handle printString) infoPrintNL.
                     ]
                 ]
             ]
@@ -2121,7 +2127,7 @@
         PreviouslyLoadedObjects := nil
     ]
 
-    "Modified: 12.7.1996 / 17:28:41 / cg"
+    "Modified: 12.7.1996 / 17:37:48 / cg"
 !
 
 rememberAllObjectFiles
@@ -3284,6 +3290,6 @@
 !ObjectFileLoader  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.101 1996-07-12 15:29:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.102 1996-07-12 15:38:21 cg Exp $'
 ! !
 ObjectFileLoader initialize!