guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving and restoring the error stack trace


From: Volkan YAZICI
Subject: Re: saving and restoring the error stack trace
Date: Thu, 7 Sep 2006 12:02:26 +0300
User-agent: Mutt/1.4.2.1i

On Aug 28 11:21, Neil Jerram wrote:
> A common requirement is to be able to show as much useful context as
> possible when a Scheme program hits an error.  The most immediate
> information about an error is the kind of error that it is - such as
> "division by zero" - and any parameters that the code which signalled
> the error chose explicitly to provide.  This information originates with
> the `error' or `throw' call (or their C code equivalents, if the error
> is detected by C code) that signals the error, and is passed
> automatically to the handler procedure of the innermost applicable
> `catch', `lazy-catch' or `with-throw-handler' expression.

I've another situation that doesn't get executed inside a `catch' block.
For instance, I need to make some variable definitions just before
executing related code via scm_c_with_throw_handler(). The problem is,
in these definitions when an error occurs (e.g. not enough memory in
case of a scm_from_locale_string() call) I'm not able to handle it and
program exists without my permission.

In such a situation, should I try to place my whole definition related
code into a SCM function and execute in a catch scope or is there any
other way to fix this?

[If you want to take a look at the related code, see
place_scheme_args(), guile_eval_str() and handle_scm_res() functions
called inside plscheme_func_handler() function in
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/~checkout~/plscheme/plscheme/plscheme.c?rev=1.4
URL.]


Regards.

P.S. Thanks for this paper. It's quite helpful. Now I'm planning to
     power up my buggy scm_c_with_throw_handler() code with that
     make-stack stuff.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]