unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
Cc: Guile Development <guile-devel@gnu.org>,
	Guile Users <guile-user@gnu.org>
Subject: Re: Ditching (debug-enable 'backwards) ?
Date: 04 Nov 2002 20:01:43 +0000	[thread overview]
Message-ID: <m3fzuhxfx4.fsf@laruns.ossau.uklinux.net> (raw)
In-Reply-To: <8765veblg1.fsf@zagadka.ping.de>

>>>>> "Marius" == Marius Vollmer <mvo@zagadka.ping.de> writes:

    Marius> Neil Jerram <neil@ossau.uklinux.net> writes:
    >> Does anyone use (debug-enable 'backwards) and have a good reason for
    >> keeping it?

    Marius> Hmm.  I'd say we should only remove it when there is significant cost
    Marius> associated with it.  Since we already have it, we might as well keep
    Marius> it.  Maybe it will make someone happy. :-)

To be more precise, what I don't like about 'backwards is that it
changes how the displayed frames are _numbered_:

guile> (let ((x 1) (y "e")) (/ 2 (+ x y)))

Backtrace:
In unknown file:
   ?: 0* (let ((x 1) (y "e")) (/ 2 (+ x y)))
   ?: 1  [/ 2 ...
   ?: 2*  [+ 1 "e"]

<unnamed port>: In procedure + in expression (+ x y):
<unnamed port>: Wrong type argument: "e"
ABORT: (wrong-type-arg)

guile> (debug-enable 'backwards)
(show-file-name #t stack 20000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 width 79 backwards procnames cheap)
guile> (let ((x 1) (y "e")) (/ 2 (+ x y)))

Backtrace:
In unknown file:
   ?: 0* [+ 1 "e"]
   ?: 1  [/ 2 ...
   ?: 2* (let ((x 1) (y "e")) (/ 2 (+ x y)))

<unnamed port>: In procedure + in expression (+ x y):
<unnamed port>: Wrong type argument: "e"
ABORT: (wrong-type-arg)

I have no objection to frames appearing in reverse order, but I prefer
that they were then _numbered_ like this (artist's impression):

Backtrace:
In unknown file:
   ?: 2* [+ 1 "e"]
   ?: 1  [/ 2 ...
   ?: 0* (let ((x 1) (y "e")) (/ 2 (+ x y)))

(As a side point, note that indentation is not as informative when
displaying frames backwards.)

    >> is likely to introduce bugs in the debugger code (if there aren't
    >> any there already),

    Marius> Is that so?  The 'backwards' option should only matter during display
    Marius> and we already have that code, right?

We do, but as we develop debugging tools further, I'd prefer not to
have the call everywhere that converts the frame number as typed by
the user to the correct stack index.  It's so easy to leave this call
out somewhere, and easy not to notice the omission.

As a further point, is similarity with GDB worth anything here?  GDB
numbers frames so that frame 0 is the innermost, so perhaps Guile
should do that too.  (GDB's direction also has the advantage that "up"
for frames coincides with "up" for frame numbers.)

        Neil



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2002-11-04 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-27 13:04 Ditching (debug-enable 'backwards) ? Neil Jerram
2002-11-03 17:41 ` Marius Vollmer
2002-11-04 20:01   ` Neil Jerram [this message]
2002-11-04 21:42     ` Marius Vollmer
2002-11-05 23:13       ` Neil Jerram
2002-11-06 12:50       ` Mikael Djurfeldt
2002-11-06 12:49     ` Mikael Djurfeldt

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=m3fzuhxfx4.fsf@laruns.ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@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).