From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: debug and backtrace Date: Wed, 16 Sep 2009 22:24:49 +0100 Message-ID: <874or2invi.fsf@ossau.uklinux.net> References: <1252670144.24639.134.camel@localhost.localdomain> <87y6oilxwx.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1253136412 31800 80.91.229.12 (16 Sep 2009 21:26:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Sep 2009 21:26:52 +0000 (UTC) Cc: Ludovic =?iso-8859-1?Q?Court=E8s?= , guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Sep 16 23:26:45 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mo21U-0005Yk-Rp for guile-devel@m.gmane.org; Wed, 16 Sep 2009 23:26:45 +0200 Original-Received: from localhost ([127.0.0.1]:52444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mo21U-0002QJ-6b for guile-devel@m.gmane.org; Wed, 16 Sep 2009 17:26:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mo20T-0001wE-3n for guile-devel@gnu.org; Wed, 16 Sep 2009 17:25:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mo20O-0001uk-3h for guile-devel@gnu.org; Wed, 16 Sep 2009 17:25:40 -0400 Original-Received: from [199.232.76.173] (port=38220 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mo20N-0001uf-SI for guile-devel@gnu.org; Wed, 16 Sep 2009 17:25:35 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:41617) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mo20I-0001Nx-Nn; Wed, 16 Sep 2009 17:25:31 -0400 Original-Received: from arudy (host86-147-112-99.range86-147.btcentralplus.com [86.147.112.99]) by mail3.uklinux.net (Postfix) with ESMTP id 845531F66FC; Wed, 16 Sep 2009 22:24:51 +0100 (BST) Original-Received: from arudy (arudy [127.0.0.1]) by arudy (Postfix) with ESMTP id B2C9A38023; Wed, 16 Sep 2009 22:24:50 +0100 (BST) In-Reply-To: (Andy Wingo's message of "Wed, 16 Sep 2009 21:31:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9336 Archived-At: Andy Wingo writes: > Hi Mike, > > On Sun 13 Sep 2009 16:30, ludo@gnu.org (Ludovic Court=E8s) writes: > >> Mike Gran writes: >> >>> With the default behavior of 1.9.x, REPL debug and backtrace are broken. >> >> Indeed, it looks like the VM frames are ignored. > > Hopefully by the next release, and certainly by the following one, this > will be fixed: by having everything on the VM stack. So yes it sucks > now, but it's because we have so many kinds of procedures and stacks > that it's tough to make a nice debugging interface. Actually I think I just found and fixed one problem. From the time when a # was a SMOB, really_make_boot_program in vm.c was still using SCM_SET_SMOB_FLAGS to set the SCM_F_PROGRAM_IS_BOOT flag - which meant that it was setting flag 1<<32 :-) which obviously was then missed by the SCM_PROGRAM_IS_BOOT calls in stacks.c. So now, with my test script ((lambda _ (car 1) 23)) I get a backtrace: neil@arudy:~/SW/Guile/git$ meta/guile --debug -s ../testcar.scm=20 Backtrace: In ice-9/boot-9.scm: 1772: 0* [save-module-excursion #] In unknown file: ?: {1}* [dynamic-wind # ...] In ice-9/boot-9.scm: 935: 2* [load "../testcar.scm"] In unknown file: ?: 3* [with-fluid* # #f #] In ice-9/boot-9.scm: 940: 4* [#] In unknown file: ?: 5* [load-compiled/vm "/home/neil/SW/Guile/git/cache/guile/ccache/1.= 9-0.D-LE-4/home/neil/SW/Guile/testcar.scm.go"] In ../testcar.scm: 2: 6* [# 23] ERROR: In procedure vm-debug-engine: ERROR: Wrong type argument in position 1 (expecting pair): 1 I'll push the fix a bit later. (I also have fixes for the incorrect stack count warning.) But I notice that there is only ever one frame per VM. E.g. with code like (define (foo n) (let ((a 1)) (let ((b 2)) (string-append (* a b))))) (which deliberately passes an invalid arg to string-append), the interpreter backtrace would show the two `let' frames, whereas the VM backtrace doesn't. Is that intended, or something else to investigate? Regards, Neil