Update of /cvsroot/sbcl/sbcl/src/code
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10837/src/code
Modified Files:
cold-init.lisp debug.lisp
Log Message:
0.9.15.9:
Changes to DISABLE-DEBUGGER:
* Allow disabling the debugger when *INVOKE-DEBUGGER-HOOK* is non-nil,
so that --disable-debugger works even when restoring cores where
that has been done.
* Store the old value of *I-D-H* when disabling the debugger, and
restore it back when enabling the debugger.
* Fix a bug where LDB wouldn't get disabled by --disable-debugger
if the core had been saved from an sbcl instance where the
debugger was disabled.
Index: cold-init.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/cold-init.lisp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- cold-init.lisp 27 Feb 2006 13:12:34 -0000 1.63
+++ cold-init.lisp 4 Aug 2006 14:14:12 -0000 1.64
@@ -306,7 +306,12 @@
(gc-reinit)
;; make sure TIME works correctly from saved cores
(setf *internal-real-time-base-seconds* nil)
+ (setf *gc-run-time* 0)
(foreign-reinit)
+ ;; If the debugger was disabled in the saved core, we need to
+ ;; re-disable ldb again.
+ (when (eq *invoke-debugger-hook* 'sb!debug::debugger-disabled-hook)
+ (sb!debug::disable-debugger))
(dolist (hook *init-hooks*)
(with-simple-restart (continue "Skip this initialization hook.")
(funcall hook))))
Index: debug.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/debug.lisp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- debug.lisp 9 Jun 2006 17:07:38 -0000 1.85
+++ debug.lisp 4 Aug 2006 14:14:12 -0000 1.86
@@ -647,24 +647,30 @@
"Argh! error within --disable-debugger error handling"))
(failure-quit :recklessly-p t)))))
+(defvar *old-debugger-hook* nil)
+
;;; halt-on-failures and prompt-on-failures modes, suitable for
;;; noninteractive and interactive use respectively
(defun disable-debugger ()
- ;; Why conditionally? Why not disable it even if user has frobbed
- ;; this hook? We could just save the old value in case of a later
- ;; ENABLE-DEBUGGER.
- (when (eql *invoke-debugger-hook* nil)
- ;; *DEBUG-IO* used to be set here to *ERROR-OUTPUT* which is sort
- ;; of unexpected but mostly harmless, but then ENABLE-DEBUGGER had
- ;; to set it to a suitable value again and be very careful,
- ;; especially if the user has also set it. -- MG 2005-07-15
- (setf *invoke-debugger-hook* 'debugger-disabled-hook)
- (sb!alien:alien-funcall (sb!alien:extern-alien "disable_lossage_handler" (function sb!alien:void)))))
+ ;; *DEBUG-IO* used to be set here to *ERROR-OUTPUT* which is sort
+ ;; of unexpected but mostly harmless, but then ENABLE-DEBUGGER had
+ ;; to set it to a suitable value again and be very careful,
+ ;; especially if the user has also set it. -- MG 2005-07-15
+ (unless (eq *invoke-debugger-hook* 'debugger-disabled-hook)
+ (setf *old-debugger-hook* *invoke-debugger-hook*
+ *invoke-debugger-hook* 'debugger-disabled-hook))
+ ;; This is not inside the UNLESS to ensure that LDB is disabled
+ ;; regardless of what the old value of *INVOKE-DEBUGGER-HOOK* was.
+ ;; This might matter for example when restoring a core.
+ (sb!alien:alien-funcall (sb!alien:extern-alien "disable_lossage_handler"
+ (function sb!alien:void))))
(defun enable-debugger ()
(when (eql *invoke-debugger-hook* 'debugger-disabled-hook)
- (setf *invoke-debugger-hook* nil)
- (sb!alien:alien-funcall (sb!alien:extern-alien "enable_lossage_handler" (function sb!alien:void)))))
+ (setf *invoke-debugger-hook* *old-debugger-hook*
+ *old-debugger-hook* nil))
+ (sb!alien:alien-funcall (sb!alien:extern-alien "enable_lossage_handler"
+ (function sb!alien:void))))
(defun show-restarts (restarts s)
(cond ((null restarts)
|