X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterr.c;h=5734ac1183b85734d7d2cfa8a3b5de41ca162061;hb=ded744f74ab2f1a97679ad4f91e0eb8d995daef2;hp=7f60ddeeee0e6bdc56412f086c7a9b8fd3d0b8a2;hpb=dfa55a883f94470267b626dae77ce7e7dfac3df6;p=sbcl.git diff --git a/src/runtime/interr.c b/src/runtime/interr.c index 7f60dde..5734ac1 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -15,15 +15,19 @@ #include #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 */ @@ -43,7 +47,16 @@ never_returns lose(char *fmt, ...) { va_list ap; - fprintf(stderr, "fatal error encountered in SBCL runtime system"); + 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); @@ -101,7 +114,7 @@ describe_internal_error(os_context_t *context) case sc_BaseCharReg: ch = *os_context_register_addr(context, offset); -#ifdef __i386__ +#ifdef LISP_FEATURE_X86 if (offset&1) ch = ch>>8; ch = ch & 0xff; @@ -160,8 +173,8 @@ lispobj debug_print(lispobj string) that %primitive print is used (it's only a debugging aid anyway) we just put guarantee our safety by putting an unused buffer on the stack before doing anything else here */ - char untouched[32]; + char untouched[32]; /* GCC warns about not using this, but that's the point.. */ fprintf(stderr, "%s\n", - (char *)(((struct vector *)PTR(string))->data),untouched); + (char *)(((struct vector *)native_pointer(string))->data),untouched); return NIL; }