unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Jan Nieuwenhuizen <janneke@gnu.org>
Cc: guile-user@gnu.org
Subject: Re: debugging help: how to read/use a backtrace?
Date: Tue, 07 Mar 2017 16:58:50 +0100	[thread overview]
Message-ID: <87efy984ed.fsf@pobox.com> (raw)
In-Reply-To: <87zigx5c0y.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 07 Mar 2017 16:42:21 +0100")

On Tue 07 Mar 2017 16:42, Jan Nieuwenhuizen <janneke@gnu.org> writes:

> Andy Wingo writes:
>
>> On Sat 21 Jan 2017 11:21, Jan Nieuwenhuizen <janneke@gnu.org> writes:
>>
>>> I often find myself struggling to pinpoint an error location from
>>> Guile's backtrace (see below) and I am starting to wonder if there is
>>> something that I'm missing.
>>
>> I believe this is comprehensively cleaned up and improved in 2.1.x.
>> (Guile 2.0 tries to identify the procedure by looking at slot 0; Guile
>> 2.2 instead uses the instruction pointer of the frame.)  Can you
>> confirm?
>
> Sadly no; this is 2.1.x (x=5 probably) as you can see from this bit
>
>      l/l=#<procedure 13000a0 at ice-9/eval.scm:342:13 (a b c d)>

What is this l/l syntax?

The way the procedure prints indicates that you have an interpreted
procedure instead of a compiled procedure.  Debugging will be not as
good.  Of course performance also will not be as good.  Still, in theory
these procedures are decorated with properties to indicate their name,
etc, at least when you print the procedure itself:

   scheme@(guile-user)> ,o interp #t
   scheme@(guile-user)> (define foo (lambda (x y z) (list x y z)))
   scheme@(guile-user)> foo
   $1 = #<procedure foo (a b c)>

In a backtrace it could be that the procedure slot was re-used and so
you just have the IP of the procedure's code (at ice-9/eval.scm:342:13)
but that code corresponds to many closures, and the closure itself is
gone.

In summary, debugging interpreted procedures can improve but I suspect
it will never be as good as compiled procedures.

Andy



      reply	other threads:[~2017-03-07 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21 10:21 debugging help: how to read/use a backtrace? Jan Nieuwenhuizen
2017-02-27 19:46 ` Andy Wingo
2017-03-07 15:42   ` Jan Nieuwenhuizen
2017-03-07 15:58     ` Andy Wingo [this message]

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=87efy984ed.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-user@gnu.org \
    --cc=janneke@gnu.org \
    /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).