* use an applicable SMOB to represent continuations, instead of a
[bpt/guile.git] / libguile / debug.c
1 /* Debugging extensions for Guile
2 * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this software; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17 * Boston, MA 02111-1307 USA
18 *
19 * As a special exception, the Free Software Foundation gives permission
20 * for additional uses of the text contained in its release of GUILE.
21 *
22 * The exception is that, if you link the GUILE library with other files
23 * to produce an executable, this does not by itself cause the
24 * resulting executable to be covered by the GNU General Public License.
25 * Your use of that executable is in no way restricted on account of
26 * linking the GUILE library code into it.
27 *
28 * This exception does not however invalidate any other reasons why
29 * the executable file might be covered by the GNU General Public License.
30 *
31 * This exception applies only to the code released by the
32 * Free Software Foundation under the name GUILE. If you copy
33 * code from other Free Software Foundation releases into a copy of
34 * GUILE, as the General Public License permits, the exception does
35 * not apply to the code that you add in this way. To avoid misleading
36 * anyone as to the status of such modified files, you must delete
37 * this exception notice from them.
38 *
39 * If you write modifications of your own for GUILE, it is your choice
40 * whether to permit this exception to apply to your modifications.
41 * If you do not wish that, delete this exception notice.
42 *
43 * The author can be reached at djurfeldt@nada.kth.se
44 * Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */
45
46 /* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
47 gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
48
49
50 #include <stdio.h>
51 #include "libguile/_scm.h"
52 #include "libguile/eval.h"
53 #include "libguile/stackchk.h"
54 #include "libguile/throw.h"
55 #include "libguile/macros.h"
56 #include "libguile/smob.h"
57 #include "libguile/procprop.h"
58 #include "libguile/srcprop.h"
59 #include "libguile/alist.h"
60 #include "libguile/continuations.h"
61 #include "libguile/strports.h"
62 #include "libguile/read.h"
63 #include "libguile/feature.h"
64 #include "libguile/dynwind.h"
65 #include "libguile/modules.h"
66 #include "libguile/ports.h"
67 #include "libguile/root.h"
68 #include "libguile/fluids.h"
69
70 #include "libguile/validate.h"
71 #include "libguile/debug.h"
72 \f
73
74 /* {Run time control of the debugging evaluator}
75 */
76
77 SCM_DEFINE (scm_debug_options, "debug-options-interface", 0, 1, 0,
78 (SCM setting),
79 "")
80 #define FUNC_NAME s_scm_debug_options
81 {
82 SCM ans;
83 SCM_DEFER_INTS;
84 ans = scm_options (setting,
85 scm_debug_opts,
86 SCM_N_DEBUG_OPTIONS,
87 FUNC_NAME);
88 #ifndef SCM_RECKLESS
89 if (!(1 <= SCM_N_FRAMES && SCM_N_FRAMES <= SCM_MAX_FRAME_SIZE))
90 {
91 scm_options (ans, scm_debug_opts, SCM_N_DEBUG_OPTIONS, FUNC_NAME);
92 SCM_OUT_OF_RANGE (1, setting);
93 }
94 #endif
95 SCM_RESET_DEBUG_MODE;
96 scm_stack_checking_enabled_p = SCM_STACK_CHECKING_P;
97 scm_debug_eframe_size = 2 * SCM_N_FRAMES;
98 SCM_ALLOW_INTS;
99 return ans;
100 }
101 #undef FUNC_NAME
102
103 static void
104 with_traps_before (void *data)
105 {
106 int *trap_flag = data;
107 *trap_flag = SCM_TRAPS_P;
108 SCM_TRAPS_P = 1;
109 }
110
111 static void
112 with_traps_after (void *data)
113 {
114 int *trap_flag = data;
115 SCM_TRAPS_P = *trap_flag;
116 }
117
118 static SCM
119 with_traps_inner (void *data)
120 {
121 SCM thunk = SCM_PACK (data);
122 return scm_apply (thunk, SCM_EOL, SCM_EOL);
123 }
124
125 SCM_DEFINE (scm_with_traps, "with-traps", 1, 0, 0,
126 (SCM thunk),
127 "")
128 #define FUNC_NAME s_scm_with_traps
129 {
130 int trap_flag;
131 SCM_VALIDATE_THUNK (1,thunk);
132 return scm_internal_dynamic_wind (with_traps_before,
133 with_traps_inner,
134 with_traps_after,
135 (void *) SCM_UNPACK (thunk),
136 &trap_flag);
137 }
138 #undef FUNC_NAME
139
140 \f
141 static SCM scm_sym_source, scm_sym_dots;
142 static SCM scm_sym_procname;
143
144 /* {Memoized Source}
145 */
146
147 long scm_tc16_memoized;
148
149
150 static int
151 prinmemoized (SCM obj,SCM port,scm_print_state *pstate)
152 {
153 int writingp = SCM_WRITINGP (pstate);
154 scm_puts ("#<memoized ", port);
155 SCM_SET_WRITINGP (pstate, 1);
156 #ifdef GUILE_DEBUG
157 scm_iprin1 (SCM_MEMOIZED_EXP (obj), port, pstate);
158 #else
159 scm_iprin1 (scm_unmemoize (obj), port, pstate);
160 #endif
161 SCM_SET_WRITINGP (pstate, writingp);
162 scm_putc ('>', port);
163 return 1;
164 }
165
166 SCM_DEFINE (scm_memoized_p, "memoized?", 1, 0, 0,
167 (SCM obj),
168 "")
169 #define FUNC_NAME s_scm_memoized_p
170 {
171 return SCM_BOOL(SCM_MEMOIZEDP (obj));
172 }
173 #undef FUNC_NAME
174
175 SCM
176 scm_make_memoized (SCM exp, SCM env)
177 {
178 /* *fixme* Check that env is a valid environment. */
179 register SCM z, ans;
180 SCM_ENTER_A_SECTION;
181 SCM_NEWSMOB (z, SCM_UNPACK (exp), SCM_UNPACK (env));
182 SCM_NEWSMOB (ans, scm_tc16_memoized, SCM_UNPACK (z));
183 SCM_EXIT_A_SECTION;
184 return ans;
185 }
186
187 #ifdef GUILE_DEBUG
188 /*
189 * Some primitives for construction of memoized code
190 *
191 * - procedure: memcons CAR CDR [ENV]
192 *
193 * Construct a pair, encapsulated in a memoized object.
194 *
195 * The CAR and CDR can be either normal or memoized. If ENV isn't
196 * specified, the top-level environment of the current module will
197 * be assumed. All environments must match.
198 *
199 * - procedure: make-gloc VARIABLE [ENV]
200 *
201 * Return a gloc, encapsulated in a memoized object.
202 *
203 * (Glocs can't exist in normal list structures, since they will
204 * be mistaken for structs.)
205 *
206 * - procedure: gloc? OBJECT
207 *
208 * Return #t if OBJECT is a memoized gloc.
209 *
210 * - procedure: make-iloc FRAME BINDING CDRP
211 *
212 * Return an iloc referring to frame no. FRAME, binding
213 * no. BINDING. If CDRP is non-#f, the iloc is referring to a
214 * frame consisting of a single pair, with the value stored in the
215 * CDR.
216 *
217 * - procedure: iloc? OBJECT
218 *
219 * Return #t if OBJECT is an iloc.
220 *
221 * - procedure: mem->proc MEMOIZED
222 *
223 * Construct a closure from the memoized lambda expression MEMOIZED
224 *
225 * WARNING! The code is not copied!
226 *
227 * - procedure: proc->mem CLOSURE
228 *
229 * Turn the closure CLOSURE into a memoized object.
230 *
231 * WARNING! The code is not copied!
232 *
233 * - constant: SCM_IM_AND
234 * - constant: SCM_IM_BEGIN
235 * - constant: SCM_IM_CASE
236 * - constant: SCM_IM_COND
237 * - constant: SCM_IM_DO
238 * - constant: SCM_IM_IF
239 * - constant: SCM_IM_LAMBDA
240 * - constant: SCM_IM_LET
241 * - constant: SCM_IM_LETSTAR
242 * - constant: SCM_IM_LETREC
243 * - constant: SCM_IM_OR
244 * - constant: SCM_IM_QUOTE
245 * - constant: SCM_IM_SET
246 * - constant: SCM_IM_DEFINE
247 * - constant: SCM_IM_APPLY
248 * - constant: SCM_IM_CONT
249 * - constant: SCM_IM_DISPATCH
250 */
251
252 #include "libguile/variable.h"
253 #include "libguile/procs.h"
254
255 SCM_DEFINE (scm_make_gloc, "make-gloc", 1, 1, 0,
256 (SCM var, SCM env),
257 "")
258 #define FUNC_NAME s_scm_make_gloc
259 {
260 #if 1 /* Unsafe */
261 if (SCM_CONSP (var))
262 var = scm_cons (SCM_BOOL_F, var);
263 else
264 #endif
265 SCM_VALIDATE_VARIABLE (1,var);
266 if (SCM_UNBNDP (env))
267 env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
268 else
269 SCM_VALIDATE_NULLORCONS (2,env);
270 return scm_make_memoized (SCM_VARVCELL (var) + 1, env);
271 }
272 #undef FUNC_NAME
273
274 SCM_DEFINE (scm_gloc_p, "gloc?", 1, 0, 0,
275 (SCM obj),
276 "")
277 #define FUNC_NAME s_scm_gloc_p
278 {
279 return SCM_BOOL((SCM_MEMOIZEDP (obj)
280 && (SCM_UNPACK(SCM_MEMOIZED_EXP (obj)) & 7) == 1));
281 }
282 #undef FUNC_NAME
283
284 SCM_DEFINE (scm_make_iloc, "make-iloc", 3, 0, 0,
285 (SCM frame, SCM binding, SCM cdrp),
286 "")
287 #define FUNC_NAME s_scm_make_iloc
288 {
289 SCM_VALIDATE_INUM (1,frame);
290 SCM_VALIDATE_INUM (2,binding);
291 return (SCM_ILOC00
292 + SCM_IFRINC * SCM_INUM (frame)
293 + (SCM_NFALSEP (cdrp) ? SCM_ICDR : 0)
294 + SCM_IDINC * SCM_INUM (binding));
295 }
296 #undef FUNC_NAME
297
298 SCM_DEFINE (scm_iloc_p, "iloc?", 1, 0, 0,
299 (SCM obj),
300 "")
301 #define FUNC_NAME s_scm_iloc_p
302 {
303 return SCM_BOOL(SCM_ILOCP (obj));
304 }
305 #undef FUNC_NAME
306
307 SCM_DEFINE (scm_memcons, "memcons", 2, 1, 0,
308 (SCM car, SCM cdr, SCM env),
309 "")
310 #define FUNC_NAME s_scm_memcons
311 {
312 if (SCM_MEMOIZEDP (car))
313 {
314 /*fixme* environments may be two different but equal top-level envs */
315 if (!SCM_UNBNDP (env) && SCM_MEMOIZED_ENV (car) != env)
316 SCM_MISC_ERROR ("environment mismatch arg1 <-> arg3",
317 scm_cons2 (car, env, SCM_EOL));
318 else
319 env = SCM_MEMOIZED_ENV (car);
320 car = SCM_MEMOIZED_EXP (car);
321 }
322 if (SCM_MEMOIZEDP (cdr))
323 {
324 if (!SCM_UNBNDP (env) && SCM_MEMOIZED_ENV (cdr) != env)
325 SCM_MISC_ERROR ("environment mismatch arg2 <-> arg3",
326 scm_cons2 (cdr, env, SCM_EOL));
327 else
328 env = SCM_MEMOIZED_ENV (cdr);
329 cdr = SCM_MEMOIZED_EXP (cdr);
330 }
331 if (SCM_UNBNDP (env))
332 env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
333 else
334 SCM_VALIDATE_NULLORCONS (3,env);
335 return scm_make_memoized (scm_cons (car, cdr), env);
336 }
337 #undef FUNC_NAME
338
339 SCM_DEFINE (scm_mem_to_proc, "mem->proc", 1, 0, 0,
340 (SCM obj),
341 "")
342 #define FUNC_NAME s_scm_mem_to_proc
343 {
344 SCM env;
345 SCM_VALIDATE_MEMOIZED (1,obj);
346 env = SCM_MEMOIZED_ENV (obj);
347 obj = SCM_MEMOIZED_EXP (obj);
348 if (!(SCM_NIMP (obj) && SCM_CAR (obj) == SCM_IM_LAMBDA))
349 SCM_MISC_ERROR ("expected lambda expression",
350 scm_cons (obj, SCM_EOL));
351 return scm_closure (SCM_CDR (obj), env);
352 }
353 #undef FUNC_NAME
354
355 SCM_DEFINE (scm_proc_to_mem, "proc->mem", 1, 0, 0,
356 (SCM obj),
357 "")
358 #define FUNC_NAME s_scm_proc_to_mem
359 {
360 SCM_VALIDATE_CLOSURE (1, obj);
361 return scm_make_memoized (scm_cons (SCM_IM_LAMBDA, SCM_CODE (obj)),
362 SCM_ENV (obj));
363 }
364 #undef FUNC_NAME
365
366 #endif /* GUILE_DEBUG */
367
368 SCM_DEFINE (scm_unmemoize, "unmemoize", 1, 0, 0,
369 (SCM m),
370 "")
371 #define FUNC_NAME s_scm_unmemoize
372 {
373 SCM_VALIDATE_MEMOIZED (1,m);
374 return scm_unmemocopy (SCM_MEMOIZED_EXP (m), SCM_MEMOIZED_ENV (m));
375 }
376 #undef FUNC_NAME
377
378 SCM_DEFINE (scm_memoized_environment, "memoized-environment", 1, 0, 0,
379 (SCM m),
380 "")
381 #define FUNC_NAME s_scm_memoized_environment
382 {
383 SCM_VALIDATE_MEMOIZED (1,m);
384 return SCM_MEMOIZED_ENV (m);
385 }
386 #undef FUNC_NAME
387
388 SCM_DEFINE (scm_procedure_name, "procedure-name", 1, 0, 0,
389 (SCM proc),
390 "")
391 #define FUNC_NAME s_scm_procedure_name
392 {
393 SCM_VALIDATE_PROC (1,proc);
394 switch (SCM_TYP7 (proc)) {
395 case scm_tcs_subrs:
396 return SCM_SNAME (proc);
397 default:
398 {
399 SCM name = scm_procedure_property (proc, scm_sym_name);
400 #if 0
401 /* Source property scm_sym_procname not implemented yet... */
402 SCM name = scm_source_property (SCM_CAR (SCM_CDR (SCM_CODE (proc))), scm_sym_procname);
403 if (SCM_FALSEP (name))
404 name = scm_procedure_property (proc, scm_sym_name);
405 #endif
406 if (SCM_FALSEP (name) && SCM_CLOSUREP (proc))
407 name = scm_reverse_lookup (SCM_ENV (proc), proc);
408 return name;
409 }
410 }
411 }
412 #undef FUNC_NAME
413
414 SCM_DEFINE (scm_procedure_source, "procedure-source", 1, 0, 0,
415 (SCM proc),
416 "")
417 #define FUNC_NAME s_scm_procedure_source
418 {
419 SCM_VALIDATE_NIM (1,proc);
420 switch (SCM_TYP7 (proc)) {
421 case scm_tcs_closures:
422 {
423 SCM src;
424 src = scm_source_property (SCM_CDR (SCM_CODE (proc)), scm_sym_copy);
425 if (! SCM_FALSEP (src))
426 return scm_cons2 (scm_sym_lambda, SCM_CAR (SCM_CODE (proc)), src);
427 src = SCM_CODE (proc);
428 return scm_cons (scm_sym_lambda,
429 scm_unmemocopy (src,
430 SCM_EXTEND_ENV (SCM_CAR (src),
431 SCM_EOL,
432 SCM_ENV (proc))));
433 }
434 case scm_tcs_subrs:
435 #ifdef CCLO
436 case scm_tc7_cclo:
437 #endif
438 /* It would indeed be a nice thing if we supplied source even for
439 built in procedures! */
440 return scm_procedure_property (proc, scm_sym_source);
441 default:
442 SCM_WTA(1,proc);
443 return SCM_BOOL_F;
444 }
445 }
446 #undef FUNC_NAME
447
448 SCM_DEFINE (scm_procedure_environment, "procedure-environment", 1, 0, 0,
449 (SCM proc),
450 "")
451 #define FUNC_NAME s_scm_procedure_environment
452 {
453 SCM_VALIDATE_NIM (1,proc);
454 switch (SCM_TYP7 (proc)) {
455 case scm_tcs_closures:
456 return SCM_ENV (proc);
457 case scm_tcs_subrs:
458 #ifdef CCLO
459 case scm_tc7_cclo:
460 #endif
461 return SCM_EOL;
462 default:
463 SCM_WTA(1,proc);
464 return SCM_BOOL_F;
465 }
466 }
467 #undef FUNC_NAME
468
469 \f
470
471 /* Eval in a local environment. We would like to have the ability to
472 * evaluate in a specified local environment, but due to the
473 * memoization this isn't normally possible. We solve it by copying
474 * the code before evaluating. One solution would be to have eval.c
475 * generate yet another evaluator. They are not very big actually.
476 */
477 SCM_DEFINE (scm_local_eval, "local-eval", 1, 1, 0,
478 (SCM exp, SCM env),
479 "Evaluate @var{exp} in its environment. If @var{env} is supplied,\n"
480 "it is the environment in which to evaluate @var{exp}. Otherwise,\n"
481 "@var{exp} must be a memoized code object (in which case, its environment\n"
482 "is implicit).")
483 #define FUNC_NAME s_scm_local_eval
484 {
485 if (SCM_UNBNDP (env))
486 {
487 SCM_VALIDATE_MEMOIZED (1, exp);
488 return scm_i_eval_x (SCM_MEMOIZED_EXP (exp), SCM_MEMOIZED_ENV (exp));
489 }
490 return scm_i_eval (exp, env);
491 }
492 #undef FUNC_NAME
493
494 #if 0
495 SCM_REGISTER_PROC (s_reverse_lookup, "reverse-lookup", 2, 0, 0, scm_reverse_lookup);
496 #endif
497
498 SCM
499 scm_reverse_lookup (SCM env, SCM data)
500 {
501 SCM names, values;
502 while (SCM_NIMP (env) && SCM_SLOPPY_CONSP (SCM_CAR (env)))
503 {
504 names = SCM_CAAR (env);
505 values = SCM_CDAR (env);
506 while (SCM_CONSP (names))
507 {
508 if (SCM_EQ_P (SCM_CAR (values), data))
509 return SCM_CAR (names);
510 names = SCM_CDR (names);
511 values = SCM_CDR (values);
512 }
513 if (! SCM_NULLP (names) && SCM_EQ_P (values, data))
514 return names;
515 env = SCM_CDR (env);
516 }
517 return SCM_BOOL_F;
518 }
519
520 SCM
521 scm_start_stack (SCM id, SCM exp, SCM env)
522 {
523 SCM answer;
524 scm_debug_frame vframe;
525 scm_debug_info vframe_vect_body;
526 vframe.prev = scm_last_debug_frame;
527 vframe.status = SCM_VOIDFRAME;
528 vframe.vect = &vframe_vect_body;
529 vframe.vect[0].id = id;
530 scm_last_debug_frame = &vframe;
531 answer = scm_i_eval (exp, env);
532 scm_last_debug_frame = vframe.prev;
533 return answer;
534 }
535
536 SCM_SYNTAX(s_start_stack, "start-stack", scm_makacro, scm_m_start_stack);
537
538 static SCM
539 scm_m_start_stack (SCM exp, SCM env)
540 {
541 exp = SCM_CDR (exp);
542 SCM_ASSERT (SCM_ECONSP (exp)
543 && SCM_ECONSP (SCM_CDR (exp))
544 && SCM_NULLP (SCM_CDDR (exp)),
545 exp,
546 SCM_WNA,
547 s_start_stack);
548 return scm_start_stack (scm_eval_car (exp, env), SCM_CADR (exp), env);
549 }
550
551 /* {Debug Objects}
552 *
553 * The debugging evaluator throws these on frame traps.
554 */
555
556 long scm_tc16_debugobj;
557
558 static int
559 prindebugobj (SCM obj,SCM port,scm_print_state *pstate)
560 {
561 scm_puts ("#<debug-object ", port);
562 scm_intprint ((int) SCM_DEBUGOBJ_FRAME (obj), 16, port);
563 scm_putc ('>', port);
564 return 1;
565 }
566
567 SCM_DEFINE (scm_debug_object_p, "debug-object?", 1, 0, 0,
568 (SCM obj),
569 "")
570 #define FUNC_NAME s_scm_debug_object_p
571 {
572 return SCM_BOOL(SCM_DEBUGOBJP (obj));
573 }
574 #undef FUNC_NAME
575
576
577 SCM
578 scm_make_debugobj (scm_debug_frame *frame)
579 {
580 register SCM z;
581 SCM_NEWCELL (z);
582 SCM_ENTER_A_SECTION;
583 SCM_SET_DEBUGOBJ_FRAME (z, frame);
584 SCM_SET_CELL_TYPE (z, scm_tc16_debugobj);
585 SCM_EXIT_A_SECTION;
586 return z;
587 }
588
589 \f
590
591 /* Undocumented debugging procedure */
592 #ifdef GUILE_DEBUG
593 SCM_DEFINE (scm_debug_hang, "debug-hang", 0, 1, 0,
594 (SCM obj),
595 "")
596 #define FUNC_NAME s_scm_debug_hang
597 {
598 int go = 0;
599 while (!go) ;
600 return SCM_UNSPECIFIED;
601 }
602 #undef FUNC_NAME
603 #endif
604
605 \f
606
607 void
608 scm_init_debug ()
609 {
610 scm_init_opts (scm_debug_options, scm_debug_opts, SCM_N_DEBUG_OPTIONS);
611
612 scm_tc16_memoized = scm_make_smob_type_mfpe ("memoized", 0,
613 scm_markcdr, NULL, prinmemoized, NULL);
614
615 scm_tc16_debugobj = scm_make_smob_type_mfpe ("debug-object", 0,
616 NULL, NULL, prindebugobj, NULL);
617
618 scm_sym_procname = SCM_CAR (scm_sysintern ("procname", SCM_UNDEFINED));
619 scm_sym_dots = SCM_CAR (scm_sysintern ("...", SCM_UNDEFINED));
620 scm_sym_source = SCM_CAR (scm_sysintern ("source", SCM_UNDEFINED));
621
622 #ifdef GUILE_DEBUG
623 scm_sysintern ("SCM_IM_AND", SCM_IM_AND);
624 scm_sysintern ("SCM_IM_BEGIN", SCM_IM_BEGIN);
625 scm_sysintern ("SCM_IM_CASE", SCM_IM_CASE);
626 scm_sysintern ("SCM_IM_COND", SCM_IM_COND);
627 scm_sysintern ("SCM_IM_DO", SCM_IM_DO);
628 scm_sysintern ("SCM_IM_IF", SCM_IM_IF);
629 scm_sysintern ("SCM_IM_LAMBDA", SCM_IM_LAMBDA);
630 scm_sysintern ("SCM_IM_LET", SCM_IM_LET);
631 scm_sysintern ("SCM_IM_LETSTAR", SCM_IM_LETSTAR);
632 scm_sysintern ("SCM_IM_LETREC", SCM_IM_LETREC);
633 scm_sysintern ("SCM_IM_OR", SCM_IM_OR);
634 scm_sysintern ("SCM_IM_QUOTE", SCM_IM_QUOTE);
635 scm_sysintern ("SCM_IM_SET_X", SCM_IM_SET_X);
636 scm_sysintern ("SCM_IM_DEFINE", SCM_IM_DEFINE);
637 scm_sysintern ("SCM_IM_APPLY", SCM_IM_APPLY);
638 scm_sysintern ("SCM_IM_CONT", SCM_IM_CONT);
639 scm_sysintern ("SCM_IM_DISPATCH", SCM_IM_DISPATCH);
640 #endif
641 scm_add_feature ("debug-extensions");
642
643 #ifndef SCM_MAGIC_SNARFER
644 #include "libguile/debug.x"
645 #endif
646 }
647
648 /*
649 Local Variables:
650 c-file-style: "gnu"
651 End:
652 */