X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbacktrace.c;h=b4503ad8b37a08764724b75a479f6f2b054de71b;hb=c6b078527eb68acc281dc79c91824c937f9447fe;hp=f5515d516af8585632fe33c2e4edbf3a2a66f9c0;hpb=17cb282da217376a547c60967ad7a4698a8b7fa4;p=sbcl.git diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index f5515d5..b4503ad 100644 --- a/src/runtime/backtrace.c +++ b/src/runtime/backtrace.c @@ -165,7 +165,7 @@ previous_info(struct call_info *info) { struct call_frame *this_frame; struct thread *thread=arch_os_get_current_thread(); - int free; + int free_ici; if (!cs_valid_pointer_p(info->frame)) { printf("Bogus callee value (0x%08lx).\n", (unsigned long)info->frame); @@ -182,10 +182,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,thread)>>2; - while (free-- > 0) { + free_ici = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,thread)); + while (free_ici-- > 0) { os_context_t *context = - thread->interrupt_contexts[free]; + thread->interrupt_contexts[free_ici]; if ((struct call_frame *)(unsigned long) (*os_context_register_addr(context, reg_CFP)) == info->frame) { @@ -406,6 +406,20 @@ debug_function_from_pc (struct code* code, void *pc) } static void +sbcl_putwc(wchar_t c, FILE *file) +{ +#ifdef LISP_FEATURE_OS_PROVIDES_PUTWC + putwc(c, file); +#else + if (c < 256) { + fputc(c, file); + } else { + fputc('?', file); + } +#endif +} + +static void print_string (lispobj *object) { int tag = widetag_of(*object); @@ -420,7 +434,7 @@ print_string (lispobj *object) wchar_t c = (wchar_t) data[i]; \ if (c == '\\' || c == '"') \ putchar('\\'); \ - putwc(c, stdout); \ + sbcl_putwc(c, stdout); \ } \ } while (0)