/[guile]/guile/guile-core/libguile/throw.c
ViewVC logotype

Diff of /guile/guile-core/libguile/throw.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.92 by mvo, Sat Apr 5 19:10:22 2003 UTC revision 1.93 by dirk, Sun Apr 20 07:19:38 2003 UTC
# Line 26  Line 26 
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"
# Line 53  static scm_t_bits tc16_jmpbuffer; Line 51  static scm_t_bits tc16_jmpbuffer;
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)
# Line 74  make_jmpbuf (void) Line 70  make_jmpbuf (void)
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    }    }
# Line 155  scm_internal_catch (SCM tag, scm_t_catch Line 147  scm_internal_catch (SCM tag, scm_t_catch
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;
# Line 652  scm_ithrow (SCM key, SCM args, int noret Line 642  scm_ithrow (SCM key, SCM args, int noret
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    

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.93

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26