From bf282f716a1ecaa09794a2cac7ce7da8d0d87675 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 7 Jun 2006 16:25:09 +0000 Subject: [PATCH] 0.9.13.33: :SB-LDB in default build * DISABLE-DEBUGGER now also turns LDB off, so scriptability remains the same. * Use lose() instead of monitor_or_something() in the runtime, and replace set_lossage_handler() with enable/disable_lossage_handler(). --- NEWS | 3 +++ src/code/debug.lisp | 9 +++++++-- src/runtime/alpha-arch.c | 1 - src/runtime/hppa-arch.c | 1 - src/runtime/interr.c | 11 ++++++++--- src/runtime/interr.h | 3 ++- src/runtime/interrupt.c | 1 - src/runtime/mips-arch.c | 1 - src/runtime/runtime.c | 3 +-- src/runtime/win32-os.c | 4 ++-- src/runtime/x86-64-arch.c | 3 +-- src/runtime/x86-arch.c | 3 +-- version.lisp-expr | 2 +- 13 files changed, 26 insertions(+), 19 deletions(-) diff --git a/NEWS b/NEWS index b688654..3c7b436 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ changes in sbcl-0.9.14 relative to sbcl-0.9.13: additionally it just doesn't work in SBCL as currently implemented, thanks to optimizations (that are always valid for the other three SLOT-VALUEish functions, but not for the setter). + * minor incompatibale change: the :SB-LDB feature is now enabled by + default, and DISABLE-DEBUGGER and ENABLE-DEBUGGER also affect + the low-level debugger. * bug fix: native unparsing of pathnames with :DIRECTORY NIL failed with a type error. (reported by blitz_ on #lisp) * bug fix: unparsing logical pathnames with :NAME :WILD :TYPE NIL diff --git a/src/code/debug.lisp b/src/code/debug.lisp index e50eb41..db912d1 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -641,16 +641,21 @@ reset to ~S." ;;; 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))) + (setf *invoke-debugger-hook* 'debugger-disabled-hook) + (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))) + (setf *invoke-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) diff --git a/src/runtime/alpha-arch.c b/src/runtime/alpha-arch.c index 91878cd..8fab937 100644 --- a/src/runtime/alpha-arch.c +++ b/src/runtime/alpha-arch.c @@ -28,7 +28,6 @@ #include "interrupt.h" #include "interr.h" #include "breakpoint.h" -#include "monitor.h" extern char call_into_lisp_LRA[], call_into_lisp_end[]; diff --git a/src/runtime/hppa-arch.c b/src/runtime/hppa-arch.c index 3d1d934..8fba416 100644 --- a/src/runtime/hppa-arch.c +++ b/src/runtime/hppa-arch.c @@ -23,7 +23,6 @@ #include "interrupt.h" #include "interr.h" #include "breakpoint.h" -#include "monitor.h" void arch_init(void) { diff --git a/src/runtime/interr.c b/src/runtime/interr.c index 9238601..8d0b01b 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -28,6 +28,7 @@ #include "genesis/static-symbols.h" #include "genesis/vector.h" #include "thread.h" +#include "monitor.h" /* the way that we shut down the system on a fatal error */ @@ -37,10 +38,14 @@ default_lossage_handler(void) exit(1); } static void (*lossage_handler)(void) = default_lossage_handler; -void -set_lossage_handler(void handler(void)) + +void enable_lossage_handler(void) +{ + lossage_handler = monitor_or_something; +} +void disable_lossage_handler(void) { - lossage_handler = handler; + lossage_handler = default_lossage_handler; } void diff --git a/src/runtime/interr.h b/src/runtime/interr.h index 3ebe8a1..e527fcb 100644 --- a/src/runtime/interr.h +++ b/src/runtime/interr.h @@ -13,7 +13,8 @@ #define _INTERR_H_ extern void lose(char *fmt, ...) never_returns; -extern void set_lossage_handler(void fun(void)); +extern void enable_lossage_handler(void); +extern void disable_lossage_handler(void); extern void describe_internal_error(os_context_t *context); extern lispobj debug_print(lispobj string); diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 45cd2fd..357a5b2 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -59,7 +59,6 @@ #include "globals.h" #include "lispregs.h" #include "validate.h" -#include "monitor.h" #include "gc.h" #include "alloc.h" #include "dynbind.h" diff --git a/src/runtime/mips-arch.c b/src/runtime/mips-arch.c index 7d3a1a8..d63a380 100644 --- a/src/runtime/mips-arch.c +++ b/src/runtime/mips-arch.c @@ -19,7 +19,6 @@ #include "interrupt.h" #include "interr.h" #include "breakpoint.h" -#include "monitor.h" #include "genesis/constants.h" diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index cba2f73..1dba2da 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -51,7 +51,6 @@ #include "arch.h" #include "gc.h" #include "interr.h" -#include "monitor.h" #include "validate.h" #include "core.h" #include "save.h" @@ -357,7 +356,7 @@ main(int argc, char *argv[], char *envp[]) define_var("nil", NIL, 1); define_var("t", T, 1); - set_lossage_handler(monitor_or_something); + enable_lossage_handler(); globals_init(); diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index 45a4656..9b78fd5 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -40,7 +40,6 @@ #include "interr.h" #include "lispregs.h" #include "runtime.h" -#include "monitor.h" #include "alloc.h" #include "genesis/primitive-objects.h" @@ -521,8 +520,9 @@ EXCEPTION_DISPOSITION handle_exception(EXCEPTION_RECORD *exception_record, fflush(stderr); fake_foreign_function_call(context); - monitor_or_something(); + lose("fake_foreign_function_call fell through"); + /* FIXME: WTF? How are we supposed to end up here? */ return ExceptionContinueSearch; } diff --git a/src/runtime/x86-64-arch.c b/src/runtime/x86-64-arch.c index 6ee2690..b45dcd5 100644 --- a/src/runtime/x86-64-arch.c +++ b/src/runtime/x86-64-arch.c @@ -24,7 +24,6 @@ #include "interrupt.h" #include "interr.h" #include "breakpoint.h" -#include "monitor.h" #include "thread.h" #include "genesis/static-symbols.h" @@ -269,7 +268,7 @@ static void sigill_handler(int signal, siginfo_t *siginfo, void *void_context) { os_context_t *context = (os_context_t*)void_context; fake_foreign_function_call(context); - monitor_or_something(); + lose("fake_foreign_function_call fell through"); } void diff --git a/src/runtime/x86-arch.c b/src/runtime/x86-arch.c index 428ad5f..9a835fa 100644 --- a/src/runtime/x86-arch.c +++ b/src/runtime/x86-arch.c @@ -23,7 +23,6 @@ #include "interrupt.h" #include "interr.h" #include "breakpoint.h" -#include "monitor.h" #include "thread.h" #include "genesis/static-symbols.h" @@ -328,7 +327,7 @@ sigill_handler(int signal, siginfo_t *siginfo, void *void_context) { #endif fake_foreign_function_call(context); - monitor_or_something(); + lose("fake_foreign_call fell through"); } void diff --git a/version.lisp-expr b/version.lisp-expr index e7667ef..5f41a32 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.13.32" +"0.9.13.33" -- 1.7.10.4