return value of signal raise;
authorclaus
Mon, 22 Aug 1994 14:10:19 +0200
changeset 113 0403779c8fe3
parent 112 ea0d780bab58
child 114 0353ec6749c8
return value of signal raise; moved OSSignals to OperatingSystem
Object.st
--- a/Object.st	Mon Aug 22 14:09:17 1994 +0200
+++ b/Object.st	Mon Aug 22 14:10:19 1994 +0200
@@ -18,7 +18,7 @@
                            SubscriptOutOfBoundsSignal NonIntegerIndexSignal
                            NotFoundSignal KeyNotFoundSignal ElementOutOfBoundsSignal
                            InformationSignal PrimitiveFailureSignal
-                           AbortSignal OSSignals
+                           AbortSignal 
                            SystemNotifier SystemWarningBox SystemInfoBox SystemConfirmer'
        poolDictionaries:''
        category:'Kernel-Objects'
@@ -28,7 +28,7 @@
 COPYRIGHT (c) 1988 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Object.st,v 1.20 1994-08-11 21:38:13 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Object.st,v 1.21 1994-08-22 12:10:19 claus Exp $
 '!
 
 "these will become classVariables soon ..."
@@ -53,7 +53,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Object.st,v 1.20 1994-08-11 21:38:13 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Object.st,v 1.21 1994-08-22 12:10:19 claus Exp $
 "
 !
 
@@ -84,13 +84,9 @@
         ElementOutOfBoundsSignal
         InformationSignal
 
-
         AbortSignal      <Signal>       Signal raised by debugger, to abort a computation
                                         BUT, only raised if handled.
 
-        OSSignals        <Array>        Array of signals to be raised for corresponding
-                                        OperatingSystem signals.
-
         SystemNotifier                  cached Notifier used in notify:
         SystemWarningBox                cached WarningBox used in warn:
         SystemInfoBox                   cached InfoBox used in information:
@@ -255,25 +251,6 @@
      this for a save abort)"
 
     ^ AbortSignal
-!
-
-operatingSystemSignal:signalNumber
-    "return the signal to be raised when an 
-     operatingSystem-signal occurs, or nil"
-
-    OSSignals notNil ifTrue:[
-        ^ OSSignals at:signalNumber ifAbsent:[nil]
-    ].
-    ^ nil
-!
-
-operatingSystemSignal:signalNumber install:aSignal
-    "install a signal to be raised when an operatingSystem-signal occurs"
-
-    OSSignals isNil ifTrue:[
-        OSSignals := Array new:32
-    ].
-    OSSignals at:signalNumber put:aSignal
 ! !
 
 !Object class methodsFor:'queries'!
@@ -1102,13 +1079,15 @@
 
 fpExceptionInterrupt
     "a floating point exception occured - this one
-     has to be handled differently since they come asynchronous
-     on some machines"
+     has to be handled differently since it comes asynchronous
+     on some machines. Also, errors from within primitive code
+     (or library functions such as GL) are sent via the Unix-signal
+     mechanism this way."
 
 "
     self error:'a floating point exception occured'
 "
-    Float domainErrorSignal raise
+    ^ Float domainErrorSignal raise
 !
 
 signalInterrupt:signalNumber
@@ -1126,7 +1105,7 @@
 
     "if there has been an ST-signal installed, use it ..."
 
-    sig := self operatingSystemSignal:signalNumber.
+    sig := OperatingSystem operatingSystemSignal:signalNumber.
     sig notNil ifTrue:[
         ^ sig raise
     ].
@@ -1153,9 +1132,16 @@
 
     ignorable ifFalse:[
         thisContext isRecursive ifTrue:[
+            'fatal: signal ' errorPrint. signalNumber errorPrintNL.
             MiniDebugger enterWithMessage:'recursive signal'.
             ^ self
-        ]
+        ].
+        "
+         a hard signal - go into debugger immediately
+        "
+        Debugger enter:here withMessage:('Signal ', name). 
+        badContext return.
+        ^ nil.
     ].
 
     "
@@ -1204,7 +1190,7 @@
      could be cought and the stackLimit increased in the handler."
 
     thisContext isRecursive ifFalse:[
-        RecursionInterruptSignal raise
+        ^ RecursionInterruptSignal raise
     ]
 !
 
@@ -1219,50 +1205,50 @@
 subscriptBoundsError
     "report error that badIndex is out of bounds"
 
-    SubscriptOutOfBoundsSignal raise
+    ^ SubscriptOutOfBoundsSignal raise
 !
 
 indexNotInteger
     "report error that index is not an Integer"
 
-    NonIntegerIndexSignal raise
+    ^ NonIntegerIndexSignal raise
 !
 
 errorNotFound
     "report error that an element was not found in a collection"
 
-    NotFoundSignal raise
+    ^ NotFoundSignal raise
 !
 
 errorKeyNotFound
     "report error that a key was not found in a collection"
 
-    KeyNotFoundSignal raise
+    ^ KeyNotFoundSignal raise
 !
 
 elementBoundsError
     "report error that badElement is out of bounds (i.e. cannot be put into
      that collection)"
 
-    ElementOutOfBoundsSignal raise
+    ^ ElementOutOfBoundsSignal raise
 !
 
 elementNotInteger
     "report error that object to be stored is not Integer"
 
-    ElementOutOfBoundsSignal raise
+    ^ ElementOutOfBoundsSignal raise
 !
 
 elementNotCharacter
     "report error that object to be stored is no Character"
 
-    ElementOutOfBoundsSignal raise
+    ^ ElementOutOfBoundsSignal raise
 !
 
 elementOutOfBounds
     "report error that object to be stored is not valid"
 
-    ElementOutOfBoundsSignal raise
+    ^ ElementOutOfBoundsSignal raise
 !
 
 mustBeRectangle
@@ -1302,7 +1288,7 @@
 primitiveFailed
     "report error that primitive code failed"
 
-    PrimitiveFailureSignal raise
+    ^ PrimitiveFailureSignal raise
 "
     ^ self error:'primitive failed'
 "
@@ -1336,19 +1322,19 @@
 halt
     "enter debugger with halt-message"
 
-    HaltSignal raise.
+    ^ HaltSignal raise.
 !
 
 halt:aString
     "enter debugger with halt-message"
 
-    HaltSignal raiseRequestWith:#halt: errorString:aString
+    ^ HaltSignal raiseRequestWith:#halt: errorString:aString
 !
 
 error
     "report error that an error occured"
 
-    ErrorSignal raise 
+    ^ ErrorSignal raise 
     "
      ^ self error:'error encountered'
     "
@@ -1357,7 +1343,7 @@
 error:aString
     "enter debugger with error-message aString"
 
-    ErrorSignal raiseRequestWith:#error: errorString: aString
+    ^ ErrorSignal raiseRequestWith:#error: errorString: aString
 !
 
 doesNotUnderstand:aMessage
@@ -1377,7 +1363,7 @@
         self enterDebuggerWith:'oops - MessageNotUnderstoodSignal is gone'.
         ^ self
     ].
-    MessageNotUnderstoodSignal
+    ^ MessageNotUnderstoodSignal
                 raiseRequestWith:aMessage
                      errorString:errorString
 !