X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fstep.lisp;h=a7222b3f6c42dcad45b16e9182d34241ed8adf28;hb=68ea71d0f020f2726e3c56c1ec491d0af734b3a4;hp=4516e79236d5a4569f90c2914cf9c85322e4fbae;hpb=8a8a8922802460741d6f8f6c11d71b1f414cf3a7;p=sbcl.git diff --git a/src/code/step.lisp b/src/code/step.lisp index 4516e79..a7222b3 100644 --- a/src/code/step.lisp +++ b/src/code/step.lisp @@ -22,6 +22,7 @@ stepper's prompt: N: Evaluate the current expression without stepping. C: Evaluate to finish without stepping. Q: Abort evaluation. + B: Backtrace. ?: Display this message. ") @@ -29,13 +30,13 @@ stepper's prompt: (defmethod single-step ((condition step-variable-condition)) (format *debug-io* "; ~A => ~S~%" - (step-condition-form condition) - (step-condition-result condition))) + (step-condition-form condition) + (step-condition-result condition))) (defmethod single-step ((condition step-values-condition)) (let ((values (step-condition-result condition))) (format *debug-io* "; ~A => ~:[#~;~{~S~^, ~}~]~%" - (step-condition-form condition) + (step-condition-form condition) values values))) (defmethod single-step ((condition step-form-condition)) @@ -46,6 +47,8 @@ stepper's prompt: (let ((line (read-line *debug-io*))) (if (plusp (length line)) (case (char-upcase (schar line 0)) + (#\B + (backtrace)) (#\Q (abort condition)) (#\C @@ -57,7 +60,7 @@ stepper's prompt: (#\? (write-line *step-help* *debug-io*)))))))) -(defvar *stepper-hook* #'single-step +(defvar *stepper-hook* 'single-step #+sb-doc "Customization hook for alternative single-steppers. *STEPPER-HOOK* is bound to NIL prior to calling the bound function with the STEP-CONDITION as argument.") @@ -65,7 +68,7 @@ with the STEP-CONDITION as argument.") (defun invoke-stepper (condition) (when (and *stepping* *stepper-hook*) (let ((hook *stepper-hook*) - (*stepper-hook* nil)) + (*stepper-hook* nil)) (funcall hook condition)))) (defmacro step (form) @@ -75,7 +78,7 @@ outside the lexical scope of the form can be stepped into only if the functions in question have been compiled with sufficient DEBUG policy to be at least partially steppable." `(let ((*stepping* t) - (*step* t)) + (*step* t)) (declare (optimize (sb-c:insert-step-conditions 0))) (format t "Single stepping. Type ? for help.~%") (locally (declare (optimize (sb-c:insert-step-conditions 3)))