26 |
#include "libguile/eq.h" |
#include "libguile/eq.h" |
27 |
#include "libguile/dynwind.h" |
#include "libguile/dynwind.h" |
28 |
#include "libguile/backtrace.h" |
#include "libguile/backtrace.h" |
|
#ifdef DEBUG_EXTENSIONS |
|
29 |
#include "libguile/debug.h" |
#include "libguile/debug.h" |
|
#endif |
|
30 |
#include "libguile/continuations.h" |
#include "libguile/continuations.h" |
31 |
#include "libguile/stackchk.h" |
#include "libguile/stackchk.h" |
32 |
#include "libguile/stacks.h" |
#include "libguile/stacks.h" |
51 |
|
|
52 |
#define JBJMPBUF(OBJ) ((jmp_buf *) SCM_CELL_WORD_1 (OBJ)) |
#define JBJMPBUF(OBJ) ((jmp_buf *) SCM_CELL_WORD_1 (OBJ)) |
53 |
#define SETJBJMPBUF(x, v) (SCM_SET_CELL_WORD_1 ((x), (v))) |
#define SETJBJMPBUF(x, v) (SCM_SET_CELL_WORD_1 ((x), (v))) |
|
#ifdef DEBUG_EXTENSIONS |
|
54 |
#define SCM_JBDFRAME(x) ((scm_t_debug_frame *) SCM_CELL_WORD_2 (x)) |
#define SCM_JBDFRAME(x) ((scm_t_debug_frame *) SCM_CELL_WORD_2 (x)) |
55 |
#define SCM_SETJBDFRAME(x, v) (SCM_SET_CELL_WORD_2 ((x), (v))) |
#define SCM_SETJBDFRAME(x, v) (SCM_SET_CELL_WORD_2 ((x), (v))) |
|
#endif |
|
56 |
|
|
57 |
static int |
static int |
58 |
jmpbuffer_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) |
jmpbuffer_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) |
70 |
SCM answer; |
SCM answer; |
71 |
SCM_REDEFER_INTS; |
SCM_REDEFER_INTS; |
72 |
{ |
{ |
|
#ifdef DEBUG_EXTENSIONS |
|
73 |
SCM_NEWSMOB2 (answer, tc16_jmpbuffer, 0, 0); |
SCM_NEWSMOB2 (answer, tc16_jmpbuffer, 0, 0); |
|
#else |
|
|
SCM_NEWSMOB (answer, tc16_jmpbuffer, 0); |
|
|
#endif |
|
74 |
SETJBJMPBUF(answer, (jmp_buf *)0); |
SETJBJMPBUF(answer, (jmp_buf *)0); |
75 |
DEACTIVATEJB(answer); |
DEACTIVATEJB(answer); |
76 |
} |
} |
147 |
answer = SCM_EOL; |
answer = SCM_EOL; |
148 |
scm_dynwinds = scm_acons (tag, jmpbuf, scm_dynwinds); |
scm_dynwinds = scm_acons (tag, jmpbuf, scm_dynwinds); |
149 |
SETJBJMPBUF(jmpbuf, &jbr.buf); |
SETJBJMPBUF(jmpbuf, &jbr.buf); |
|
#ifdef DEBUG_EXTENSIONS |
|
150 |
SCM_SETJBDFRAME(jmpbuf, scm_last_debug_frame); |
SCM_SETJBDFRAME(jmpbuf, scm_last_debug_frame); |
|
#endif |
|
151 |
if (setjmp (jbr.buf)) |
if (setjmp (jbr.buf)) |
152 |
{ |
{ |
153 |
SCM throw_tag; |
SCM throw_tag; |
642 |
jbr = (struct jmp_buf_and_retval *)JBJMPBUF (jmpbuf); |
jbr = (struct jmp_buf_and_retval *)JBJMPBUF (jmpbuf); |
643 |
jbr->throw_tag = key; |
jbr->throw_tag = key; |
644 |
jbr->retval = args; |
jbr->retval = args; |
|
#ifdef DEBUG_EXTENSIONS |
|
645 |
scm_last_debug_frame = SCM_JBDFRAME (jmpbuf); |
scm_last_debug_frame = SCM_JBDFRAME (jmpbuf); |
|
#endif |
|
646 |
longjmp (*JBJMPBUF (jmpbuf), 1); |
longjmp (*JBJMPBUF (jmpbuf), 1); |
647 |
} |
} |
648 |
|
|