[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trouble with scm_display_backtrace in guile 1.8.3
From: |
Ludovic Courtès |
Subject: |
Re: trouble with scm_display_backtrace in guile 1.8.3 |
Date: |
Tue, 05 Feb 2008 15:26:37 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Hi,
(I must confess I'd be more comfortable with the same piece of code in
Scheme... Generally, I find it more convenient to have the boot code as
a Guile script which then loads all the relevant pieces of C code.
Scheme code is also less likely to break with future Guile versions.)
"René Köcher" <address@hidden> writes:
> SCM stack = scm_fluid_ref(
> SCM_VARIABLE_REF(scm_the_last_stack_fluid_var));
> SCM subr = SCM_CAR(args);
> SCM mesg = SCM_CADR(args);
> SCM cargs = SCM_CADDR(args);
> #if 1
> /* FIXME: still wrong-type-arg error.. */
> scm_display_backtrace(stack, scm_current_error_port(),
> SCM_UNDEFINED, SCM_UNDEFINED);
Presumably STACK is `#f' here, can you confirm it (e.g., by
`scm_write'ing it)? If so, then this means that `SCM_DEBUG_P' is
somehow not taken into account.
In theory, what you propose should work:
guile> (define (foo x)
(catch #t
(lambda () (error "sdf"))
(lambda args (fluid-ref the-last-stack))))
guile> (foo 2)
#<stack 8050fc0:b7a8dbf0>
As you can see, the error handler gets to see a valid stack when looking
at THE-LAST-STACK.
Thanks,
Ludovic.