From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: trouble with scm_display_backtrace in guile 1.8.3 Date: Tue, 05 Feb 2008 15:26:37 +0100 Message-ID: <87abmfeaxu.fsf@dellish.bordeaux.inria.fr> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1202218025 23391 80.91.229.12 (5 Feb 2008 13:27:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2008 13:27:05 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Feb 05 14:27:27 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JMNpd-00083C-Pp for guile-user@m.gmane.org; Tue, 05 Feb 2008 14:27:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMNpB-0006Wt-Et for guile-user@m.gmane.org; Tue, 05 Feb 2008 08:26:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMNp5-0006Um-Jy for guile-user@gnu.org; Tue, 05 Feb 2008 08:26:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMNp4-0006Tq-R8 for guile-user@gnu.org; Tue, 05 Feb 2008 08:26:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMNp4-0006TX-MP for guile-user@gnu.org; Tue, 05 Feb 2008 08:26:50 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JMNp4-0002le-9F for guile-user@gnu.org; Tue, 05 Feb 2008 08:26:50 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JMNov-0006FU-GB for guile-user@gnu.org; Tue, 05 Feb 2008 13:26:41 +0000 Original-Received: from 193.50.110.98 ([193.50.110.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Feb 2008 13:26:41 +0000 Original-Received: from ludo by 193.50.110.98 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Feb 2008 13:26:41 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.98 X-Revolutionary-Date: 17 =?iso-8859-1?Q?Pluvi=F4se?= an 216 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i486-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:mwLKV0Hgd2b/cOYP4VOq8eNpsX0= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:6412 Archived-At: 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" 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) # As you can see, the error handler gets to see a valid stack when looking at THE-LAST-STACK. Thanks, Ludovic.