0.7.0.2:
[sbcl.git] / src / code / debug.lisp
index 535b429..937decf 100644 (file)
@@ -305,12 +305,12 @@ Function and macro commands:
        (format t "~&~S: FUN-END in ~S" bp-number
               (sb!di:debug-fun-name place))))))
 \f
-;;;; MAIN-HOOK-FUNCTION for steps and breakpoints
+;;;; MAIN-HOOK-FUN for steps and breakpoints
 
 ;;; This must be passed as the hook function. It keeps track of where
 ;;; STEP breakpoints are.
-(defun main-hook-function (current-frame breakpoint &optional return-vals
-                                        fun-end-cookie)
+(defun main-hook-fun (current-frame breakpoint &optional return-vals
+                                   fun-end-cookie)
   (setf *default-breakpoint-debug-fun*
        (sb!di:frame-debug-fun current-frame))
   (dolist (step-info *step-breakpoints*)
@@ -377,7 +377,7 @@ Function and macro commands:
                 (break string)
                 (format t "~A" string)))
            (t
-            (break "error in main-hook-function: unknown breakpoint"))))))
+            (break "unknown breakpoint"))))))
 \f
 ;;; Set breakpoints at the next possible code-locations. After calling
 ;;; this, either (CONTINUE) if in the debugger or just let program flow
@@ -399,14 +399,14 @@ Function and macro commands:
            (when bp-info
              (sb!di:deactivate-breakpoint (breakpoint-info-breakpoint
                                            bp-info))))
-         (let ((bp (sb!di:make-breakpoint #'main-hook-function code-location
+         (let ((bp (sb!di:make-breakpoint #'main-hook-fun code-location
                                           :kind :code-location)))
            (sb!di:activate-breakpoint bp)
            (push (create-breakpoint-info code-location bp 0)
                  *step-breakpoints*))))
        (t
        (let* ((debug-fun (sb!di:frame-debug-fun *current-frame*))
-              (bp (sb!di:make-breakpoint #'main-hook-function debug-fun
+              (bp (sb!di:make-breakpoint #'main-hook-fun debug-fun
                                          :kind :fun-end)))
          (sb!di:activate-breakpoint bp)
          (push (create-breakpoint-info debug-fun bp 0)
@@ -607,7 +607,7 @@ reset to ~S."
            ;; the program. WITH-STANDARD-IO-SYNTAX does some of that,
            ;; but
            ;;   1. It doesn't affect our internal special variables 
-           ;;      like *CURRENT-LEVEL*.
+           ;;      like *CURRENT-LEVEL-IN-PRINT*.
            ;;   2. It isn't customizable.
            ;;   3. It doesn't set *PRINT-READABLY* or *PRINT-PRETTY* 
            ;;      to the same value as the toplevel default.
@@ -615,7 +615,7 @@ reset to ~S."
            ;;      helpful behavior for a debugger.
            ;; We try to remedy all these problems with explicit 
            ;; rebindings here.
-           (sb!kernel:*current-level* 0)
+           (sb!kernel:*current-level-in-print* 0)
            (*print-length* *debug-print-length*)
            (*print-level* *debug-print-level*)
            (*readtable* *debug-readtable*)
@@ -644,7 +644,12 @@ reset to ~S."
           (format *error-output*
                   "~&(caught ~S trying to print ~S when entering debugger)~%"
                   (type-of condition)
-                  '*debug-condition*)))
+                  '*debug-condition*)
+          (when (typep condition 'cell-error)
+            ;; what we really want to know when it's e.g. an UNBOUND-VARIABLE:
+            (format *error-output*
+                    "~&(CELL-ERROR-NAME = ~S)~%)"
+                    (cell-error-name *debug-condition*)))))
 
        ;; After the initial error/condition/whatever announcement to
        ;; *ERROR-OUTPUT*, we become interactive, and should talk on
@@ -828,7 +833,7 @@ reset to ~S."
 
 (sb!xc:defmacro define-var-operation (ref-or-set &optional value-var)
   `(let* ((temp (etypecase name
-                 (symbol (sb!di:debug-fun-symbol-variables
+                 (symbol (sb!di:debug-fun-symbol-vars
                           (sb!di:frame-debug-fun *current-frame*)
                           name))
                  (simple-string (sb!di:ambiguous-debug-vars
@@ -1473,7 +1478,7 @@ argument")
                         *default-breakpoint-debug-fun*))))))
           (setup-fun-start ()
             (let ((code-loc (sb!di:debug-fun-start-location place)))
-              (setf bp (sb!di:make-breakpoint #'main-hook-function
+              (setf bp (sb!di:make-breakpoint #'main-hook-fun
                                               place
                                               :kind :fun-start))
               (setf break (sb!di:preprocess-for-eval break code-loc))
@@ -1483,7 +1488,7 @@ argument")
                       print-functions))))
           (setup-fun-end ()
             (setf bp
-                  (sb!di:make-breakpoint #'main-hook-function
+                  (sb!di:make-breakpoint #'main-hook-fun
                                          place
                                          :kind :fun-end))
             (setf break
@@ -1504,8 +1509,7 @@ argument")
                     print-functions)))
           (setup-code-location ()
             (setf place (nth index *possible-breakpoints*))
-            (setf bp (sb!di:make-breakpoint #'main-hook-function
-                                            place
+            (setf bp (sb!di:make-breakpoint #'main-hook-fun place
                                             :kind :code-location))
             (dolist (form print)
               (push (cons