X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdebug.impure.lisp;h=5d52ddc439410b1e51cb70d308adc491e778b7fd;hb=236ff428ec33a3c55a7c2248027aaad3c19588ff;hp=03773346a4e15bf828c2274ec20a6c81ea03e788;hpb=3d2165e67f9ad1443f6e7d8ad24810000b0436e8;p=sbcl.git diff --git a/tests/debug.impure.lisp b/tests/debug.impure.lisp index 0377334..5d52ddc 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) @@ -108,12 +119,11 @@ ;; Make sure the backtrace isn't stunted in ;; any way. (Depends on running in the main - ;; thread.) - (let ((end (last backtrace 2))) + ;; thread.) FIXME: On Windows we get two + ;; extra foreign frames below regular frames. + (let ((end (last backtrace #-win32 2 #+win32 4))) (unless (equal (caar end) - (if *show-entry-point-details* - '(sb-c::tl-xep sb-impl::toplevel-init) - 'sb-impl::toplevel-init)) + 'sb-impl::toplevel-init) (print (list :backtrace-stunted (caar end))) (setf result nil))) (return-from outer-handler))))) @@ -140,7 +150,8 @@ (funcall fun))) (with-test (:name (:undefined-function :bug-346) - :fails-on '(or :alpha)) ; bug 346 + :fails-on '(or :alpha :ppc :sparc :mips + (and :x86-64 (or :freebsd :darwin)))) (assert (verify-backtrace (lambda () (test #'optimized)) (list *undefined-function-frame* @@ -148,18 +159,23 @@ ;; bug 353: This test fails at least most of the time for x86/linux ;; ca. 0.8.20.16. -- WHN - (with-test (:name (:undefined-function :bug-356) - :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 :mips)) (assert (verify-backtrace (lambda () (test #'not-optimized)) (list *undefined-function-frame* (list '(flet not-optimized)) (list '(flet test) #'not-optimized)))))) -;;; Division by zero was a common error on PPC. It depended on the +;;; Division by zero was a common error on PPC. It depended on the ;;; return function either being before INTEGER-/-INTEGER in memory, -;;; or more than MOST-POSITIVE-FIXNUM bytes ahead. It also depends on -;;; INTEGER-/-INTEGER calling SIGNED-TRUNCATE. I believe Raymond Toy +;;; or more than MOST-POSITIVE-FIXNUM bytes ahead. It also depends on +;;; INTEGER-/-INTEGER calling SIGNED-TRUNCATE. I believe Raymond Toy ;;; says that the Sparc backend (at least for CMUCL) inlines this, so ;;; if SBCL does the same this test is probably not good for the ;;; Sparc. @@ -178,19 +194,24 @@ (declare (optimize (speed 1) (debug 2))) ; no tail call elimination (funcall fun))) (with-test (:name (:divide-by-zero :bug-346) - :fails-on '(or :alpha)) ; bug 346 + :fails-on '(or :alpha (and :x86-64 :darwin))) ; bug 346 (assert (verify-backtrace (lambda () (test #'optimized)) (list '(/ 42 &rest) (list '(flet test) #'optimized))))) (with-test (:name (:divide-by-zero :bug-356) - :fails-on '(or :alpha)) ; bug 356 + :fails-on '(or :alpha (and :x86-64 :darwin))) ; bug 356 (assert (verify-backtrace (lambda () (test #'not-optimized)) (list '(/ 42 &rest) '((flet not-optimized)) (list '(flet test) #'not-optimized)))))) (with-test (:name (:throw :no-such-tag) - :fails-on '(or (and :x86 :linux) (and :x86 :freebsd) :alpha :mips)) + :fails-on '(or + (and :x86 :sunos) + (and :x86-64 :darwin) + (and :sparc :linux) + :alpha + :mips)) (progn (defun throw-test () (throw 'no-such-tag t)) @@ -233,7 +254,8 @@ ;;; FIXME: This test really should be broken into smaller pieces (with-test (:name (:backtrace :misc) - :fails-on '(and :x86 :linux)) + :fails-on '(or (and :x86 (or :sunos)) + (and :x86-64 :darwin))) (macrolet ((with-details (bool &body body) `(let ((sb-debug:*show-entry-point-details* ,bool)) ,@body))) @@ -337,6 +359,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))) @@ -348,9 +375,9 @@ ;;; 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) +#-(and (or ppc x86 x86-64) darwin) (with-test (:name (trace :encapsulate nil) - :fails-on '(or ppc sparc)) + :fails-on '(or :ppc :sparc :mips)) (let ((out (with-output-to-string (*trace-output*) (trace trace-this :encapsulate nil) (assert (eq 'ok (trace-this))) @@ -358,6 +385,17 @@ (assert (search "TRACE-THIS" out)) (assert (search "returned OK" out)))) +#-(and (or ppc x86 x86-64) 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 (defmacro nest-errors (n-levels error-form) @@ -398,3 +436,5 @@ (loop while (sb-thread:thread-alive-p thread))) (disable-debugger) + +(write-line "/debug.impure.lisp done")