projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.9.1.55: trivial cleanup, new documentation directory
[sbcl.git]
/
src
/
runtime
/
backtrace.c
diff --git
a/src/runtime/backtrace.c
b/src/runtime/backtrace.c
index
18f93a0
..
f03e84f
100644
(file)
--- a/
src/runtime/backtrace.c
+++ b/
src/runtime/backtrace.c
@@
-15,20
+15,26
@@
#include <stdio.h>
#include <signal.h>
#include <stdio.h>
#include <signal.h>
-#include "runtime.h"
#include "sbcl.h"
#include "sbcl.h"
+#include "runtime.h"
#include "globals.h"
#include "os.h"
#include "interrupt.h"
#include "lispregs.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. */
struct call_frame {
/* 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;
struct call_frame *old_cont;
#else
u32 old_cont;
@@
-39,13
+45,13
@@
struct call_frame {
};
struct call_info {
};
struct call_info {
-#ifndef alpha
+#ifndef LISP_FEATURE_ALPHA
struct call_frame *frame;
#else
u32 frame;
#endif
int interrupted;
struct call_frame *frame;
#else
u32 frame;
#endif
int interrupted;
-#ifndef alpha
+#ifndef LISP_FEATURE_ALPHA
struct code *code;
#else
u32 code;
struct code *code;
#else
u32 code;
@@
-73,7
+79,6
@@
code_pointer(lispobj object)
break;
case RETURN_PC_HEADER_WIDETAG:
case SIMPLE_FUN_HEADER_WIDETAG:
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;
len = HEADER_LENGTH(header);
if (len == 0)
headerp = NULL;
@@
-90,7
+95,8
@@
code_pointer(lispobj object)
static boolean
cs_valid_pointer_p(struct call_frame *pointer)
{
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));
}
((char *) pointer < (char *) current_control_stack_pointer));
}
@@
-133,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 -
}
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));
(HEADER_LENGTH(info->code->header) * sizeof(lispobj));
#else
(HEADER_LENGTH(((struct code *)info->code)->header) * sizeof(lispobj));
@@
-146,10
+152,11
@@
static int
previous_info(struct call_info *info)
{
struct call_frame *this_frame;
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)) {
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;
}
return 0;
}
@@
-163,10
+170,10
@@
previous_info(struct call_info *info)
if (info->lra == NIL) {
/* We were interrupted. Find the correct signal context. */
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 =
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) {
if ((struct call_frame *)(*os_context_register_addr(context,
reg_CFP))
== info->frame) {
@@
-180,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 -
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));
(HEADER_LENGTH(info->code->header) * sizeof(lispobj));
#else
(HEADER_LENGTH(((struct code *)info->code)->header) * sizeof(lispobj));
@@
-200,15
+207,15
@@
backtrace(int nframes)
call_info_from_lisp_state(&info);
do {
call_info_from_lisp_state(&info);
do {
- printf("<Frame 0x%08x%s, ", (unsigned long) info.frame,
+ printf("<Frame 0x%08lx%s, ", (unsigned long) info.frame,
info.interrupted ? " [interrupted]" : "");
if (info.code != (struct code *) 0) {
lispobj function;
info.interrupted ? " [interrupted]" : "");
if (info.code != (struct code *) 0) {
lispobj function;
- printf("CODE: 0x%08X, ", (unsigned long) info.code | OTHER_POINTER_LOWTAG);
+ printf("CODE: 0x%08lX, ", (unsigned long) info.code | OTHER_POINTER_LOWTAG);
-#ifndef alpha
+#ifndef LISP_FEATURE_ALPHA
function = info.code->entry_points;
#else
function = ((struct code *)info.code)->entry_points;
function = info.code->entry_points;
#else
function = ((struct code *)info.code)->entry_points;
@@
-231,12
+238,13
@@
backtrace(int nframes)
symbol = (struct symbol *) object;
object = (lispobj *) native_pointer(symbol->name);
}
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
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??\?), ");
printf("(Not simple string??\?), ");
} else
printf("(Not other pointer??\?), ");
@@
-249,7
+257,7
@@
backtrace(int nframes)
printf("CODE: ???, ");
if (info.lra != NIL)
printf("CODE: ???, ");
if (info.lra != NIL)
- printf("LRA: 0x%08x, ", (unsigned long)info.lra);
+ printf("LRA: 0x%08lx, ", (unsigned long)info.lra);
else
printf("<no LRA>, ");
else
printf("<no LRA>, ");
@@
-263,6
+271,8
@@
backtrace(int nframes)
#else
#else
+
+
void
backtrace(int nframes)
{
void
backtrace(int nframes)
{