X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterr.c;h=fc66ac90b916d8462fae457b222a7d37d4ab5e9c;hb=ae47ad0774edd8cb376772ae7e615428295f979e;hp=e4df5ec9a270368040dc1593a9b11c804c91ae18;hpb=9086ddef369825b92533128f68dc04e0b165ea40;p=sbcl.git diff --git a/src/runtime/interr.c b/src/runtime/interr.c index e4df5ec..fc66ac9 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -17,16 +17,17 @@ #include #include +#include "sbcl.h" #include "arch.h" #include "signal.h" #include "runtime.h" -#include "sbcl.h" #include "interr.h" #include "print.h" #include "lispregs.h" #include "genesis/static-symbols.h" #include "genesis/vector.h" +#include "thread.h" /* the way that we shut down the system on a fatal error */ @@ -47,6 +48,15 @@ lose(char *fmt, ...) { va_list ap; fprintf(stderr, "fatal error encountered in SBCL pid %d",getpid()); + /* freeze all the other threads, so we have a chance of debugging them + */ + if(all_threads) { + struct thread *th1,*th=arch_os_get_current_thread(); + for_each_thread(th1) { + if(th1!=th) kill(th1->pid,SIGSTOP); + } + } + if (fmt) { fprintf(stderr, ":\n"); va_start(ap, fmt); @@ -102,9 +112,9 @@ describe_internal_error(os_context_t *context) brief_print(*os_context_register_addr(context, offset)); break; - case sc_BaseCharReg: + case sc_CharacterReg: ch = *os_context_register_addr(context, offset); -#ifdef __i386__ +#ifdef LISP_FEATURE_X86 if (offset&1) ch = ch>>8; ch = ch & 0xff; @@ -126,13 +136,13 @@ describe_internal_error(os_context_t *context) #ifdef sc_WordPointerReg case sc_WordPointerReg: #endif - printf("\t0x%08x\n", *os_context_register_addr(context, offset)); + printf("\t0x%08lx\n", (unsigned long) *os_context_register_addr(context, offset)); break; case sc_SignedReg: - printf("\t%d\n", *os_context_register_addr(context, offset)); + printf("\t%ld\n", (long) *os_context_register_addr(context, offset)); break; case sc_UnsignedReg: - printf("\t%u\n", *os_context_register_addr(context, offset)); + printf("\t%lu\n", (unsigned long) *os_context_register_addr(context, offset)); break; #ifdef sc_SingleFloatReg case sc_SingleFloatReg: