guile-devel
[Top][All Lists]
Advanced

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

Re: Ditching (debug-enable 'backwards) ?


From: Neil Jerram
Subject: Re: Ditching (debug-enable 'backwards) ?
Date: 04 Nov 2002 20:01:43 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Marius" == Marius Vollmer <address@hidden> writes:

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





reply via email to

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