guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ditching (debug-enable 'backwards) ?


From: Mikael Djurfeldt
Subject: Re: Ditching (debug-enable 'backwards) ?
Date: 06 Nov 2002 13:49:40 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Neil Jerram <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]