X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Fbacktrace.c;h=429807f7510f49f078ea4a06d90261c72e5ba0ac;hb=731d5dd65a7b94b5d49d1663d9b60c3a406ce38c;hp=a4cbc116ffda78ee0ffc8a3df2ca3212988f9290;hpb=e365f2f7a9c66d307b48fee70778f4eaa84bdcc0;p=sbcl.git diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index a4cbc11..429807f 100644 --- a/src/runtime/backtrace.c +++ b/src/runtime/backtrace.c @@ -15,8 +15,8 @@ #include #include -#include "runtime.h" #include "sbcl.h" +#include "runtime.h" #include "globals.h" #include "os.h" #include "interrupt.h" @@ -26,8 +26,9 @@ #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. */ @@ -78,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; @@ -95,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)); } @@ -155,7 +156,7 @@ previous_info(struct call_info *info) int free; if (!cs_valid_pointer_p(info->frame)) { - printf("Bogus callee value (0x%08x).\n", (unsigned long)info->frame); + printf("Bogus callee value (0x%08lx).\n", (unsigned long)info->frame); return 0; } @@ -206,13 +207,13 @@ backtrace(int nframes) call_info_from_lisp_state(&info); do { - printf("entry_points; @@ -237,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??\?), "); @@ -255,7 +257,7 @@ backtrace(int nframes) printf("CODE: ???, "); if (info.lra != NIL) - printf("LRA: 0x%08x, ", (unsigned long)info.lra); + printf("LRA: 0x%08lx, ", (unsigned long)info.lra); else printf(", "); @@ -269,6 +271,8 @@ backtrace(int nframes) #else + + void backtrace(int nframes) {