From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Subject: Re: trouble with scm_display_backtrace in guile 1.8.3
Date: Tue, 05 Feb 2008 15:26:37 +0100 [thread overview]
Message-ID: <87abmfeaxu.fsf@dellish.bordeaux.inria.fr> (raw)
In-Reply-To: f52e27170802040230g604a1589m2688112909a184b6@mail.gmail.com
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" <shirk87@googlemail.com> 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.
next prev parent reply other threads:[~2008-02-05 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 10:30 trouble with scm_display_backtrace in guile 1.8.3 René Köcher
2008-02-05 14:26 ` Ludovic Courtès [this message]
2008-02-06 22:47 ` RenéKöcher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87abmfeaxu.fsf@dellish.bordeaux.inria.fr \
--to=ludo@gnu.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).