unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mikael Djurfeldt <mdj@kvast.blakulla.net>
Cc: Marius Vollmer <mvo@zagadka.ping.de>,
	Guile Development <guile-devel@gnu.org>,
	Guile Users <guile-user@gnu.org>
Subject: Re: Ditching (debug-enable 'backwards) ?
Date: 06 Nov 2002 13:49:40 +0100	[thread overview]
Message-ID: <xy7of92ual7.fsf@linnaeus.i-did-not-set--mail-host-address--so-shoot-me> (raw)
In-Reply-To: <m3fzuhxfx4.fsf@laruns.ossau.uklinux.net>

Neil Jerram <neil@ossau.uklinux.net> writes:

> 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.)

Historic note + personal commentary:

I wrote the debugging evaluator and the backtracing code (yes, the
code sucks) during a hectic few days in 1995 as a part of a teaching
environment at KTH, it was important that the backtraces were both
informative and intuitive.  To me that meant that the direction of
time was downwards on the page and "up" in numbers.  As you point out,
"downwards on page" also means that indentation can be used in a
natural way to indicate evaluation of arguments.

If I remember it correctly what happened was: RMS wanted Guile
backtraces to look like GDB backtraces.  We argued quite a lot about
this and he finally allowed me to implement the current backtrace look
if I provided GDB backtraces as an option.

Personally, I've always been frustrated both with the order of frames
and the frame numbering in GDB, because 1. the most important frames
are far away from next command line so that your eyes have to jump
around on the page, 2. the most important frames disappear first
during scrolling, 3. I need to know how many frames are on the stack
in order to *compute* the frame number for the tenth (in time) frame
on the stack, and 4. that frame number *varies* depending on how far
you've run your program after that invocation.

In contrast, with the current default numbering style in Guile, you
never need to know the number of frames on the stack, since the
numbers are clearly written in front of the frame in the backtrace
listing.  In fact, they give you a feeling for how large the stack
is.

Mikael D.


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


      parent reply	other threads:[~2002-11-06 12:49 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
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 [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=xy7of92ual7.fsf@linnaeus.i-did-not-set--mail-host-address--so-shoot-me \
    --to=mdj@kvast.blakulla.net \
    --cc=djurfeldt@nada.kth.se \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=mvo@zagadka.ping.de \
    /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).