Smalltalk.st
changeset 3062 5b8a2aa07108
parent 3044 a0bbac91639b
child 3083 451912c492ae
--- a/Smalltalk.st	Tue Oct 28 20:15:25 1997 +0100
+++ b/Smalltalk.st	Tue Oct 28 20:19:04 1997 +0100
@@ -10,8 +10,6 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:3.2.1 on 18-oct-1997 at 12:05:27 am'                 !
-
 Object subclass:#Smalltalk
 	instanceVariableNames:''
 	classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath
@@ -21,7 +19,7 @@
 		ResourcePath SourcePath BitmapPath BinaryPath FileInPath
 		BinaryDirName ResourceDirName SourceDirName BitmapDirName
 		FileInDirName ChangeFileName ImageStartTime ImageRestartTime
-		DemoMode SyntaxHilighting'
+		DemoMode SyntaxHilighting SaveEmergencyImage'
 	poolDictionaries:''
 	category:'System-Support'
 !
@@ -49,10 +47,15 @@
     Also global variables are (conceptionally) kept here.
 
     As you will notice, this is NOT a Dictionary
-     - my implementation of globals is totally different
-       (due to the need to be able to access globals from c-code as well).
+    - my implementation of globals is totally different
+      due to the need to be able to access globals from c-code as well,
+      I do not use associations for globals, but instead keep the
+      name<->value relations in the VM and access globals via utility
+      functions found there.
+
     However, it provides the known enumeration protocol.
-    It may change to become a subclass of collection at some time ...
+    It may change to become a subclass of collection at some time,
+    to inherit more collection stuff ...
 
 
     [Instance variables:]
@@ -78,19 +81,31 @@
                                         Set to a default here, but typically changed from some
                                         startup.rc file
 
-        StartupClass    <Class>         
-        StartupSelector <Symbol>        
-        StartupArguments <Array>
-                                        class and selector, where the system starts up
-                                        (right after VM initialization)
-                                        If an image is saved while this is nonNil, the image will come up
-                                        there.
-
-        CommandLineArguments <Array>    command line broken into words
+        StartupClass    <Class>         class and selector, where the system starts up
+        StartupSelector <Symbol>        (right after VM initialization)
+        StartupArguments <Array>        If an image is saved while those being nonNil, 
+                                        the image will come up there.
+                                        Allows for customized images to be
+                                        generated from a standard ST/X.
+
+        CommandLine          <String>   Unix (OS-) command line
+
+        CommandLineArguments <Array>    Unix (OS-) command line arguments broken into words
 
         SilentLoading   <Boolean>       suppresses messages during fileIn and in compiler
-                                        (can be set to true from a customized main)
-
+                                        (can be set to true from a customized main.c)
+
+        Initializing    <Boolean>       true while (re-)initializing
+                                        Controls the behavior of certain error
+                                        reporters (for example: suppress dialogBoxes)
+                                        while the system is not yet fit for full operation.
+
+        StandAlone      <Boolean>       true, if this is a standalone app;
+                                        if true the process scheduler watches for
+                                        which processes are still running, and 
+                                        exits ST/X, when the last non-background
+                                        and non-system process exits.
+                                        
         LogDoits        <Boolean>       if true, doits are also logged in the changes
                                         file. Default is false, since the changes file
                                         may become huge if every tiny doIt is saved there ...
@@ -98,14 +113,12 @@
         LoadBinaries    <Boolean>       if true, we attempt to load classes rom a binary
                                         file, if present. If false, this is always suppressed.
 
-        ImageStartTime  <AbsoluteTime>  timestamp when this system was started the very first time
-                                        (i.e. the time of the initial start without an image)
-
-        ImageRestartTime
-                        <AbsoluteTIme>  timestamp when this image was started
-
-
-
+        SaveEmergencyImage <Boolean>    if true (the default), an emergency image
+                                        is saved, if the main Display looses its
+                                        connection. This is useful if you have a
+                                        flaky display connection (serial line)
+                                        and want to have your stuff saved automatically
+                                        in case of a broken connection.
 
     strictly private classVariables (helpers):
 
@@ -114,16 +127,29 @@
         CachedAbbreviations
                         <Dictionary>    className to filename mappings
 
+        RealSystemPath  <Collection>    cached collection of directories along the path
+                                        which really exist. Caching avoids long checks
+                                        for existing directories on broken NFS volumes.
+
         SourcePath      <Collection>    cached names of really existing directories
         BitmapPath                      These are remembered, since in NFS systems,
         ResourcePath                    the time to lookup files may become long
         BinaryPath                      (especially, if some directories are on machines
-        FileInPath                      which are not up ...). Therefore, the set of really
+        FileInPath                      which are not up ...). 
+                                        Therefore, the set of really
                                         existing directories is cached when the SystemPath
                                         is walked the first time.
+                                        A consequence is that you have to invoke
+                                        flushSystemPath, when you create any of those
+                                        directories while running
+                                        (and want the running ST/X to look there)
+
 
     [author:]
         Claus Gittinger
+
+    [see also:]
+        ObjectMemory
 "
 ! !
 
@@ -345,8 +371,9 @@
     LogDoits := false.
     LoadBinaries := false.
     SyntaxHilighting := false.
-
-    "Modified: 8.8.1997 / 10:55:03 / cg"
+    SaveEmergencyImage := true.
+
+    "Modified: / 24.10.1997 / 18:22:47 / cg"
 !
 
 initializeModules
@@ -1666,6 +1693,10 @@
     "
     Display notNil ifTrue:[
         Display deviceIOErrorSignal handlerBlock:[:ex |
+            SaveEmergencyImage == true ifTrue:[
+                'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR.
+                ObjectMemory primSnapShotOn:'crash.img'.
+            ].
             'Display [warning]: broken display connection - exit.' infoPrintCR.
             Smalltalk exit.
         ].
@@ -1788,9 +1819,9 @@
 
     self exit
 
-    "Created: 18.7.1996 / 21:07:39 / cg"
-    "Modified: 9.9.1996 / 17:42:50 / stefan"
-    "Modified: 11.4.1997 / 13:39:06 / cg"
+    "Created: / 18.7.1996 / 21:07:39 / cg"
+    "Modified: / 9.9.1996 / 17:42:50 / stefan"
+    "Modified: / 24.10.1997 / 18:23:16 / cg"
 !
 
 readEvalPrint
@@ -2547,6 +2578,22 @@
 
     "Modified: 16.1.1997 / 01:25:58 / cg"
     "Created: 17.10.1997 / 13:52:19 / cg"
+!
+
+saveEmergencyImage:aBoolean
+    "set/clear the flag which controls if ST/X should save an
+     emergency image in case of a broken display connection.
+     The default is true.
+     This may be useful, if you work with an unsecure display
+     (serial line), and want to have a chance of proceeding after
+     a crash. In multiheaded applications, this only affects 
+     crashes of the master Display connection (the initial connection);
+     errors on other displays are reported to the views and treated
+     like window destroy from the windowManager."
+
+    SaveEmergencyImage := aBoolean
+
+    "Modified: / 24.10.1997 / 18:22:26 / cg"
 ! !
 
 !Smalltalk class methodsFor:'system management-fileIn'!
@@ -3724,6 +3771,21 @@
     "
 !
 
+fullVersionString
+    "{ Pragma: +optSpace }"
+
+    "return a full version string"
+
+    ^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate 
+
+    "
+     Smalltalk fullVersionString
+    "
+
+    "Created: / 27.10.1997 / 17:03:09 / cg"
+    "Modified: / 27.10.1997 / 17:04:02 / cg"
+!
+
 hello
     "{ Pragma: +optSpace }"
 
@@ -3934,5 +3996,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.263 1997-10-21 17:44:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.264 1997-10-28 19:19:04 cg Exp $'
 ! !