X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdebug.impure.lisp;h=ea5d8b7160933bee458796bce84972d1a8d35a3a;hb=b66385e2031fc2cac17dd129df0af400beb48a22;hp=a3f3fbbba5884adaf9cf8553e12ca8ebddbf7c97;hpb=6ddaf294e5a7e3b1792ed1d9c342894c38538773;p=sbcl.git diff --git a/tests/debug.impure.lisp b/tests/debug.impure.lisp index a3f3fbb..ea5d8b7 100644 --- a/tests/debug.impure.lisp +++ b/tests/debug.impure.lisp @@ -14,6 +14,11 @@ ;;;; more information. (cl:in-package :cl-user) + +;;; The debugger doesn't have any native knowledge of the interpreter +(when (eq sb-ext:*evaluator-mode* :interpret) + (sb-ext:quit :unix-status 104)) + ;;;; Check that we get debug arglists right. @@ -38,7 +43,13 @@ ;; happen to be the two case that I had my nose rubbed in when ;; debugging a GC problem caused by applying %SIMPLE-FUN-ARGLIST to ;; a closure. -- WHN 2001-06-05) - (t :unknown))) + (t + #+sb-eval + (if (typep fun 'sb-eval::interpreted-function) + (sb-eval::interpreted-function-lambda-list fun) + :unknown) + #-sb-eval + :unknown))) (defun zoop (zeep &key beep) blurp) @@ -139,7 +150,8 @@ (declare (optimize (speed 1) (debug 2))) ; no tail call elimination (funcall fun))) - (with-test (:fails-on '(or :alpha)) ; bug 346 + (with-test (:name (:undefined-function :bug-346) + :fails-on '(or :alpha)) ; bug 346 (assert (verify-backtrace (lambda () (test #'optimized)) (list *undefined-function-frame* @@ -147,7 +159,13 @@ ;; bug 353: This test fails at least most of the time for x86/linux ;; ca. 0.8.20.16. -- WHN - (with-test (:fails-on '(or (and :x86 :linux) :alpha)) + (with-test (:name (:undefined-function :bug-353) + ;; This used to have fewer :fails-on features pre-0.9.16.38, + ;; but it turns out that the bug was just being masked by + ;; the presence of the IR1 stepper instrumentation (and + ;; is thus again failing now that the instrumentation is + ;; no more). + :fails-on '(or :x86 :x86-64 :alpha)) (assert (verify-backtrace (lambda () (test #'not-optimized)) (list *undefined-function-frame* @@ -175,17 +193,23 @@ (test (fun) (declare (optimize (speed 1) (debug 2))) ; no tail call elimination (funcall fun))) - (with-test (:fails-on '(or :alpha)) ; bug 346 + (with-test (:name (:divide-by-zero :bug-346) + :fails-on '(or :alpha)) ; bug 346 (assert (verify-backtrace (lambda () (test #'optimized)) (list '(/ 42 &rest) (list '(flet test) #'optimized))))) - (with-test (:fails-on '(or :alpha)) ; bug 346 + (with-test (:name (:divide-by-zero :bug-356) + :fails-on '(or :alpha)) ; bug 356 (assert (verify-backtrace (lambda () (test #'not-optimized)) (list '(/ 42 &rest) '((flet not-optimized)) (list '(flet test) #'not-optimized)))))) -(with-test (:fails-on '(or (and :x86 :linux) :alpha)) +(with-test (:name (:throw :no-such-tag) + :fails-on '(or + (and :x86 (or :linux :freebsd sunos)) + :alpha + :mips)) (progn (defun throw-test () (throw 'no-such-tag t)) @@ -226,7 +250,9 @@ (defbt 5 (&optional (opt (oops))) (list opt)) -(with-test (:fails-on '(and :x86 :linux)) +;;; FIXME: This test really should be broken into smaller pieces +(with-test (:name (:backtrace :misc) + :fails-on '(and :x86 (or :linux :sunos))) (macrolet ((with-details (bool &body body) `(let ((sb-debug:*show-entry-point-details* ,bool)) ,@body))) @@ -330,6 +356,11 @@ (defun trace-this () 'ok) +(defun trace-fact (n) + (if (zerop n) + 1 + (* n (trace-fact (1- n))))) + (let ((out (with-output-to-string (*trace-output*) (trace trace-this) (assert (eq 'ok (trace-this))) @@ -338,13 +369,29 @@ (assert (search "returned OK" out))) ;;; bug 379 -#-(and ppc darwin) -(let ((out (with-output-to-string (*trace-output*) - (trace trace-this :encapsulate nil) - (assert (eq 'ok (trace-this))) - (untrace)))) - (assert (search "TRACE-THIS" out)) - (assert (search "returned OK" out))) +;;; This is not a WITH-TEST :FAILS-ON PPC DARWIN since there are +;;; suspicions that the breakpoint trace might corrupt the whole image +;;; on that platform. +#-(and (or ppc x86) darwin) +(with-test (:name (trace :encapsulate nil) + :fails-on '(or :ppc :sparc :mips)) + (let ((out (with-output-to-string (*trace-output*) + (trace trace-this :encapsulate nil) + (assert (eq 'ok (trace-this))) + (untrace)))) + (assert (search "TRACE-THIS" out)) + (assert (search "returned OK" out)))) + +#-(and (or ppc x86) darwin) +(with-test (:name (trace-recursive :encapsulate nil) + :fails-on '(or :ppc :sparc :mips)) + (let ((out (with-output-to-string (*trace-output*) + (trace trace-fact :encapsulate nil) + (assert (= 120 (trace-fact 5))) + (untrace)))) + (assert (search "TRACE-FACT" out)) + (assert (search "returned 1" out)) + (assert (search "returned 120" out)))) ;;;; test infinite error protection