From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: William Morgan Newsgroups: gmane.lisp.guile.devel Subject: wrong-type-arg in scm_display_backtrace Date: Sun, 29 Dec 2002 20:31:49 -0500 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <20021230013149.GB25056@masanjin.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041211820 11235 80.91.224.249 (30 Dec 2002 01:30:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2002 01:30:20 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Sokw-0002pS-00 for ; Mon, 30 Dec 2002 02:30:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Sol5-0002xY-00 for guile-devel@m.gmane.org; Sun, 29 Dec 2002 20:30:23 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18SokV-0002hk-00 for guile-devel@gnu.org; Sun, 29 Dec 2002 20:29:47 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18Sok8-0001xB-00 for guile-devel@gnu.org; Sun, 29 Dec 2002 20:29:26 -0500 Original-Received: from h0060976e2b56.ne.client2.attbi.com ([65.96.180.211] helo=lux) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Sojw-0001gS-00 for guile-devel@gnu.org; Sun, 29 Dec 2002 20:29:12 -0500 Original-Received: from wmorgan by lux with local (Exim 3.35 #1 (Debian)) id 18SomT-0006nC-00 for ; Sun, 29 Dec 2002 20:31:49 -0500 Original-To: guile-devel@gnu.org Content-Disposition: inline User-Agent: Mutt/1.4i X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:1844 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1844 Dear Guile experts, I am writing a C program that uses Guile as a scripting engine. There doesn't seem to be a lot of documentation about this aspect of Guile and I am relying my interpretation of other people's code. Now I have a problem. I need to catch Guile exceptions in my own handler. However, when I try to display the backtrace, I invariably get the following message: Exception during displaying of backtrace: wrong-type-arg Here's the exception-handling procedure I'm passing to scm_internal_cwdr (mostly copied from an old email by Mikael Djurfeldt): --- cut here --- SCM guile_error_handler(void *data, SCM tag, SCM throw_args) { SCM port = scm_def_errp; if (scm_ilength (throw_args) >= 3) { SCM stack = scm_fluid_ref(SCM_VARIABLE_REF (scm_the_last_stack_fluid_var)); SCM subr = SCM_CAR (throw_args); SCM message = SCM_CADR (throw_args); SCM args = SCM_CADDR (throw_args); scm_newline (port); scm_display_backtrace (stack, port, SCM_UNDEFINED, SCM_UNDEFINED); scm_newline (port); scm_display_error (stack, port, subr, message, args, SCM_EOL); return SCM_BOOL_F; } else { scm_puts ("uncaught throw to ", port); scm_prin1 (tag, port, 0); scm_puts (": ", port); scm_prin1 (throw_args, port, 1); scm_putc ('\n', port); } return SCM_BOOL_T; } --- cut here --- I don't fully understand the internals of Guile, particlarly how to deal with fluids, so perhaps my treatment of scm_the_last_stack_fluid_var is incorrect? (But the call to scm_display_error seems fine...) Any help would be appreciated. Thanks, -- William _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel