1 /* Printing of backtraces and error messages
2 * Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006 Free Software Foundation
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 3 of
7 * the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 #include "libguile/_scm.h"
37 #include "libguile/stacks.h"
38 #include "libguile/srcprop.h"
39 #include "libguile/struct.h"
40 #include "libguile/strports.h"
41 #include "libguile/throw.h"
42 #include "libguile/fluids.h"
43 #include "libguile/ports.h"
44 #include "libguile/strings.h"
45 #include "libguile/dynwind.h"
47 #include "libguile/validate.h"
48 #include "libguile/lang.h"
49 #include "libguile/backtrace.h"
50 #include "libguile/filesys.h"
51 #include "libguile/private-options.h"
53 /* {Error reporting and backtraces}
55 * Note that these functions shouldn't generate errors themselves.
58 /* Print parameters for error messages. */
60 #define DISPLAY_ERROR_MESSAGE_MAX_LEVEL 7
61 #define DISPLAY_ERROR_MESSAGE_MAX_LENGTH 10
63 /* Print parameters for failing expressions in error messages.
64 * (See also `print_params' below for backtrace print parameters.)
67 #define DISPLAY_EXPRESSION_MAX_LEVEL 2
68 #define DISPLAY_EXPRESSION_MAX_LENGTH 3
71 #define SCM_ASSERT(_cond, _arg, _pos, _subr) \
75 SCM scm_the_last_stack_fluid_var
;
78 display_header (SCM source
, SCM port
)
80 if (SCM_MEMOIZEDP (source
))
82 SCM fname
= scm_source_property (source
, scm_sym_filename
);
83 SCM line
= scm_source_property (source
, scm_sym_line
);
84 SCM col
= scm_source_property (source
, scm_sym_column
);
86 /* Dirk:FIXME:: Maybe we should store the _port_ rather than the
87 * filename with the source properties? Then we could in case of
88 * non-file ports give at least some more details than just
89 * "<unnamed port>". */
90 if (scm_is_true (fname
))
91 scm_prin1 (fname
, port
, 0);
93 scm_puts ("<unnamed port>", port
);
95 if (scm_is_true (line
) && scm_is_true (col
))
98 scm_intprint (scm_to_long (line
) + 1, 10, port
);
100 scm_intprint (scm_to_long (col
) + 1, 10, port
);
104 scm_puts ("ERROR", port
);
105 scm_puts (": ", port
);
109 struct display_error_message_data
{
113 scm_print_state
*pstate
;
120 display_error_message (struct display_error_message_data
*d
)
122 if (scm_is_string (d
->message
) && scm_is_true (scm_list_p (d
->args
)))
123 scm_simple_format (d
->port
, d
->message
, d
->args
);
125 scm_display (d
->message
, d
->port
);
126 scm_newline (d
->port
);
127 return SCM_UNSPECIFIED
;
131 before_display_error_message (struct display_error_message_data
*d
)
133 scm_print_state
*pstate
= d
->pstate
;
134 d
->old_fancyp
= pstate
->fancyp
;
135 d
->old_level
= pstate
->level
;
136 d
->old_length
= pstate
->length
;
138 pstate
->level
= DISPLAY_ERROR_MESSAGE_MAX_LEVEL
;
139 pstate
->length
= DISPLAY_ERROR_MESSAGE_MAX_LENGTH
;
143 after_display_error_message (struct display_error_message_data
*d
)
145 scm_print_state
*pstate
= d
->pstate
;
146 pstate
->fancyp
= d
->old_fancyp
;
147 pstate
->level
= d
->old_level
;
148 pstate
->length
= d
->old_length
;
152 scm_display_error_message (SCM message
, SCM args
, SCM port
)
154 struct display_error_message_data d
;
156 scm_print_state
*pstate
;
158 port
= scm_i_port_with_print_state (port
, SCM_UNDEFINED
);
159 print_state
= SCM_PORT_WITH_PS_PS (port
);
160 pstate
= SCM_PRINT_STATE (print_state
);
166 scm_internal_dynamic_wind ((scm_t_guard
) before_display_error_message
,
167 (scm_t_inner
) display_error_message
,
168 (scm_t_guard
) after_display_error_message
,
174 display_expression (SCM frame
, SCM pname
, SCM source
, SCM port
)
176 SCM print_state
= scm_make_print_state ();
177 scm_print_state
*pstate
= SCM_PRINT_STATE (print_state
);
178 pstate
->writingp
= 0;
180 pstate
->level
= DISPLAY_EXPRESSION_MAX_LEVEL
;
181 pstate
->length
= DISPLAY_EXPRESSION_MAX_LENGTH
;
182 if (scm_is_symbol (pname
) || scm_is_string (pname
))
184 if (SCM_FRAMEP (frame
)
185 && SCM_FRAME_EVAL_ARGS_P (frame
))
186 scm_puts ("While evaluating arguments to ", port
);
188 scm_puts ("In procedure ", port
);
189 scm_iprin1 (pname
, port
, pstate
);
190 if (SCM_MEMOIZEDP (source
))
192 scm_puts (" in expression ", port
);
193 pstate
->writingp
= 1;
194 scm_iprin1 (scm_i_unmemoize_expr (source
), port
, pstate
);
197 else if (SCM_MEMOIZEDP (source
))
199 scm_puts ("In expression ", port
);
200 pstate
->writingp
= 1;
201 scm_iprin1 (scm_i_unmemoize_expr (source
), port
, pstate
);
203 scm_puts (":\n", port
);
204 scm_free_print_state (print_state
);
207 struct display_error_args
{
217 display_error_body (struct display_error_args
*a
)
219 SCM current_frame
= SCM_BOOL_F
;
220 SCM source
= SCM_BOOL_F
;
221 SCM prev_frame
= SCM_BOOL_F
;
225 && SCM_STACKP (a
->stack
)
226 && SCM_STACK_LENGTH (a
->stack
) > 0)
228 current_frame
= scm_stack_ref (a
->stack
, SCM_INUM0
);
229 source
= SCM_FRAME_SOURCE (current_frame
);
230 prev_frame
= SCM_FRAME_PREV (current_frame
);
231 if (!SCM_MEMOIZEDP (source
) && scm_is_true (prev_frame
))
232 source
= SCM_FRAME_SOURCE (prev_frame
);
233 if (!scm_is_symbol (pname
)
234 && !scm_is_string (pname
)
235 && SCM_FRAME_PROC_P (current_frame
)
236 && scm_is_true (scm_procedure_p (SCM_FRAME_PROC (current_frame
))))
237 pname
= scm_procedure_name (SCM_FRAME_PROC (current_frame
));
239 if (scm_is_symbol (pname
) || scm_is_string (pname
) || SCM_MEMOIZEDP (source
))
241 display_header (source
, a
->port
);
242 display_expression (current_frame
, pname
, source
, a
->port
);
244 display_header (source
, a
->port
);
245 scm_display_error_message (a
->message
, a
->args
, a
->port
);
246 return SCM_UNSPECIFIED
;
249 struct display_error_handler_data
{
254 /* This is the exception handler for error reporting routines.
255 Note that it is very important that this handler *doesn't* try to
256 print more than the error tag, since the error very probably is
257 caused by an erroneous print call-back routine. If we would
258 try to print all objects, we would enter an infinite loop. */
260 display_error_handler (struct display_error_handler_data
*data
,
261 SCM tag
, SCM args SCM_UNUSED
)
263 SCM print_state
= scm_make_print_state ();
264 scm_puts ("\nException during displaying of ", data
->port
);
265 scm_puts (data
->mode
, data
->port
);
266 scm_puts (": ", data
->port
);
267 scm_iprin1 (tag
, data
->port
, SCM_PRINT_STATE (print_state
));
268 scm_putc ('\n', data
->port
);
269 return SCM_UNSPECIFIED
;
273 /* The function scm_i_display_error prints out a detailed error message. This
274 * function will be called directly within libguile to signal error messages.
275 * No parameter checks will be performed by scm_i_display_error. Thus, User
276 * code should rather use the function scm_display_error.
279 scm_i_display_error (SCM stack
, SCM port
, SCM subr
, SCM message
, SCM args
, SCM rest
)
281 struct display_error_args a
;
282 struct display_error_handler_data data
;
291 scm_internal_catch (SCM_BOOL_T
,
292 (scm_t_catch_body
) display_error_body
, &a
,
293 (scm_t_catch_handler
) display_error_handler
, &data
);
297 SCM_DEFINE (scm_display_error
, "display-error", 6, 0, 0,
298 (SCM stack
, SCM port
, SCM subr
, SCM message
, SCM args
, SCM rest
),
299 "Display an error message to the output port @var{port}.\n"
300 "@var{stack} is the saved stack for the error, @var{subr} is\n"
301 "the name of the procedure in which the error occurred and\n"
302 "@var{message} is the actual error message, which may contain\n"
303 "formatting instructions. These will format the arguments in\n"
304 "the list @var{args} accordingly. @var{rest} is currently\n"
306 #define FUNC_NAME s_scm_display_error
308 SCM_VALIDATE_OUTPUT_PORT (2, port
);
310 scm_i_display_error (stack
, port
, subr
, message
, args
, rest
);
312 return SCM_UNSPECIFIED
;
322 static int n_print_params
= 9;
323 static print_params_t default_print_params
[] = {
327 { 1, 4 }, { 1, 3 }, { 1, 2 }
329 static print_params_t
*print_params
= default_print_params
;
332 SCM_DEFINE (scm_set_print_params_x
, "set-print-params!", 1, 0, 0,
334 "Set the print parameters to the values from @var{params}.\n"
335 "@var{params} must be a list of two-element lists which must\n"
336 "hold two integer values.")
337 #define FUNC_NAME s_scm_set_print_params_x
342 print_params_t
*new_params
;
344 SCM_VALIDATE_NONEMPTYLIST_COPYLEN (2, params
, n
);
345 for (ls
= params
; !SCM_NULL_OR_NIL_P (ls
); ls
= SCM_CDR (ls
))
346 SCM_ASSERT (scm_ilength (SCM_CAR (params
)) == 2
347 && scm_is_unsigned_integer (SCM_CAAR (ls
), 0, INT_MAX
)
348 && scm_is_unsigned_integer (SCM_CADAR (ls
), 0, INT_MAX
),
351 s_scm_set_print_params_x
);
352 new_params
= scm_malloc (n
* sizeof (print_params_t
));
353 if (print_params
!= default_print_params
)
355 print_params
= new_params
;
356 for (i
= 0; i
< n
; ++i
)
358 print_params
[i
].level
= scm_to_int (SCM_CAAR (params
));
359 print_params
[i
].length
= scm_to_int (SCM_CADAR (params
));
360 params
= SCM_CDR (params
);
363 return SCM_UNSPECIFIED
;
369 indent (int n
, SCM port
)
372 for (i
= 0; i
< n
; ++i
)
373 scm_putc (' ', port
);
377 display_frame_expr (char *hdr
, SCM exp
, char *tlr
, int indentation
, SCM sport
, SCM port
, scm_print_state
*pstate
)
380 scm_t_ptob_descriptor
*ptob
= scm_ptobs
+ SCM_PTOBNUM (sport
);
383 pstate
->length
= print_params
[i
].length
;
384 ptob
->seek (sport
, 0, SEEK_SET
);
385 if (scm_is_pair (exp
))
387 pstate
->level
= print_params
[i
].level
- 1;
388 scm_iprlist (hdr
, exp
, tlr
[0], sport
, pstate
);
389 scm_puts (&tlr
[1], sport
);
393 pstate
->level
= print_params
[i
].level
;
394 scm_iprin1 (exp
, sport
, pstate
);
397 n
= ptob
->seek (sport
, 0, SEEK_CUR
);
400 while (indentation
+ n
> SCM_BACKTRACE_WIDTH
&& i
< n_print_params
);
401 ptob
->truncate (sport
, n
);
403 scm_display (scm_strport_to_string (sport
), port
);
407 display_application (SCM frame
, int indentation
, SCM sport
, SCM port
, scm_print_state
*pstate
)
409 SCM proc
= SCM_FRAME_PROC (frame
);
410 SCM name
= (scm_is_true (scm_procedure_p (proc
))
411 ? scm_procedure_name (proc
)
413 display_frame_expr ("[",
414 scm_cons (scm_is_true (name
) ? name
: proc
,
415 SCM_FRAME_ARGS (frame
)),
416 SCM_FRAME_EVAL_ARGS_P (frame
) ? " ..." : "]",
423 SCM_DEFINE (scm_display_application
, "display-application", 1, 2, 0,
424 (SCM frame
, SCM port
, SCM indent
),
425 "Display a procedure application @var{frame} to the output port\n"
426 "@var{port}. @var{indent} specifies the indentation of the\n"
428 #define FUNC_NAME s_scm_display_application
430 SCM_VALIDATE_FRAME (1, frame
);
431 if (SCM_UNBNDP (port
))
432 port
= scm_current_output_port ();
434 SCM_VALIDATE_OPOUTPORT (2, port
);
435 if (SCM_UNBNDP (indent
))
438 if (SCM_FRAME_PROC_P (frame
))
439 /* Display an application. */
441 SCM sport
, print_state
;
442 scm_print_state
*pstate
;
444 /* Create a string port used for adaptation of printing parameters. */
445 sport
= scm_mkstrport (SCM_INUM0
,
446 scm_make_string (scm_from_int (240),
451 /* Create a print state for printing of frames. */
452 print_state
= scm_make_print_state ();
453 pstate
= SCM_PRINT_STATE (print_state
);
454 pstate
->writingp
= 1;
457 display_application (frame
, scm_to_int (indent
), sport
, port
, pstate
);
465 SCM_SYMBOL (sym_base
, "base");
468 display_backtrace_get_file_line (SCM frame
, SCM
*file
, SCM
*line
)
470 SCM source
= SCM_FRAME_SOURCE (frame
);
471 *file
= *line
= SCM_BOOL_F
;
472 if (SCM_MEMOIZEDP (source
))
474 *file
= scm_source_property (source
, scm_sym_filename
);
475 *line
= scm_source_property (source
, scm_sym_line
);
477 else if (scm_is_pair (source
)
478 && scm_is_pair (scm_cdr (source
))
479 && scm_is_pair (scm_cddr (source
))
480 && !scm_is_pair (scm_cdddr (source
)))
482 /* (addr . (filename . (line . column))), from vm compilation */
483 *file
= scm_cadr (source
);
484 *line
= scm_caddr (source
);
489 display_backtrace_file (frame
, last_file
, port
, pstate
)
493 scm_print_state
*pstate
;
497 display_backtrace_get_file_line (frame
, &file
, &line
);
499 if (scm_is_eq (file
, *last_file
))
504 scm_puts ("In ", port
);
505 if (scm_is_false (file
))
506 if (scm_is_false (line
))
507 scm_puts ("unknown file", port
);
509 scm_puts ("current input", port
);
512 pstate
->writingp
= 0;
513 scm_iprin1 (file
, port
, pstate
);
514 pstate
->writingp
= 1;
516 scm_puts (":\n", port
);
520 display_backtrace_file_and_line (SCM frame
, SCM port
, scm_print_state
*pstate
)
524 display_backtrace_get_file_line (frame
, &file
, &line
);
526 if (scm_is_eq (SCM_PACK (SCM_SHOW_FILE_NAME
), sym_base
))
528 if (scm_is_false (file
))
530 if (scm_is_false (line
))
531 scm_putc ('?', port
);
533 scm_puts ("<stdin>", port
);
537 pstate
-> writingp
= 0;
539 scm_iprin1 ((scm_is_string (file
)?
540 scm_basename (file
, SCM_UNDEFINED
) : file
),
543 scm_iprin1 (file
, port
, pstate
);
545 pstate
-> writingp
= 1;
548 scm_putc (':', port
);
550 else if (scm_is_true (line
))
553 for (i
= scm_to_int (line
)+1; i
> 0; i
= i
/10, j
++)
558 if (scm_is_false (line
))
559 scm_puts (" ?", port
);
561 scm_intprint (scm_to_int (line
) + 1, 10, port
);
562 scm_puts (": ", port
);
566 display_frame (SCM frame
, int nfield
, int indentation
, SCM sport
, SCM port
, scm_print_state
*pstate
)
570 /* Announce missing frames? */
571 if (!SCM_BACKWARDS_P
&& SCM_FRAME_OVERFLOW_P (frame
))
573 indent (nfield
+ 1 + indentation
, port
);
574 scm_puts ("...\n", port
);
577 /* display file name and line number */
578 if (scm_is_true (SCM_PACK (SCM_SHOW_FILE_NAME
)))
579 display_backtrace_file_and_line (frame
, port
, pstate
);
581 /* Check size of frame number. */
582 n
= SCM_FRAME_NUMBER (frame
);
583 for (i
= 0, j
= n
; j
> 0; ++i
) j
/= 10;
585 /* Number indentation. */
586 indent (nfield
- (i
? i
: 1), port
);
589 scm_iprin1 (scm_from_int (n
), port
, pstate
);
591 /* Real frame marker */
592 scm_putc (SCM_FRAME_REAL_P (frame
) ? '*' : ' ', port
);
595 indent (indentation
, port
);
597 if (SCM_FRAME_PROC_P (frame
))
598 /* Display an application. */
599 display_application (frame
, nfield
+ 1 + indentation
, sport
, port
, pstate
);
601 /* Display a special form. */
603 SCM source
= SCM_FRAME_SOURCE (frame
);
604 SCM copy
= (scm_is_pair (source
)
605 ? scm_source_property (source
, scm_sym_copy
)
607 SCM umcopy
= (SCM_MEMOIZEDP (source
)
608 ? scm_i_unmemoize_expr (source
)
610 display_frame_expr ("(",
611 scm_is_pair (copy
) ? copy
: umcopy
,
613 nfield
+ 1 + indentation
,
618 scm_putc ('\n', port
);
620 /* Announce missing frames? */
621 if (SCM_BACKWARDS_P
&& SCM_FRAME_OVERFLOW_P (frame
))
623 indent (nfield
+ 1 + indentation
, port
);
624 scm_puts ("...\n", port
);
628 struct display_backtrace_args
{
633 SCM highlight_objects
;
637 display_backtrace_body (struct display_backtrace_args
*a
)
638 #define FUNC_NAME "display_backtrace_body"
640 int n_frames
, beg
, end
, n
, i
, j
;
641 int nfield
, indent_p
, indentation
;
642 SCM frame
, sport
, print_state
;
644 scm_print_state
*pstate
;
646 a
->port
= SCM_COERCE_OUTPORT (a
->port
);
648 /* Argument checking and extraction. */
649 SCM_VALIDATE_STACK (1, a
->stack
);
650 SCM_VALIDATE_OPOUTPORT (2, a
->port
);
651 n_frames
= scm_to_int (scm_stack_length (a
->stack
));
652 n
= scm_is_integer (a
->depth
) ? scm_to_int (a
->depth
) : SCM_BACKTRACE_DEPTH
;
655 beg
= scm_is_integer (a
->first
) ? scm_to_int (a
->first
) : 0;
663 if (scm_is_integer (a
->first
))
665 beg
= scm_to_int (a
->first
);
679 SCM_ASSERT (beg
>= 0 && beg
< n_frames
, a
->first
, SCM_ARG3
, s_display_backtrace
);
680 SCM_ASSERT (n
> 0, a
->depth
, SCM_ARG4
, s_display_backtrace
);
682 /* Create a string port used for adaptation of printing parameters. */
683 sport
= scm_mkstrport (SCM_INUM0
,
684 scm_make_string (scm_from_int (240), SCM_UNDEFINED
),
688 /* Create a print state for printing of frames. */
689 print_state
= scm_make_print_state ();
690 pstate
= SCM_PRINT_STATE (print_state
);
691 pstate
->writingp
= 1;
693 pstate
->highlight_objects
= a
->highlight_objects
;
695 /* First find out if it's reasonable to do indentation. */
703 frame
= scm_stack_ref (a
->stack
, scm_from_int (beg
));
704 for (i
= 0, j
= 0; i
< n
; ++i
)
706 if (SCM_FRAME_REAL_P (frame
))
708 if (j
> SCM_BACKTRACE_INDENT
)
713 frame
= (SCM_BACKWARDS_P
714 ? SCM_FRAME_PREV (frame
)
715 : SCM_FRAME_NEXT (frame
));
719 /* Determine size of frame number field. */
720 j
= SCM_FRAME_NUMBER (scm_stack_ref (a
->stack
, scm_from_int (end
)));
721 for (i
= 0; j
> 0; ++i
) j
/= 10;
725 frame
= scm_stack_ref (a
->stack
, scm_from_int (beg
));
727 last_file
= SCM_UNDEFINED
;
728 for (i
= 0; i
< n
; ++i
)
730 if (!scm_is_eq (SCM_PACK (SCM_SHOW_FILE_NAME
), sym_base
))
731 display_backtrace_file (frame
, &last_file
, a
->port
, pstate
);
733 display_frame (frame
, nfield
, indentation
, sport
, a
->port
, pstate
);
734 if (indent_p
&& SCM_FRAME_EVAL_ARGS_P (frame
))
736 frame
= (SCM_BACKWARDS_P
?
737 SCM_FRAME_PREV (frame
) : SCM_FRAME_NEXT (frame
));
740 scm_remember_upto_here_1 (print_state
);
742 return SCM_UNSPECIFIED
;
746 SCM_DEFINE (scm_display_backtrace_with_highlights
, "display-backtrace", 2, 3, 0,
747 (SCM stack
, SCM port
, SCM first
, SCM depth
, SCM highlights
),
748 "Display a backtrace to the output port @var{port}. @var{stack}\n"
749 "is the stack to take the backtrace from, @var{first} specifies\n"
750 "where in the stack to start and @var{depth} how many frames\n"
751 "to display. @var{first} and @var{depth} can be @code{#f},\n"
752 "which means that default values will be used.\n"
753 "If @var{highlights} is given it should be a list; the elements\n"
754 "of this list will be highlighted wherever they appear in the\n"
756 #define FUNC_NAME s_scm_display_backtrace_with_highlights
758 struct display_backtrace_args a
;
759 struct display_error_handler_data data
;
764 if (SCM_UNBNDP (highlights
))
765 a
.highlight_objects
= SCM_EOL
;
767 a
.highlight_objects
= highlights
;
768 data
.mode
= "backtrace";
770 scm_internal_catch (SCM_BOOL_T
,
771 (scm_t_catch_body
) display_backtrace_body
, &a
,
772 (scm_t_catch_handler
) display_error_handler
, &data
);
773 return SCM_UNSPECIFIED
;
778 scm_display_backtrace (SCM stack
, SCM port
, SCM first
, SCM depth
)
780 return scm_display_backtrace_with_highlights (stack
, port
, first
, depth
,
784 SCM_VARIABLE (scm_has_shown_backtrace_hint_p_var
, "has-shown-backtrace-hint?");
786 SCM_DEFINE (scm_backtrace_with_highlights
, "backtrace", 0, 1, 0,
788 "Display a backtrace of the stack saved by the last error\n"
789 "to the current output port. If @var{highlights} is given\n"
790 "it should be a list; the elements of this list will be\n"
791 "highlighted wherever they appear in the backtrace.")
792 #define FUNC_NAME s_scm_backtrace_with_highlights
794 SCM port
= scm_current_output_port ();
796 scm_fluid_ref (SCM_VARIABLE_REF (scm_the_last_stack_fluid_var
));
798 if (SCM_UNBNDP (highlights
))
799 highlights
= SCM_EOL
;
801 if (scm_is_true (the_last_stack
))
804 scm_puts ("Backtrace:\n", port
);
805 scm_display_backtrace_with_highlights (the_last_stack
,
811 if (scm_is_false (SCM_VARIABLE_REF (scm_has_shown_backtrace_hint_p_var
))
814 scm_puts ("Type \"(debug-enable 'backtrace)\" if you would like "
816 "automatically if an error occurs in the future.\n",
818 SCM_VARIABLE_SET (scm_has_shown_backtrace_hint_p_var
, SCM_BOOL_T
);
823 scm_puts ("No backtrace available.\n", port
);
825 return SCM_UNSPECIFIED
;
832 return scm_backtrace_with_highlights (SCM_EOL
);
838 scm_init_backtrace ()
840 SCM f
= scm_make_fluid ();
841 scm_the_last_stack_fluid_var
= scm_c_define ("the-last-stack", f
);
843 #include "libguile/backtrace.x"