1.0.4.33: check that context is not a null-alien
[sbcl.git] / src / code / interr.lisp
index 8614280..b441516 100644 (file)
           (values "<error finding interrupted name -- trapped debug-condition>"
                   nil)))))
 \f
+
 ;;;; INTERNAL-ERROR signal handler
 
 (defun internal-error (context continuable)
   (infinite-error-protect
    (/show0 "about to bind ALIEN-CONTEXT")
    (let ((alien-context (locally
-                          (declare (optimize (inhibit-warnings 3)))
+                            (declare (optimize (inhibit-warnings 3)))
                           (sb!alien:sap-alien context (* os-context-t)))))
      (/show0 "about to bind ERROR-NUMBER and ARGUMENTS")
      (multiple-value-bind (error-number arguments)
 (defun memory-fault-error ()
   (error 'memory-fault-error
          :address current-memory-fault-address))
+
+;;; This is SIGTRAP / EXCEPTION_BREAKPOINT that runtime could not deal
+;;; with. Prior to Windows we just had a Lisp side handler for
+;;; SIGTRAP, but now we need to deal this portably.
+(defun unhandled-trap-error (context-sap)
+  (declare (type system-area-pointer context-sap))
+  (infinite-error-protect
+   (let ((context (sap-alien context-sap (* os-context-t))))
+     (error "Unhandled breakpoint/trap at #x~X."
+            (sap-int (sb!vm:context-pc context))))))