projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.8.15.17
[sbcl.git]
/
src
/
runtime
/
backtrace.c
diff --git
a/src/runtime/backtrace.c
b/src/runtime/backtrace.c
index
e43f96d
..
e10af61
100644
(file)
--- a/
src/runtime/backtrace.c
+++ b/
src/runtime/backtrace.c
@@
-15,14
+15,20
@@
#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__
+#ifndef LISP_FEATURE_X86
/* KLUDGE: Sigh ... I know what the call frame looks like and it had
* better not change. */
/* KLUDGE: Sigh ... I know what the call frame looks like and it had
* better not change. */
@@
-66,14
+72,13
@@
code_pointer(lispobj object)
headerp = (lispobj *) native_pointer(object);
header = *headerp;
headerp = (lispobj *) native_pointer(object);
header = *headerp;
- type = TypeOf(header);
+ type = widetag_of(header);
switch (type) {
switch (type) {
- case type_CodeHeader:
+ case CODE_HEADER_WIDETAG:
break;
break;
- case type_ReturnPcHeader:
- case type_SimpleFunHeader:
- case type_ClosureFunHeader:
+ case RETURN_PC_HEADER_WIDETAG:
+ case SIMPLE_FUN_HEADER_WIDETAG:
len = HEADER_LENGTH(header);
if (len == 0)
headerp = NULL;
len = HEADER_LENGTH(header);
if (len == 0)
headerp = NULL;
@@
-90,8
+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)
{
- /* lose("stub: hasn't been updated for X86"); */
- 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));
}
@@
-113,8
+118,8
@@
call_info_from_context(struct call_info *info, os_context_t *context)
unsigned long pc;
info->interrupted = 1;
unsigned long pc;
info->interrupted = 1;
- if (LowtagOf(*os_context_register_addr(context, reg_CODE))
- == type_FunPointer) {
+ if (lowtag_of(*os_context_register_addr(context, reg_CODE))
+ == FUN_POINTER_LOWTAG) {
/* We tried to call a function, but crapped out before $CODE could
* be fixed up. Probably an undefined function. */
info->frame =
/* We tried to call a function, but crapped out before $CODE could
* be fixed up. Probably an undefined function. */
info->frame =
@@
-147,6
+152,7
@@
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)) {
@@
-164,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) {
@@
-207,7
+213,7
@@
backtrace(int nframes)
if (info.code != (struct code *) 0) {
lispobj function;
if (info.code != (struct code *) 0) {
lispobj function;
- printf("CODE: 0x%08X, ", (unsigned long) info.code | type_OtherPointer);
+ printf("CODE: 0x%08X, ", (unsigned long) info.code | OTHER_POINTER_LOWTAG);
#ifndef alpha
function = info.code->entry_points;
#ifndef alpha
function = info.code->entry_points;
@@
-221,18
+227,18
@@
backtrace(int nframes)
header = (struct simple_fun *) native_pointer(function);
name = header->name;
header = (struct simple_fun *) native_pointer(function);
name = header->name;
- if (LowtagOf(name) == type_OtherPointer) {
+ if (lowtag_of(name) == OTHER_POINTER_LOWTAG) {
lispobj *object;
object = (lispobj *) native_pointer(name);
lispobj *object;
object = (lispobj *) native_pointer(name);
- if (TypeOf(*object) == type_SymbolHeader) {
+ if (widetag_of(*object) == SYMBOL_HEADER_WIDETAG) {
struct symbol *symbol;
symbol = (struct symbol *) object;
object = (lispobj *) native_pointer(symbol->name);
}
struct symbol *symbol;
symbol = (struct symbol *) object;
object = (lispobj *) native_pointer(symbol->name);
}
- if (TypeOf(*object) == type_SimpleString) {
+ if (widetag_of(*object) == SIMPLE_BASE_STRING_WIDETAG) {
struct vector *string;
string = (struct vector *) object;
struct vector *string;
string = (struct vector *) object;
@@
-264,6
+270,8
@@
backtrace(int nframes)
#else
#else
+
+
void
backtrace(int nframes)
{
void
backtrace(int nframes)
{