X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbacktrace.c;h=f03e84f3bf1e01fc1cabb17178cdec21d6930611;hb=dc71db379ab4162a45c393a2e828f619dae9fa32;hp=1b300ba5849849b7915c9ba2f18da9c0f30bf57f;hpb=1419c1d2d50f039be46a8667351b7738ac4965e4;p=sbcl.git diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index 1b300ba..f03e84f 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" @@ -28,13 +28,13 @@ #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. */ struct call_frame { -#ifndef alpha +#ifndef LISP_FEATURE_ALPHA struct call_frame *old_cont; #else u32 old_cont; @@ -45,13 +45,13 @@ struct call_frame { }; struct call_info { -#ifndef alpha +#ifndef LISP_FEATURE_ALPHA struct call_frame *frame; #else u32 frame; #endif int interrupted; -#ifndef alpha +#ifndef LISP_FEATURE_ALPHA struct code *code; #else u32 code; @@ -79,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; @@ -140,7 +139,7 @@ call_info_from_context(struct call_info *info, os_context_t *context) } if (info->code != NULL) info->pc = pc - (unsigned long) info->code - -#ifndef alpha +#ifndef LISP_FEATURE_ALPHA (HEADER_LENGTH(info->code->header) * sizeof(lispobj)); #else (HEADER_LENGTH(((struct code *)info->code)->header) * sizeof(lispobj)); @@ -157,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; } @@ -188,7 +187,7 @@ previous_info(struct call_info *info) if (info->code != NULL) info->pc = (unsigned long)native_pointer(info->lra) - (unsigned long)info->code - -#ifndef alpha +#ifndef LISP_FEATURE_ALPHA (HEADER_LENGTH(info->code->header) * sizeof(lispobj)); #else (HEADER_LENGTH(((struct code *)info->code)->header) * sizeof(lispobj)); @@ -208,15 +207,15 @@ backtrace(int nframes) call_info_from_lisp_state(&info); do { - printf("entry_points; #else function = ((struct code *)info.code)->entry_points; @@ -239,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??\?), "); @@ -257,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(", "); @@ -271,6 +271,8 @@ backtrace(int nframes) #else + + void backtrace(int nframes) {