From: Neil Jerram <neil@ossau.uklinux.net>
To: Andy Wingo <wingo@pobox.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, guile-devel@gnu.org
Subject: Re: debug and backtrace
Date: Wed, 16 Sep 2009 22:24:49 +0100 [thread overview]
Message-ID: <874or2invi.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <m3iqfibs9q.fsf@pobox.com> (Andy Wingo's message of "Wed, 16 Sep 2009 21:31:45 +0200")
Andy Wingo <wingo@pobox.com> writes:
> Hi Mike,
>
> On Sun 13 Sep 2009 16:30, ludo@gnu.org (Ludovic Courtès) writes:
>
>> Mike Gran <spk121@yahoo.com> 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 #<program> 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
Backtrace:
In ice-9/boot-9.scm:
1772: 0* [save-module-excursion #<program 9dc0630 at ice-9/boot-9.scm:1785:3 ()>]
In unknown file:
?: {1}* [dynamic-wind #<program 9dc0620 at ice-9/boot-9.scm:1771:18 ()> ...]
In ice-9/boot-9.scm:
935: 2* [load "../testcar.scm"]
In unknown file:
?: 3* [with-fluid* #<fluid 9> #f #<program 9dc0600 at ice-9/boot-9.scm:935:4 ()>]
In ice-9/boot-9.scm:
940: 4* [#<program 9dc0600 at ice-9/boot-9.scm:935: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* [#<program 9e3e4e0 at ../testcar.scm:0:1 _> 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
next prev parent reply other threads:[~2009-09-16 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 11:55 debug and backtrace Mike Gran
2009-09-13 14:30 ` Ludovic Courtès
2009-09-13 20:47 ` Neil Jerram
2009-09-16 19:31 ` Andy Wingo
2009-09-16 21:24 ` Neil Jerram [this message]
2009-09-17 12:24 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874or2invi.fsf@ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=wingo@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).