1.0.5.56: conditionally re-enable interrupts interrupting current thread
[sbcl.git] / src / code / condition.lisp
index 705d945..5384c44 100644 (file)
@@ -1109,16 +1109,6 @@ SB-EXT:PACKAGE-LOCKED-ERROR-SYMBOL."))
                         '(:ansi-cl :section (15 1 2 1))
                         '(:ansi-cl :section (15 1 2 2)))))
 
-(define-condition io-timeout (stream-error)
-  ((direction :reader io-timeout-direction :initarg :direction))
-  (:report
-   (lambda (condition stream)
-     (declare (type stream stream))
-     (format stream
-             "I/O timeout ~(~A~)ing ~S"
-             (io-timeout-direction condition)
-             (stream-error-stream condition)))))
-
 (define-condition namestring-parse-error (parse-error)
   ((complaint :reader namestring-parse-error-complaint :initarg :complaint)
    (args :reader namestring-parse-error-args :initarg :args :initform nil)
@@ -1157,7 +1147,26 @@ SB-EXT:PACKAGE-LOCKED-ERROR-SYMBOL."))
                (reader-error-format-arguments condition)
                (reader-impossible-number-error-error condition))))))
 
-(define-condition timeout (serious-condition) ())
+(define-condition timeout (serious-condition)
+  ((seconds :initarg :seconds :initform nil :reader timeout-seconds))
+  (:report (lambda (condition stream)
+             (format stream "Timeout occurred~@[ after ~A seconds~]."
+                     (timeout-seconds condition)))))
+
+(define-condition io-timeout (stream-error timeout)
+  ((direction :reader io-timeout-direction :initarg :direction))
+  (:report
+   (lambda (condition stream)
+     (declare (type stream stream))
+     (format stream
+             "I/O timeout ~(~A~)ing ~S."
+             (io-timeout-direction condition)
+             (stream-error-stream condition)))))
+
+(define-condition deadline-timeout (timeout) ()
+  (:report (lambda (condition stream)
+             (format stream "A deadline was reached after ~A seconds."
+                     (timeout-seconds condition)))))
 
 (define-condition declaration-type-conflict-error (reference-condition
                                                    simple-error)
@@ -1170,6 +1179,7 @@ SB-EXT:PACKAGE-LOCKED-ERROR-SYMBOL."))
 
 (define-condition step-condition ()
   ((form :initarg :form :reader step-condition-form))
+
   #!+sb-doc
   (:documentation "Common base class of single-stepping conditions.
 STEP-CONDITION-FORM holds a string representation of the form being
@@ -1180,8 +1190,18 @@ stepped."))
       "Form associated with the STEP-CONDITION.")
 
 (define-condition step-form-condition (step-condition)
-  ((source-path :initarg :source-path :reader step-condition-source-path)
-   (pathname :initarg :pathname :reader step-condition-pathname))
+  ((args :initarg :args :reader step-condition-args))
+  (:report
+   (lambda (condition stream)
+     (let ((*print-circle* t)
+           (*print-pretty* t)
+           (*print-readably* nil))
+       (format stream
+                 "Evaluating call:~%~<  ~@;~A~:>~%~
+                  ~:[With arguments:~%~{  ~S~%~}~;With unknown arguments~]~%"
+               (list (step-condition-form condition))
+               (eq (step-condition-args condition) :unknown)
+               (step-condition-args condition)))))
   #!+sb-doc
   (:documentation "Condition signalled by code compiled with
 single-stepping information when about to execute a form.
@@ -1215,13 +1235,14 @@ single-stepping information after executing a form.
 STEP-CONDITION-FORM holds the form, and STEP-CONDITION-RESULT holds
 the values returned by the form as a list. No associated restarts."))
 
-(define-condition step-variable-condition (step-result-condition)
+(define-condition step-finished-condition (step-condition)
   ()
+  (:report
+   (lambda (condition stream)
+     (declare (ignore condition))
+     (format stream "Returning from STEP")))
   #!+sb-doc
-  (:documentation "Condition signalled by code compiled with
-single-stepping information when referencing a variable.
-STEP-CONDITION-FORM hold the symbol, and STEP-CONDITION-RESULT holds
-the value of the variable. No associated restarts."))
+  (:documentation "Condition signaled when STEP returns."))
 
 \f
 ;;;; restart definitions