X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbacktrace.c;h=d21e4885ed228b1efcde34379ac875038a3de7c2;hb=b86f43bae31f775d834c724e21f0f573b968f695;hp=12f954f7305cff61dc401e5dbabe2daac31c7834;hpb=d2e48d5a1805e3fb98268473a71aff38d8fd9d0b;p=sbcl.git diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index 12f954f..d21e488 100644 --- a/src/runtime/backtrace.c +++ b/src/runtime/backtrace.c @@ -15,16 +15,20 @@ #include #include -#include "runtime.h" #include "sbcl.h" +#include "runtime.h" #include "globals.h" #include "os.h" #include "interrupt.h" #include "lispregs.h" +#ifdef LISP_FEATURE_GENCGC +#include "gencgc-alloc-region.h" +#endif #include "genesis/static-symbols.h" #include "genesis/primitive-objects.h" +#include "thread.h" -#ifndef __i386__ +#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)) /* KLUDGE: Sigh ... I know what the call frame looks like and it had * better not change. */ @@ -75,7 +79,6 @@ code_pointer(lispobj object) break; case RETURN_PC_HEADER_WIDETAG: case SIMPLE_FUN_HEADER_WIDETAG: - case CLOSURE_FUN_HEADER_WIDETAG: len = HEADER_LENGTH(header); if (len == 0) headerp = NULL; @@ -92,7 +95,8 @@ code_pointer(lispobj object) static boolean cs_valid_pointer_p(struct call_frame *pointer) { - return (((char *) CONTROL_STACK_START <= (char *) pointer) && + struct thread *thread=arch_os_get_current_thread(); + return (((char *) thread->control_stack_start <= (char *) pointer) && ((char *) pointer < (char *) current_control_stack_pointer)); } @@ -148,6 +152,7 @@ static int previous_info(struct call_info *info) { struct call_frame *this_frame; + struct thread *thread=arch_os_get_current_thread(); int free; if (!cs_valid_pointer_p(info->frame)) { @@ -165,10 +170,10 @@ previous_info(struct call_info *info) if (info->lra == NIL) { /* We were interrupted. Find the correct signal context. */ - free = SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX)>>2; + free = SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,thread)>>2; while (free-- > 0) { os_context_t *context = - lisp_interrupt_contexts[free]; + thread->interrupt_contexts[free]; if ((struct call_frame *)(*os_context_register_addr(context, reg_CFP)) == info->frame) { @@ -233,12 +238,13 @@ backtrace(int nframes) symbol = (struct symbol *) object; object = (lispobj *) native_pointer(symbol->name); } - if (widetag_of(*object) == SIMPLE_STRING_WIDETAG) { + if (widetag_of(*object) == SIMPLE_BASE_STRING_WIDETAG) { struct vector *string; string = (struct vector *) object; printf("%s, ", (char *) string->data); } else + /* FIXME: broken from (VECTOR NIL) */ printf("(Not simple string??\?), "); } else printf("(Not other pointer??\?), "); @@ -265,6 +271,8 @@ backtrace(int nframes) #else + + void backtrace(int nframes) {