ObjFLoader.st
changeset 83 10c73a059351
parent 82 8c8fce31bdde
child 84 ecb74f0507fd
--- a/ObjFLoader.st	Sun Apr 02 13:09:33 1995 +0200
+++ b/ObjFLoader.st	Tue Apr 11 17:30:32 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.17 1995-04-02 11:09:09 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.18 1995-04-11 15:30:06 claus Exp $
 '!
 
 !ObjectFileLoader class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.17 1995-04-02 11:09:09 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.18 1995-04-11 15:30:06 claus Exp $
 "
 !
 
@@ -1492,6 +1492,8 @@
 			    3: let it send #initialize to its class
     "
 
+    |status badClassName|
+
     Verbose ifTrue:[
 	Transcript showCr:'phase 0 ...'
     ].
@@ -1501,6 +1503,20 @@
 	 interruptable:false
 	 argument:0.
 
+    (status := self loadStatus) == 0 ifFalse:[
+	badClassName := self classNameThatFailed.
+	status == -1 ifTrue:[
+	    Transcript showCr:'load failed - missing class: ' , badClassName.
+	] ifFalse:[
+	    status == -2 ifTrue:[
+	        Transcript showCr:'load failed - version mismatch: ' , badClassName.
+	    ] ifFalse:[
+	        Transcript showCr:'load failed'.
+	    ].
+	].
+	^ self
+    ].
+
     Verbose ifTrue:[
 	Transcript showCr:'phase 1 ...'
     ].
@@ -1517,6 +1533,24 @@
     self moduleInit:3 forceOld:false interruptable:true.
 !
 
+loadStatus
+    "ask VM if class-hierarchy has been completely loaded"
+
+%{
+    RETURN (_MKSMALLINT(__check_registration__()));
+%}
+!
+
+classNameThatFailed
+    "ask VM for the name of the class that caused trouble"
+
+%{
+    extern char *__name_registration_failure__();
+
+    RETURN (_MKSTRING(__name_registration_failure__()));
+%}
+!
+
 callInitFunctionAt:address specialInit:special forceOld:forceOld interruptable:interruptable argument:argument
     "call a function at address - this is very dangerous.
      This is needed to call the classes init-function after loading in a