From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Volkan YAZICI Newsgroups: gmane.lisp.guile.user Subject: Re: saving and restoring the error stack trace Date: Thu, 7 Sep 2006 12:02:26 +0300 Message-ID: <20060907090226.GB1396@alamut> References: <87ejv2gx0x.fsf@ossau.uklinux.net> <87r6z0fqnj.fsf@ossau.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157619891 31677 80.91.229.2 (7 Sep 2006 09:04:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Sep 2006 09:04:51 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Sep 07 11:04:48 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GLFoP-0007IK-4a for guile-user@m.gmane.org; Thu, 07 Sep 2006 11:04:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GLFoO-0002Fd-M4 for guile-user@m.gmane.org; Thu, 07 Sep 2006 05:04:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GLFoJ-0002Bl-JC for guile-user@gnu.org; Thu, 07 Sep 2006 05:04:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GLFoG-00024U-EY for guile-user@gnu.org; Thu, 07 Sep 2006 05:04:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GLFoG-00024A-6Q for guile-user@gnu.org; Thu, 07 Sep 2006 05:04:32 -0400 Original-Received: from [212.175.13.129] (helo=fep05.ttnet.net.tr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GLFoZ-00089J-HY for guile-user@gnu.org; Thu, 07 Sep 2006 05:04:52 -0400 Original-Received: from alamut ([85.104.209.176]) by fep05.ttnet.net.tr with ESMTP id <20060907090422.TBSQ10864.fep05.ttnet.net.tr@alamut>; Thu, 7 Sep 2006 12:04:22 +0300 Original-To: Neil Jerram Content-Disposition: inline In-Reply-To: <87r6z0fqnj.fsf@ossau.uklinux.net> User-Agent: Mutt/1.4.2.1i X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5495 Archived-At: 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. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user